3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
8 //////////////////////////////////////////////////////////////////////////////
10 // collect together MC info for comparison purposes - effieciency studies and so on// //
11 // marian.ivanov@cern.ch //
12 //////////////////////////////////////////////////////////////////////////////
16 ////////////////////////////////////////////////////////////////////////
18 // Start of implementation of the class AliTPCdigitRow
20 ////////////////////////////////////////////////////////////////////////
22 #include <TParticle.h>
23 #include "AliTrackReference.h"
30 const Int_t kgRowBytes = 32;
32 class AliTPCdigitRow: public TObject {
35 virtual ~AliTPCdigitRow(){;}
36 void SetRow(Int_t row);
37 Bool_t TestRow(Int_t row) const ;
38 AliTPCdigitRow & operator=(const AliTPCdigitRow &digOld);
39 Int_t RowsOn(Int_t upto=8*kgRowBytes) const;
45 UChar_t fDig[kgRowBytes];
46 ClassDef(AliTPCdigitRow,1) // container for digit pattern
50 ////////////////////////////////////////////////////////////////////////
52 // Start of implementation of the class AliMCInfo
54 ////////////////////////////////////////////////////////////////////////
56 class AliMCInfo: public TObject {
61 AliMCInfo(const AliMCInfo& info);
65 AliTrackReference fTrackRef; // track reference saved in the output tree
66 AliTrackReference fTrackRefOut; // decay track reference saved in the output tree
67 AliTrackReference fTRdecay; // track reference at decay point
69 Int_t fPrimPart; // index of primary particle in TreeH
70 TParticle fParticle; // generated particle
71 Float_t fMass; // mass of the particle
73 Int_t fLabel; // track label
74 Int_t fEventNr; // event number
75 Int_t fMCtracks; // indication of how many times the track is retuturned back
76 Int_t fPdg; //pdg code
77 Float_t fDecayCoord[3]; // position of particle decay
78 Double_t fVDist[4]; //distance of the particle vertex from primary vertex
79 Bool_t fTPCdecay; //indicates decay in TPC
80 Int_t fRowsWithDigitsInn; // number of rows with digits in the inner sectors
81 Int_t fRowsWithDigits; // number of rows with digits in the outer sectors
82 Int_t fRowsTrackLength; // last - first row with digit
83 Float_t fPrim; // theoretical dedx in tpc according particle momenta and mass
84 AliTPCdigitRow fTPCRow; // information about digits row pattern
85 Int_t fNTPCRef; // tpc references counter
86 Int_t fNITSRef; // ITS references counter
87 Int_t fNTRDRef; // TRD references counter
88 Int_t fNTOFRef; // TOF references counter
89 TClonesArray * fTPCReferences; //containner with all track references -in the TPC
90 TClonesArray * fITSReferences; //container with ITS references
91 TClonesArray * fTRDReferences; //container with TRD references
92 TClonesArray * fTOFReferences; //container with TRD references
94 ClassDef(AliMCInfo,1) // container for
99 class AliGenV0Info: public TObject {
102 AliMCInfo fMCd; //info about daughter particle - second particle for V0
103 AliMCInfo fMCm; //info about mother particle - first particle for V0
104 TParticle fMotherP; //particle info about mother particle
105 void Update(Float_t vertex[3]); // put some derived info to special field
106 Double_t fMCDist1; //info about closest distance according closest MC - linear DCA
107 Double_t fMCDist2; //info about closest distance parabolic DCA
109 Double_t fMCPdr[3]; //momentum at vertex daughter - according approx at DCA
110 Double_t fMCPd[4]; //exact momentum from MC info
111 Double_t fMCX[3]; //exact position of the vertex
112 Double_t fMCXr[3]; //rec. position according helix
114 Double_t fMCPm[3]; //momentum at the vertex mother
115 Double_t fMCAngle[3]; //three angels
116 Double_t fMCRr; // rec position of the vertex
117 Double_t fMCR; //exact r position of the vertex
118 Int_t fPdg[2]; //pdg code of mother and daugter particles
119 Int_t fLab[2]; //MC label of the partecle
121 Double_t fInvMass; //reconstructed invariant mass -
122 Float_t fPointAngleFi; //point angle fi
123 Float_t fPointAngleTh; //point angle theta
124 Float_t fPointAngle; //point angle full
126 ClassDef(AliGenV0Info,1) // container for
131 class AliGenKinkInfo: public TObject {
133 AliGenKinkInfo(); //default cosntructor
134 void Update(); // put some derived info to special field
137 AliMCInfo fMCd; //info about daughter particle - second particle for V0
138 AliMCInfo fMCm; //info about mother particle - first particle for V0
139 Double_t fMCDist1; //info about closest distance according closest MC - linear DCA
140 Double_t fMCDist2; //info about closest distance parabolic DCA
142 Double_t fMCPdr[3]; //momentum at vertex daughter - according approx at DCA
143 Double_t fMCPd[4]; //exact momentum from MC info
144 Double_t fMCX[3]; //exact position of the vertex
145 Double_t fMCXr[3]; //rec. position according helix
147 Double_t fMCPm[3]; //momentum at the vertex mother
148 Double_t fMCAngle[3]; //three angels
149 Double_t fMCRr; // rec position of the vertex
150 Double_t fMCR; //exact r position of the vertex
151 Int_t fPdg[2]; //pdg code of mother and daugter particles
152 Int_t fLab[2]; //MC label of the partecle
153 ClassDef(AliGenKinkInfo,1) // container for
158 ////////////////////////////////////////////////////////////////////////
160 // Start of implementation of the class AliGenInfoMaker
162 ////////////////////////////////////////////////////////////////////////
164 class AliGenInfoMaker {
168 AliGenInfoMaker(const char * fnGalice, const char* fnRes ="genTracks.root",
169 Int_t nEvents=1, Int_t firstEvent=0);
170 virtual ~AliGenInfoMaker();
172 Int_t Exec(Int_t nEvents, Int_t firstEventNr);
173 void CreateTreeGenTracks();
174 void CloseOutputFile();
178 Int_t BuildKinkInfo(); // build information about MC kinks
179 Int_t BuildV0Info(); // build information about MC kinks
180 Int_t BuildHitLines(); // build information about MC kinks
181 void SetFirstEventNr(Int_t i) {fFirstEventNr = i;}
182 void SetNEvents(Int_t i) {fNEvents = i;}
183 void SetDebug(Int_t level) {fDebug = level;}
184 Int_t SetIO(Int_t eventNr);
185 Int_t CloseIOEvent();
188 Float_t TR2LocalX(AliTrackReference *trackRef,
189 AliTPCParam *paramTPC) const;
190 AliMCInfo * GetInfo(UInt_t i) const {return (i<fNParticles)? fGenInfo[i]:0;}
191 AliMCInfo * MakeInfo(UInt_t i);
194 Int_t fDebug; //! debug flag
195 Int_t fEventNr; //! current event number
196 Int_t fLabel; //! track label
197 Int_t fNEvents; //! number of events to process
198 Int_t fFirstEventNr; //! first event to process
199 UInt_t fNParticles; //! number of particles in TreeK
200 TTree *fTreeGenTracks; //! output tree with generated tracks
201 TTree *fTreeKinks; //! output tree with Kinks
202 TTree *fTreeV0; //! output tree with V0
203 TTree *fTreeHitLines; //! tree with hit lines
204 char fFnRes[1000]; //! output file name with stored tracks
205 TFile *fFileGenTracks; //! output file with stored fTreeGenTracks
207 AliRunLoader * fLoader; //! pointer to the run loader
208 TTree * fTreeD; //! current tree with digits
209 TTree * fTreeTR; //! current tree with TR
210 AliStack *fStack; //! current stack
212 AliMCInfo ** fGenInfo; //! array with pointers to gen info
213 Int_t fNInfos; //! number of tracks with infos
215 AliTPCParam* fParamTPC; //! AliTPCParam
216 Float_t fVPrim[3]; //! primary vertex position
217 // the fVDist[3] contains size of the 3-vector
220 Double_t fTPCPtCut; // do not store particles with generated pT less than this
221 Double_t fITSPtCut; // do not store particles with generated pT less than this
222 Double_t fTRDPtCut; // do not store particles with generated pT less than this
223 Double_t fTOFPtCut; // do not store particles with generated pT less than this
225 ClassDef(AliGenInfoMaker,0) // class which creates and fills tree with TPCGenTrack objects
232 AliTPCParam * GetTPCParam();
233 Float_t TPCBetheBloch(Float_t bg);