Data Analysis within an AcquRoot Framework - Nuclear Physics ...

Data Analysis within an AcquRoot Framework - Nuclear Physics ... Data Analysis within an AcquRoot Framework - Nuclear Physics ...

nuclear.gla.ac.uk
from nuclear.gla.ac.uk More from this publisher
11.07.2015 Views

Data Analysis within an AcquRoot FrameworkJ.R.M. AnnandDepartment of Physics and AstronomyUniversity of GlasgowAcquRoot Version 4v2July 2, 2008AbstractACQU is a set of software tools for the acquisition and analysis of data from sub-atomicphysics experiments. This document describes the C++ version of the data analyser which isbased on the CERN toolkit ROOT. The structure of AcquRoot is shown, along with workinginstances of analysis classes and methods for conguration. A companion package MCGeneratorfor Monte Carlo simulation of data is also described.1

<strong>Data</strong> <strong>Analysis</strong> <strong>within</strong> <strong>an</strong> <strong>AcquRoot</strong> <strong>Framework</strong>J.R.M. Ann<strong>an</strong>dDepartment of <strong>Physics</strong> <strong>an</strong>d AstronomyUniversity of Glasgow<strong>AcquRoot</strong> Version 4v2July 2, 2008AbstractACQU is a set of software tools for the acquisition <strong>an</strong>d <strong>an</strong>alysis of data from sub-atomicphysics experiments. This document describes the C++ version of the data <strong>an</strong>alyser which isbased on the CERN toolkit ROOT. The structure of <strong>AcquRoot</strong> is shown, along with workinginst<strong>an</strong>ces of <strong>an</strong>alysis classes <strong>an</strong>d methods for conguration. A comp<strong>an</strong>ion package MCGeneratorfor Monte Carlo simulation of data is also described.1


Contents1 Introduction 42 Software Structure of ACQU 42.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 <strong>AcquRoot</strong> Software Structure 63.1 The main program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63.2 The ROOT Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63.3 The T<strong>AcquRoot</strong> interface to ACQU <strong>Data</strong> . . . . . . . . . . . . . . . . . . . . . 83.3.1 Mk1Loop <strong>an</strong>d OineLoop . . . . . . . . . . . . . . . . . . . . . . . . . . 83.4 The Threaded <strong>Data</strong> Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83.4.1 Ring Buer TA2RingBuer . . . . . . . . . . . . . . . . . . . . . . . . . 104 The Analyser Structure 104.0.2 TA2<strong>Data</strong>M<strong>an</strong>ager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104.0.3 TA2HistM<strong>an</strong>ager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134.0.4 TA2<strong>Analysis</strong> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144.0.5 TA2Apparatus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164.0.6 TA2Detector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 Setup Technicalities 175.1 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175.1.1 Core Acqu Distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . 175.1.2 User Acqu Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195.2 Parameter Conguration Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205.2.1 Base T<strong>AcquRoot</strong> conguration le . . . . . . . . . . . . . . . . . . . . . 205.2.2 Conguration le for TA2<strong>Analysis</strong> or derived class . . . . . . . . . . . . 215.2.3 TA2<strong>Data</strong>Server conguration le . . . . . . . . . . . . . . . . . . . . . . 225.2.4 Apparatus conguration les . . . . . . . . . . . . . . . . . . . . . . . . 245.2.5 Detector conguration les . . . . . . . . . . . . . . . . . . . . . . . . . 245.2.6 <strong>Physics</strong> conguration le . . . . . . . . . . . . . . . . . . . . . . . . . . 255.3 <strong>Data</strong> Filtering <strong>an</strong>d Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265.3.1 LoadVariable a exible me<strong>an</strong>s to access addresses . . . . . . . . . . . . . 275.3.2 <strong>Data</strong> Cut Specication . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295.4 Display Specication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315.4.1 Histograms set up by TA2HistM<strong>an</strong>ager::ParseDisplay . . . . . . . . . . 315.4.2 Special histogram setup in TA2<strong>Analysis</strong> . . . . . . . . . . . . . . . . . . 336 Specimen <strong>Analysis</strong> Classes 346.1 Detector Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346.2 Apparatus Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346.2.1 TA2CrystalBall . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346.2.2 TA2KensTagger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346.3 <strong>Physics</strong> Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346.3.1 TA2Photo<strong>Physics</strong> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347 Obsolete Comp<strong>an</strong>ion Software 358 AcquMC a Monte Carlo reaction-kinematics generator 368.1 TMCGenerator event generation . . . . . . . . . . . . . . . . . . . . . . . . . . 378.1.1 TMCFoamGenerator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378.1.2 TMCFoamInt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378.2 TMCParticle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398.2.1 TMCReson<strong>an</strong>ce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408.2.2 TMCFoamParticle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408.2.3 TMCdS5MDMParticle . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418.3 Conguration le format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418.4 Output formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432


8.4.1 Mkin output format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438.4.2 AcquMC output format . . . . . . . . . . . . . . . . . . . . . . . . . . . 449 <strong>Analysis</strong> of Monte Carlo generated data 459.0.3 Features of the GEANT-3 based simulation . . . . . . . . . . . . . . . . 4510 DAQ Software 4710.1 TDAQexperiment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4710.1.1 Conguration les for TDAQexperiment . . . . . . . . . . . . . . . . . . 4710.2 TDAQmodule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4810.2.1 Conguration les for TDAQmodule . . . . . . . . . . . . . . . . . . . . 4810.2.2 Supported hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50A Applications 52A.1 Cluster Determination Algorithms for Segmented Calorimeters . . . . . . . . . 52A.1.1 The basic cluster algorithm. . . . . . . . . . . . . . . . . . . . . . . . . . 52A.1.2 The extended cluster algorithm. . . . . . . . . . . . . . . . . . . . . . . 52A.1.3 The split-o search algorithm. . . . . . . . . . . . . . . . . . . . . . . . 53A.1.4 Conguration le options for TA2ClusterDetector . . . . . . . . . . . . 53A.1.5 Preliminary Cluster studies using Monte Carlo generated events. . . . . 543


1 IntroductionACQU is mainly, but not exclusively, used <strong>within</strong> the Mainz A2 collaboration. From the outsetin 1988 the desire has been to keep all parts as exible <strong>an</strong>d general purpose as possible. With alittle thought this c<strong>an</strong> generally be achieved without incurring <strong>an</strong>y signic<strong>an</strong>t ineciencies in thedata readout <strong>an</strong>d <strong>an</strong>alysis software. Up to the start of Crystal Ball experiments at MAMI thetraditional form of ACQU has been used, which is written in C <strong>an</strong>d C++, with a little FORTRANto interface to HBOOK. The latest <strong>an</strong>d probably last version of this software is 3v4. Starting at3v5 a new data <strong>an</strong>alysis program (<strong>AcquRoot</strong>) has been written to replace the traditional Sortprogram. With the implementation of threaded multi-tasking, <strong>AcquRoot</strong> has developed to theextent that it has, on its own, more-or-less full ACQU functionality <strong>an</strong>d the potential to do muchmore.This m<strong>an</strong>ual describes the <strong>AcquRoot</strong> (AR) <strong>an</strong>alysis software (including AcquMC <strong>an</strong>d AcquDAQcomponents), as traditional ACQU is covered by a separate m<strong>an</strong>ual. As the name implies, theAR <strong>an</strong>alyser is built on the framework of ROOT, the CERN C++ based suite of software tools<strong>an</strong>d libraries. This has similar functionality to its predecessor, the FORTRAN-based PAW <strong>an</strong>dHBOOK, although the programing l<strong>an</strong>guages are quite dierent. ROOT, based on object-orientedsources, has broader r<strong>an</strong>ge of functionality <strong>an</strong>d better perform<strong>an</strong>ce. ROOT has a further adv<strong>an</strong>tagethat its macro l<strong>an</strong>guage (essentially a script processor) is in nearly all respects the same as C++.Novice <strong>an</strong>alysers are encouraged to learn the basics of Linux/UNIX operating systems <strong>an</strong>d to readthe ROOT user guide. These aspects are not covered in this m<strong>an</strong>ual.2 Software Structure of ACQU2.1 OverviewFig. 1 shows a basic layout schematic of the multi-threaded AR, with the threaded tasks <strong>within</strong>AR taking over from traditional ACQU separate-program components. This avoids the need forcommunication via shared memory as the threads share a common data store. It is colour-codedas follows.• Red: main programs.• Dark Pink: embedded threads in main programs.• Pale Pink: embedded procedures in main programs or threads.• Pale blue: text parameter les which are read in by the main programs at the initialisationstage. These, amongst other things specify entities to display <strong>an</strong>d the desired <strong>an</strong>alysisprocedures.• Green: I/O to/from disk, tape or network.AR has threads which supercede the old ACQU tasks• <strong>Data</strong>Server: input of non-root-format data from experiment, e.g.storage.via net or from mass• <strong>Analysis</strong>: supercedes the old sort program.• <strong>Data</strong>Store: output of reduced (ltered data) in native or root formats. This function hasbeen absorbed into the <strong>an</strong>alysis thread.4


• Control: root comm<strong>an</strong>d-line processing for display etc.• DAQ-Control: this is under development. The DAQ software will be made ROOT compatible.As of AR-3v11 the <strong>Analysis</strong>, Control <strong>an</strong>d <strong>Data</strong>Server threads are in operation.ACQU−ROOT <strong>Data</strong> <strong>Analysis</strong> & StorageJ.R.M. Ann<strong>an</strong>dupdate 12th Sept 2003, 19th March 20047th J<strong>an</strong> 2005NetworkonlineACQU−ROOTC++ Analyser/ControllerMULTI−THREAD Operation<strong>Analysis</strong> ThreadT<strong>AcquRoot</strong>Online<strong>Data</strong> InputThe AnalyserTA2<strong>Analysis</strong>Base CLASSControl ThreadOffline<strong>Data</strong> InputROOT "shell"full ROOT capabilitySpectrum Display etc.DAQ Control ThreadGUI basedComm<strong>an</strong>d Interfaceto VMEbus CPU<strong>Data</strong> Server ThreadTake over Ext. Server TaskMultiple input data streamsTA2<strong>Data</strong>ServerCRYSTAL−BALLMonte CarloGEANT−3 Fortr<strong>an</strong>HBOOK NTUPLE FileROOTFileROOTFilePARTIALLYANALYSEDDATA<strong>Analysis</strong> Config.text fileNetworkonlineDisk/Tape file"online"..... .......Figure 1: Schematic of the <strong>AcquRoot</strong> <strong>an</strong>alysis scheme.5


3 <strong>AcquRoot</strong> Software StructureAR started as a component of ACQU <strong>an</strong>d originally was intended as <strong>an</strong> alternative to the Sortprogram. However its scope has broadened to the extent that it has taken over all ACQU taskscompletely.AR is coded in C++, sticking to ANSI convention where possible, <strong>an</strong>d makes extensive use of thefacilities oered by ROOT. Most of the AR classes are derived from ROOT TNamed (a TObjectwith a character-string Name) <strong>an</strong>d may be m<strong>an</strong>ipulated directly using the ROOT macro interpreterCINT.Source code les may be found in subdirectories of $acqu_sys, but navigation of this softwareis facilitated by the html documentation, which is generated from the primary .cc <strong>an</strong>d .h les usingthe appropriate make comm<strong>an</strong>d, <strong>an</strong>d c<strong>an</strong> be found at directory $acqu_sys/htmldoc. On Glasgowsystems the html les have links to the main ROOT documentation directory /cern/root/doc/htmldoc,this directory being specied in the .rootrc setup le. The usefulness of the html les is of courseimproved if the source code is well commented, using the conventions laid out in the ROOT THtmlClass documentation. The conguration of environmental variables such as $acqu_sys is coveredin Sec.5.1.3.1 The main programAR may be invoked from <strong>an</strong>y ROOT session through dynamic loading of the AR shared library <strong>an</strong>dsubsequent m<strong>an</strong>ipulation from the ROOT shell. However for convenience it is also compiled as <strong>an</strong>executable <strong>AcquRoot</strong> which c<strong>an</strong> be run without explicit invocation of ROOT. The main programcalls AR Class TA2Control which inherits from TRint <strong>an</strong>d thus provides a ROOT comm<strong>an</strong>dshell whence <strong>an</strong>y ROOT comm<strong>an</strong>d or operation may be carried out. It also creates inst<strong>an</strong>ces ofT<strong>AcquRoot</strong> <strong>an</strong>d TA2<strong>Analysis</strong> (or <strong>an</strong> inherited user-dened <strong>an</strong>alysis Class) calls their congurationmethods <strong>an</strong>d starts data processing.Batch processing may be performed by supplying the appropriate options at the comm<strong>an</strong>d line:<strong>AcquRoot</strong> --offline --batch Config-File-Name >&!Message.log3.2 The ROOT InterfaceAR is incorporated into the ROOT Class hieracrchy (Fig. 2) through the Class TA2System,inheriting from TNamed, which is a TObject with a name <strong>an</strong>d a title. AR Classes thus gainaccess to ROOT methods, <strong>an</strong>d may be m<strong>an</strong>ipulated interactively from the ROOT comm<strong>an</strong>d shell(using the CINT interpreter) while AR is running. Thus for example kinematic cuts on data couldbe altered without restarting AR.TA2System has some general-purpose methods for• File h<strong>an</strong>dling, via <strong>an</strong> interface to the UNIX system, with basic methods for reading <strong>an</strong>dparsing lines of text.• Error h<strong>an</strong>dling with variable grades of severity of response, up to exit AR. The default is toprint <strong>an</strong> error message, set a ag (protected parameter fIsError of Class TA2System) <strong>an</strong>dproceed. The ag may be interrogated at a later stage, e.g. by the PostInitialise() virtualmethod of TA2System.• Conguration of the Class, either by comm<strong>an</strong>d-line input or by lines read from a parameterle, held in directory $acqu/data. Methods FileCong() <strong>an</strong>d Comm<strong>an</strong>dCong(), along withvirtual method SetCong() h<strong>an</strong>dle these tasks.6


3.3 The T<strong>AcquRoot</strong> interface to ACQU <strong>Data</strong>The T<strong>AcquRoot</strong> Class inherits from TA2System (Fig. 2) <strong>an</strong>d, in common with all AR classes,conguration is performed by the TA2System methods described in Sec. 3.2.<strong>Data</strong> processing is h<strong>an</strong>dled by the method Run(), which is started as a separate thread (by methodStart() ) so that the output of the sorting may be examined via the ROOT shell while processingcontinues. The ROOT shell may in principle be used to alter <strong>an</strong>alysis parameters while sortingproceeds, e.g. through a SetXXX() function of a particular <strong>an</strong>alysis class. Run operates in threepossible modes:1. Online mode (the default mode). Here T<strong>AcquRoot</strong> links to the data-server thread embodiedin AR class TA2<strong>Data</strong>Server (3.4) using the procedure Link<strong>Data</strong>Server( TA2<strong>Data</strong>Server*ds). <strong>Data</strong> buers in either traditional (Mk1) or new (Mk2) ACQU format are read <strong>an</strong>dtr<strong>an</strong>sferred to a buer by the server, which T<strong>AcquRoot</strong> processes using method <strong>Data</strong>Loop()for TA2<strong>Data</strong>Server linkage. This method operate on the data buer (typically 32 kbyte long)calling Mk1EventLoop() to process each sequential event, which in turn calls the Process()method of main <strong>an</strong>alysis class which inherits from TA2<strong>Analysis</strong> (4). Formats other th<strong>an</strong>Mk1 (e.g. TAPS) c<strong>an</strong> be h<strong>an</strong>dled by the TA2<strong>Data</strong>Server if <strong>an</strong> appropriate format class isprovided (see 3.4).2. Oine mode (selected by comm<strong>an</strong>d line option --offline). Here the data-server thread isnot required <strong>an</strong>d the OineLoop() method of T<strong>AcquRoot</strong> reads events from a Tree le <strong>an</strong>dcalls the Process() method of the TA2<strong>Analysis</strong> as above. TA2<strong>Data</strong>Server is not used in thiscase. Oine is usually used to process pre-ltered data (by previous passes of <strong>AcquRoot</strong>)or GEANT generated data.3. Batch mode (selected by comm<strong>an</strong>d line option --batch). The control thread is not started<strong>an</strong>d display output <strong>an</strong>d log les may optionally be sent to a directory dierent from $acqu.This is useful for batch farm operations where the batch control process does not have writeaccess to a private $acqu directory. Batch mode may be used with either Online or Oinedata-input modes.3.3.1 Mk1Loop <strong>an</strong>d OineLoopThese methods perform the same function of taking input data <strong>an</strong>d where appropriate passing itto the <strong>an</strong>alyser. Mk1Loop works with data provided by TA2<strong>Data</strong>Server while OineLoop readsthe data itself directly from a ROOT Tree le.3.4 The Threaded <strong>Data</strong> ServerThe threaded data server TA2<strong>Data</strong>Server provides all of the functionality of the traditional<strong>Data</strong>Server program <strong>an</strong>d in addition allows the simult<strong>an</strong>eous processing of multiple input datastreams. In traditional ACQU it is assumed that for multi-node DAQ systems, one of the DAQnodes is <strong>an</strong> event builder which reads/assembles sub-events <strong>an</strong>d sends a single data stream to the<strong>an</strong>alyser. This scheme c<strong>an</strong> be inecient if the front-end DAQ event builder is not suciently powerful<strong>an</strong>d may be unfeasible if linkage of non-compatible DAQ systems is required. For exampleat Mainz the TAPS array, which plugs the forward hole in Crystal Ball accept<strong>an</strong>ce, has its ownDAQ system which is not easily married to ACQU-DAQ.Thus the option to perform event building on the data storage <strong>an</strong>d <strong>an</strong>alysis computer systemhas been built into AR (Fig.3). In the case of Mainz tagged-photon experiments the data fromTAPS <strong>an</strong>d the Crystal Ball are sent on separate bre-optic lines to the online <strong>an</strong>alysis (a highperform<strong>an</strong>ce Linux PC), where TA2<strong>Data</strong>Server performs the following:8


Figure 3: Threaded data server TA2<strong>Data</strong>Server• Read all streams asynchronously via classes TA2NetSource (network data tr<strong>an</strong>sfer) or TA2FileSource(data from disk/tape le), both is which inherited from TA2<strong>Data</strong>Source. The TA2<strong>Data</strong>Sourceread loops are run as separate threads. Each source feeds data into a buer (Sec.3.4.1), whereit is retrieved by TA2<strong>Data</strong>Server.• Identify <strong>an</strong>d extract simult<strong>an</strong>eous sub-events from all streams. <strong>Data</strong> is assumed by defaultto be in ACQU (Mk1) format, but other other formats are possible. The basis of theformat-recognition software is class TA2<strong>Data</strong>Format <strong>an</strong>d specic formats are h<strong>an</strong>dled byTA2Mk1Format (Mk1) <strong>an</strong>d TA2TAPSFormat (TAPS).• In all formats it is assumed that each sub-event incorporates <strong>an</strong> identication stamp (hardwaregeneratedevent number) which is used check the synchronisation of the sub-events. An erroris generated when these do not match.• If the event matching is correct then the contents of each sub-event are merged into a singleevent which is then written to <strong>an</strong> output buer. This buer is optionally written to disk <strong>an</strong>dalso passed to T<strong>AcquRoot</strong> (Sec.3.3) etc. for processing.9


Single input, where TA2<strong>Data</strong>Server operates in a similar way to the old <strong>Data</strong>Server, or multipleinput data sources may be chosen via conguration le (Fig.13).3.4.1 Ring Buer TA2RingBuerTA2RingBuer is a component of the data server. It is a linked list of data buers, with thelast in the list linked back to the rst. The intermediate data buers shown in Fig.3 are of typeTA2RingBuer.4 The Analyser Structure<strong>Data</strong> <strong>an</strong>alysis is performed by three Classes (Fig. 4), all of which inherit from TA2<strong>Data</strong>M<strong>an</strong>ager(Sec.4.0.2), which provides methods for passing data between Classes, <strong>an</strong>d TA2HistM<strong>an</strong>ager(Sec.4.0.3) which provides a general purpose histogrammer of results using the ROOT TH1F/TH2F/TH3FClasses. All three Classes have the capability to:1. Read in conguration data from le or comm<strong>an</strong>d line using TA2System methods (Sec.3.2)2. Communicate with T<strong>AcquRoot</strong> <strong>an</strong>d other data-<strong>an</strong>alysis Classes.3. Histogram the results of the local calculations.In principle TA2<strong>Data</strong>M<strong>an</strong>ager does not restrict the system to a 3-tier structure (Fig.4) so thatsub-detectors or even sub-sub-detectors would be possible, but this would be over complicated<strong>an</strong>d detector classes in <strong>an</strong>y case are geared for segmentation.4.0.2 TA2<strong>Data</strong>M<strong>an</strong>agerThis Class c<strong>an</strong> be envisaged as the provider of the arrowed data links shown in Fig. 4, i.e. it isthe class which glues the structure together. <strong>Analysis</strong>, apparatus, detector <strong>an</strong>d physics classesall inherit from this one <strong>an</strong>d are able to communicate with each other via its methods.Protected class variables include pointers to ADC <strong>an</strong>d scaler information, as well as pointers to theparent class <strong>an</strong>d the list of child classes. Methods CreateChild() <strong>an</strong>d AddChild() create inst<strong>an</strong>cesof child classes, while general purpose Decode() <strong>an</strong>d Reconstruct() call the specialist <strong>an</strong>alysisfunctions for each child on the list.TA2<strong>Data</strong>M<strong>an</strong>ager is responsible for setting up lists of data ltering conditions through the methodsParseCuts() <strong>an</strong>d SetCut(). Three linked lists (type TA2MultiCut*) of data cuts (type TA2Cut)are used to maintain:1. TA2MultiCut* f<strong>Data</strong>Cuts: list of cuts applied globally to the output of the decode orreconstruct methods of the particular <strong>an</strong>alysis class.2. TA2MultiCut* fHistCuts: list of cuts applied ONLY to specic histograms.3. TA2MultiCut* fMiscCuts: list of wild-card cuts which may be used at the <strong>an</strong>alysers discretion,e.g. to determine the species of particle.4. TA2MultiCut* fCompoundCut: a me<strong>an</strong>s of chaining simple cuts to form a compound cut10


Figure 4: The 3-tier structure of the AR <strong>an</strong>alyser. A central <strong>an</strong>alyser TA2<strong>Analysis</strong> (red), hasTA2Apparatus-type children (blue). The specic apparati themselves have TA2Detector-typechildren (blue-grey).Application of cuts (<strong>an</strong>d other <strong>an</strong>alysis procedures) requires a method to access the variables ofa specic inst<strong>an</strong>ce of <strong>an</strong> <strong>an</strong>alysis class. This is done in a similar way to ROOT where specicinst<strong>an</strong>ces of classes may be accessed though a Name character string <strong>an</strong>d indeed most AR classesinherit from TNamed. Method LoadVariable() implements the storage of <strong>an</strong> associative structwhich contains a pointer to a variable, a character string by which the variable is known <strong>an</strong>d <strong>an</strong>integer which species the type of the variable. Possible permutations are:1. Double_t (64-bit oat) single-value scaler variableLoadVariable("Mtot",&fMtot,EDSingleX);where variable fMtot is of type Double_t2. Double_t (64-bit oat) array of single-value variablesLoadVariable("Energy",fEnergy,EDSingleX);where variable fEnergy is of type Double_t*11


fUniqueIDfBitsfgDtorOnlyfgObjectStatkC<strong>an</strong>DeletekMustCle<strong>an</strong>upkObjInC<strong>an</strong>vas@~TObjectMakeZombieDoErrorTObjectTObjectoperator=AppendPadBrowseClassNameClearCloneCompareCopyDeleteDist<strong>an</strong>cetoPrimitiveDrawDrawClassDrawCloneDumpExecuteExecuteExecuteEventFindObjectFindObjectGetDrawOptionGetUniqueIDGetNameGetIconNameGetOptionTObjectkIsReferencedkHasUUIDkC<strong>an</strong>notPickkZombiekBitMaskkSingleKeykNoContextMenu kOverwritekInvalidObject kWriteDeletekIsOnHeap fgIsAkNotDeletedGetObjectInfoGetTitleH<strong>an</strong>dleTimerHashInheritsFromInheritsFromInspectIsFolderIsEqualIsSortableIsOnHeapIsZombieNotifylsPaintPopPrintReadRecursiveRemoveSaveAsSavePrimitiveSetDrawOptionSetUniqueIDUseCurrentStyleWriteWriteoperator newoperator new@[@]operator newoperator new@[@]operator deleteoperator delete@[@] operator=operator delete Clearoperator delete@[@] CloneSetBitSetBitResetBitTestBitTestBitsInvertBitInfoWarningErrorSysErrorFatalAbstractMethodMayNotUseGetDtorOnlySetDtorOnlyGetObjectStatSetObjectStatClassClass_NameIsAShowMembersfNamefTitlefgIsATNamed@~TNamedTNamedTNamedTNamedTNamedCompareCopyFillBufferGetNameGetTitleHashIsSortableSetNameSetNameTitleSetTitlelsPrintSizeofClassClass_NameIsAShowMembersTA2SystemfCmdList[5]fInputFilefLogFilefLogStreamfIsInitfIsErrorfIsConfigPassfgIsA@~TA2SystemBaseInitPrintErrorPrintMessageMap2KeyMap2KeyMap2StringGetMapKeyGetMapStringAddCmdListFileConfigComm<strong>an</strong>dConfigParseMiscSetConfigPostInitBuildNameCheckNameGetInputFileGetLogFileGetLogStreamSetLogStreamSetLogFileIsInitIsErrorClassClass_NameIsAShowMembersfR<strong>an</strong>domfR<strong>an</strong>dSeedfParentfChildrenfVariablesfTreeFilefTreefBr<strong>an</strong>chfNbr<strong>an</strong>chf<strong>Data</strong>CutsfHistCutsfMiscCutsfCompoundCutfRateMonitorfBitPatternfPatternHitsfNPatternHits@~TA2<strong>Data</strong>M<strong>an</strong>agerPostInitGetN2VGetVarTypeIsIntCreateChildLoadVariableParseCutResetCutPostInitialiseAddChildAddChildDecodeDecodeSavedReconstructCle<strong>an</strong>upUpdatePeriodPeriodicParsePeriodParseEndOfFileParseFinishSetEndOfFileSetFinishEndFileFinishMacroExeSetSaveEventTA2<strong>Data</strong>M<strong>an</strong>agerfADCfADCdefinedfMultifScalerfScalerBufffScalerSumfEventfMaxADCfMaxScalerfScalerIndexfScalerCurrfScalerAccfNPeriodfMaxPeriodfPeriodCmdfEndOfFileCmdfFinishCmdInitSaveTreeInitSaveTreeSaveEventSaveEventCloseEventGetChildTypeGetChildGetGr<strong>an</strong>dChildGetParentGetChildrenGet<strong>Data</strong>CutsGetHistCutsGetMiscCutsGetADCGetADCdefinedGetScalerGetScalerSumGetEventGetEventGetMaxADCGetMaxScalerGetScalerIndexGetScalerCurrGetScalerAccGetScalerErrorGetMultiGetMultifTreeFileNamefIsRawDecodefIsDecodefIsReconstructfIsRawDecodeOKfIsDecodeOKfIsReconstructOKfIsCutfIsBitPatternfIsRateMonitorfIsEndOfFilefIsFinishfIsSaveEventkValidChildfgIsAGetRateMonitorGetBitPatternGetPatternHitsGetNPatternHitsGetTreeFileGetTreeGetNPeriodGetMaxPeriodGetPeriodCmdGetEndOfFileCmdGetFinishCmdIsRawDecodeIsDecodeIsReconstructIsRawDecodeOKIsDecodeOKIsReconstructOKIsBitPatternIsRateMonitorIsEndOfFileIsFinishIsSaveEventClassClass_NameIsAShowMembersFigure 5: TA2<strong>Data</strong>M<strong>an</strong>ager inherit<strong>an</strong>ce scheme. This plot, auto-generated by THtml, lists classvariables <strong>an</strong>d procedures.3. Double_t (64-bit oat) multi-value variableLoadVariable("Mmiss",fMmiss,EDMultiX);where variable fMmiss is of type Double_t*. Multi-value variables usually have a nonconst<strong>an</strong>tmultiplicity event-by-event, with the end-of-buer delimited by the marker EBuer-End. If histogramed, all multiple values are lled into the same histogram.4. Int_t (32-bit integer) versions of items 1 3 above may be specied by substituting EI forED, so that for example EDSingleX → EISingleX.The associative struct is wrapped in a ROOT TObject in the form of class TA2_N2V so that itmay be added to the fVariables linked list of TA2<strong>Data</strong>M<strong>an</strong>ager. From here it may be accessedusing the name string with the GetN2V(char*) method, or the address of the variable may bereturned using GetVar(char*), which in addition pulls out the pointer from TA2_N2V. In caseswhere the TA2<strong>Data</strong>M<strong>an</strong>ager is a parent (e.g. TA2Apparatus) or a gr<strong>an</strong>dparent (TA2<strong>Analysis</strong>),GetN2V is able to decend through the child/child-of-child lists in search of the variable name.Where the variable is stored in a child class the supplied name would a compound of the nameof the child class <strong>an</strong>d the name of the variable. For example at physics or <strong>an</strong>alysis level access of12


the TimeOR variable of detector class NaI a part of apparatus CB would be performed usingthe string CB_NaI_TimeOR. Obviously the placement of the '_' character <strong>within</strong> a variable orclass name should be avoided as it will confuse GetN2V().Further information on the use of LoadVariable() <strong>an</strong>d the setting up of data cuts is given inSec.5.3.2.4.0.3 TA2HistM<strong>an</strong>agerThis class inherits from TA2<strong>Data</strong>M<strong>an</strong>ager (Fig.5) <strong>an</strong>d contains methods ParseDisplay(), Setup1D(),SetupMulti1D() <strong>an</strong>d Setup2D() to specify <strong>an</strong>d initialise the histograming of <strong>an</strong>alysis class variables.fNamefTitlefgIsATNamed@~TNamedTNamedTNamedTNamedTNamedoperator=ClearCloneCompareCopyFillBufferGetNameGetTitleHashIsSortableSetNameSetNameTitleSetTitlelsPrintSizeofClassClass_NameIsAShowMembersTA2SystemfCmdList[5]fInputFilefLogFilefLogStreamfIsInitfIsErrorfIsConfigPassfgIsA@~TA2SystemBaseInitPrintErrorPrintMessageMap2KeyMap2KeyMap2StringGetMapKeyGetMapStringAddCmdListFileConfigComm<strong>an</strong>dConfigParseMiscSetConfigPostInitBuildNameCheckNameGetInputFileGetLogFileGetLogStreamSetLogStreamSetLogFileIsInitIsErrorClassClass_NameIsAShowMembersfR<strong>an</strong>domfR<strong>an</strong>dSeedfParentfChildrenfVariablesfTreeFilefTreefBr<strong>an</strong>chfNbr<strong>an</strong>chf<strong>Data</strong>CutsfHistCutsfMiscCutsfCompoundCutfRateMonitorfBitPatternfPatternHitsfNPatternHitsTA2<strong>Data</strong>M<strong>an</strong>agerfADCfADCdefinedfMultifScalerfScalerBufffScalerSumfEventfMaxADCfMaxScalerfScalerIndexfScalerCurrfScalerAccfNPeriodfMaxPeriodfPeriodCmdfEndOfFileCmdfFinishCmd@~TA2<strong>Data</strong>M<strong>an</strong>ager InitSaveTreePostInitInitSaveTreeGetN2VSaveEventGetVarType SaveEventIsIntCloseEventCreateChild GetChildTypeLoadVariable GetChildParseCutGetGr<strong>an</strong>dChildResetCutGetParentPostInitialise GetChildrenAddChildGet<strong>Data</strong>CutsAddChildGetHistCutsDecodeGetMiscCutsDecodeSaved GetADCReconstruct GetADCdefinedCle<strong>an</strong>upGetScalerUpdatePeriod GetScalerSumPeriodicGetEventParsePeriod GetEventParseEndOfFile GetMaxADCParseFinish GetMaxScalerSetEndOfFile GetScalerIndexSetFinishGetScalerCurrEndFileGetScalerAccFinishGetScalerErrorMacroExeGetMultiSetSaveEvent GetMultifTreeFileNamefIsRawDecodefIsDecodefIsReconstructfIsRawDecodeOKfIsDecodeOKfIsReconstructOKfIsCutfIsBitPatternfIsRateMonitorfIsEndOfFilefIsFinishfIsSaveEventkValidChildfgIsAGetRateMonitorGetBitPatternGetPatternHitsGetNPatternHitsGetTreeFileGetTreeGetNPeriodGetMaxPeriodGetPeriodCmdGetEndOfFileCmdGetFinishCmdIsRawDecodeIsDecodeIsReconstructIsRawDecodeOKIsDecodeOKIsReconstructOKIsBitPatternIsRateMonitorIsEndOfFileIsFinishIsSaveEventClassClass_NameIsAShowMembersTA2HistM<strong>an</strong>agerfHistListf1Dhistf2Dhistf3DhistfN1DhistfN2DhistfN3DhistfIsDisplayfgIsA@~TA2HistM<strong>an</strong>agerDecodeDecodeSavedReconstructSetConfigParseDisplayFillHistFillAllHistHistZeroHistZeroAllSaveHistListHistH2DIsDisplayGetN1DhistGetN2DhistGetN3DhistGet1DhistGet2DhistGet3DhistClassClass_NameIsAShowMembersFigure 6: TA2HistM<strong>an</strong>ager inherit<strong>an</strong>ce scheme. This plot, auto-generated by THtml lists classvariables <strong>an</strong>d procedures.This class, which is part of <strong>an</strong>y <strong>an</strong>alysis class, maintains lists of 1D (TList* f1Dhist), 2D (TList*f2Dhist) <strong>an</strong>d 3D (TList* f3Dhist) histograms of the decoded or reconstructed local variables.Histograms are based on the TH1F, TH2F <strong>an</strong>d TH3F ROOT Classes with outer, templatedwrapper Classes to h<strong>an</strong>dle specics:13


1. TA2H1S: 1D spectrum for a single-valued parameter, which may be of <strong>an</strong>y type (integer,oat etc.), but is cast to (Double_t*) when the histogram is lled.2. TA2H1M: 1D spectrum for a multi-valued parameter. This is contained in a buer (theaddress of the buer is stored at construct). The buer is sc<strong>an</strong>ned <strong>an</strong>d each value is histogrameduntil the sequence is terminated by a EBuerEnd delimiter.3. TA2H1MF: 1D spectrum of signal shape from a sampling ADC. Otherwise similar to TA2H1M.4. TA2H1MS: 1D spectrum of consecutive scaler counts. Operationally similar to TA2H1MF.5. TA2H2SS: 2D spectrum with single-valued x <strong>an</strong>d y parameters.6. TA2H2MS: 2D spectrum with multi-valued x <strong>an</strong>d single-valued y parameters.7. TA2H2SM: 2D spectrum with single-valued x <strong>an</strong>d multi-valued y parameters.8. TA2H2MS: 2D spectrum with multi-valued x <strong>an</strong>d y parameters.9. TA2H3S: 3D spectrum with single-valued x, y <strong>an</strong>d z parameters.10. TA2H3M: 3D spectrum with multi-valued x, y <strong>an</strong>d z parametersNote that the TA2H are passed the address(es) of the variable(s) to be histogramed on construction.The addresses are retrieved using the LoadVariable() <strong>an</strong>d GetN2V() methods described inSec.4.0.2 <strong>an</strong>d so the variable naming convention is the same as for data-ltering cuts.The method FillHist() calls the templated Fill() routine specic to type for each TA2H found inthe lists of spectra. Method Hist() plots a spectrum, List1D, List2D() output the contents ofthe 1D <strong>an</strong>d 2D histogram lists, ZeroHist(), ZeroAll() zero the histogram contents <strong>an</strong>d SaveHist()writes all listed histograms of a particular class to a ROOT le.4.0.4 TA2<strong>Analysis</strong>TA2<strong>Analysis</strong>, which inherits from TA2HistM<strong>an</strong>ager (Fig.7) provides the core of the data <strong>an</strong>alysissystem (Fig.4), with all sorting taking place <strong>within</strong> the Process() method.14


TA2SystemfCmdList[5]fInputFilefLogFilefLogStreamfIsInitfIsErrorfIsConfigPassfgIsA@~TA2SystemBaseInitPrintErrorPrintMessageMap2KeyMap2KeyMap2StringGetMapKeyGetMapStringAddCmdListFileConfigComm<strong>an</strong>dConfigParseMiscSetConfigPostInitBuildNameCheckNameGetInputFileGetLogFileGetLogStreamSetLogStreamSetLogFileIsInitIsErrorClassClass_NameIsAShowMembersfR<strong>an</strong>domfR<strong>an</strong>dSeedfParentfChildrenfVariablesfTreeFilefTreefBr<strong>an</strong>chfNbr<strong>an</strong>chf<strong>Data</strong>CutsfHistCutsfMiscCutsfCompoundCutfRateMonitorfBitPatternfPatternHitsfNPatternHitsTA2<strong>Data</strong>M<strong>an</strong>agerfADCfADCdefinedfMultifScalerfScalerBufffScalerSumfEventfMaxADCfMaxScalerfScalerIndexfScalerCurrfScalerAccfNPeriodfMaxPeriodfPeriodCmdfEndOfFileCmdfFinishCmd@~TA2<strong>Data</strong>M<strong>an</strong>ager InitSaveTreePostInitInitSaveTreeGetN2VSaveEventGetVarType SaveEventIsIntCloseEventCreateChild GetChildTypeLoadVariable GetChildParseCut GetGr<strong>an</strong>dChildResetCut GetParentPostInitialise GetChildrenAddChild Get<strong>Data</strong>CutsAddChild GetHistCutsDecodeGetMiscCutsDecodeSaved GetADCReconstruct GetADCdefinedCle<strong>an</strong>upGetScalerUpdatePeriod GetScalerSumPeriodicGetEventParsePeriod GetEventParseEndOfFile GetMaxADCParseFinish GetMaxScalerSetEndOfFile GetScalerIndexSetFinish GetScalerCurrEndFileGetScalerAccFinishGetScalerErrorMacroExe GetMultiSetSaveEvent GetMultifTreeFileNamefIsRawDecodefIsDecodefIsReconstructfIsRawDecodeOKfIsDecodeOKfIsReconstructOKfIsCutfIsBitPatternfIsRateMonitorfIsEndOfFilefIsFinishfIsSaveEventkValidChildfgIsAGetRateMonitorGetBitPatternGetPatternHitsGetNPatternHitsGetTreeFileGetTreeGetNPeriodGetMaxPeriodGetPeriodCmdGetEndOfFileCmdGetFinishCmdIsRawDecodeIsDecodeIsReconstructIsRawDecodeOKIsDecodeOKIsReconstructOKIsBitPatternIsRateMonitorIsEndOfFileIsFinishIsSaveEventClassClass_NameIsAShowMembersTA2HistM<strong>an</strong>agerfHistListf1Dhistf2Dhistf3DhistfN1DhistfN2DhistfN3DhistfIsDisplayfgIsA@~TA2HistM<strong>an</strong>agerDecodeDecodeSavedReconstructSetConfigParseDisplayFillHistFillAllHistHistZeroHistZeroAllSaveHistListHistH2DIsDisplayGetN1DhistGetN2DhistGetN3DhistGet1DhistGet2DhistGet3DhistClassClass_NameIsAShowMembersfRaw<strong>Data</strong>fNDAQEventfNhitsfNEventfNEvAnalysedfNOnlineEventfNHardwareErrorfHardwareErrorfFlash@~TA2<strong>Analysis</strong>TA2<strong>Analysis</strong>SetConfigProcessMProcessCle<strong>an</strong>upCreateChildParseDisplayLoadVariableParseADCPostInitialiseScalersZeroSumScalersRawDecodeEndFileFinishInitSaveTreeCh<strong>an</strong>geTreeFileInitTreeFileNameSaveHistTA2<strong>Analysis</strong>fMultif<strong>Physics</strong>fPrevFileNamefParticleIDfIs<strong>Physics</strong>fIsProcessCompletefgIsAGetNhitsGetFlashGetMultiGetMultiGet<strong>Physics</strong>Is<strong>Physics</strong>GetNEventGetNEvAnalysedGetNOnlineEventGetNDAQEventGetParticleIDSetParticleIDIsProcessCompleteClassClass_NameIsAShowMembersStreamerFigure 7: TA2<strong>Analysis</strong> inherits from TA2HistM<strong>an</strong>ager, TA2<strong>Data</strong>M<strong>an</strong>ager <strong>an</strong>d TA2System. Thisplot, auto-generated by THtml, lists class variables <strong>an</strong>d procedures.The event processing loop shown in Fig.8 is the most import<strong>an</strong>t procedure of TA2<strong>Analysis</strong>.15


Figure 8: TA2<strong>Analysis</strong>::Process() ow diagram4.0.5 TA2ApparatusTA2SystemfCmdList[5]fInputFilefLogFilefLogStreamfIsInitfIsErrorfIsConfigPassfgIsA@~TA2SystemBaseInitPrintErrorPrintMessageMap2KeyTA2<strong>Data</strong>M<strong>an</strong>agerfR<strong>an</strong>domfR<strong>an</strong>dSeedfParentfChildrenfVariablesfTreeFilefTreefBr<strong>an</strong>chfNbr<strong>an</strong>chf<strong>Data</strong>CutsfHistCutsfMiscCutsfCompoundCutfRateMonitorfBitPatternfADCfADCdefinedfMultifScalerfScalerBufffScalerSumfEventfMaxADCfMaxScalerfScalerIndexfScalerCurrfScalerAccfNPeriodfMaxPeriodfPeriodCmdfTreeFileNamefIsRawDecodefIsDecodefIsReconstructfIsRawDecodeOKfIsDecodeOKfIsReconstructOKfIsCutfIsBitPatternfIsRateMonitorfIsEndOfFilefIsFinishfIsSaveEventkValidChildfgIsATA2HistM<strong>an</strong>agerfHistListf1Dhistf2Dhistf3DhistfN1DhistfN2DhistfN3DhistfIsDisplayfgIsA@~TA2HistM<strong>an</strong>agerDecodeDecodeSavedReconstructTA2ApparatusfP4fPDGtypefPDG_IDfP4totfParticleIDfMtotfMinvfEtotfMaxParticlefNparticlefROOToutputfPCutfNCutfNSectorfPCutStartfNSectorCutfgIsA@~TA2ApparatusSetConfigLoadVariablePostInitCreateChildGetNparticleGetPCutGetPCutGetNCutGetNSector16


4.0.6 TA2DetectorTA2SystemfCmdList[5]fInputFilefLogFilefLogStreamfIsInitfIsErrorfIsConfigPassfgIsA@~TA2SystemBaseInitPrintErrorPrintMessageMap2KeyMap2KeyMap2StringGetMapKeyGetMapStringAddCmdListFileConfigComm<strong>an</strong>dConfigParseMiscSetConfigPostInitBuildNameCheckNameGetInputFileGetLogFileGetLogStreamSetLogStreamSetLogFileIsInitIsErrorClassClass_NameIsAShowMembersfR<strong>an</strong>domfR<strong>an</strong>dSeedfParentfChildrenfVariablesfTreeFilefTreefBr<strong>an</strong>chfNbr<strong>an</strong>chf<strong>Data</strong>CutsfHistCutsfMiscCutsfCompoundCutfRateMonitorfBitPatternfPatternHitsfNPatternHitsTA2<strong>Data</strong>M<strong>an</strong>agerfADCfADCdefinedfMultifScalerfScalerBufffScalerSumfEventfMaxADCfMaxScalerfScalerIndexfScalerCurrfScalerAccfNPeriodfMaxPeriodfPeriodCmdfEndOfFileCmdfFinishCmd@~TA2<strong>Data</strong>M<strong>an</strong>ager InitSaveTreePostInitInitSaveTreeGetN2VSaveEventGetVarType SaveEventIsIntCloseEventCreateChild GetChildTypeLoadVariable GetChildParseCut GetGr<strong>an</strong>dChildResetCut GetParentPostInitialise GetChildrenAddChild Get<strong>Data</strong>CutsAddChild GetHistCutsDecodeGetMiscCutsDecodeSaved GetADCReconstruct GetADCdefinedCle<strong>an</strong>upGetScalerUpdatePeriod GetScalerSumPeriodicGetEventParsePeriod GetEventParseEndOfFile GetMaxADCParseFinish GetMaxScalerSetEndOfFile GetScalerIndexSetFinish GetScalerCurrEndFileGetScalerAccFinishGetScalerErrorMacroExe GetMultiSetSaveEvent GetMultifTreeFileNamefIsRawDecodefIsDecodefIsReconstructfIsRawDecodeOKfIsDecodeOKfIsReconstructOKfIsCutfIsBitPatternfIsRateMonitorfIsEndOfFilefIsFinishfIsSaveEventkValidChildfgIsAGetRateMonitorGetBitPatternGetPatternHitsGetNPatternHitsGetTreeFileGetTreeGetNPeriodGetMaxPeriodGetPeriodCmdGetEndOfFileCmdGetFinishCmdIsRawDecodeIsDecodeIsReconstructIsRawDecodeOKIsDecodeOKIsReconstructOKIsBitPatternIsRateMonitorIsEndOfFileIsFinishIsSaveEventClassClass_NameIsAShowMembersTA2HistM<strong>an</strong>agerfHistListf1Dhistf2Dhistf3DhistfN1DhistfN2DhistfN3DhistfIsDisplayfgIsA@~TA2HistM<strong>an</strong>agerDecodeDecodeSavedReconstructSetConfigParseDisplayFillHistFillAllHistHistZeroHistZeroAllSaveHistListHistH2DIsDisplayGetN1DhistGetN2DhistGetN3DhistGet1DhistGet2DhistGet3DhistClassClass_NameIsAShowMembersfElementfEnergyfEnergyORfTimefTimeORfPositionfMe<strong>an</strong>PosfShiftOpfShiftValuefNShiftOpfHitsfRawTimeHitsfRawEnergyHitsfDetectorCommfDetectorHistfTotalEnergy@~TA2DetectorDecodeBasicSetConfigPostInitDecodeDecodeSavedReconstructCle<strong>an</strong>upSaveDecodedReadDecodedSetupArraysDeleteArraysCreateChildLoadVariableParseShiftApplyShiftGetElementGetElementGetEnergyGetEnergyORGetEnergyGetTimeGetTimeORGetTimeGetPositionGetPositionGetMe<strong>an</strong>PosTA2DetectorfEnergyScalefTimeOffsetfNhitsfNADChitsfNTDChitsfNelementfNelemfMaxHitsfIsECalibfIsScalerfIsEnergyfIsTimefIsPosfIsRawHitsfgIsAGetShiftOpGetShiftValueGetNShiftOpGetHitsGetHitsGetRawTimeHitsGetRawEnergyHitsGetTotalEnergyGetEnergyScaleGetTimeOffsetGetNhitsGetNADChitsGetNTDChitsGetNelementGetNelemGetMaxHitsIsEcalibIsScalerIsEnergyIsTimeIsPosIsRawHitsClassClass_NameIsAShowMembersFigure 10: TA2Detector inherits from TA2HistM<strong>an</strong>ager, TA2<strong>Data</strong>M<strong>an</strong>ager <strong>an</strong>d TA2System. Thisplot, auto-generated by THtml, lists class variables <strong>an</strong>d procedures.5 Setup Technicalities5.1 InstallationAny user account on a Linux-based system may be set up for AR use. Installation procedures forboth core <strong>an</strong>d user acqu distributions are given in the following subsections.5.1.1 Core Acqu DistributionThis contains the kernel of <strong>AcquRoot</strong> in shared libraries <strong>an</strong>d header les. When installed ona commonly accessible disk, these may be linked by multiple users to provide core <strong>AcquRoot</strong>functionality to personal <strong>an</strong>alysis implementations. The following assumes that core software is17


Env. Variable Typical Value Env. Variable Typical ValueROOTSYS /cern/root/dev acquversion 4v1ROOT /home/jrma/cern/root acqudate 7th Jul 2007LD_LIBRARY_PATH .:/cern/root/dev/lib:... acqu_site jrma1ACQU_SYSROOT /home/acqu/4v1 acqu_sys /home/acqu/4v1/acquACQUROOT /home/jrma acqu /home/jrma/acquCCCOMP g++ acqu_debugger dddCPUTYPE __LINUX acqu_debug -gacqu_usesubdirsYESTable 1: The ACQU UNIX environmental variables for user jrma linking to <strong>AcquRoot</strong> 4v1 installedon user acqu. Note that from 4v0 onwards code is written entirely in C++ <strong>an</strong>d old environmentalvariables relating to other l<strong>an</strong>guages are no longer used.installed in a dedicated user account. This account, called here acqu, needs no special systempriveleges, but its directory system should be readable by other users.1. Login as acqu. Copy or download the ACQU distribution tar le to the home directory. Thename (e.g. 4v1.25.08.07.tar.gz) species the version (i.e. version 3, subversion 17) <strong>an</strong>d date(i.e. 1st December 2004).2. Unpack the distribution. From the home directory...tar zxvf 4v1.25.08.07.tar.gzThis should create a directory called 4v1.25.08.07. For setup scripts to work properly thefollowing symbolic link should by created...ln -s 4v1.25.08.07 4v1Its often convenient to make a further symbolic link...ln -s 4v1 devThe next item assumes this has been done3. Basic set up of the acqu account (skip this item if the set up has been performed already).Two rc les .acqurc, .rootrc should reside on the home directory. From the home directory...cp dev/acqu/User/.acqurc .cp dev/acqu/User/.rootrc .Edit .acqurc. Check the setup of environment variables ACQU_SYSROOT, ACQUROOT<strong>an</strong>d ROOTSYS <strong>an</strong>d if necessary ch<strong>an</strong>ge.If running on systems where processors with dierent architecture may be used (e.g. if yourdesktop is <strong>an</strong> I386 <strong>an</strong>d your batch farm uses X64) the .acqurc le should contain the linesetenv acqu_usesubdirs YESREAD THE COMMENTS in .acqurc for guid<strong>an</strong>ce.Edit .rootrc. Usually only the line specifying the directory where ROOT html documentationresides requires to be ch<strong>an</strong>ged. The c<strong>an</strong> also be set to a web address.Create or edit .tcshrc (or .cshrc) the setup script for the shell tcsh. Suitable lines to pastein for automatic ROOT <strong>an</strong>d ACQU set up c<strong>an</strong> be found in ~/dev/acqu/User/.tcshrc.4. Test the automatic set up (skip if performed already). Logout <strong>an</strong>d then login again as acqu.Some messages should appear regarding executing the acqu_setup script. If <strong>an</strong>y error isreported while the tcsh shell executes the .tcshrc initial script, its possible that the ACQUenvironment has not been initialised fully. The shell comm<strong>an</strong>d printenv will print out alldened environmental variables. The ones congured by ACQU (there will be others) shouldlook similar to the typical values in Table 1.5. Build ACQU...cd $acqu18


make ultracle<strong>an</strong>makeThis compiles <strong>an</strong>d links the entire suite of ACQU programs including the html documentation.To compile <strong>an</strong>d link <strong>AcquRoot</strong> only...make <strong>AcquRoot</strong>5.1.2 User Acqu InstallationDetermine the account holding the core ACQU distribution, which the user needs to access (readonly).This will usually be called something similar to acqu, acqusys or a2acqu. Listing thehome directory of this account should reveal directories, the working versions of which have asymbolic link pointer, e.g. directory 4v1.25.08.07 (version 4v1 at date 25th August 2007) pointedto by link 4v1. To set up normal-user <strong>AcquRoot</strong> data <strong>an</strong>alysis...1. Unless otherwise directed select the highest version/subversion <strong>an</strong>d execute the setup script:source ~acqu/4v1/acqu/acqu_setupThis line should be inserted into the setup script for the tcsh shell setup script usually called~/.tcshrc or ~/.cshrc as outlined in item 3 of Sec.5.1.1.2. If this is a completely new start then setup a private acqu directory:cd ~; tar ztvf $acqu_sys/User/UserAcqu.tar.gzThis merely lists the contents of the archive so that the le <strong>an</strong>d directory specication maybe checked. To actually install:tar zxvf $acqu_sys/User/UserAcqu.tar.gzThis will create <strong>an</strong> acqu directory which contains bin, obj, lib, root/src <strong>an</strong>d root/macrossubdirectories.3. If this is a completely new start copy over two rc les to your home directory (~):cd; cp $acqu_sys/User/.acqurc .cp $acqu_sys/User/.rootrc .These les may require editing to conform with the peculiarities of the local Linux system.Where the user wishes to retain the functionality of <strong>an</strong> existing .rootrc le the setup willneed to be merged, possibly requiring expert advice. However in m<strong>an</strong>y cases the .rootrcch<strong>an</strong>ges are minimal, relating to the html documentation directory only.4. Look closely at the lines in .acqurcsetenv ACQU_SYSROOT /home/acqu/$acquversionsetenv CERNROOT /cern/devThis assumes /home/acqu is the acqu account home directory <strong>an</strong>d /cern/dev the placewhere cernlib (the old F77 based CERN tools) software resides (if its installed).setenv acqu_debugger dddsetenv acqu_debug -gThis chooses the ddd GUI interface to the gdb debugger <strong>an</strong>d sets the ag to compile indebug mode. To compile in st<strong>an</strong>dard mode comment out the latter line. The directoryspecications are highly system dependent.5. When satised that the rc les are correctly congured exit the shell <strong>an</strong>d open a new shell(i.e. a start a new xterm of the equivalent). The acqu_setup script should execute <strong>an</strong>dprint a b<strong>an</strong>ner with version <strong>an</strong>d date. Now perform the following:cd $acqu; make ultracle<strong>an</strong>; makeThis will compile the sample user source code which is provided with the distribution indirectory $acqu/root/src <strong>an</strong>d if successful write <strong>an</strong> executable <strong>AcquRoot</strong> to the $acqu/bindirectory <strong>an</strong>d a private ROOT library $acqu/lib/libUserRoot.so.19


6. To run <strong>AcquRoot</strong>...cd $acqu; <strong>AcquRoot</strong> CB.OfflineCB.Oine is the name of the base le which congures <strong>an</strong> <strong>an</strong>alysis of CB data from disk.Unless the <strong>AcquRoot</strong> parameter les are correctly congured this will very likely fail. Con-guration is described in Sec.5.25.2 Parameter Conguration FilesThe structure of the tree of parameter les to set up the AR <strong>an</strong>alyser is basically similar tothat in Fig.4. The parameter les are hum<strong>an</strong>-readable text les, created using a st<strong>an</strong>dard editor.Comment lines are designated by the '#' character....please read the comments/expl<strong>an</strong>ations inthose displayed in subsequent gures.5.2.1 Base T<strong>AcquRoot</strong> conguration leThis supplies information to setup:1. The tree structure of ROOT les for oine <strong>an</strong>alysis.2. The <strong>an</strong>alysis class <strong>an</strong>d <strong>an</strong>alysis-class conguration le to use.3. The data server conguration le to use for online runningThe typed instruction<strong>AcquRoot</strong> CB.Offlinecauses AR to use the le $acqu/data/CB.Oine (Fig.11) as the base conguration le, i.e. theconguration le for the class T<strong>AcquRoot</strong>. If the le name is omitted then AR will try to open$acqu/data/ROOTsetup.dat. Any base le may be made the default by making a symbolic link.cd $acqu/data; ln -s CB.Offline ROOTsetup.datThe full set of cong comm<strong>an</strong>ds provided by T<strong>AcquRoot</strong> are given in Table 2 <strong>an</strong>d <strong>an</strong> example oftheir use in a cong. le is shown in Fig.11.Keyword Parameters FunctionName: char, int, char Output tree name, #br<strong>an</strong>ch, proc-typeBr<strong>an</strong>ch: char, int Name & buer size (byte) of br<strong>an</strong>chDirectory: char Name of output-le directory<strong>Analysis</strong>: char Name of <strong>an</strong>alysis class to use<strong>Analysis</strong>Setup: char Name of <strong>an</strong>alysis cong leServerSetup: char Name of data server cong leSetADC: int, int, int M<strong>an</strong>ual ADC/scaler #adc, #scaler, bits/adcEventSize: int ONLY used if no Name: Br<strong>an</strong>ch: etc.EventIndex: int M<strong>an</strong>ual setup of adc index of event ID stampTreeFile: char Name of input le for oine <strong>an</strong>alysisScalerNoClear: int, int... Fragmented scaler read: block indicesLocal-DAQ: Char_t*, .... DAQ(s) on same node as AR, DAQ cong le name(s)Table 2: T<strong>AcquRoot</strong> conguration comm<strong>an</strong>ds20


Wednesday December 15, 2004 /home/jrma/acqu/data/CB.OfflineDec 15, 04 12:42 CB.OfflinePage 1/2##−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−##−−Author JRM Ann<strong>an</strong>d 29th Apr 2003##−−Update JRM Ann<strong>an</strong>d... 1st Dec 2004##−−Description## *** Acqu++ Root ***## Online/Offline <strong>Analysis</strong> of Sub−Atomic <strong>Physics</strong> Experimental <strong>Data</strong>#### Parameter File: CB.Offline## Master parameter file for Acqu−Root <strong>an</strong>alysis. Expected to reside in## directory $acqu/data/## To use invoke...## <strong>AcquRoot</strong> CB.Offline##−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−## Input data setup for Offline <strong>an</strong>alysis...this info is ignored## if no offline connection is used, ie c<strong>an</strong> be left in.## Tree name <strong>an</strong>d # br<strong>an</strong>ches are used if storing filtered data in root tree## format or reading data ( −−offline ) from a chain of tree files.## Process Type c<strong>an</strong> be "Raw", "MC" or "<strong>Physics</strong>".## For a st<strong>an</strong>dard Raw <strong>an</strong>alysis 3 br<strong>an</strong>ches would normally be used.## For MC input the number of br<strong>an</strong>ches depends on the format of the saved data## <strong>Physics</strong> mode isn’t implmented yet## Ensure the buffer size is sufficient for each br<strong>an</strong>ch.## RawEvent_Hits: 32768 is the data record length...should be OK## RawEvent_Scalers: 4 * (number of scalers + 1) is sufficient## Mk1_Header: 4 * (number of ADCs + 1) is sufficient## NB with TAPS the number of ADCs = 29001## Tree Name # br<strong>an</strong>ches Process TypeName: RawEvent_AR_Save 3 Raw## Br<strong>an</strong>ch Name Buffer sizeBr<strong>an</strong>ch: RawEvent_Hits 32768Br<strong>an</strong>ch: RawEvent_Scalers 4192Br<strong>an</strong>ch: Mk1_Header 120000#### List of Tree files which will form the input TChain for −−offline runningTreeFile: /scratch/jrma/CB_3557.rd0TreeFile: /scratch/jrma/CB_3558.rd0#### Directory to save <strong>an</strong>y created ROOT files (include final / )Directory: /scratch/jrma/#### M<strong>an</strong>ual setup of ADC, Scaler, bits−in−ADC numbers## Usually needed only where experiment header information is not given## e.g. if the input tree file is generated by GEANT## #ADC #Scaler #bits#SetADC: 30000 492 12#### End of Offline <strong>an</strong>alysis input specification##−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−## Needed for offline <strong>an</strong>alysis if event marker ID hasn’t been saved in header## IDEventIndex: 400#### Normally don’t attempt to set eventsize m<strong>an</strong>ually##EventSize: 32768#### <strong>Analysis</strong> mode.## User−defined <strong>an</strong>alysis class<strong>Analysis</strong>: TA2User<strong>Analysis</strong>## <strong>Analysis</strong> setup file<strong>Analysis</strong>Setup: CB<strong>an</strong>alysis.dat#### Online running...setup of data serverFigure 11: AR sample base conguration le. It species the user <strong>an</strong>alysis class TA2User<strong>Analysis</strong>,congured using the le CB<strong>an</strong>alysis.dat <strong>an</strong>d the internal data server, congured using CBserver-Setup.datDec 15, 04 12:42 CB.OfflinePage 2/2## This is ignored for offline running <strong>an</strong>d may be left inServerSetup: CBserver.OfflinePrinted by Red Hat Linux User5.2.2 Conguration le for TA2<strong>Analysis</strong> or derived classA sample <strong>an</strong>alysis conguration le CB<strong>an</strong>alysis.dat is shown in Fig.12. This species:• h<strong>an</strong>dlers for multi-hit or ash ADC's (st<strong>an</strong>dard single-value ADC's do not require <strong>an</strong>y inputhere)• the optional apparatus classes to load, <strong>an</strong>d their conguration les. Apparatus-level reconstructionis also enabled.• the optional physics class to load <strong>an</strong>d the conguration le.• the display of some import<strong>an</strong>t raw ADC's <strong>an</strong>d scalers21


Tuesday December 14, 2004 /home/jrma/acqu/data/CB<strong>an</strong>alysis.dat### Stuff to monitor time dependence of counting rates <strong>an</strong>d the hit pattern## coming from the trigger box....the parameter is the setup file nameRateMonitor: Trigger.RateBitPattern: Trigger.Pat#### Apparatus setup## Raw <strong>an</strong>alysis may be performed without Apparati## Name Class Setup fileApparatus: CB TA2Calorimeter CB.datApparatus: TAPS TA2Calorimeter TAPS.datApparatus: TAGG TA2KensTagger KensTagger.datApparatus: LinPol TA2LinearPol LinearPolapparatus.dat#### Turn on apparatus−level reconstructionReconstruct−<strong>Analysis</strong>:#### Specify physics <strong>an</strong>alysis<strong>Physics</strong>−<strong>Analysis</strong>: Meson TA2Photo<strong>Physics</strong> CBphysics.dat#### Do some post initialisation...usually necessaryInitialise:#### Setup of extra procedures to run at periodic intervals## The procedures are usually held in macro script files## Period...every N events## N Macro File Macro ProcedurePeriod: 100000 PeriodMacro.C PeriodMacro()####−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−##−−Author JRM Ann<strong>an</strong>d 29th Apr 2003##−−Update JRM Ann<strong>an</strong>d... 1st Dec 2004##−−Description## *** Acqu++ Root ***## Online/Offline <strong>Analysis</strong> of Sub−Atomic <strong>Physics</strong> Experimental <strong>Data</strong>#### Parameter File: CB<strong>an</strong>alysis.dat (specified in CB.Offline)## Setup basic parameters of <strong>an</strong>alysis to be used## This one sets up <strong>an</strong> <strong>an</strong>alysis of Crystal Ball data####−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−#### The following give sample specifications for## h<strong>an</strong>dlers for flash or multihit ADCs or TDCs#### Catch−TDC, where a reference TDC ch<strong>an</strong>nel has to be specified## The reference TDC ch<strong>an</strong>nel contains the trigger time which is subtracted## from the other specified ch<strong>an</strong>nels## CB TDC’s## #hits start stop referenceMultiADC: 3 2001 2767 2000MultiADC: 3 4000 4511 2000#### SG ADC read out in 3−sum mode (#hits is always 3)## DC # ch<strong>an</strong>nels summed for the pedestal (before signal leading edge)## signal # ch<strong>an</strong>nels summed for the signal region of the pulse## tail # ch<strong>an</strong>nels summed for the tail region (after signal trailing edge)## CB S−ADC’s# #hits start stop DC signal tailMultiADC: 3 3000 3735 30 30 30## MWPC strip S−ADC’s (switched to single−value read)#MultiADC: 3 5000 5319 30 30 30Dec 14, 04 13:21 CB<strong>an</strong>alysis.datPage 2/2## EndFile...each time <strong>an</strong> input data file is closed#EndFile: EndFileMacro.C EndFileMacro()#### Finish...when all input data files processed#Finish: FinishMacro.C FinishMacro()#### Save all accepted events (ie those which pass all data cuts) to a## ROOT file. <strong>Data</strong> saved in RAW format (ie ADC indices <strong>an</strong>d values)#Save−Event:#### Histogram ALL defined single value ADC’s#Display: All## Histogram ADCs 100 − 131#Display: ADC 100 131#### Display of multihit stuff etc.## CB CATCH TDC’s, 1st hit#Display: MultiHit 2001 2007 1000 −1000 0 0#Display: MultiHit 2008 2031 1000 −3000 −2000 0#### CB CATCH TDC’s, 2nd hit#Display: MultiHit 2032 2720 500 −2600 400 0#Display: MultiHit 4000 4383 500 −4000 2000 0#### CB SADC’s pedestal#Display: MultiHit 3000 3720 100 6000 7000 0## CB SADC’s signal#Display: MultiHit 3000 3720 1000 0000 4000 1## CB SADC’s tail#Display: MultiHit 3000 3720 500 −800 200 2#### Display blocks of scalersDisplay: Scaler 0 11Display: SumScaler 0 11Display: Scaler 12 363Display: SumScaler 12 363Display: Scaler 364 491#### Time dependence of individual scaler rates <strong>an</strong>d ratiosDisplay: Rate 0 2500Display: Rate 1 2500Display: Rate 2 2500Display: Rate 3 2500Display: Rate 4 2500Display: Rate 5 2500#### Trigger pattern, <strong>an</strong>d e−beam polarisation bitsDisplay: Pattern 0 16 0 16Display: Pattern 1 8 0 8#### CB−TAPS synchronisation monitorsDisplay: 2D 20401 200 0 4000 2001M0 200 −600 −400Display: 2D 20401 200 0 4000 2004M0 200 −600 −400Display: 2D 20401 200 0 4000 2005M0 200 −600 −400#### END OF FILEFigure 12: AR sample <strong>an</strong>alysis conguration le.The full list of conguration comm<strong>an</strong>ds for TA2<strong>Analysis</strong> is given in Table 3Keyword Parameters FunctionApparatus: char, char, char Name, class-name <strong>an</strong>d cong le of <strong>an</strong> apparatusReconstruct-<strong>Analysis</strong>:Dec 14, 04 13:21 CB<strong>an</strong>alysis.datPage 1/2Enable apparatus reconstruct procedures<strong>Physics</strong>-<strong>Analysis</strong> char, char, char Name, class-name <strong>an</strong>d cong le of physicsDisplay: see Fig.12 Set up histrgramsInitialise:Some further setting after all parms read inMultiADC: see Fig.12 H<strong>an</strong>dler for multi-value ADCsFlashADC: see Fig.12 H<strong>an</strong>dler for sampling ADCsBitPattern: char Hit pattern-unit decode, name of cong leRateMonitor: char Scaler time dependences, name of cong lePeriod: int,char,char period(# events), macro le, macro comm<strong>an</strong>dEndFile: char, char macro le, macro comm<strong>an</strong>dFinish: char, char macro le, macro comm<strong>an</strong>dSave-Event:Save ltered data to ROOT tree lePrinted by ACQU data <strong>an</strong>alysisTable 3: TA2<strong>Analysis</strong> conguration comm<strong>an</strong>ds5.2.3 TA2<strong>Data</strong>Server conguration leThe cong. le to use to setup the internal <strong>Data</strong>Server is specied in the base cong. le (Fig.11)<strong>an</strong>d the server cong. le itself, CBserver.Oine, is listed at the left of Fig.13. It species thatdata is received in a single stream from a disk le. An alternative server le MergeServer.Onlinespecies that data is received from 2 network stream sockets. These 2 streams are stored directly22


to disk les for diagnostic purposes, the streams are merged <strong>an</strong>d the merged data is also writtento a disk le.Wednesday December 15, 2004 /home/jrma/acqu/data/CBserver.Offline, /home/jrma/acqu/data/MergeServer.OnlineDec 14, 04 13:25 CBserver.OfflinePage 1/1##−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−##−−Author JRM Ann<strong>an</strong>d 13th J<strong>an</strong> 2004##−−Update JRM Ann<strong>an</strong>d... 1st Dec 2004##−−Description## *** Acqu++ Root ***## Online/Offline <strong>Analysis</strong> of Sub−Atomic <strong>Physics</strong> Experimental <strong>Data</strong>#### Parameter File: CBserver.Offline## Configuration file for <strong>Data</strong>Server (data input for <strong>an</strong>alysis)####−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−## Number of Input streams (sources of data), Record length to write data## <strong>an</strong>d switch 0/1 = no/yes to control data write## Number streams Record Len Save <strong>Data</strong>Input−Streams: 1 32768 0#### Optional directory spec. If not specified File−Names must contain the full## directory pathFile−Directory: /scratch1/acqu/#### Specify each input stream## From disk file, ACQU (Mk1) format, save <strong>an</strong>y output to file (save=1)## Input data record length, Output data record length#### Source Format Save? RecLen Buffers Swap MarkIDStream−Spec: File Mk1 0 32768 32 0 400#### Now the list of data files to <strong>an</strong>alyse## File Name 1st rec Last rec#File−Name: CB_1867.dat 0 0#File−Name: CB_929.dat 0 0#File−Name: CB_1980.dat 0 0#File−Name: CB_1763.dat 0 0#File−Name: CB_2749.dat 0 0File−Name: CB_3557.dat 0 0File−Name: CB_3626.dat 0 0#### ENDDec 15, 04 20:25 MergeServer.OnlinePage 1/1##−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−##−−Author JRM Ann<strong>an</strong>d 13th J<strong>an</strong> 2004##−−Update JRM Ann<strong>an</strong>d... 1st Dec 2004##−−Description## *** Acqu++ Root ***## Online/Offline <strong>Analysis</strong> of Sub−Atomic <strong>Physics</strong> Experimental <strong>Data</strong>#### Parameter File: MergeServer.Online## Default master parameter file for <strong>Data</strong>Server (data input for <strong>an</strong>alysis)## Online data taking, merged ACQU & TAPS####−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−## Number of Input streams (sources of data), Record length to write data## <strong>an</strong>d switch 0/1 = no/yes to control data write## Number streams Record Len Save <strong>Data</strong>Input−Streams: 2 32768 1#### Optional directory spec. If not specified File−Names must contain the full## directory pathFile−Directory: scratch/#### Specify each network−socket input stream## Mk1(ACQU) data, node slarti,IP−port 3010, 512 elem buffer, event stamp 400## TAPS data, node taps02,IP−port 4097, 32 elem buffer, event stamp 29000## Individual data stream save is turned on...usually for diagnostic only## Source Format Save? Node Port Buffers MkID SwapStream−Spec: Network Mk1 1 slarti 3010 512 400File−Name: CB_Mk1 0 0Stream−Spec: Network TAPS 1 taps02 4097 32 29000File−Name: CB_TAPS 0 0##Figure 13: <strong>Data</strong> Server conguration lePrinted by ACQU data <strong>an</strong>alysisThe following set up comm<strong>an</strong>ds are recognised by TA2<strong>Data</strong>ServerKeyword Parameters FunctionInput-Streams int, int, int #-streams, record-length, save(0/1=no/yes)Stream-Spec: see Fig.13 parameters for data streamFile-Name: char Input data le nameFile-Directory: char Directory where data les resideTable 4: TA2<strong>Data</strong>Servercap:TA2<strong>Analysis</strong>-conguration-comm<strong>an</strong>ds conguration comm<strong>an</strong>ds23


5.2.4 Apparatus conguration lesApparatus conguration les will depend on the specic coding of the SetCong() method ofthe particular apparatus class, but in general this will call the TA2Apparatus method as well assupplying its own particular comm<strong>an</strong>ds. Conventionally the local comm<strong>an</strong>d list of the derivedapparatus class is searched rst for a match with the input comm<strong>an</strong>d string <strong>an</strong>d if not found thenthe comm<strong>an</strong>d list of TA2Apparatus is searched. The le listed in Fig.14 has been used to set upthe user-dened TA2Calorimeter class but all of the lines shown are quite general. A summary ofTA2Apparatus comm<strong>an</strong>ds is given in Table 5The gure shows how to specify...• Names, Class Names <strong>an</strong>d Setup les for all detectors which are part of the class. Theapparatus contains TA2CalArray, TA2PlasticPID <strong>an</strong>d TA2CylMWPC types of detectors• Some post-initialisation. This normally calls the TA2Apparatus method <strong>an</strong>d may add someextras.• Procedure to execute periodically (every N events)• Filtering cuts to apply to the data, described in Sec.5.3.2.• Histograms to be made of variables, described in Sec. ??Keyword Parameters FunctionDetector: char, char, char Name, class name, cong le<strong>Data</strong>-Cut: see Fig.14 Specify data cutReconstruct:Enable reconstruct methodInitialise:Further initialisationDisplay: see Fig.14 Specify histogramsParticleID: int init. PDG data base (max # particles)ParticleID-Cut int int setup particle-ID cuts from misc listMisc:NOT IMPLEMENTEDPeriod: int, char, char Period(events), Macro le, Macro comm<strong>an</strong>dEndFile: char, char End of File procedure (Macro le, Macro comm<strong>an</strong>d)Finish: char, char End of Run procedure (Macro le, Macro comm<strong>an</strong>d)Save-Event:Not yet implementedTable 5: TA2Apparatus conguration comm<strong>an</strong>ds5.2.5 Detector conguration lesAs with apparati (Sec.5.2.4) detector conguration les depend on the specic coding of theSetCong() method of the detector class, but user detector classes generally call the TA2Detectormethod if the input comm<strong>an</strong>d is not found in their own particular comm<strong>an</strong>d list. The le listedin Fig.15 is used to set up a TA2ClusterDetector class which is derived from TA2Detector <strong>an</strong>dillustrates cong. comm<strong>an</strong>ds or both base <strong>an</strong>d inherited class.The le supplies:• ADC, TDC <strong>an</strong>d Position calibration information for each element of the array of detectorsnumbering 720 in this case.• Time-walk specication for TDC correction.24


Tuesday December 14, 2004 /home/jrma/acqu/data/CB.datDec 14, 04 13:44 CB.datPage 1/2##−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−##−−Author JRM Ann<strong>an</strong>d 29th Apr 2003##−−Update JRM Ann<strong>an</strong>d...##−−Description## *** Acqu++ Root ***## Online/Offline <strong>Analysis</strong> of Sub−Atomic <strong>Physics</strong> Experimental <strong>Data</strong>#### Parameter File: CBapparatus.dat (specified in ROOT<strong>an</strong>alysis.dat)## or equivalent## Setup <strong>an</strong>alysis of the Crystal Ball apparatus## This one sets up <strong>an</strong> <strong>an</strong>alysis of the Crystal_Ball NaI(Tl) array## <strong>an</strong>d the inner Particle ID Detector####−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−#### Specify list of detectors which constitute the Crystal Ball apparatus## Name Class Name Setup fileDetector: NaI TA2CalArray CB_NaI_June.datDetector: PID TA2PlasticPID CB_PID_June3.datDetector: MWPC TA2CylMWPC MWPC.16.10.04#### <strong>Data</strong> reconstruction method for Crystal BallReconstruct:#### Do some post−initialisation.## Should usually be done before display is setupInitialise:#### Periodic procedure to execute every N * NA events## NA is the period specified in the <strong>an</strong>alysis (see CB<strong>an</strong>alysis.dat).## Thus if NA = 100000, CBPeriodMacro() will execute every 200000 events## If no <strong>an</strong>alysis periodic specified, no apparatus periodic will execute## N Macro File Macro ProcedurePeriod: 2 CBPeriodMacro.C CBPeriodMacro()#### Cut specification## NB 2D cuts, ie a general polygon on the X−Y pl<strong>an</strong>e not yet implemented## Simple rect<strong>an</strong>gle cuts may be made by <strong>an</strong> AND of X <strong>an</strong>d Y conditions## 1/2D Name Link Scope Low/High Limits#<strong>Data</strong>−Cut: 1D MtotC AND compound−data#<strong>Data</strong>−Cut: 1D Mtot OR element 100 180#<strong>Data</strong>−Cut: 1D Mtot OR element 500 600#<strong>Data</strong>−Cut: 1D PID_Nhits AND data 1 16#<strong>Data</strong>−Cut: 1D NaI_ClNhits AND data 1 16#### Histograms of apparatus−level variables## histogram name should be preceeded by 1D or 2D (for dimension of spectrum)## Name ch<strong>an</strong>/low/high min/max condition(opt)#Display: 1D Nhit 16 0 16#Display: 1D Mtot 800 0 800 0 0 MtotC#Display: 1D Minv 500 0 500 0 7Display: 1D NphotMinv 800 0 800 0 1#Display: 1D NaI_ClNhitsOR 16 0 16###Display: 1D PID_Energy 100 0 20 0 23#### X−Name X−ch/low/high/id Y−Name Y−ch/low/high/id Condition(opt)#Display: 2D Mtot 100 0 800 −1 NphotMinv 100 0 800 1#Display: 2D Mtot 100 0 800 −l NphotMinv 100 0 800 2#Display: 2D Mtot 100 0 800 −1 Nhit 16 0 16 0###Display: 2D NaI_EnergyOR 100 0 800 −1 PID_Energy 100 0 20 0Dec 14, 04 13:44 CB.datPage 2/2##Display: 2D PID_Hits 24 0 24 −1 NaI_ClPhi 180 −180 180 −1Display: 2D MWPC_PhiWire0 180 0 6.5 −1 NaI_ClPhi 180 −180 180 −1Display: 2D MWPC_PhiSWDiff0 180 −0.1 0.1 −1 NaI_ClPhi 180 −180 180 −1Display: 2D MWPC_PhiWire0 180 0 6.5 −1 PID_Hits 24 0 24 −1Display: 2D MWPC_ZIntersect0 100 −200 200 −1 NaI_ClTheta 180 0 180 −1Display: 2D MWPC_ZIntersect1 100 −300 300 −1 NaI_ClTheta 180 0 180 −1Display: 2D MWPC_TrackTheta 180 0 3.15 −1 NaI_ClTheta 180 0 180 −1Display: 2D MWPC_TrackPhi 180 −3.14 3.14 −1 NaI_ClPhi 180 −180 180 −1Display: 2D MWPC_PhiDiff 180 −0.5 0.5 −1 NaI_ClPhi 180 −180 180 −1##Display 1D MWPC_Xvertex 1000 −100 100Display 1D MWPC_Yvertex 1000 −100 100Display 1D MWPC_Zvertex 200 −500 500Display 1D MWPC_PsXvertex 1000 −100 100Display 1D MWPC_PsYvertex 1000 −100 100Display 1D MWPC_PsZvertex 1000 −500 500Display: 1D MWPC_ZIntersect0 500 −220 220Display: 1D MWPC_PhiSWDiff0 100 −0.2 0.2Display: 1D MWPC_PhiWire0 360 0 6.4Display: 1D MWPC_ZIntersect1 500 −320 320Display: 1D MWPC_PhiSWDiff1 100 −0.2 0.2Display: 1D MWPC_PhiWire1 360 0 6.4Display: 1D MWPC_PhiDiff 100 −0.5 0.5Display: 2D MWPC_Xvertex 100 −50 50 −1 MWPC_Yvertex 100 −50 50 −1Display: 2D MWPC_Zvertex 150 −300 300 −1 MWPC_Rvertex 40 0 40 −1Display: 2D MWPC_PsXvertex 100 −50 50 −1 MWPC_PsYvertex 100 −50 50 −1Display: 2D MWPC_PsZvertex 150 −300 300 −1 MWPC_PsRvertex 40 0 40 −1Display: 2D MWPC_ZIntersect0 100 −220 220 −1 MWPC_PhiWire0 180 −0.1 6.4 −1Display: 2D MWPC_ZIntersect0 100 −220 220 −1 MWPC_ZIntersect1 100 −320 320 −1Display: 2D MWPC_ZIntersect0 100 −220 220 −1 MWPC_PhiSWDiff0 100 −0.1 0.1 −1Display: 2D MWPC_ZIntersect1 100 −320 320 −1 MWPC_PhiWire1 180 −0.1 6.4 −1Display: 2D MWPC_ZIntersect1 100 −320 320 −1 MWPC_PhiSWDiff1 180 −0.1 0.1 −1Display: 2D MWPC_PhiSWDiff0 100 −0.1 0.1 −1 MWPC_PhiSWDiff1 100 −0.1 0.1 −1Display: 2D MWPC_PhiWire0 180 0.0 6.4 −1 MWPC_PhiSWDiff0 100 −0.1 0.1 −1Display: 2D MWPC_PhiWire1 180 0.0 6.4 −1 MWPC_PhiSWDiff1 100 −0.1 0.1 −1Display: 2D MWPC_ZIntersect0 100 −220 220 −1 MWPC_PhiDiff 50 −0.1 0.1 −1Display: 2D MWPC_PhiWire0 180 0.0 6.4 −1 MWPC_PhiDiff 50 −0.1 0.1 −1Display: 2D MWPC_PhiWire1 180 0.0 6.4 −1 MWPC_PhiDiff 50 −0.1 0.1 −1Figure 14: Crystal Ball apparatus conguration lePrinted by ACQU data <strong>an</strong>alysis• Nearest neighbour information for each element of the array.• Some postinitialisation, which is highly detector specic.• Filtering cuts to apply to the data, described in Sec.5.3.2.• Histograms to be made of variables, described in Sec. ??A summary of all recognised cong. comm<strong>an</strong>ds for TA2Detector is given in Table 6 <strong>an</strong>d extensionsto the comm<strong>an</strong>d list provided by various derived detector types are given in Tables 7, 8 <strong>an</strong>d 95.2.6 <strong>Physics</strong> conguration leTA2<strong>Physics</strong> <strong>an</strong>d its inherited classes combine the information from the apparati into physicalqu<strong>an</strong>tities such as missing mass or missing momentum. The actual physics class to use is specied25


Dec 08, 05 19:33 CB_NaI.dat Page 1/2##−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−##−−Author JRM Ann<strong>an</strong>d 29th Apr 2003##−−Update JRM Ann<strong>an</strong>d... 1st Dec 2004##−−Description## *** Acqu++ Root ***## Online/Offline <strong>Analysis</strong> of Sub−Atomic <strong>Physics</strong> Experimental <strong>Data</strong>#### Parameter File: CB_NaI.dat. Setup of decoding of NaI information##−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−## Total # Elements in array, Pulse−Height info? Time info? Position info?## Info switch is off/on = 0/1## Total Energy? Time? Position?Size: 720 1 1 1#### Save separate ADC <strong>an</strong>d TDC hits arrays...no energy/time cuts appliedRawHits:#### Get global coordinate−shift variables from input line## A shift operation is characterised by a 2−char name <strong>an</strong>d value## Up to 12 operations may input <strong>an</strong>d the associated corrinate## tr<strong>an</strong>sforms are performed in order they appear on the line## Allowed operations## Tr<strong>an</strong>slate in X,Y or Z.....TX,TY,TZ by assocoaied value## Rotate about X,Y or Z.....RX,RY,RZ by associated value in deg.## Invert X,Y,Z..............IX,IY,IZ (associated value ignored)## Rotate about me<strong>an</strong> pos## (Z only for now) .....MX,MY,MZ by associated value in deg.## This hypothetical set of shifts has NOT been applied#Shift−Coord: IX 0.0 RX 20.0 TZ 60.0#### Calibration factors for each crystal...one line for each crystal## ADC# : index of pulse−height ADC including <strong>an</strong>y multi−hit spec (M1 here)## low,high: energy cuts for valid hit (in MeV)## ped : the pedestal(zero pulse height) ch<strong>an</strong>nel (NOT MeV)## MeV/ch<strong>an</strong>: conversion gain in these units## TDC# : index for time ADC including <strong>an</strong>y multi−hit spec (M0 here)## l,high : time cuts for valid hit (in ns)## off : time offset (nominal time zero) ch<strong>an</strong>nel## ns/ch : conversion gain in these units## Pos : coordinates of the detector. Here x,y,z mid front face of NaI## Optionally after each Element: line a time−walk correction may be specified## Thresh : the threshold in MeV of the leading edge discriminator## RiseTime: the rise time in ns of the signal from the detector element#### ADC# low high ped MeV/ch TDC# l,high off ns/ch PosElement: 3015M1 0.5 400. 0.00 0.0625 2032M0 0 200 −2200 0.117 3.62 45.21 2.63## Thresh RiseTimeTimewalk: 1.5 90.Element: 3014M1 0.5 400. 0.00 0.0677 2033M0 0 200 −2200 0.117 7.32 44.51 5.32Timewalk: 1.5 90.## ....## There would now follow a further 718 "Element:" <strong>an</strong>d optionally## "Timewalk:" lines so that calibration factors may be given for all## 720 elements of the detector#### Specification of adjacent detectors for Clustering## Only if the detector is a TA2ClusterDetector## Max # clusters to <strong>an</strong>alyse Cluster threshold Energy (MeV)Max−Cluster: 8 25#### Turn on search for <strong>an</strong>y connected hits outside of near−neighbour list## hits−size−fact min−dist max−distIterate−Neighbours: 3 4.5 5.5#### Search for clusters which could be split offs from the main cluster## Thresh−SplitOff(MeV) Split−Off Opening <strong>an</strong>gle (deg.)#Split−Off: 30.0 5.0#### Nearest neighbours for each element (see above) of array## Parameter N specifies the number of neighbours (adjacent elements)## This is followed by a list of the indices of the adjacent elements.## 1st in the list is the index of the "central element"## N List indices of neighboursNext−Neighbour: 12 0 1 144 576 145 577 432 579 2 3 146 288Next−Neighbour: 13 1 0 2 3 5 6 4 146 145 144 576 577 579## ....## There would now follow a further 718 "Next−Neighbour:"## lines so that adjacent elements may be given for all## 720 elements of the detector#### Do some further array initialisation BEFORE display specificationInitialise:#### Periodic procedure to execute every N * NAp * NA events## NAp is the (CB) apparatus period, NA is the <strong>an</strong>alysis period## If NA = 100000, NAp = 2; NaIPeriodMacro() will execute every 400000 events## If no <strong>an</strong>alysis/apparatus periodic, no detector periodic will execute## N Macro File Macro ProcedurePeriod: 2 NaIPeriodMacro.C NaIPeriodMacro()#### Cut specification. Syntax the same for all <strong>an</strong>alysis classes## see apparatus file CB.dat## 1/2D Name Link Scope Low/High Limits#<strong>Data</strong>−Cut: 1D CBCross OR compound−data#<strong>Data</strong>−Cut: 1D ClTheta NAND element 50 65#<strong>Data</strong>−Cut: 1D ClPhi NAND element 50 65#<strong>Data</strong>−Cut: 1D CBBox OR compound−data#<strong>Data</strong>−Cut: 1D ClTheta NOR element 120 140#<strong>Data</strong>−Cut: 1D ClPhi NOR element −150 −120#<strong>Data</strong>−Cut: 1D ClNhits AND data 6 6#### Histograming of basic detector stuff## NaI Crystal hit multiplicity, 64 ch<strong>an</strong>nels, r<strong>an</strong>ge 0−64## Name ch/low/high imin/imaxDec 08, 05 19:33 CB_NaI.dat Page 2/2Display: 1D Nhits 64 0 64Display: 1D NADChits 64 0 64Display: 1D NTDChits 64 0 64#### NaI hit frequency distribution, 720 elements, r<strong>an</strong>ge 0 −− 720Display: 1D Hits 720 0 720Display: 1D ADCHits 720 0 720Display: 1D TDCHits 720 0 720#### Total Energy deposited in the array, 400 ch<strong>an</strong>nels, r<strong>an</strong>ge 0 −− 800 MeVDisplay: 1D Etot 400 0 800#### Energy/time for individual crystals, 200 ch<strong>an</strong>nels, r<strong>an</strong>ge 0−400 MeV, 0−200 ns## Make histogram for each element (0−719) of the CB#Display: 1D Energy 200 0 400 0 719#Display: 1D Time 200 0 200 0 719Display: 1D EnergyOR 200 0 400Display: 1D TimeOR 200 0 200#### Cluster Histograms## Cluster energy OR, 200 ch<strong>an</strong>, 0−800 MeVDisplay: 1D ClEnergyOR 200 0 800#### Hit pattern <strong>within</strong> each cluster, 32 ch<strong>an</strong>, 0−32, 720 histograms#Display: 1D ClHits 32 0 32 0 719#### # hits in each cluster#Display: 1D ClMulti 32 0 32 0 719#### # clusters detected per eventDisplay: 1D ClNhits 16 0 16Display: 1D ClNhitsOR 16 0 16#### Distribution of cluster hits...index of the central element plottedDisplay: 1D ClTotHits 720 0 720#### 2D diagnostic plots. id = −1 me<strong>an</strong>s not specified## X−Name X−ch/low/high/id Y−Name Y ch/low/high/id Condition(opt)Display: 2D ClTheta 180 0 180 −1 ClPhi 180 −180 180 −1Display: 2D EnergyOR 100 0 400 −1 Hits 720 0 720 −1Display: 2D TimeOR 180 0 180 −1 Hits 720 0 720 −1Printed by ACQU administrationThursday December 08, 2005 CB_NaI.dat1/1Figure 15: TA2ClusterDetector conguration le. Most of the Element: <strong>an</strong>d Next-Neighbour:lines (720 lines of each comm<strong>an</strong>d) have been removed for brevity <strong>an</strong>d clarity.in the <strong>an</strong>alysis le (Fig.12) as is the physics conguration le. User-dened physics methods willvary considerably, but all will need target nuclei specication as in the physics conguration leshown in Fig.16. This le also has some wild-card setup, which user physics classes c<strong>an</strong> interpretas they see t, <strong>an</strong>d of course specication of cuts <strong>an</strong>d histograms. The syntax for the latterfollows the st<strong>an</strong>dard rules as TA2<strong>Physics</strong> is a type of TA2Apparatus. Indeed TA2<strong>Physics</strong> calls thest<strong>an</strong>dard TA2Apparatus::SetCong() method <strong>an</strong>d so has the comm<strong>an</strong>ds given in Table 5.A summary of TA2<strong>Physics</strong>-specic comm<strong>an</strong>ds is given in Table 10. The coding of TA2<strong>Physics</strong> ispreliminary <strong>an</strong>d suggestions of general-purpose utilities to augment the bare bones are welcome.5.3 <strong>Data</strong> Filtering <strong>an</strong>d DisplayAny data <strong>an</strong>alysis system requires that chosen variables may be tested, histogramed <strong>an</strong>d displayed.This may be hard-wired into code, but in <strong>AcquRoot</strong> a more exible approach is taken.26


Keyword Parameters FunctionSize: int, int, int, int # elements, yes/no energy, time, positionElement: see Fig.15 Calibration parameters for element of a detecorAllElement: DIAGNOSTIC ONLY Give all elements same calibrationInitialise:Further initialisationDisplay: see Fig.15 Histogram cong.<strong>Data</strong>-Cut: see Fig.15 <strong>Data</strong>-ltering cuts cong.TimeWalk: double, double Walk correction to TDC. Discr thresh, rise timeAllTimeWalk: DIAGNOSTIC ONLY All elements same walk correctionRawHits:Save ADC/TDC hit patterns (no cuts)BitPattern: char Hit pattern-unit decode, name of cong lePeriod: int, char, char Period(events), Macro le, Macro comm<strong>an</strong>dEndFile: char, char End of File procedure (Macro le, Macro comm<strong>an</strong>d)Finish: char, char End of Run procedure (Macro le, Macro comm<strong>an</strong>d)Energy-Scale: double Global scaling for fEnergy array (scale factor)Energy-R<strong>an</strong>dom: int Smearing of energies (r<strong>an</strong>dom generator seed)Shift-Coord: see Fig.15 Global tr<strong>an</strong>sforms of detector coordinatesTable 6: TA2Detector conguration comm<strong>an</strong>dsKeyword Parameter FunctionMax-Cluster: int, double Max # clusters, cluster energy thresholdNext-Neighbour: see Fig.15 Specify adjacent detectors for cluster ndingAll-Neighbour: DIAGNOSTIC ONLY All elements same neighboursSplit-O: double, double Split threshold (MeV), max main-split <strong>an</strong>gle (deg)Iterate-Neighbours: int, double, double Array size factor, new neighbour min, max dist<strong>an</strong>ceTable 7: TA2ClusterDetector conguration comm<strong>an</strong>dsKeyword Parameter FunctionBar: int # long scintillator barsBar-Size: int, int, double, double, double bar parametersTable 8: TA2LongScint conguration comm<strong>an</strong>ds. The detector is assumed to consist of a long barof plastic scintillator read at both ends by PMT.Keyword Parameter FunctionNumber-Layers: int # active layers in detectorNumber-Chambers: int # active chambers in detectorLayers-In-Chamber: see MWPC.16.10.04 Indices of layes in chamberChamber-Parameter: see MWPC.16.10.04 Size <strong>an</strong>d position of chamberPl<strong>an</strong>e-Wire:Not yet implementedCyl-Wire: see MWPC.16.10.04 Cylindrical array of wiresPl<strong>an</strong>e-Drift:Not yet implementedPl<strong>an</strong>e-Strip:Not yet implementedCyl-Strip: see MWPC.16.10.04 Helical wound cathode stripsTable 9: TA2WireChamber conguration comm<strong>an</strong>ds. Cong. le MWPC.16.10.04, part of theUser<strong>Data</strong> bundle, shows how a TA2CylMWPC is set up.5.3.1 LoadVariable a exible me<strong>an</strong>s to access addressesTA2<strong>Data</strong>M<strong>an</strong>ager::LoadVariable() is used to associate a name (character string) with the addressof a particular variable <strong>an</strong>d the associative list is then stored in the private data b<strong>an</strong>ks of <strong>an</strong>y27


Tuesday December 14, 2004 /home/jrma/acqu/data/CBphysics.dat##−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−##−−Author JRM Ann<strong>an</strong>d 29th Apr 2003##−−Update JRM Ann<strong>an</strong>d... 1st Dec 2004##−−Description## *** Acqu++ Root ***## Online/Offline <strong>Analysis</strong> of Sub−Atomic <strong>Physics</strong> Experimental <strong>Data</strong>#### Parameter File: CBphysics.dat## Last stage in event−by−event <strong>an</strong>alysis####−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−#### Target parameters (LH2)## x,y,z Mass(MeV)Target: 0. 0. 0. 938.271## Would be CD#Target: 0. 0. 0. 1875.613 11188.174#### Wild−card stuff for fitting combinations of particles to a reaction## Not fully implementedPermutations: 1#### Particle data group database, max # particlesParticleID: 16#### Do some post−initialisation.## Should usually be done before display is setupInitialise:## Cut specification...see apparatus setup, same syntax applies# 1/2D Name Link Scope Low/High Limits#<strong>Data</strong>−Cut: 1D MtotC OR compound−hist#<strong>Data</strong>−Cut: 1D Mtot OR element 100 200#<strong>Data</strong>−Cut: 1D Mtot OR element 400 600## Histograms of physics−level variables# histogram name should be preceeded by 1D or 2D (for dimension of spectrum)# Name ch<strong>an</strong>/low/high min/max condition(opt)#Display: 1D Mtot 800 0 800 0 0 MtotC#Display: 1D Minv 500 0 500 0 7#Display: 1D Mmiss 500 0 2000#Display: 1D DpnMmiss 1000 0 1000#Display: 1D DpnMmiss 1000 0000 2000#Display: 1D DpnAngle 180 0 180#Display: 1D DpnAngleCM 180 0 180#Display: 1D PhiDiff 180 0 360#Display: 1D ThetaDiff 180 0 180#Display: 1D ThetaDiffCM 180 0 180#Display: 1D ThetaP 180 0 180#Display: 1D ThetaN 180 0 180#Display: 1D ThetaPCM 180 0 180#Display: 1D ThetaNCM 180 0 180Display: 1D CBTAPS2PhotonMinv 200 0 800#Display: 1D Pmiss 500 0 500 0 7#Display: 1D Ptheta 500 0 500 0 7#Display: 1D Pphi 500 0 500 0 7## X−Name X−ch/low/high/id Y−Name Y−ch/low/high/id Cond(opt)#Display: 2D Mtot 100 0 800 −1 NphotMinv 100 0 800 1#Display: 2D Mtot 100 0 800 −l NphotMinv 100 0 800 2#Display: 2D Mtot 100 0 800 −1 Nhit 16 0 16 0#Display: 2D CB_NaI_TimeOR 100 0 200 −1 TAPS_BaF2_TimeOR 100 0 200 −1## Any wild−card stuff here#Misc: Not yet implemented#Display: 2D CB_NaI_EnergyOR 100 0 200 −1 TAPS_BaF2_EnergyOR 100 0 200 −1Display: 2D CB_NphotMinv 100 0 800 1 Mmiss 100 0 2000 0Display: 2D CB_NphotMinv 100 0 800 5 Mmiss 100 0 2000 0#Display: 2D DpnAngle 180 0 180 0 TAGG_Ladder_Hits 176 0 352 0#Display: 2D DpnAngle 180 −180 180 0 PhiDiff 180 0 360 0#Display: 2D DpnAngleCM 180 −180 180 0 PhiDiff 180 0 360 0#Display: 2D ThetaDiff 180 −180 180 0 PhiDiff 180 0 360 0#Display: 2D ThetaDiffCM 180 −180 180 0 PhiDiff 180 0 360 0#Display: 2D ThetaDiffCM 180 −180 180 0 DpnMmiss 100 000 1000 0#Display: 2D ThetaDiff 180 −180 180 0 DpnMmiss 100 000 1000 0#Display: 2D ThetaP 180 0 180 0 ThetaPCM 180 0 180 0#Display: 2D ThetaDiff 180 −180 180 0 ThetaDiffCM 180 −180 180 0Figure 16: Sample conguration le for a user, inherited physics class of TA2<strong>Physics</strong>Dec 14, 04 16:18 CBphysics.datPage 1/2Dec 14, 04 16:18 CBphysics.datPage 2/2Printed by ACQU data <strong>an</strong>alysisKeyword Parameters FunctionTarget: see Fig.16 Target x,y,z, atomic massesPermutations: int,int,int,int,int,int,int,int Wild-card integer inputTable 10: TA2<strong>Physics</strong> conguration comm<strong>an</strong>ds<strong>an</strong>alysis class which inherits from TA2<strong>Data</strong>M<strong>an</strong>ager. The variable's address may then be retrievedfor setting up histrograms or data cuts by supplying the name. The basic method isTA2<strong>Data</strong>M<strong>an</strong>ager::LoadVariable(const char* name, T* var, Int_t type);The templated variable T* var is pointer to (address o) <strong>an</strong> Int_t or Double_t <strong>an</strong>d Int_t typetells TA2<strong>Data</strong>M<strong>an</strong>ager what type of variable to expect. It may have 4 dierent values...1. EISingleX for a single value Int_t (4-byte integer)2. EIMultiX for a multiple value Int_t3. EDSingleX for a single value Double_t (8-byte oat)28


4. EDMultiX for a multiple value Double_tMultiple value variables are held in a buer <strong>an</strong>d it is the start address of the buer which issupplied. Usually the number of values held in the buer will ch<strong>an</strong>ge from one event to the next<strong>an</strong>d so the end of buer is marked with the special value EBuerEnd. <strong>AcquRoot</strong> histogram <strong>an</strong>dcut m<strong>an</strong>agers know to look for this delimiter if the supplied type is EIMultiX or EDMultiX. Atypical inst<strong>an</strong>ce of a EDMultiX is the Time-OR of the focal pl<strong>an</strong>e detectors of the A2 Tagger.Usually a set of LoadVariable statements are bundled together in a single method as in the followingextracted from TA2ClusterDetector.ccvoid TA2ClusterDetector::LoadVariable( ){ // Input name - variable pointer associations for <strong>an</strong>y subsequent// cut or histogram setup// LoadVariable( "name", pointer-to-variable, type-spec );// NB scaler variable pointers need the preceeding &// array variable pointers do not.// type-spec ED prefix for a Double_t variable// EI prefix for <strong>an</strong> Int_t variable// type-spec SingleX for a single-valued variable// MultiX for a multi-valued variableTA2<strong>Data</strong>M<strong>an</strong>ager::LoadVariable("ClNhits", &fNCluster, EISingleX);TA2<strong>Data</strong>M<strong>an</strong>ager::LoadVariable("ClTotHits", fClustHit, EIMultiX);TA2<strong>Data</strong>M<strong>an</strong>ager::LoadVariable("ClTheta", fTheta, EDMultiX);TA2<strong>Data</strong>M<strong>an</strong>ager::LoadVariable("ClPhi", fPhi, EDMultiX);TA2<strong>Data</strong>M<strong>an</strong>ager::LoadVariable("ClNhitsOR", fNClustHitOR, EIMultiX);TA2<strong>Data</strong>M<strong>an</strong>ager::LoadVariable("ClEnergyOR",fClEnergyOR, EDMultiX);TA2Detector::LoadVariable();}5.3.2 <strong>Data</strong> Cut SpecicationAt the present stage of development data ltering cuts may be applied to computed (i.e. producedin a decode or reconstruct procedure) variables only. The set up of cuts is performed bythe TA2<strong>Data</strong>M<strong>an</strong>ager::ParseCut( char* ) method (Sec.4.0.2) which is thus automatically part of<strong>an</strong>alysis, apparatus, detector <strong>an</strong>d physics classes.Inst<strong>an</strong>ces of cut specication may be found in the descriptions of conguration les in Sec.5.2, butthe syntax is covered here in detail.1. Cut-spec. lines are agged by the keyword <strong>Data</strong>-Cut:. Multiple <strong>Data</strong>-Cut: lines may bespecied in which case a chain of logical evaluations is carried out.2. After the keyword the line should contain at least 4 (often more) string parameters... dimension,cutX, link, scope.3. dimension = 1D cut in 1 dimension; = 2D cut in 2 dimension.4. cutX is the name of the variable to be tested (the X variable if working in 2D)...see Sec.5.3.15. link species how multiple conditions are joined logically. With two Boole<strong>an</strong> variables toevaluate a chain of cut-results: A (always initialised to 1 = TRUE before starting evaluation)which is the st<strong>an</strong>ding value of the chain, <strong>an</strong>d B which is the value of the particular elementof the chain. The 4 allowed values of link <strong>an</strong>d their counterpart Boole<strong>an</strong> operations are asfollows...(a) AND A = A.B(b) OR A = A + B29


(c) NAND A = A.B(d) NOR A = A + B(e) If <strong>an</strong> AND operation gives 0 (=FALSE) then evaluation of the logical chain is stopped<strong>an</strong>d 0 is returned as the combined Boole<strong>an</strong> value. If <strong>an</strong> OR operation gives 1 then chainevaluation stops <strong>an</strong>d 1 is returned.6. scope may have 7 dierent values(a) histogram the cut applies to a histogram only <strong>an</strong>d has to be specied in the histogramsetup comm<strong>an</strong>d line (Sec.5.4)(b) data the cut applies to the entire data stream. If the test of a particular cut returnsFALSE, then no further <strong>an</strong>alysis of the event takes place. Note that cut evaluation takesplace just before histogramming <strong>an</strong>d after the variables of a particular <strong>an</strong>alysis classhave been determined, e.g. in TA2Detector::Decode() or TA2Apparatus::Reconstruct().Thus a cut at apparatus level will have no eect on detector histograms, while a detectorcut will aect apparatus histograms.(c) misc the cut is added to the wild-card list, to be employed at the discretion of theuser. By default misc cuts do nothing, but for example they may be used to identifyparticles. The TA2Apparatus::SortParticleIDCuts() method sorts the cuts containedin the fMiscCuts list for use in Reconstruct() procedures. However to do this correctlythe cut options must be set correctly.(d) compound-hist start a compound-logic cut for histogram(s) only. Here the name givenin cutX above should be some unique string which has not already been used as avariable name (Sec. 5.3.1).(e) compound-data is similar to compound-hist except it acts on the entire data stream.(f) compound-misc is the misc equivalent of compound-data(g) element species a logical building block of a compound-hist, compound-data orcompound-misc which must have been started before the element is introduced. Elementswill be added to the compound cut until a <strong>Data</strong>-Cut: line with scope ≠elementis encountered. Within a compound cut evaluation of the internal logical chain proceedsas in item 5 above.1D cut additional parametersWhere scope = histogram, data, misc or element a further 2 Double_t numbers low,high <strong>an</strong>d one optional Int_t ind must be supplied on the <strong>Data</strong>-Cut: input line. The st<strong>an</strong>dard 1Dwindow cut applied to a variable with value v returns TRUE if low ≤ v ≤ high. Parameter indis supplied if the variable is a member of a xed length array (N.B. NOT a multi-value variabledescribed in Sec.5.3.1). For example the line in a TA2Detector conguration<strong>Data</strong>-Cut:1D Energy AND data 20 200 238 (opt)Would specify that the Energy of element 238 of the detector array must be <strong>within</strong> the r<strong>an</strong>ge20-200 MeV to pass the cut test.Optionally up to 8 numbers may be appended at the end of the line. These are wild-card parameterswhich are stored in the cut's private (read-only) data. They have no bearing on the operationof the cut returning TRUE/FALSE but in the case of misc cuts c<strong>an</strong> be used to determine howthe cut is used2D cut additional parameters<strong>Data</strong>-Cut: 2D Echarged AND misc DeltaE p0 PIDdE.07.04.05.root 0 0 0 2212Where scope = histogram, data, misc or element (misc in the case above) a further 3 parametersare m<strong>an</strong>datory, followed by options30


1. DeltaE is the name of the Y-variable.2. p0 is the name of the 2D polygon which species the cut limits.3. PIDdE.07.04.05.root is the name of the root le which contains the polygon in the formof the TCutG ROOT class. M<strong>an</strong>y polygons may be held in a single ROOT le.4. 0 0 are optional indices for non scaler variables (ix followed by iy). In the case above bothEcharged (X) <strong>an</strong>d DeltaE (Y) variables are arrays so the 0 0 species the 0th element ofeach.5. 0 2212 are 2 (of up-to-eight) optional parameters which are appended to the line <strong>an</strong>d whichare stored in the cut's private, read-only data b<strong>an</strong>k. Normally these would only be used formisc cuts. In the present case the 0 refers to sector 0 of the detector system (ix, iy = 0 inthe previous item also refer to the same sector but this is not always the case). 2212 is thePDG code for a proton. Thus if this misc cut is used for particle ID, a cut return of TRUEsays that the particle is a proton.5.4 Display SpecicationInst<strong>an</strong>ces of display specication may be found in the conguration le descriptions of Sec.5.2. Acommon setup procedure is provided in TA2HistM<strong>an</strong>ager::ParseDisplay() which recognises setuplines beginning with the keyword Display:.5.4.1 Histograms set up by TA2HistM<strong>an</strong>ager::ParseDisplayThis method is used by Detector, Apparatus <strong>an</strong>d <strong>Physics</strong> classes. A setup comm<strong>an</strong>d for a 1D plotwould typically look likeDisplay: 1D Energy 1000 10. 800. 0 299 Cut1D WeightWhere the parameters are explained as follows:1D histograms1. 1D species a one-dimensional histogram. 2D is also possible.2. Energy is the name (see Sec.5.3.1) of the variable to histogram3. 1000 10. 800. specify a 1000-ch<strong>an</strong>nel histogram covering the r<strong>an</strong>ge of values 10.0 to 800.04. 0 299 apply in the case where Energy is a xed-length array of values, e.g. the Energies ofeach element of a composite detector. These Int_t values specify the r<strong>an</strong>ge of indices forwhich a histogram should be created, in this case creating 300 histograms to cover Energy[0]- Emergy[299]. If Energy is a single-valued these indices may be omitted or -1 -1 entered.5. Cut1D is <strong>an</strong> optional parameter which species the name of a cut which should be applied tothis histogram only. Omit if no cut is desired. The cut of scope histogram or compound-hist(Sec. 5.3.2) should have been initialised previously.6. Weight is <strong>an</strong> optional parameter, the name of a variable (see Sec.5.3.1) which species <strong>an</strong>on-unity increment value for the histogram. If its not given, normal unity increments areimplemented. The weight variable c<strong>an</strong> be <strong>an</strong>y Double_t class variable (as with Energyabove), <strong>an</strong>d it is the users responsibility to set this variable at each event.31


The names of the histograms resulting from this line would be:ClassName_Energy0.Cut1D.Weight ...ClassName_Energy299.Cut1D.WeightClassName is the name of the <strong>an</strong>alysis class which owns the histogram. For a scaler variable(item 4) the indices are omitted. Cut <strong>an</strong>d Weight names are appended only if the cut or weight isspecied <strong>an</strong>d exists.2D histogramsTwo dimensional histograms would typically be set up using a comm<strong>an</strong>d line likeDisplay: 2D Etot 100 10. 800. -1 Time 100 0. 200. 55 Cut2D Weightwith the parameters explained as follows1. 2D to distinguish from a 1D plot.2. Etot the name of the X variable.3. 100 10. 800. The X-axis has 100 bins <strong>an</strong>d values r<strong>an</strong>ging from 10. to 80.4. -1 This value says that Etot is a scaler variable. In the case that Etot is <strong>an</strong> array, <strong>an</strong> integer≥ 0 species the array index. Multiple indices are not allowed5. Time is the name of the Y-variable6. 100 0. 200. The Y-axis has 100 bins <strong>an</strong>d values r<strong>an</strong>ging from 0.0 to 200.7. 55 Time is <strong>an</strong> array so plot Time[55] here.8. Cut2D is <strong>an</strong> optional name of a cut to be applied to this histogram only.9. Weight is <strong>an</strong> optional name of a parameter to specify increment weightThe name of the histogram resulting from this line would be:CLassName_Time55_v_Etot.Cut2D.WeightClassName is the name of the <strong>an</strong>alysis class which owns the histogram. For scaler variables(items 4,7) the indices are omitted. Cut <strong>an</strong>d Weight names are appended only if the cut or weightis specied <strong>an</strong>d exists.3D histogramsThree dimensional histograms would typically be set up using a comm<strong>an</strong>d line likeDisplay: 3D Etot 100 10. 800. -1 Time 100 0. 200. 55 Efrac 20 0.0 1.0 22 Cut3DWeightwith the parameters explained as follows1. 3D to distinguish from a 1D plot.2. Etot the name of the X variable.3. 100 10. 800. The X-axis has 100 bins <strong>an</strong>d values r<strong>an</strong>ging from 10. to 80.4. -1 This value says that Etot is a scaler variable. In the case that Etot is <strong>an</strong> array, <strong>an</strong> integer≥ 0 species the array index. Multiple indices are not allowed for 3D32


5. Time is the name of the Y-variable6. 100 0. 200. The Y-axis has 100 bins <strong>an</strong>d values r<strong>an</strong>ging from 0.0 to 200.7. 55 Time is <strong>an</strong> array so plot Time[55] here.8. Efrac is the name of the Z-variable9. 20 0.0 1.0 The Z-axis has 20 bins <strong>an</strong>d values r<strong>an</strong>ging from 0.0 to 1.010. 22 Efrac is <strong>an</strong> array so plot Efrac[22].11. Cut3D is <strong>an</strong> optional name of a cut to be applied to this histogram only.12. Weight is <strong>an</strong> optional name of a parameter to specify increment weightThe name of the histogram resulting from this line would be:CLassName_Efrac22_v_Time55_v_Etot.Cut3D.WeightClassName is the name of the <strong>an</strong>alysis class which owns the histogram. For a scaler variables(items 4,7,10) the indices are omitted. Cut <strong>an</strong>d Weight names are appended only if the cut orweight is specied <strong>an</strong>d exists.5.4.2 Special histogram setup in TA2<strong>Analysis</strong>TA2<strong>Analysis</strong> has a private ParseDisplay() method as some of the display related to ADC or scaleroutput is slightly non-st<strong>an</strong>dard although the keyword is still Display:. After the keyword comes aplot delimiter <strong>an</strong>d associated parameters which are explained (<strong>an</strong>d exemplied) as follows.• All Display all single value ADCsDisplay: All• ADC Display a r<strong>an</strong>ge (ADC100 - ADC131) of single value ADCsDisplay: ADC 100 131• 2D Plot 1 ADC value against <strong>an</strong>otherDisplay: 2D 20401 200 0 4000 2001M0 200 -600 -400Plot ADC20401 X-axis 200 bins r<strong>an</strong>ge 0 4000 against multihit ADC2001 (0th hit) Y-axis200 bins r<strong>an</strong>ge -600 to -400• Scaler Display last-read-buer values of scalers 0 - 11Display: Scaler 0 11• SumScaler Display accumulated values of scalers 0 - 11Display: SumScaler 0 11• Rate Display Rate 0 in multiscaler mode (equivalent to time dependence). Allocate 2500bins to plot. Assumes a TA2RateMonitor has been set up previously.Display: Rate 0 2500• Pattern Display hit pattern 0. Allocate 16 bins covering the r<strong>an</strong>ge 0 - 16. Assumes aTA2BitPattern has been set up previously.Display: Pattern 0 16 0 16• ADChits Display number of hits in each single value ADC. Here hit from the 1st 4096 ADCsare plottedDisplay ADChits 4096 0 409633


• FlashShape Display the waveform given by sampling ADC 55.obtained automatically from the sampling ADC software h<strong>an</strong>dlerDisplay FlashShape 55Binning <strong>an</strong>d r<strong>an</strong>ge are• MultiHit Display a r<strong>an</strong>ge of multihit ADCsDisplay: MultiHit 3000 3720 1000 0000 4000 1Display Make 1D histograms for multihit ADCs 3000 - 3720. Each plot has 1000 bins coveringthe r<strong>an</strong>ge 0 - 4000. The nal 1 species that the 1st (starts with 0th) hit of the multi-blockis plotted.6 Specimen <strong>Analysis</strong> ClassesSome very simple examples of <strong>an</strong>alysis classes are provided with the AR core distribution. However<strong>an</strong>y serious data <strong>an</strong>alysis requires some esh on top of the bare bones. The $acqu_sys/Usersubdirectory contains 2 tar archives1. UserAcqu.tar.gz: a set of <strong>an</strong>alysis classes which will perform <strong>an</strong>alysis to physics level ofMainz Tagger/CB/TAPS data2. User<strong>Data</strong>.tar.gz: a set of conguration les to setup various types of <strong>an</strong>alysis.These are intended as a guide to enable the user to build his/her personal <strong>an</strong>alysis.6.1 Detector ClassesThe system provides <strong>an</strong> abstract base detector class TA2Detector, from which all detectors arebuilt.6.2 Apparatus ClassesThe system provides <strong>an</strong> abstract base apparatus class TA2Apparatus, from which all apparati arebuilt.6.2.1 TA2CrystalBall6.2.2 TA2KensTagger6.3 <strong>Physics</strong> ClassesThe system provides <strong>an</strong> abstract base physics class TA2<strong>Physics</strong>, from which all physics <strong>an</strong>alysesare built, <strong>an</strong>d which is itself derived from TA2Apparatus. Thus TA2<strong>Physics</strong> may be regarded asa super apparatus which assembles all apparatus information to give <strong>an</strong> overall view of a reactionprocess.6.3.1 TA2Photo<strong>Physics</strong>34


7 Obsolete Comp<strong>an</strong>ion SoftwareThe original ACQU was coded before multi-thread functionality became st<strong>an</strong>dard on UNIX-likeoperating systems <strong>an</strong>d so multi-tasking components of ACQU were separate programs which communicatedvia System-V semaphores <strong>an</strong>d shared memories. The use of these separate tasks wasphased out in the evolution of <strong>AcquRoot</strong> v3 <strong>an</strong>d is entirely absent from v4. Indeed all remn<strong>an</strong>tsof the original ACQU have been removed from v4 <strong>an</strong>d coding is now entirely in C++ <strong>within</strong> theframework of ROOT.35


8 AcquMC a Monte Carlo reaction-kinematics generatorAs part of the ongoing eort to convert the computer models of A2 detector systems fromHBOOK/GEANT-3 to ROOT/GEANT-4 st<strong>an</strong>dard, a C++, ROOT-compatible kinematics generatorAcquMC has been written. This program normally runs st<strong>an</strong>d alone, but the classes whichit uses are ROOT/CINT compatible <strong>an</strong>d may be used in <strong>an</strong>y ROOT session if the appropriatelibraries are loaded.AcquMC inputs information from a conguration le, by default MCsetup.dat, which resides inthe same directory as the <strong>AcquRoot</strong> conguration les. Other conguration les may be speciedon the comm<strong>an</strong>d line along with switches which control the loading of base classes, e.g.:AcquMC GP_PPi0_SAID.datWhich species the use of conguration le GP_PPi0_SAID.dat. The format of the congurationles is very similar to <strong>AcquRoot</strong> les, as input is h<strong>an</strong>dled by the SetCong() method of TA2System(Sec.3.2), from which the main generator classes are decended.A schematic diagram of the software structure of AcquMC is given in Fig.17. The main task ofevent generation is performed by TMCGenerator (or its decendent TMCFoamGenerator), whileparticle properties are h<strong>an</strong>dled by TMCParticle <strong>an</strong>d its decendents. R<strong>an</strong>dom sampling is performedwith the ROOT class TR<strong>an</strong>dom (<strong>an</strong>d its vari<strong>an</strong>ts) with non-uniform sampling distributionsh<strong>an</strong>dled via ROOT histogram class TH1D. This is the double-precision version of 1D histogramclass TH1 as all calculations are performed in double precision. Multi-dimensional r<strong>an</strong>dom samplingis performed via the ROOT class TFoam, implemented in TMCFoamGenerator which inheritsfrom TMCGenerator.AcquMC C++ Event GenerationJ.R.M. Ann<strong>an</strong>d5th July 2007Kinematics Generator GP4(TMCParticle* Reaction)ReturnReturnNoTMCParticleXYesdecayproducts?YesGenerateDecaysDecay particles’decay listsLastin list?NoOptionTMCFoamParticleTMCParticle::GenDecay()2−bodyPhase Spaceor "<strong>Physics</strong>">2particles?N4−momentaCMBoostCM −> LABN−bodyPhase Spaceor "<strong>Physics</strong>"Configure AcquMCTA2System::FileConfigStart Event LoopGEvent()OptionalCall N−Dim TFoamSave sampled vectorBeam 4−MomentumBeam + Target= Reaction ParticleOptionalTMCFoamIntInitialise TFoamDensity() fn.Next EventParameter(text) FileConfigurationParameter(text) File<strong>Physics</strong> ModelTabulate on N−D GridN−Dim Interpolateto calculate TFoamvolume elementsRecursiveGP4Errors?ROOT TreeAcquMC FormatStore EventEither/ORROOT ntuplemkin−equivalentFigure 17: Flow chart of AcquMC36


8.1 TMCGenerator event generationAcquMC has a skeletal main program <strong>an</strong>d the main work horse is the class TMCGenerator which isa direct decendent of TA2System. TMCGenerator contains the main event loop which calculatesbeam energy, direction <strong>an</strong>d point of interaction in <strong>an</strong> extended target. The beam <strong>an</strong>d target4-momenta are added <strong>an</strong>d the result<strong>an</strong>t entity is treated as a particle using the TMCParticleclass (Sec.8.2). Thus the reaction is h<strong>an</strong>dled as a decay of the reaction particle <strong>an</strong>d details ofthe reaction dynamics are stored <strong>within</strong> the associated class. The reaction nal-state productsare also h<strong>an</strong>dled by TMCParticle <strong>an</strong>d decay of <strong>an</strong>y unstable product is h<strong>an</strong>dled in a similar way.Multi-step decays are h<strong>an</strong>dled recursively <strong>an</strong>d in principle there is no limit to the number of steps.The recursive chain terminates when a daughter particle reports back that it is stable.Usually the AcquMC main program runs the TMCFoamGenerator class (8.1.1) which c<strong>an</strong> functionexactly as its parent TMCGenerator, but also has the capability of multidimensional r<strong>an</strong>domsampling via the ROOT class TFoam.The inherit<strong>an</strong>ce scheme of the generator classes is given in Fig.18.8.1.1 TMCFoamGeneratorThis vari<strong>an</strong>t of TMCGenerator uses the ROOT class TFoam to sample <strong>an</strong> N-dimensional vectorfrom a foam of volume elements (bubbles) in the hyperspace. This foam is generated from<strong>an</strong> abritrary relationship, which for example could be a 5-fold dierential cross section whichdetermines completely a 3-body nal state in terms of a set of energies <strong>an</strong>d <strong>an</strong>gles. Where thisrelationship c<strong>an</strong> not be specied by simple relations, it is tabulated on a grid of values <strong>an</strong>dinterpolated at intermediate values. This is h<strong>an</strong>dled by the class TMCFoamInt (8.1.2) <strong>an</strong>d itsdecendents.8.1.2 TMCFoamIntThis class is a decendent of the ROOT class TFoamIntegr<strong>an</strong>d, which constructs the foam ofN-dimensional volume elements. TMCFoamInt has procedures to perform the following:• Read<strong>Data</strong>( Char_t* le )Read in data points from a le, tabulated on <strong>an</strong> N-dimensional grid, which species thekinematic relationships which TFoam has to reproduce.• LinInterpN( Double_t* x, Bool_t comp )Perform multi-linear interpolation on the grid of values (as read in above) to provide thevalue at the point x = (x 0 , x 1, . . . x n ). The switch-variable comp, if set to TRUE (defaultis FALSE), causes the interpolator to apply error compensation, equivalent to quadraticinterpolation.• Density( Int_t nDim, Double_t* x )This is the procedure used by TFoamIntegr<strong>an</strong>d to construct the foam of volume elements.TFoamIntegr<strong>an</strong>d supplies a vector x, sampled r<strong>an</strong>domly in N-D space, where each elementis sampled on the interval {0,1}. The element values are scaled to the interval of physicalinterest, e.g. for polar <strong>an</strong>gle one might scale x i = {0, 1} → {0, π}. The return is the valueof the N-dimensional relation, as for example calculated using the interpolator describedabove. Weighting factors calculated using a particular x i value may optionally be appliedto the return value. If x i is a polar <strong>an</strong>gle then the weighting factor sin(x i ) c<strong>an</strong> be applied toaccount for phase space.So far two specialist decendents of TMCFoamInt have been coded:37


fNamefTitlefgIsATNamed@~TNamedTNamedTNamedTNamedTNamedoperator=ClearCloneCompareCopyFillBufferGetNameGetTitleHashIsSortableSetNameSetNameTitleSetTitlelsPrintSizeofClassClass_NameIsAShowMembersTA2SystemfCmdList[5]fInputFilefLogFilefLogStreamfIsInitfIsErrorfIsConfigPassfgIsA@~TA2SystemBaseInitPrintErrorPrintMessageMap2KeyMap2KeyMap2StringGetMapKeyGetMapStringAddCmdListFileConfigComm<strong>an</strong>dConfigParseMiscSetConfigPostInitBuildNameCheckNameGetInputFileGetLogFileGetLogStreamSetLogStreamSetLogFileIsInitIsErrorClassClass_NameIsAShowMembersfR<strong>an</strong>dfSeedfNrunfPDGfTargetMassTMCGeneratorfTargetQFRecoilMassfTargetRadiusfTargetLengthfTargetCentrefVertexfBeamCentrefP4TargetfP4TargetQFfP4BeamfP4RfBeamfTargetQF@~TMCGeneratorTMCGeneratorFlushParseBeamParseTargetParseTargetQFParseParticleInitParticleDistPostInitInitTreeSaveEventCloseEventSetConfigGenerateGEventGP4InitNtupleSaveNtupleCloseNtupleGetR<strong>an</strong>dGetSeedGetPDGGetTargetMassGetTargetRadiusGetTargetLengthGetTargetCentreGetVertexfReactionfNThrowfNParticlefReson<strong>an</strong>cefReactionListfParticlefTreeFileNamefTreeFilefTreefNtuplefBr<strong>an</strong>chfEventfIsTreeOutfIsNtupleOutfIsErrorfgIsAGetBeamCentreGetP4TargetGetP4BeamGetP4RGetBeamGetReactionGetNthrowGetNParticleGetReson<strong>an</strong>ceGetReactionListGetParticleGetTreeFileNameGetTreeFileGetTreeGetBr<strong>an</strong>chGetEventIsTreeOutIsNtupleOutIsErrorGetParticleClassClass_NameIsAShowMembersStreamerTMCFoamGeneratorfFoamListfFoamXfIntfXfXscalefScalefFoamInitOptfNDimfN<strong>Data</strong>BasefFnOptfFoamModelfgIsA@~TMCFoamGeneratorTMCFoamGeneratorFlushPostInitSetConfigRead<strong>Data</strong>baseGEventGetFoamListGetFoamInitOptGetXGetXscaleGetScaleGetNDimGetN<strong>Data</strong>BaseGetFnOptClassClass_NameIsAShowMembersStreamerFigure 18: Inherit<strong>an</strong>ce scheme of TMCGenerator, <strong>an</strong>d TMCFoamGenerator.TMCPhotoPSInt This has a specialised Read<strong>Data</strong> procedure to input SAID generated observablesfor pseudo-scalar meson photoproduction. For each incident energy <strong>an</strong>d meson production<strong>an</strong>gle, 16 observables (cross section + the various single <strong>an</strong>d double polarisation qu<strong>an</strong>tities) areinput. The data base is split into 16, one section for each of the observables. The Density procedureoperates in 3-D with vector elements x 0 ≡ E γ , x 1 ≡ θ π , x 2 ≡ φ π , but the observables areevaluated by 2-D interpolation in energy <strong>an</strong>d polar <strong>an</strong>gle. Following that the asymuthal dependenceis calculated explicitly using the observables <strong>an</strong>d the polarisation states of beam, target <strong>an</strong>drecoil particle. Input of polarisation vectors is described in 8.3.38


TMCdS5MDMInt This is a specialist integr<strong>an</strong>d class, designed to h<strong>an</strong>dle radiative, pseudoscalarmeson photoproduction. This has been measured to access magnetic dipole moments ofnucleon reson<strong>an</strong>ces. It has a modied Read<strong>Data</strong> procedure which allows input of more th<strong>an</strong> oneobservable on the 5-D grid of dσ/dE γ ′dΩ γ ′dΩ π , where γ ′ is the radiated photon <strong>an</strong>d π is thepseudo-scaler meson. If the overall dimension of TFoam is set to 6, then a block of dierentialcross section values, followed by a block of Σ asymmetry values, is expected as input. If thedimension is set to 5 then only dierential cross section is read in.5-D interpolation is performed to evaluate cross section (<strong>an</strong>d Σ) for a given r<strong>an</strong>domly sampledvector x, x 0 ≡ E γ x 1 ≡ E γ ′ x 2 ≡ θ γ ′ x 3 ≡ φ π x 4 ≡ θ π . If Σ is generated then x 5 ≡ φ π <strong>an</strong>dthe Density procedure weights the cross section according to [1 − cos(2φ π )]. The weighted crosssection is then returned as the value of Density. Energy <strong>an</strong>d phase-space weighting factors mayalso be applied as described in 8.1.2.Note that although TMCdS5MDMInt was designed for radiative meson photoproduction it c<strong>an</strong> inprinciple be applied to <strong>an</strong>y reaction producing a 3-body nal state.8.2 TMCParticleTObjectTNamedTMCParticleTMCFoamParticleTObjectTNamedTMCParticleTMCReson<strong>an</strong>cefUniqueID kIsReferenced kZombiefNamefBitskHasUUID kBitMaskfTitlefgDtorOnly kC<strong>an</strong>notPick kSingleKey fgIsAfgObjectStat kNoContextMenu kOverwritekC<strong>an</strong>Delete kInvalidObject kWriteDelete@~TNamedkMustCle<strong>an</strong>up kIsOnHeap fgIsATNamedkObjInC<strong>an</strong>vas kNotDeletedTNamed@~TObject GetObjectInfo operator new@[@] TNamedMakeZombie GetTitle operator delete TNamedDoError H<strong>an</strong>dleTimer operator delete@[@] operator=TObject Hashoperator delete ClearTObject InheritsFrom operator delete@[@] Cloneoperator= InheritsFrom SetBitCompareAppendPad Inspect SetBitCopyBrowse IsFolder ResetBitFillBufferClassName IsEqual TestBitGetNameClearIsSortable TestBitsGetTitleCloneIsOnHeap InvertBitHashCompare IsZombie InfoIsSortableCopyNotifyWarningSetNameDeletelsErrorSetNameTitleDist<strong>an</strong>cetoPrimitive PaintSysErrorSetTitleDrawPopFatallsDrawClass PrintAbstractMethod PrintDrawClone ReadMayNotUse SizeofDumpRecursiveRemoveGetDtorOnlyClassExecute SaveAs SetDtorOnly Class_NameExecute SavePrimitive GetObjectStat IsAExecuteEvent SetDrawOption SetObjectStat ShowMembersFindObject SetUniqueID ClassFindObject UseCurrentStyle Class_NameGetDrawOption WriteIsAGetUniqueID WriteShowMembersGetName operator newfR<strong>an</strong>dom fPhiDist fTcmfPDGfPhiLow fWtfParent fPhiHigh fWtMaxfP4fTDistfPDGindexfP4dfTLowfNdfP4Beam fTHighfDecayModefDecayList fPDistfIsDecayfThetaDist fPLowfIsTrackfThetaLow fPHighfIsReson<strong>an</strong>cefThetaHigh fMassfgIsAfCosThDist fMassQFfCosThLow fMdfCosThHigh fMd2@~TMCParticle GetP4d GetTcmPdkGetP4d GetWtTMCParticle GetP4Beam GetWtMaxTMCParticle GetDecayList GetPDGindexTMCParticle GetThetaDist GetNdFlushGetThetaLow GetDecayModeInitGetThetaHigh SetDecayModePostInit GetCosThDist IsDecayGenDecay GetCosThLow IsTrackGen2Decay GetCosThHigh IsReson<strong>an</strong>ceGenNDecay GetPhiDist SetDecayBoostLab GetPhiLow SetTrackFindDist GetPhiHigh GetDecaySetDist GetTDist ThetaSetDist GetTLow CosThetaSetDist GetTHigh PhiAddDecay GetPDist EnergyReplaceDecay GetPLow MomentumGenMCDist GetPHigh P4GetR<strong>an</strong>dom GetMass ClassGetPDG GetMassQF Class_NamefXscalefScalefIThetafICosThetafIPhifIEnergyfIMomentumfgIsA@~TMCFoamParticleTMCFoamParticleTMCFoamParticleFlushInitGetXscaleGetScaleGetIThetaGetICosThetaGetIPhiGetIEnergyGetIMomentumSetFoamLinkThetaCosThetaPhiEnergyMomentumDistClassClass_NameIsAShowMembersStreamerStreamerNVirtualfUniqueID kIsReferenced kZombiefNamefBitskHasUUID kBitMaskfTitlefgDtorOnly kC<strong>an</strong>notPick kSingleKey fgIsAfgObjectStat kNoContextMenu kOverwritekC<strong>an</strong>Delete kInvalidObject kWriteDelete@~TNamedkMustCle<strong>an</strong>up kIsOnHeap fgIsATNamedkObjInC<strong>an</strong>vas kNotDeletedTNamed@~TObject GetObjectInfo operator new@[@] TNamedMakeZombie GetTitle operator delete TNamedDoError H<strong>an</strong>dleTimer operator delete@[@] operator=TObject Hashoperator delete ClearTObject InheritsFrom operator delete@[@] Cloneoperator= InheritsFrom SetBitCompareAppendPad Inspect SetBitCopyBrowse IsFolder ResetBitFillBufferClassName IsEqual TestBitGetNameClearIsSortable TestBitsGetTitleCloneIsOnHeap InvertBitHashCompare IsZombie InfoIsSortableCopyNotifyWarningSetNameDeletelsErrorSetNameTitleDist<strong>an</strong>cetoPrimitive PaintSysErrorSetTitleDrawPopFatallsDrawClass PrintAbstractMethod PrintDrawClone ReadMayNotUse SizeofDumpRecursiveRemoveGetDtorOnlyClassExecute SaveAs SetDtorOnly Class_NameExecute SavePrimitive GetObjectStat IsAExecuteEvent SetDrawOption SetObjectStat ShowMembersFindObject SetUniqueID ClassFindObject UseCurrentStyle Class_NameGetDrawOption WriteIsAGetUniqueID WriteShowMembersGetName operator newfR<strong>an</strong>dom fPhiDist fTcmfPDGfPhiLow fWtfParent fPhiHigh fWtMaxfP4fTDistfPDGindexfP4dfTLowfNdfP4Beam fTHighfDecayModefDecayList fPDistfIsDecayfThetaDist fPLowfIsTrackfThetaLow fPHighfIsReson<strong>an</strong>cefThetaHigh fMassfgIsAfCosThDist fMassQFfCosThLow fMdfCosThHigh fMd2@~TMCParticle GetP4d GetTcmPdkGetP4d GetWtTMCParticle GetP4Beam GetWtMaxTMCParticle GetDecayList GetPDGindexTMCParticle GetThetaDist GetNdFlushGetThetaLow GetDecayModeInitGetThetaHigh SetDecayModePostInit GetCosThDist IsDecayGenDecay GetCosThLow IsTrackGen2Decay GetCosThHigh IsReson<strong>an</strong>ceGenNDecay GetPhiDist SetDecayBoostLab GetPhiLow SetTrackFindDist GetPhiHigh GetDecaySetDist GetTDist ThetaSetDist GetTLow CosThetaSetDist GetTHigh PhiAddDecay GetPDist EnergyReplaceDecay GetPLow MomentumGenMCDist GetPHigh P4GetR<strong>an</strong>dom GetMass ClassGetPDG GetMassQF Class_NamefGammafMassDistfMLowfMHighfgIsA@~TMCReson<strong>an</strong>ceTMCReson<strong>an</strong>ceTMCReson<strong>an</strong>ceTMCReson<strong>an</strong>ceFindDistMassGetGammaGetMassDistGetMLowGetMHighClassClass_NameIsAShowMembersStreamerStreamerNVirtualGetIconNameoperator new@[@]SetParentSetQFIsAGetIconNameoperator new@[@]SetParentSetQFIsAGetOptionoperator newGetParentMassShowMembersGetOptionoperator newGetParentMassShowMembersGetP4SetMassStreamerGetP4SetMassStreamerSetP4GetMdStreamerNVirtualSetP4GetMdStreamerNVirtualSetP4GetMd2SetP4GetMd2Figure 19: Inherit<strong>an</strong>ce schemes of TMCParticle classesParticles are characterised <strong>within</strong> AcquMC by the TMCParticle class, which is a direct decendent ofTNamed <strong>an</strong>d thus does not have <strong>an</strong>y of the I/O functionality of TMCGenerator classes. Inherit<strong>an</strong>ceschemes for TMCParticle <strong>an</strong>d its decendents TMCReson<strong>an</strong>ce <strong>an</strong>d TMCFoamParticle are given inFig.19. The main features of this class are described as follows:• Basic static properties of the particle may be obtained via the Particle <strong>Data</strong> Group (PDG)data base which may be passed, along with a particle descriptor index, when the class isconstructed. For example mass would be obtained through the instructionfMass = fPDG->GetParticle(ipdg)->Mass() ;If the employed root distribution has no PDG database then particle mass (the minimumnecessary information) c<strong>an</strong> be specied at construct time.39


• Details of the kinematics of the decay are implemented in the procedures Gen2Decay() <strong>an</strong>dGenNDecay(). In the case that the particle is a reaction particle the decay is just thereaction process. The daughter particles participating in the decay process return kinematicqu<strong>an</strong>tities via the following functions:1. Double_t Theta() the polar <strong>an</strong>gle2. Double_t CosTheta() cosine of the polar <strong>an</strong>gle3. Double_t Phi() the asimuthal <strong>an</strong>gle4. Double_t Energy() the kinetic energy of the particle5. Double_t Momentum() the momentum of the particle.6. TLorentzVector P4() samples the complete 4-momentum using the CosTheta(), Phi()<strong>an</strong>d Momentum() functions above.By default these functions use uniform r<strong>an</strong>dom distributions over a previously-input r<strong>an</strong>ge ofvalues. However a non-uniform distribution may be specied for <strong>an</strong>y particle via the P-Distr:directive which is described in Sec.8.3. Alternatively the kinematic qu<strong>an</strong>tity may be linked(8.3) to <strong>an</strong> element of the output vector from TFoam.• The 2-body decay algorithm c<strong>an</strong> use either phase-space (the default) or non-uniform distribution(s)for <strong>an</strong>y of the 5 possible kinematic variables. For the decay to 3 or more particlesphase space is assumed by default <strong>an</strong>d the entry of non-uniform distributions will produceerroneous results. If non-phase-space ≥ 3-body kinematics are desired, this must be encodedin the GenNDecay() procedure of a specialist particle class decended from TMCParticle ofTMCFoamParticle (see 8.2.3).• A linked list of pointers to TMCParticle classes characterises the decay products of a particularparticle. For each event the generator loop GP4() decends through the lists of decayproducts, calling their GenDecay() procedures until a stable particle is reached.• A pointer is provided to the class which characterises its parent particle if <strong>an</strong>y....the reactionparticle has no parent.8.2.1 TMCReson<strong>an</strong>ceThis class is a derivative of TMCParticle (Fig.19) <strong>an</strong>d diers in that the mass is not assumedconst<strong>an</strong>t, but is sampled from a Breit-Wigner type of distribution when using the Mass() function.The st<strong>an</strong>dard TMCParticle::Mass() returns the const<strong>an</strong>t fMass. The alternative functionGetMass() always returns the const<strong>an</strong>t fMass regardless of particle class.8.2.2 TMCFoamParticleThis derivative of TMCParticle provides additional options for choosing the kinematics of particles,in particular to allow correlated sampling of variables for a single or multiple particles. By defaultTMCFoamParticle will behave exactly as TMCParticle. However it may be linked to the n-dimensional vector which is sampled in the GEvent() procedure of TMCFoamGenerator. Then-dimensional hyperspace, which is sampled, is initialised prior to the start of the event loop inTMCFoamGenerator (Fig.17).Any (or none) of the 5 possible kinematic variables may be tied to <strong>an</strong>y element of the TFoamvector, e.g. if element x j (j = 0 − n − 1) corresponds to the energy of the particular particlethen the a call to the Energy() function returns x j . Linkage is specied by the Foam: directivedescribed in Sec.8.3.If no linkage to the TFoam vector is specied then Energy() <strong>an</strong>d other kinematic qu<strong>an</strong>tities arereturned exactly as for TMCParticle.40


8.2.3 TMCdS5MDMParticleThis version of TMCFoamParticle has a specialist GenNDecay procedure. This takes the 5(or 6) dimensional vector output from TFoam sampled from a 5-fold dierential cross sectiondσ/dE γ ′dΩ γ ′dΩ π . This species completely a three-particle nal state (8.1.2). Its assumed thatthe vector elements are0 : E beam , 1 : E 1 , 2 : θ 1 , 3 : φ 1 , 4 : θ 2 , 5 : φ 2E 2 <strong>an</strong>d E 3 , θ 3 , φ 3 are calculated from the above input. Supply of φ 2 is optional. If not supplied itis sampled r<strong>an</strong>domly in one dimension.8.3 Conguration le formatAs with AR classes, initialisation is performed by the FileCong() procedure which reads lines froma text le <strong>an</strong>d then calls SetCong() to parse the comm<strong>an</strong>ds enumerated below. The comm<strong>an</strong>dline in type-face as it would appear in the conguration le is followed by a short expl<strong>an</strong>ation.Note that there must be a space after the colon in the key-word (the 1st word on the line).1. Foam-Model: MDMEvent-generation model for TFoam multi-dimensional sampling.(Char_t* = MDM) is for radiative pseudo-scalar meson productionA SAID option is also available. It takes ouput from the eponymous partial-wave <strong>an</strong>alysisdatabase [4], e.g. for pion or eta photoproduction. If this directive is not supplied the defaultis to make no particular model assumption.2. Number-Throws: 200000 888888 10Number of events to run (Int_t =200000); r<strong>an</strong>dom generator seed (Int_t=888888); numberof runs (Int_t=10). Each run would be of 200000 events.3. Beam: 22 0.0 0.0 -500.0Beam particle PDG index (Int_t=22); origin x,y,z coordinates (Double_t = 0.0 0.0 -500.0)in cm. Alternatively the particle mass in GeV may be given instead of the PDG index, butthe number must be <strong>an</strong> explicit oat with a decimal point, e.g. photon = 0.0, proton =0.938.4. Target: 0.938 2.5 5.0 0.0 0.0 0.0Target particle/nucleus mass in GeV (Double_t=0.938); Target radius <strong>an</strong>d length in cm(Double_t=2.5 5.0); Target-centre x,y,z coordinates in cm (Double_t=0.0 0.0 0.0).5. QF-Target: 0.938 10.255The beam interacts with a quasi-free particle of mass in GeV (Double_t=0.938), whichis embedded <strong>within</strong> the target, which is 12 C. The mass of the recoiling system in GeV(Double_t=10.255) is here that of 11 B in its ground state. The QF-Target particle (name= TargetQF) accepts kinematic distribution input (see item 7).6. Particle: Pi0 111 1 0 Delta_1 NULLParticle name (Char_t*=Pi0); PDG index (Int_t=111); Decay to other particles switch 0/1= OFF/ON (Int_t=1 ON); Track particle switch (Int_t=0 OFF); Parent particle, if <strong>an</strong>y,name (Char_t*=Delta_1); Particle Option (Char_t*=NULL). The name of each particlemust be unique in a particular run. As with Beam: above, a oating-point mass may begiven instead of the PDG index. Unstable particles should have decay set to 1 if one expectsto detect the daughter products. Setting track to 1 causes the particles 4-momentum tobe saved in the output ROOT le. If the particle is a decay product then the name of theparent particle must be given, otherwise enter NULL. Options reect non-st<strong>an</strong>dard modes ofsampling kinematic variables which are described below, but usually NULL (st<strong>an</strong>dard mode)is used.41


7. Reson<strong>an</strong>ce: S11 1.535 0.15Species a short lived particle whose mass has a signic<strong>an</strong>t width. Name (Char_t*=S11);Reson<strong>an</strong>t peak mass in GeV (Double_t=1.535); Reson<strong>an</strong>ce width in GeV (Double_t=0.15).This comm<strong>an</strong>d merely enters reson<strong>an</strong>ce characteristics which may then be used in theParticle: specication (item 5), by substituting the reson<strong>an</strong>ce name for PDG index. If aparticle is also a reson<strong>an</strong>ce then its mass c<strong>an</strong> be sampled from a Breit-Wigner distribution.A few reson<strong>an</strong>ces, e.g. P33(1232), are included in the PDG tables in which case PDG index(Int_t=2214 for P33(1232)) may be substituted for the reson<strong>an</strong>t mass <strong>an</strong>d reson<strong>an</strong>t widthomitted.8. P-Distr: Beam Cos(Theta) TMath::Gaus(x,1.0,0.000001) 0.9999975 1.0 200Specify a non-uniform distribution for a kinematic variable of a particle of name (Char_t*= Beam);the variable name (Char_t*=Cos(Theta)); the distribution (Char_t*=TMath::Gaus(x,1.0,0.000001));the limits over which to sample this distribution (Double_t=0.9999975 1.0); the numberof bins in the TH1D used to perform the sampling (Int_t=200). If the desired distributiondoes not have a simple <strong>an</strong>alytical form then the limits <strong>an</strong>d TH1D parameters are omitted<strong>an</strong>d the distribution string is then the name of a le, by default in the $acqu/data directory,which contains a table of x, f(x) values (1 line for each pair) which dene the distribution.The x values should ascend monotonically. The present line says that the cosine of the polar<strong>an</strong>gle of the beam particle should follow a Gaussi<strong>an</strong> centered on 1.0 with a σ of 0.000001in the r<strong>an</strong>ge 0.9999975 to 1.0. Multiple P-Distr operations may be applied to a singleparticle, which may be <strong>an</strong>y of the dened particlesThe recognised variable names are:Theta-Dist [polar <strong>an</strong>gle], Cos(Theta) [cosine polar <strong>an</strong>gle], Phi-Dist [asimuthal <strong>an</strong>gle],T-Dist [kinetic energy], P-Dist [momentum].9. Tree-Output: /scratch/acqu/GP_PPi0C_200kT 2ROOT TTree output to le (Char_t*=/scratch/acqu/GP_PPi0C_200kT). The TTree has(Int_t=2) TBr<strong>an</strong>ch. Output format is given in Sec.8.4.10. Ntuple-Output: /scratch/acqu/GP_PPi0C_200kNROOT TNtuple (basic form of TTree) to le (Char_t*=/scratch/acqu/GP_PPi0C_200kN).Output format is given in Sec.8.4.The following comm<strong>an</strong>ds are supported by the TMCFoamGenerator class in addition to thoseenumerated above.1. Foam-Distribution: 5 0 data/MDM_dSig5b.datEnter a distribution for input into TFoam. The N-dimensional distribution has dimension(Int_t=5), interpolation option (Int_t=0) <strong>an</strong>d is read from le (Char_t*=data/MDM_dSig5b.dat).2. Foam-Option: 1000 200 8 1 2 25 1 1.1Parameters which control the initialisation of TFoam which are nCells (Int_t=1000); nSampl(Int_t=200); nBin (Int_t=8); OptRej (Int_t=1); OptDrive (Int_t=2); EvPerBin (Int_t=25);Chat (Int_t=1); MaxWtRej (Double_t=1.1). The parameters above represent the defaultwhich is applied if no explicit Foam-Option: comm<strong>an</strong>d is supplied. See the ROOT referencesection on TFoam for the me<strong>an</strong>ing of these variables. In general the default will work quitewell.3. Foam: Gamma_0 2 -1 3 1 -1Couple the kinematic variables of TMCParticle name (Char_t*=Gamma_0) to the TFoamgenerated N-dimensional vector. Five integers are input (Int_t=2 -1 3 1 -1), whichcorrespond to the 5 cases of kinematic variable recognised by TMCParticle1st:Theta-Dist, 2nd:Cos(Theta), 3rd:Phi-Dist, 4th:T-Dist, 5th:P-Dist. Each integerrepresents the corresponding element of the TFoam generated vector. A value of -1 species42


that there is no corresponding TFoam vector element <strong>an</strong>d st<strong>an</strong>dard TMCParticle samplingshould be used (either uniform or weighted). The present line species the polar <strong>an</strong>gleis TFoam element 2, the cosine polar <strong>an</strong>gle element is unspecied, the asimuthal <strong>an</strong>gle isTFoam element 3, the kinetic energy is TFoam element 1 <strong>an</strong>d the momentum is unspecied.In the present case N=5 the r<strong>an</strong>ge of valid values for the 5 integers is 0 to 4.4. Foam-Limits: 0 0.2 0.4Reset the limits to a kinematic variable which have been input via Foam-Distribution: wherethe variable identier is the TFoam vector index (Int_t=0); the lower <strong>an</strong>d upper limits(Double_t=0.2 0.4). For example the data base input by Foam-Distribution: might sp<strong>an</strong><strong>an</strong> incident energy (index 0) of 0.15 to 1.5 GeV, while the current calculation is desired overthe r<strong>an</strong>ge 0.2 to 0.4 GeV.5. Beam-Pol: 0.0 0.0 0.0Set the components of the beam polaristion vector (Double_t = 0.0 0.0 0.0).6. Target-Pol: 0.0 0.0 0.0Set the components of the target polaristion vector (Double_t = 0.0 0.0 0.0).7. Recoil-Pol: 0.0 0.0 0.0Set the components of the recoil-particle polaristion vector (Double_t = 0.0 0.0 0.0).8. Foam-Weight: Bremsstrahlung 0Foam-Weight: SinTheta 2The rst (Char_t*=Bremsstrahlung) is for use in extended energy r<strong>an</strong>ge bremsstrahlungbeam experiments where the photon-energy dependence is given in the N-dimensional TFoamdistribution with the vector index of the incident photon (Int_t=0). The incident photonenergy dependence is weighted with a simple 1/E γ dependence.The second (Char_t*=SinTheta) applies a phase-space factor to a polar <strong>an</strong>gle distributionspecied as index (Int_t=2)8.4 Output formats<strong>Data</strong> may be output in either of two data formats.1. A ROOT version of mkin format2. AcquMC format8.4.1 Mkin output formatThis output format mimics that of the F77 program mkin, <strong>an</strong> event generator which has been usedpreviously with the GEANT-3 based model of the Crystal Ball cbsim. In AcquMC the output iswritten as a ROOT (as opposed to hbook) ntuple. Each event contains the following.• V x , V y , V z the Cartesi<strong>an</strong> coordinates of the reaction vertex.• p x , p y , p z , P tot , E to specify the 4-momentum of the beam particle. P tot =<strong>an</strong>d p x = P x /P tot . E is the total energy.√P 2 x + P 2 y + P 2 z• This is followed by the 4-momentum specication of each particle which has been markedas trackable. This specication is identical to that of the beam particle.This format is compatible with the Ge<strong>an</strong>t-4 model of the Crystal Ball <strong>an</strong>d TAPS43


8.4.2 AcquMC output formatThis output format used a ROOT TTree to save the reaction vertex <strong>an</strong>d 4-momenta of the particlesproduced in a particular generated event. Each event contains:• V x , V y , V z the Cartesi<strong>an</strong> coordinates of the reaction vertex.• P x , P y , P z , E to specify the 4-momentum of the beam particle. Symbols are as in Sec.8.4.1.• This is followed by the 4-momentum specication of each particle which has been markedas trackable. This specication is identical to that of the beam particle.The ROOT macro MCReplay(FileName.root) provides a diagnostic of the output, in le namedFileName.root generated by AcquMC. The le name requires full directory specication. MCReplaycreates histograms of• The vertex x, y, z coordinates <strong>an</strong>d x − y, r − z 2D distributions.• The momentum bal<strong>an</strong>ce, which is expected to be zero if all nal-state momentum is tracked.• The lab. x, y, z momentum components <strong>an</strong>d energy of the beam particle.• The lab. polar <strong>an</strong>d asimuthal <strong>an</strong>gles of the beam particle.• The lab. x, y, z momentum components <strong>an</strong>d energy of each tracked particle.• The lab. polar <strong>an</strong>d asimuthal <strong>an</strong>gles of each tracked particle44


9 <strong>Analysis</strong> of Monte Carlo generated dataThe <strong>an</strong>alysis of Crystal-Ball Monte Carlo output may be done <strong>within</strong> the same framework (ROOT)as the real data <strong>an</strong>alysis outlined above. The present GEANT-3 model of CB/TAPS will be withus for some time <strong>an</strong>d it outputs data as <strong>an</strong> HBOOK ntuple, which may trivially be convertedto ROOT format using the h2root utility. This root le c<strong>an</strong> then be run through <strong>AcquRoot</strong> inoine mode in a similar way to the <strong>an</strong>alysis of reduced data. Creating <strong>an</strong>d <strong>an</strong>alysing MonteCarlo data is summarised as follows:1. Create <strong>an</strong> input data le for mkin or MCGenerator to characterise the reaction of interest.These are st<strong>an</strong>dard text les which may be created using <strong>an</strong> editor such as emacs.2. Run the reaction event generator mkin or MCGenerator. This will create <strong>an</strong> ntuple (or tree)le of N reaction events where N is specied from le or comm<strong>an</strong>d line. Each event consists ofbeam 4-momentum, reaction vertex in the target <strong>an</strong>d the 4-momenta of the reaction productparticles.3. Create <strong>an</strong> ***.cards data le for cbsim to further characterise the reaction of interest.This is also a st<strong>an</strong>dard text le.4. Run the reaction kinematics ntuple/tree le through the CB/TAPS simulation cbsim. Trackparticles through the detector systems <strong>an</strong>d calculate <strong>an</strong>d store energy deposits (<strong>an</strong>d times)in detector elements. The output data is stored in <strong>an</strong> ntuple le.5. Convert cbsim output from hbook to root format using h2root.6. Run the cbsim output through <strong>AcquRoot</strong>.9.0.3 Features of the GEANT-3 based simulationIn cbsim, the GEANT-3 based model of CB <strong>an</strong>d TAPS, the position of the TAPS elements is readin from the le taps.dat held in the cbsim directory. In early versions of this le the x coordinateis inverted with the result that 4-momenta derived from the MC generated events have their p xcomponent inverted. If the 1st line of taps.dat reads:0 -1 -1then all should be correct. Conversely if the 1st line of taps.dat reads:0 1 -1then the x coordinates are inverted. Monte Carlo les generated using the inverted TAPS xcoordinate may still be <strong>an</strong>alysed correctly in <strong>AcquRoot</strong> using the global coordinate shift feature ofthe TA2Detector class. To apply this feature the conguration le for the BaF 2 array, commonlycalled BaF2_MC.dat for <strong>an</strong>alysis of Monte Carlo events, should contain the line:Shift-Coord: IX 0.0which tells the class to invert the x coordinate when it stores the position of a detector element.Note that the IX operation is one of a possible 12 types of shift operation provided by TA2Detector.As there is considerable scope for confusion in this business it is prudent to have a kinematicsmonitor in the <strong>AcquRoot</strong> <strong>an</strong>alysis. The following example used a phase-space generation of thereaction γ + p → p + η, η → γγ for E γ = 900 MeV. The monitor is just a comparison of missing4-momentum P miss , derived from the 2 photons detected in the Crystal Ball, with recoil proton4-momentum P p obtained from a hit in the TAPS array which has the appropriate time of ight.The results are plotted in Fig.20.Plotted are the polar <strong>an</strong>d asimuthal <strong>an</strong>gle dierences δθ = θ miss − θ p <strong>an</strong>d δφ = φ miss − φ p . Aswould be expected inverting x has a negligible eect on the apparent tight correlation in θ, whilethe x invertion completely destroys the correlation in φ.45


TA2Photo<strong>Physics</strong>MDM_Angle1PTA2Photo<strong>Physics</strong>MDM_Angle1P45004000Correct TAPS x coordinateEntries 16948Me<strong>an</strong> 0.03425RMS 2.3434000Inverted TAPS x coordinateEntries 16806Me<strong>an</strong> -0.05458RMS 2.4753500350030003000250025002000200015001500100010005005000-20 -15 -10 -5 0 5 10 15 20δθ (deg)0-20 -15 -10 -5 0 5 10 15 20δθ (deg)TA2Photo<strong>Physics</strong>MDM_Angle2PTA2Photo<strong>Physics</strong>MDM_Angle2P900Correct TAPS x coordinateEntries 16948Me<strong>an</strong> 0.1477RMS 17.5670Inverted TAPS x coordinateEntries 16806Me<strong>an</strong> 2.03RMS 102.680060700600505004004030030200100200-150 -100 -50 0 50 100 150δφ (deg)-150 -100 -50 0 50 100 150δφ (deg)Figure 20: TAPS Monte Carlo kinematic monitor. δθ = θ miss − θ p , δφ = φ miss − φ p46


10 DAQ SoftwareAcquDAQ is structured on the model of <strong>an</strong> array of front-end processors, each reading data fromsome component of the detector system, <strong>an</strong>d feeding that data to one or more central eventbuilders. Event-building software is embodied in the MergeBuers procedure of TA2<strong>Data</strong>Server(Sec.3.4), while the TDAQexperiment class of AcquDAQ constitutes a container for all the DAQcomponents which typically run on a front-end machine.Figure 21: TDAQexperiment schematic diagram10.1 TDAQexperimentFig.21 gives a schematic diagram of the tasks which are run <strong>within</strong> the TDAQexperiment envelope.The operational sequence of TDAQexperiment is:1. Congure the DAQ session using the TA2System::FileCong() procedure, as employed by<strong>AcquRoot</strong> classes. This inputs data from text conguration les in a local disk store (usually$acqu/data/). The data are described in Sec.10.1.1.2. Initialise the hardware according to the instructions input from data les3. Start the threads which run, in parallel, component processes of the DAQ system.4. Start the experimental-control process embodied in TDAQSupervise. External control comm<strong>an</strong>dsmay be received from either a local keyboard or via the network.10.1.1 Conguration les for TDAQexperimentAs with AR classes, initialisation is performed by the SetCong() procedure with the comm<strong>an</strong>dsitemised below. The comm<strong>an</strong>d line in type-face as it would appear in the conguration le isfollowed by a short expl<strong>an</strong>ation. Note that there must be a space after the colon in the key-word.47


1. Description: Test of AcquDAQ 4v0A brief description of the experiment, which is written into the data header.2. File-Name: /scratch/acqu/AcquDAQ 32 50000 32768 Disk 32768 3010<strong>Data</strong> output specication: le name including directory spec. (/scratch/acqu/AcquDAQ);number of output buers to create (32); number of data records to write to single le (50000);size in bytes of a data record (32768); ID of IP-socket used to send data (3010).3. Event-Counters: 100 0Frequency of running Scaler readout (100) <strong>an</strong>d slow control (0) procedures. Entering 0 turnsthis process OFF.4. Start-Run: 0Default run number to start DAQ session. This value is overriden by <strong>an</strong>y value read fromthe le $acqu/Run.log (if it exists), which in turn is overriden by the optional run-numberparameter supplied with the Run comm<strong>an</strong>d received via TDAQsupervisor.5. #Control: Local 0 0Control: ENet AcquCtrl 3020Specify the communication method for TDAQsuperviser. Here the commented-out localkeyboard input (Local) has been disabled <strong>an</strong>d ethernet (ENet) input enabled from (AcquCtrl)6. Module: CBD_8210 cbd_0 cbd8210_0.dat 800000 0 0DAQ hardware component electronics, in this case a CAMAC parallel br<strong>an</strong>ch driver (CBD_8210),which is given device title (cbd_0), reads conguration data from le (cbd8210_0.dat),gives the hexadecimal base address of the module (800000) in this <strong>an</strong> A24 VMEbus address,(0) base index not used here, (0) number of ch<strong>an</strong>nels not used here. The 1st 3 parametersare always supplied for a module. Starting with 800000 the parameters supplied for theCBD_8210 are VMEbus device dependent.7. IRQ-Ctrl: cbd_0Hardware module, having device title (cbd_0) which is used to ag <strong>an</strong> interrupt, used totrigger event-by-event readout.10.2 TDAQmoduleDAQ hardware is characterised by inherited classes of TDAQmodule (Fig.22), TDAQmodule beingpurely virtual, ie. <strong>an</strong> abstract framework on which real hardware characteristics are hung.10.2.1 Conguration les for TDAQmoduleThe following summarises the available options specied in module les (Sec.10.1.1 Item #6).Items 1-3 are completely general, 4 is VMEbus1. BaseSetup: 10000000 256 ADCThe module sits at hex base address 1000000 (0 species dened elsewhere), has 256 registers(ie allocate space for 256 register structures) <strong>an</strong>d is of type ADC. Allowed type values are ADC,Scaler, SlowCtrl (slow control), P-Ctrl (primary DAQ controller), S-Ctrl (secondaryDAQ controller) <strong>an</strong>d IRQ (trigger processor, e.g. control start of readout)2. Init:Run PostInit() procedure48


Figure 22: TDAQmodule schematic3. BaseIndex: 4096 128 16This comm<strong>an</strong>d is used with ADCs <strong>an</strong>d Scalers to specify the start index (4096), the numberof readout ch<strong>an</strong>nels in the module (128) <strong>an</strong>d the number of signic<strong>an</strong>t bits (16) of eachdatum read from the module4. Register: 200 32 09 0843 0Setup a VMEbus module register at address addr (oset from the base address), width is thenumber of signic<strong>an</strong>t bits (e.g. 8,16,32) in the register, am is the VMEbus address modiercode (usually 09), datum is <strong>an</strong> optional parameter which is the number written to theregister at initialisation, <strong>an</strong>d the optional nreg species how m<strong>an</strong>y registers at consecutiveaddresses to setup identically. If datum is omitted no initialisation of the register is carriedout <strong>an</strong>d if nreg is omitted a single register only is specied.5. CAMAC-CNAF: 0 0 0 1 IRQThis is the CAMAC vari<strong>an</strong>t of the Register: directive. It sets up function code <strong>an</strong>dsubaddress(es) for the CAMAC module whose br<strong>an</strong>ch, crate <strong>an</strong>d station (BCN) are givenin the main cong. le (Sec.10.1.1). The 5 parameters are datum (0), function code (0),1st sub-address (0), last sub-address (1), register type (IRQ). Allowed types are IRQ (eventby-eventreadout), Init (initialise) <strong>an</strong>d Test. For write function codes (e.g. 16,17...) thevalue of datum is written. In the present case a read function (0,1,2....) is given <strong>an</strong>d datumis ignored. Thus the module sub-addresses A0, A1 are read each event. Set 1st <strong>an</strong>d lastsub-addresses equal for a single sub-address.Other directives have a more specialist module-specic functions which are detailed in Sec.10.2.2.49


10.2.2 Supported hardwareThis will be updated periodically as new hardware is included.CAEN V2718 PCI-to-VMEbus bridge This hardware connects the PCI bus of a st<strong>an</strong>dardPC to the VMEbus via optical bres. CAEN software from a provided library is used to initialisethe link <strong>an</strong>d read/write VMEbus addresses. The module has full Address Modifer (AM) VMEbusaddressing capabilities. It is introduced to the DAQ via the TDAQexperiment line:Module: CAEN_V2718 v2718_0 v2718.dat 0 0The supplied parametersMainz KPh X86 based single board VMEbus computer This VMEbus slot-1 controleris produced by the Mainz Institut fuer KernPhysik <strong>an</strong>d is based on <strong>an</strong> X86 CPU. It is introducedto the DAQ via the TDAQexperiment line:CES CBD 8210 CAMAC parallel br<strong>an</strong>ch driver This VMEbus module converts <strong>an</strong> A24VMEbus address to a CAMAC BCNAF comm<strong>an</strong>d, which is geographical specifying Br<strong>an</strong>ch # (B),Crate # (C), Crate Station # (N), Module Subaddress # (A), Function Code (F). The followingsetup line species base address 800000 (hex) which corresponds to Br<strong>an</strong>ch 0.Module: CBD_8210 cbd_0 cbd8210_0.dat 800000 0 0Generic CAMAC module This may be used to initialise <strong>an</strong>y CAMAC module which requiresonly generic CAMAC-CNAF: directives (Sec.10.2.1). The directive from the main cong. le isas follows:Module: CAMAC a2_0 a2ctrl_0.dat 1 30The module in this case is a type-A2 crate controller on crate 1 station 30. Its virtual stationis 30 which physically doesn't exist. File a2ctrl_0.dat contains the setup AF directives. It isassumed to lie on the br<strong>an</strong>ch specied by the last introduced VME-CAMAC interface, e.g. theCBD 8210 above.LeCroy 4508 memory lookup unit This 2×8-bit memory lookup unit is often used for triggercontrol in AcquDAQ. It has some specialist directives to setup the internal RAMS. It is speciedin the main cong. le by the following:Module: LRS_4508 mlu_0 lrs4508_0.dat 1 4which says it sits in crate 1 at station 4. The setup le lrs4508_0.dat contains, in addition togeneric directives, a specialist of the form:RAM: 0 ffff c0RAM: 0 03 f7The 3 parameters specify in order RAM # (0), which for the 4508 may be 0/1 for the top/bottomsections of the module; the hex input bit pattern (03) for which the valid r<strong>an</strong>ge is 0-ff; thecorresponding hex output bit pattern (f7) for which the valid r<strong>an</strong>ge is 0-ff. If the input bitpattern is set to ffff then all RAM locations are written in the above case with c0, ie its adefault output value, given in cases where <strong>an</strong> input pattern is not specied.50


LeCroy 2373 memory lookup unit This 16-bit memory lookup unit has some specialistdirectives to setup internal RAMS. It is specied in the main cong. le by the following:Module: LRS_2373 mlu_1 lrs2373_0.dat 1 5which says it sits in crate 1 at station 5. The setup le lrs2373_0.dat contains, in addition togeneric directives, specialists of the form:RAM: ffff c0RAM: 3bf 4fa0CCR: 60The RAM: directives are very similar to the LeCroy 4508 above except that there is no RAM 0/1.The CCR: parameter is set to hex 60 for pulsed mode <strong>an</strong>d hex 40 for latched mode.Generic VMEbus module This may be used to initialise <strong>an</strong>y VMEbus module which doesnot require specialist h<strong>an</strong>dling:Module: VMEbus disc_0 v895_0.dat e0000000 5 16In this case it is a CAEN V895, 16-ch<strong>an</strong>nel leading-edge discriminator which sits at base addresshex e0000000.CAEN V792 32-ch<strong>an</strong>nel QDC Module: CAEN_V792 v792_0 v792_0.dat ee000000 100 32Virtual Modules for DAQ-software testing Module: Virtual vADC_0 vADC_0.dat ADC 20032 12Module: Virtual vSCA_0 vSCA_0.dat Scaler 200 32 24Module: Virtual vIRQ_0 vIRQ_0.dat S-Ctrl 0 0 1651


AApplicationsA.1 Cluster Determination Algorithms for Segmented CalorimetersIn a segmented calorimeter, such as the Crystal Ball or TAPS arrays, <strong>an</strong> energetic particle willgenerally produce a shower of secondary particles which will re a group of (usually) adjacentelements of the array. This group is known as a cluster. Dierent types of particle <strong>an</strong>d dierentenergies will produce cluster signatures with dierent spatial extents <strong>an</strong>d dierent distributions ofenergy deposition. The event reconstruction software has to:1. identify which hits in the calorimeter array group together to form a cluster.2. calculate the total energy deposition <strong>within</strong> the cluster, which c<strong>an</strong> be related to the energyof the incident particle.3. calculate a weighted me<strong>an</strong> position of the cluster hits, which c<strong>an</strong> be related to the entr<strong>an</strong>ceposition of the incident particle.4. calculate diagnostic parameters which may be used to aid identication of the incidentparticle.In cases where a reaction produces multiple nal-state products, e.g. in kaon or eta productionwhere the meson decays could give 6 or 8 photons, identication of the individual clusters c<strong>an</strong> bea non-trivial process. Within AR the detector class TA2ClusterDetector has a variety of methodsto identify <strong>an</strong>d calculate the properties of clusters.A.1.1The basic cluster algorithm.The basic method to identify hit clusters is essentially that used by UCLA for <strong>an</strong>alysis of CrystalBall experiments at BNL. The array of calorimeter hits for a particular event is searched for localmaxima in energy deposition. Starting with the array element which has the absolute maximumenergy, its nearest neighbours are sc<strong>an</strong>ned <strong>an</strong>d if they contain energy they are added to the cluster<strong>an</strong>d also crossed o the hits array to avoid double counting. Each element of the calorimeter has<strong>an</strong> associated list of neighbour elements which are input from the detector conguration le. Thusno particular neighbour geometry has to be assumed a priori <strong>an</strong>d the extent of the neighbourarray, e.g. one ring, two rings around the element, c<strong>an</strong> be tuned by h<strong>an</strong>d.After this cluster is determined, the remaining hits are re-sc<strong>an</strong>ned to nd the next maximum inenergy deposition <strong>an</strong>d a similar neighbour sc<strong>an</strong> performed to determine the next cluster. Thisprocedure continues until there are no hits left or the number of clusters exceeds a maximumnumber specied in the detector conguration le. To be saved as a cluster, the group of adjacenthits has to have a total energy E tot = ∑ i E i which exceeds a threshold E th specied in the detectorconguration le. The weighted me<strong>an</strong> position is given by r m = ∑ i r i√Ei / ∑ √ E i <strong>an</strong>d variousqu<strong>an</strong>tities such as a the fraction of total energy contained in the central element of the cluster arealso saved.A.1.2The extended cluster algorithm.The basic algorithm does not always catch all of the hits in a cluster <strong>an</strong>d so <strong>an</strong> optional further sc<strong>an</strong>may be performed to sweep up <strong>an</strong>y hits which are connected to the cluster but are not includedin the neighbour array of the central element. This method was adapted from that used in TAPS<strong>an</strong>alysis with some modication to improve computational eciency.52


After a basic cluster is determined (Sec.A.1.1) the remaining hits array is sc<strong>an</strong>ned. The dist<strong>an</strong>ced ij = |r i − r j | is calculated for each cluster member i <strong>an</strong>d each remaining hit j. If d min ≤ d ij ≤d max , where d min <strong>an</strong>d d max are specied in the detector conguration le, then element j isadded to the cluster <strong>an</strong>d crossed o the remaining-hits list. The procedure is then iterated overthe new cluster elements to search for <strong>an</strong>y further connections <strong>an</strong>d the iteration stops when nonew elements are added. Once this is performed E tot ,r m etc. are calculated as before.A.1.3The split-o search algorithm.Occasionally a shower produces a set of calorimeter hits which c<strong>an</strong>not be combined into onecluster using the methods outlined above. Characteristically a photon shower might produce amain cluster <strong>an</strong>d a separate smaller cluster containing a relatively small amount of energy. Thelatter is known as a split-o <strong>an</strong>d it is often, but by no me<strong>an</strong>s always, situated <strong>within</strong> a relativelysmall opening <strong>an</strong>gle with respect to the main cluster. In this scheme clusters are determinedby either of the methods above (Sec.A.1.1,A.1.2), but in order to recognise split-os the clusterenergy threshold E sptot is set lower th<strong>an</strong> normal, e.g. E sptot ∼ 5 MeV as opposed to say E tot ∼30 MeV for π 0 decay photons. The resulting clusters are then sorted <strong>an</strong>d those whose energyexceeds E tot are labelled main clusters <strong>an</strong>d <strong>an</strong>ything remaining is labelled a potential split-o.The opening <strong>an</strong>gles ϑ kl between all combinations of main k, <strong>an</strong>d split-o clusters l are thencalculated <strong>an</strong>d sorted. Those combinations having ϑ kl ≥ ϑ max , where ϑ max is read from thedetector conguration le, are rejected <strong>an</strong>d <strong>an</strong>y remaining k, l combinations are assigned on thepriority of minimum ϑ kl . Once this is done cluster l is merged with cluster k so that Etot k =Etot k + Etot l <strong>an</strong>d rm (r k = √ )m√ k Ektot + rml Eltot /(√Ektot + √ )Etotl .A.1.4Conguration le options for TA2ClusterDetectorIn addition to the st<strong>an</strong>dard Element: <strong>an</strong>d Next-Neighbour: lines which have to be entered foreach element of the calorimeter array, the TA2ClusterDetector class (<strong>an</strong>d its parent TA2Detector)have a number of options which are import<strong>an</strong>t to determination of cluster parameters.1. The global energy scale factor. After TA2Detector converts from ADC ch<strong>an</strong>nel to energyusing calibration parameters particular to the given detector element, the result<strong>an</strong>t energyis multiplied by the global scaling factor. By default the scale factor is set to 1.0. To use avalue of say 1.05 the detector conguration le would contain the line:Energy-Scale: 1.052. The maximum number of clusters to h<strong>an</strong>dle <strong>an</strong>d cluster threshold energy. This requires <strong>an</strong>input line of the form:Max-Cluster: 12 30.0which species that the class will h<strong>an</strong>dle up to 12 clusters <strong>an</strong>d that each cluster must haveE tot ≥ 30 MeV.3. The option to turn on iterative searching for additional cluster members. This requires <strong>an</strong>input line of the form:Iterate-Neighbours: 3 5.9 6.1The factor 3 causes the neighbour-list array for <strong>an</strong>y particular element to be increased in sizeby a factor 3, e.g. if 12 neighbours are given on a Next-Neighbour: line then the size of thearray is increased to 36 to allow for potential extra neighbours. The iterative search checksthe array boundaries. Numbers 5.9, 6.1 are respectively d min , d max the dist<strong>an</strong>ce limits usedto determine if <strong>an</strong> element is connected to the cluster.4. The option to turn on split-o searching. This requires <strong>an</strong> input line of the form:Split-Off: 5.0 20.053


This species that E spth, the initial low cluster threshold to catch split-os, is set to 5.0 MeV<strong>an</strong>d that the maximum opening <strong>an</strong>gle between main <strong>an</strong>d split-o clusters ϑ max is 20.0 degrees.A.1.5Preliminary Cluster studies using Monte Carlo generated events.A study of the eects of dierent methods of cluster <strong>an</strong>alysis was performed using events generatedby mkin <strong>an</strong>d played through the cbsim Monte Carlo model. The simulation assumed amonoenergetic photon of energy 900 MeV incident on a 5 cm hydrogen target, producing <strong>an</strong>η <strong>an</strong>da recoil proton according to phase space. Both η → γγ <strong>an</strong>d η → π 0 π 0 π 0 decays were considered,again with energy <strong>an</strong>d <strong>an</strong>gle distributions determined by phase space consideration only.The resulting ntuples containing 10 5 events were converted to root trees <strong>an</strong>d played through theAR <strong>an</strong>alyser. The signal produced by the nal-state photons <strong>an</strong>d proton were <strong>an</strong>alysed using thecluster-determination methods (Sec.A.1.1,A.1.2,A.1.3) of the AR class TA2ClusterDetector, forboth the Crystal Ball <strong>an</strong>d TAPS, <strong>an</strong>d TA2Photo<strong>Physics</strong> <strong>an</strong>alysed the 4-momenta produced by theapparati.Note that the simulations were performed using the correct (not x-inverted) TAPS coordinatesystem (as input to cbsim) <strong>an</strong>d also that this study is not intended as a denitive statement onhow to perform cluster <strong>an</strong>alysis. It is merely a guide as to the type of eects or pitfalls which maybe encountered.Fig.23 shows proton missing mass distributions obtained when only the nal-state photons aredetected <strong>an</strong>d plots labelled 1 <strong>an</strong>d 2 refer respectively to η → γγ <strong>an</strong>d η → π 0 π 0 π 0 nal statedecays. The sub-labels A,B,C,D are explained as follows:A: The st<strong>an</strong>dard cluster-determination algorithm of Sec.A.1.1 was used. The cluster energy thresholdwas 30 MeV.B: The extended cluster-determination algorithm of Sec.A.1.2 was used, also with a cluster energythreshold of 30 MeV.C: The st<strong>an</strong>dard algorithm was used, followed by a split-o search of Sec.A.1.3. The cluster energythreshold was 30 MeV <strong>an</strong>d the split-o threshold was 5 MeV.D: This was similar to C, except that the extended algorithm was used before the split-o search.Note that the global energy scales of both TAPS <strong>an</strong>d the Crystal Ball were set to 1.0 so that theabsolute degree of energy loss in cluster determination could be assessed.Case/Parameter 1A 1B 1C 1D 2A 2B 2C 2D〈M miss 〉 − M p (MeV) 31.3 25.3 26.2 23.9 33.7 29.5 29.2 27.9δ σ M miss (MeV) 19.1 20.3 20.3 20.6 18.1 18.7 18.7 19.0〈E miss 〉 (MeV) 75.3 68.4 69.0 66.6 76.9 74.5 71.2 72.3〈θ miss − θ p 〉 (deg) -0.15 0.03 0.02 0.10 -0.21 -0.11 -0.06 -0.06δ RMS (θ miss − θ p ) (deg) 2.3 2.3 2.4 2.4 2.2 2.2 2.2 2.2〈φ miss − φ p 〉 (deg) 0.18 0.15 0.11 0.09 0.04 -0.18 -0.06 -0.27δ RMS (φ miss − φ p ) (deg) 17.3 17.6 17.6 17.9 19.0 18.2 18.3 17.9% events with ηp ID 33.3 40.0 39.4 41.3 9.6 8.3 12.0 9.0% events with 2/6 γ 80.3 82.0 79.8 81.9 43.2 30.4 43.4 30.5% events with >2/6 γ 11.9 9.6 12.2 9.8 5.4 3.2 5.5 3.2Table 11: Summary of cluster-study results. M miss is as in Fig.23, E miss is the missing energy ifboth nal-state η <strong>an</strong>d p are identied, θ <strong>an</strong>d φ <strong>an</strong>gles are as dened in Sec.9.0.3Table 11 summarises some results extracted from this exercise. If c<strong>an</strong> be seen that the variousalgorithms have a minimal eect on <strong>an</strong>gle determination <strong>an</strong>d also on energy resolution.54


TA2Photo<strong>Physics</strong>5000400030001A: η→γγMDM_EmEtaPEntries 41744Me<strong>an</strong> 969.5RMS 19.68χ 2/ ndf542.8 / 31Const<strong>an</strong>t 5168 ±31.3Me<strong>an</strong> 969.6 ±0.1Sigma 19.08 ±0.07TA2Photo<strong>Physics</strong>60005000400030001BMDM_EmEtaPEntries 50534Me<strong>an</strong> 963.4RMS 20.69χ 2/ ndf352.4 / 34Const<strong>an</strong>t 5916 ±32.8Me<strong>an</strong> 963.6 ±0.1Sigma 20.3 ±0.120002000100010000800 850 900 950 1000 10500800 850 900 950 1000 1050TA2Photo<strong>Physics</strong>60005000400030001CMDM_EmEtaPEntries 49760Me<strong>an</strong> 964.3RMS 20.73χ 2/ ndf363 / 33Const<strong>an</strong>t 5829 ±32.5Me<strong>an</strong> 964.5 ±0.1Sigma 20.28 ±0.07TA2Photo<strong>Physics</strong>60005000400030001DMDM_EmEtaPEntries 52294Me<strong>an</strong> 962.1RMS 21χ / ndf316 / 352Const<strong>an</strong>t 6028 ±32.9Me<strong>an</strong> 962.2 ±0.1Sigma 20.64 ±0.0720002000100010000800 850 900 950 1000 10500800 850 900 950 1000 1050TA2Photo<strong>Physics</strong>160014001200100002A: η→3πMDM_EmEtaPEntries 12476Me<strong>an</strong> 972.7RMS 19.74χ / ndf178.2 / 302Const<strong>an</strong>t 1622 ±18.7Me<strong>an</strong> 972 ±0.2Sigma 18.14 ±0.13TA2Photo<strong>Physics</strong>1400120010008002BMDM_EmEtaPEntries 10655Me<strong>an</strong> 968.5RMS 20.062χ / ndf119.9 / 30Const<strong>an</strong>t 1347 ±16.6Me<strong>an</strong> 967.8 ±0.2Sigma 18.72 ±0.148006004006004002002000800 850 900 950 1000 10500800 850 900 950 1000 1050TA2Photo<strong>Physics</strong>2000180016001400120010002CMDM_EmEtaPEntries 15608Me<strong>an</strong> 968.1RMS 20.19χ / ndf193 / 312Const<strong>an</strong>t 1971±20.3Me<strong>an</strong> 967.5 ±0.2Sigma 18.72 ±0.12TA2Photo<strong>Physics</strong>1400120010008002DMDM_EmEtaPEntries 11563Me<strong>an</strong> 966.8RMS 20.27χ / ndf135.4 / 302Const<strong>an</strong>t 1444 ±17.2Me<strong>an</strong> 966.2 ±0.2Sigma 18.95 ±0.148006004006004002002000800 850 900 950 1000 10500800 850 900 950 1000 1050Figure 23: Proton missing mass from the reaction γ + p → p + η for E γ = 900 MeV. Events weregenerated by the mkin/cbsim Monte Carlo model. The solid curves represent Gaussi<strong>an</strong> ts to themissing-mass distributions.In the case of η → γγ, detection of the relatively high energy photons is improved, both interms of energy determination <strong>an</strong>d in eciency of identifying the correct number of photons, ifthe extended cluster algorithm is applied. Case 1B is in all respects better th<strong>an</strong> 1A. Turning onthe split-o search (Case 1C,1D) does improve the energy bal<strong>an</strong>ce slightly, but does nothing to55


suppress erroneous detection of more th<strong>an</strong> 2 photons.In the case of η → 3π 0 the situation is less clear cut. Energy determination in Case 2B is betterth<strong>an</strong> 2A, but conversely the eciency of detecting 6 photons is signic<strong>an</strong>tly poorer in 2B. Againthe split-o search (Case 2C, 2D) gives a small improvement in energy determination but seemsto have little of no eect in suppressing erroneous detection of more th<strong>an</strong> 6 photons.Thus the overall message is choose the best horse for a particular course...there is currently nomagic bullet to tackle this problem globally.References[1] ACQU[2] ROOT Users Guide[3] A2 Ge<strong>an</strong>t-4 base simulation of the Crystal Ball & TAPS @ MAMI, D.Glazier.[4] SAID[5] MDM56

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!