ANALYSIS Package and HBTAN Offline Week Piotr Krzysztof
ANALYSIS Package and HBTAN Offline Week Piotr Krzysztof Skowroński 18 September 2004 30 June 2004 Analysis project P. K. Skowroński Offline Week June 2004
ANALYSIS The main idea is that all analyses use the same data format, so we can n n 2 Use the same data input so we can run all analyses together and save time for data reading, etc. . . Use result of any other analyses (e. g. flow, jets, . . . ) Control what are results of other analyses on our data sample and if there any correlations Share the code Analysis project P. K. Skowroński Offline Week June 2004 30 June 2004
AOD Analysis Object Data Designed to be analysis oriented Similar to ESD but n n Contains data needed to analysis only Designed for efficiency of the analysis Contains n n n 3 list of particles – Ali. VAODParticle Vertex positions Whatever more needed for analysis concerning general event properties Analysis project P. K. Skowroński Offline Week June 2004 30 June 2004
Ali. VAODParticle Virtual AOD Particle n pure virtual class w Analyses can differ in preferable internal representation of a particle properties n n pt, q, f px, py, pz w Analyses should depend only on the interface defined by Ali. VAODParticle n n Given analysis specific particle should not extend functionality of a particle If such needed, proper method should be defined in VAODParticle w Still guarantee that one analysis can always be run on data prepared for other analysis n n 4 Even if less efficient way Provides all the interfaces needed for accessing any particle property Analysis project P. K. Skowroński Offline Week June 2004 30 June 2004
Concrete versions of particles Ali. AODParticle Concretized varsion of a particle class based on px, py, pz reprezentation Ali? ? ? Particle - waiting to be implemented 5 Analysis project P. K. Skowroński Offline Week June 2004 30 June 2004
Ali. AODPair It is object that has n n 2 pointers to particles Set of method for calculating all two particle properties It buffers results n 6 This speeded up HBT analysis more than twise!!! Analysis project P. K. Skowroński Offline Week June 2004 30 June 2004
Ali. Run. Analysis Implements loop over events Takes data from a reader (Ali. Reader) Reader provides 2 pointers to AODs n n Reconstructed and (eventually if demanded) Simulated These two AODs have „parallel” structure w Nth particle in simulated event corresponds to nth in the reconstructed one n n Comfortable for any comparisons and resolution analyses One track can appear more than ones in AOD in two different incarnations w f. g ones as pion and ones as kaon (calculation of some properties require mass assumption) w In order to recognize them, particles are given UID (unique ID) Run. Analysis checks AOD against the event cut n 7 Implemented by Ali. Event. Cut Analysis project P. K. Skowroński Offline Week June 2004 30 June 2004
Ali. Analysis: base class for analyses Analysis has to provide 3 methods n n n Init() Process. Event(Ali. AOD* rec, Ali. AOD*sim=0) Finish() Analysis is a task n n n Ali. Analysis inherits from TTask Identified by unique names Under Developement: Specification what requires and what provides w This way Ali. Run. Analysis can correctly order the execution and check if there is no circular dependencies between analyses 8 Analysis project P. K. Skowroński Offline Week June 2004 30 June 2004
Ali. Analysis cont. – anlysis-wide Pair. Cut Functionality designed for HBT n but I think it is useful for other analyses When doing analysis of MC data, cuts may be checked on: n n n Reconstructed data only Simulated data only Both simulated and reconstructed There are methods that perform these tasks n n n Pass. Track Pass. Part. And. Track Ali. Analysis has data member pointer to method (fk. Pass) n It points to one of the methods above, depending on the user n 9 setting It saves 1 if statement (inside quadruple loop!) Analysis project P. K. Skowroński Offline Week June 2004 30 June 2004
Output data Currently each analysis is responsible for writing its results to file n Done in Finish() method Output data could be stored in folders n n 10 Other analyses can find there data which they require Writing results can be managed by Ali. Run. Analysis project P. K. Skowroński Offline Week June 2004 30 June 2004
Cuts Design of all cuts is similar Cut contains list of „Base Cuts” „Base Cut” implements a cut on a single property „Logical Base Cuts”: that perform logical operations on others „base cuts” n n F. g. : Ali. AODOr. Pair. Cut Allows to create tree structure that implements sophisticated logical operations, e. g. (Number of TPC tracks > N) AND (ZDC signal > X) Cut implements shortcut methods for setting ranges n 11 e. g. . : Set. Pt. Range(0. 4, 0. 7) Analysis project P. K. Skowroński Offline Week June 2004 30 June 2004
Cuts „Base Cuts” are distinguishable by their property (enumerate type) n If a given base cut is already present in the list, and user wants to change its range „Empty Cuts” n n Accepts everything All pointers to cuts by default point an empty cut w No necessity of checking if pointer is not NULL Cuts use negative logic! n n 12 Method that tests is called Rejected w True when rejected Carefully with logical base cuts w Ranges specify what we want to accept Analysis project P. K. Skowroński Offline Week June 2004 30 June 2004
Cuts: advantages of this design Cuts, that ranges were specified, are checked only Configuration without necessity of recompilation Very easy to extend functionality n n 13 User can implement his own library with base cuts w No necessity to reinstall the software (e. g. on all Ali. En sites) because one more cut is needed One still can create a base cut that implements complicated algorithm Analysis project P. K. Skowroński Offline Week June 2004 30 June 2004
Cuts: Ali. Event. Cut n Event properties Ali. Particle. Cut n Particle properties Ali. Pair. Cut n n Pair properties Apart of list of pair „base cuts” consists pointers to 2 Ali. Particle. Cut w They can point the same cut 14 Analysis project P. K. Skowroński Offline Week June 2004 30 June 2004
Readers Run. Analysis takes data from an object of Ali. Reader type Reader returns AODs There are implemented following readers n n n Ali. Reader. ESD w Reads ESD w Also can read Ali. Reader. Kine. Tree w Reads Kinematics Tree Ali. Reader. AOD w Reads and Writes AODs User can set a list of directories where to look for data n By default it seeks in current directory Reader has a list of Particle Cuts n 15 Particle is accepted if some it is accepted by any of cuts Analysis project P. K. Skowroński Offline Week June 2004 30 June 2004
Readers Method Next() reads the next event n Returns non-zero value when no more events available Concretized Reader has to implement n Read. Next() w Attempts to read next event w Returns 0 in case of success n Rewind() Readers do not buffer events by default n n 16 If some kind of mixing is necessary given analysis has to make a own copy for their use Reading with buffering is implemented in Ali. Reader Analysis project P. K. Skowroński Offline Week June 2004 30 June 2004
Recent development AOD stores particles in Clones Array User can specify which particle type is stored n n Ali. AOD: : Set. Particle. Class(TClass*) Ali. AOD: : Set. Particle. Class. Name(const char*) Automatical conversion between different particle types is guaranteed by overloading Ali. VAODParticle& operator=(const Ali. VAODParticle&) New particle types must implement Clear(Option_t*) method, if they have any pointer data member n 17 It has to delete all dynamically allocatted objects Analysis project P. K. Skowroński Offline Week June 2004 30 June 2004
Ali. Reader. AOD Reader for Reading and Writing AODs from/to file To write use static method Int_t Ali. Reader. AOD: : Write. AOD(Ali. Reader* inreader, const char* outfilename, const char* pclassname); n n n Inreader – reader providing AODs to store Outfilename Pclassname – Name of the particle class to be stored AODs are stored in TTree Example macro: $(ALICE_ROOT)/ANALYSIS/Write. AOD. C 18 Analysis project P. K. Skowroński Offline Week June 2004 30 June 2004
Ali. Reader. AOD In case no particle cuts are specified reader returns pointer to the tree buffer (very fast) In the other case, accepted particles are copied to the new AOD object n Slower, but not remarkably – less then factor 2 I have produced AODs for HBT analyses that can be found at: alien: /alice/cern. ch/user/s/skowron/PDC 04/AOD/cent 1/ n Directories w 10000 -11424 – contain data without ITS stand alone tracking, binned according to reconstructed z vertex position w 20000 -22200 – data with ITS stand alone, not binned n 19 The single selection criterion was that PID probability was >50% Analysis project P. K. Skowroński Offline Week June 2004 30 June 2004
Ali. Reader. ESD (Christian Finck) Reading of MUON data from ESD Functionality that allows to switch on/off reading of: n n 20 Central barrel data MUON data PHOS data. . . Analysis project P. K. Skowroński Offline Week June 2004 30 June 2004
Other classes moved from HBTAN Ali. Track. Points n n List of spatial coordinates of a track in different radii Used to asses w Average distance between two tracks w If track was passing close to some element or other track at given position Ali. Cluster. Map n n Bit Vector describing cluster occupation in TPC w 1 on nth field if track has a cluster on nth padrow Used to detect splitted tracks Ali. Event. Buffer n n 21 FIFO queue for buffering events w Readers by default are not buffering Utility class for local AOD buffering Analysis project P. K. Skowroński Offline Week June 2004 30 June 2004
Summary Analysis framework and AOD data format is implemented The design is flexible so it is supposed to fit any kind of analysis The special accent was put on the performance n Sometimes with a cost of the code clarity HBTAN is an example of advanced analysis based on this framework Other analyses have to come after n 22 Example of one analysis is not a proof of the concept Analysis project P. K. Skowroński Offline Week June 2004 30 June 2004
- Slides: 22