3 ////////////////////////////////////////////////////////////////////////
5 // Start of implementation of the class digitRow
7 ////////////////////////////////////////////////////////////////////////
8 const Int_t kgRowBytes = 32;
10 class digitRow: public TObject {
14 virtual ~digitRow(){;}
15 void SetRow(Int_t row);
16 Bool_t TestRow(Int_t row);
17 digitRow & operator=(const digitRow &digOld);
18 Int_t RowsOn(Int_t upto=8*kgRowBytes);
24 UChar_t fDig[kgRowBytes];
26 ClassDef(digitRow,1) // container for digit pattern
31 ////////////////////////////////////////////////////////////////////////
33 // Start of implementation of the class AliTPCGenInfo
35 ////////////////////////////////////////////////////////////////////////
37 class AliTPCGenInfo: public TObject {
43 AliTrackReference fTrackRef; // track reference saved in the output tree
44 AliTrackReference fTrackRefOut; // decay track reference saved in the output tree
45 TParticle fParticle; // generated particle
46 Int_t fLabel; // track label
47 Int_t fEventNr; // event number
49 Float_t fDecayCoord[3]; // position of particle decay
50 Double_t fVDist[4]; //distance of the particle vertex from primary vertex
52 Int_t fRowsWithDigitsInn; // number of rows with digits in the inner sectors
53 Int_t fRowsWithDigits; // number of rows with digits in the outer sectors
54 Int_t fRowsTrackLength; // last - first row with digit
55 Int_t fDigitsInSeed; // digits in the default seed rows
56 Float_t fPrim; // theoretical dedx in tpc according particle momenta and mass
57 digitRow fRow; // information about digits row pattern
58 TClonesArray * fReferences; //containner with all track references
59 ClassDef(AliTPCGenInfo,1) // container for
61 ClassImp(AliTPCGenInfo)
65 class AliTPCGenV0Info: public TObject {
67 AliTPCGenInfo fMCd; //info about daughter particle
68 AliTPCGenInfo fMCm; //info about mother particle
69 void Update(); // put some derived info to special field
70 Double_t fDist1; //info about closest distance according closest MC - linear DCA
71 Double_t fDist2; //info about closest distance parabolic DCA
73 Double_t fPdr[3]; //momentum at vertex daughter - according approx at DCA
74 Double_t fPd[4]; //exact momentum from MC info
75 Double_t fX[3]; //exact position of the vertex
76 Double_t fXr[3]; //rec. position according helix
78 Double_t fPm[3]; //momentum at the vertex mother
79 Double_t fAngle[3]; //three angels
80 Double_t fRr; // rec position of the vertex
81 Double_t fR; //exact r position of the vertex
82 Int_t fPdg[2]; //pdg code of mother and daugter particles
83 Int_t fLab[2]; //MC label of the partecle
84 ClassDef(AliTPCGenV0Info,1) // container for
86 ClassImp(AliTPCGenV0Info)
90 void AliTPCGenV0Info::Update()
92 fPd[0] = fMCd.fParticle.Px();
93 fPd[1] = fMCd.fParticle.Py();
94 fPd[2] = fMCd.fParticle.Pz();
95 fPd[3] = fMCd.fParticle.P();
96 fX[0] = fMCd.fParticle.Vx();
97 fX[1] = fMCd.fParticle.Vy();
98 fX[2] = fMCd.fParticle.Vz();
99 fR = TMath::Sqrt( fX[0]*fX[0]+
101 fPdg[0] = fMCd.fParticle.GetPdgCode();
102 fPdg[1] = fMCm.fParticle.GetPdgCode();
104 fLab[0] = fMCd.fParticle.GetUniqueID();
105 fLab[1] = fMCm.fParticle.GetUniqueID();
112 /////////////////////////////////////////////////////////////////////////
113 class AliTPCRecInfo: public TObject {
116 AliTPCRecInfo(){fTP = new TClonesArray("AliTPCTrackPoint2",0);}
117 ~AliTPCRecInfo(){if (fTP) {fTP->Delete();delete fTP;}}
119 AliTPCtrack fTPCTrack; // tpc track
120 Float_t fTRLocalCoord[3]; //local coordinates of the track ref.
121 Int_t fReconstructed; //flag if track was reconstructed
122 Double_t fRecPhi; // reconstructed phi angle (0;2*kPI)
123 Double_t fLambda; // reconstructed
124 Double_t fRecPt_1; // reconstructed
125 Float_t fdEdx; // reconstructed dEdx
126 Int_t fFake; // fake track
127 Int_t fMultiple; // number of reconstructions
128 TClonesArray *fTP; //container with track points
131 ClassDef(AliTPCRecInfo,1) // container for
133 ClassImp(AliTPCRecInfo)
135 void AliTPCRecInfo::Reset()
145 /////////////////////////////////////////////////////////
146 /////////////////////////////////////////////////////////
147 /////////////////////////////////////////////////////////
150 class AliTPCRecV0Info: public TObject {
152 AliTPCRecInfo fT1; //track1
153 AliTPCRecInfo fT2; //track2
154 Double_t fDist1; //info about closest distance according closest MC - linear DCA
155 Double_t fDist2; //info about closest distance parabolic DCA
157 Double_t fPdr[3]; //momentum at vertex daughter - according approx at DCA
158 Double_t fXr[3]; //rec. position according helix
160 Double_t fPm[3]; //momentum at the vertex mother
161 Double_t fAngle[3]; //three angles
162 Double_t fRr; // rec position of the vertex
163 Int_t fLab[2]; //MC label of the partecle
164 ClassDef(AliTPCRecV0Info,1) // container for
167 ClassImp(AliTPCRecV0Info)
174 ////////////////////////////////////////////////////////////////////////
176 // Start of implementation of the class TPCFindGenTracks
178 ////////////////////////////////////////////////////////////////////////
180 class TPCFindGenTracks {
184 TPCFindGenTracks(char* fnHits,
185 char* fnDigits ="tpc.digits.root",
186 char* fnRes ="genTracks.root",
187 Int_t nEvents=1, Int_t firstEvent=0);
188 virtual ~TPCFindGenTracks();
191 Int_t Exec(Int_t nEvents, Int_t firstEventNr);
192 void CreateTreeGenTracks();
193 void CloseOutputFile();
197 //void FillInfo(Int_t iParticle);
198 void SetFirstEventNr(Int_t i) {fFirstEventNr = i;}
199 void SetNEvents(Int_t i) {fNEvents = i;}
200 void SetDebug(Int_t level) {fDebug = level;}
201 Int_t SetIO(Int_t eventNr);
203 Float_t TR2LocalX(AliTrackReference *trackRef,
204 AliTPCParam *paramTPC);
207 AliTPCGenInfo* fMCInfo; //! information writen per particle
208 Int_t fDebug; //! debug flag
209 Int_t fEventNr; //! current event number
210 Int_t fLabel; //! track label
211 Int_t fNEvents; //! number of events to process
212 Int_t fFirstEventNr; //! first event to process
213 Int_t fNParticles; //! number of particles in TreeK
214 TTree *fTreeGenTracks; //! output tree with generated tracks
215 char *fFnRes; //! output file name with stored tracks
216 char *fFnHits; //! input file name with hits
217 char *fFnDigits; //! input file name with digits
218 TFile *fFileGenTracks; //! output file with stored fTreeGenTracks
219 TFile *fFileHits; //! input file with hits
220 TFile *fFileTreeD; //! input file with digits
222 TTree * fTreeD; //! current tree with digits
223 TTree * fTreeTR; //! current tree with TR
224 AliStack *fStack; //! current stack
226 digitRow *fContainerDigitRow; //! big container for partial information
228 AliTrackReference *fReferences; //! container with track references
229 Int_t *fReferenceIndex0; //! first index for given track
230 Int_t *fReferenceIndex1; //! last index for given track
232 AliTPCParam* fParamTPC; //! AliTPCParam
233 Double_t fVPrim[3]; //! primary vertex position
234 // the fVDist[3] contains size of the 3-vector
238 // some constants for the original non-pareller tracking (by Y.Belikov)
239 static const Int_t seedRow11 = 158; // nRowUp - 1
240 static const Int_t seedRow12 = 139; // nRowUp - 1 - (Int_t) 0.125*nRowUp
241 static const Int_t seedRow21 = 149; // seedRow11 - shift
242 static const Int_t seedRow22 = 130; // seedRow12 - shift
243 static const Double_t kRaddeg = 180./kPI;
245 static const Int_t fgMaxIndexTR = 50000; // maximum number of tracks with a track ref
246 static const Int_t fgMaxTR = 1000000; // maximum number of track refs
248 static const Int_t fgMaxParticles = 2000000; // maximum number of generated particles
249 static const Double_t fgPtCut = .1; // do not store particles with generated pT less than this
250 static const Float_t fgTrackRefLocalXMax = 82.95;
251 static const Float_t fgTrackRefLocalXMaxDelta = 5.;
253 ClassDef(TPCFindGenTracks,1) // class which creates and fills tree with TPCGenTrack objects
255 ClassImp(TPCFindGenTracks)
259 ////////////////////////////////////////////////////////////////////////
261 // Start of implementation of the class TPCCmpTr
263 ////////////////////////////////////////////////////////////////////////
269 TPCCmpTr(char* fnRecTracks,
270 char* fnGenTracks ="genTracks.root",
271 char* fnCmpRes ="cmpTracks.root",
272 char* fnGalice ="galice.root",
273 Int_t nEvents=1, Int_t firstEvent=0);
277 Int_t Exec(Int_t nEvents, Int_t firstEventNr);
278 void CreateTreeCmp();
279 void CloseOutputFile();
280 Bool_t ConnectGenTree();
281 Int_t TreeGenLoop(Int_t eventNr);
282 Int_t TreeTLoop(Int_t eventNr);
283 void SetFirstEventNr(Int_t i) {fFirstEventNr = i;}
284 void SetNEvents(Int_t i) {fNEvents = i;}
285 void SetDebug(Int_t level) {fDebug = level;}
287 // tmp method, should go to TrackReferenceTPC
288 TVector3 TR2Local(AliTrackReference *trackRef,
289 AliTPCParam *paramTPC);
293 Int_t fEventNr; //! current event number
294 Int_t fNEvents; //! number of events to process
295 Int_t fFirstEventNr; //! first event to process
297 char *fFnCmp; //! output file name with cmp tracks
298 TFile *fFileCmp; //! output file with cmp tracks
299 TTree *fTreeCmp; //! output tree with cmp tracks
301 char *fFnGenTracks; //! input file name with gen tracks
302 TFile *fFileGenTracks;
303 TTree *fTreeGenTracks;
305 char *fFnHits; //! input file name with gAlice object (needed for B)
306 TFile *fFileHits; //! input file with gAlice
308 char *fFnRecTracks; //! input file name with tpc rec. tracks
309 TFile *fFileRecTracks; //! input file with reconstructed tracks
310 TTree *fTreeRecTracks; //! tree with reconstructed tracks
311 TTree *fTreePoints; //! tree with reconstructed points
313 Int_t *fIndexRecTracks; //! index of particle label in the TreeT_TPC
314 Int_t *fFakeRecTracks; //! number of fake tracks
315 Int_t *fMultiRecTracks; //! number of multiple reconstructions
317 TObjArray * fTracks; //!container with tracks
318 TObjArray * fTrackPoints; //! container with track points
320 AliTPCParam* fParamTPC; //! AliTPCParam
321 Int_t fNParticles; //! number of particles in the input tree genTracks
322 Int_t fDebug; //! debug flag
323 Int_t fNextTreeGenEntryToRead; //! last entry already read from genTracks tree
325 AliTPCGenInfo* fMCInfo; //! MC information writen per particle
326 AliTPCRecInfo* fRecInfo; //! Rec. information writen per particle
328 AliTPCtrack *fTPCTrack; //! pointer to TPC track to connect branch
330 ClassDef(TPCCmpTr,1) // class which creates and fills tree with TPCGenTrack objects