4 class AliTPCComparisonDraw: public TObject{
6 AliTPCComparisonDraw(){fTree = 0;}
7 void SetIO(const char *fname = "cmpTracks.root");
11 TH1F * EffVsPt(const char* selection, const char * quality, Float_t min=0.15, Float_t max=3.);
12 TH1F * EffVsRM(const char* selection, const char * quality, Float_t min=90, Float_t max=250, Int_t nBins=10);
13 TH1F * EffVsRS(const char* selection, const char * quality, Float_t min=90, Float_t max=250, Int_t nBins=10);
15 TH1F * ResPtvsPt(const char* selection, const char * quality, Float_t min=0.15, Float_t max=5., Int_t nBins=10);
16 TH1F * MeanPtvsPt(const char* selection, const char * quality, Float_t min=0.15, Float_t max=5., Int_t nBins=10);
18 TH1F * ResdEdxvsN(const char* selection, const char * quality, Float_t min=50, Float_t max=150., Int_t nBins=10);
19 // TH1F * MeandEdxvsN(const char* selection, const char * quality, Float_t min=50, Float_t max=150., Int_t nBins=10);
22 static void AliLabelAxes(TH1* histo, const char* xAxisTitle, const char* yAxisTitle);
23 Double_t* CreateLogBins(Int_t nBins, Double_t xMin, Double_t xMax);
25 static TH1F* CreateEffHisto(TH1F* hGen, TH1F* hRec);
26 static TH1F* CreateResHisto(TH2F* hRes2, TH1F **phMean,
27 Bool_t drawBinFits = kTRUE,Bool_t overflowBinFits = kFALSE);
33 ClassDef(AliTPCComparisonDraw,1)
35 ClassImp(AliTPCComparisonDraw)
40 ////////////////////////////////////////////////////////////////////////
42 // Start of implementation of the class digitRow
44 ////////////////////////////////////////////////////////////////////////
45 const Int_t kgRowBytes = 32;
47 class digitRow: public TObject {
51 virtual ~digitRow(){;}
52 void SetRow(Int_t row);
53 Bool_t TestRow(Int_t row);
54 digitRow & operator=(const digitRow &digOld);
55 Int_t RowsOn(Int_t upto=8*kgRowBytes);
61 UChar_t fDig[kgRowBytes];
62 ClassDef(digitRow,1) // container for digit pattern
67 ////////////////////////////////////////////////////////////////////////
69 // Start of implementation of the class AliTPCGenInfo
71 ////////////////////////////////////////////////////////////////////////
73 class AliTPCGenInfo: public TObject {
80 AliTrackReference fTrackRef; // track reference saved in the output tree
81 AliTrackReference fTrackRefOut; // decay track reference saved in the output tree
82 AliTrackReference fTRdecay; // track reference at decay point
83 TParticle fParticle; // generated particle
84 Int_t fLabel; // track label
85 Int_t fEventNr; // event number
86 Int_t fMCtracks; // indication of how many times the track is retuturned back
87 Int_t fPdg; //pdg code
88 Float_t fDecayCoord[3]; // position of particle decay
89 Double_t fVDist[4]; //distance of the particle vertex from primary vertex
90 Bool_t fTPCdecay; //indicates decay in TPC
91 Int_t fRowsWithDigitsInn; // number of rows with digits in the inner sectors
92 Int_t fRowsWithDigits; // number of rows with digits in the outer sectors
93 Int_t fRowsTrackLength; // last - first row with digit
94 Int_t fDigitsInSeed; // digits in the default seed rows
95 Float_t fPrim; // theoretical dedx in tpc according particle momenta and mass
96 digitRow fRow; // information about digits row pattern
97 TClonesArray * fReferences; //containner with all track references
98 ClassDef(AliTPCGenInfo,1) // container for
100 ClassImp(AliTPCGenInfo)
104 class AliTPCGenV0Info: public TObject {
106 AliTPCGenInfo fMCd; //info about daughter particle
107 AliTPCGenInfo fMCm; //info about mother particle
108 void Update(); // put some derived info to special field
109 Double_t fDist1; //info about closest distance according closest MC - linear DCA
110 Double_t fDist2; //info about closest distance parabolic DCA
112 Double_t fPdr[3]; //momentum at vertex daughter - according approx at DCA
113 Double_t fPd[4]; //exact momentum from MC info
114 Double_t fX[3]; //exact position of the vertex
115 Double_t fXr[3]; //rec. position according helix
117 Double_t fPm[3]; //momentum at the vertex mother
118 Double_t fAngle[3]; //three angels
119 Double_t fRr; // rec position of the vertex
120 Double_t fR; //exact r position of the vertex
121 Int_t fPdg[2]; //pdg code of mother and daugter particles
122 Int_t fLab[2]; //MC label of the partecle
123 ClassDef(AliTPCGenV0Info,1) // container for
125 ClassImp(AliTPCGenV0Info)
129 void AliTPCGenV0Info::Update()
131 fPd[0] = fMCd.fParticle.Px();
132 fPd[1] = fMCd.fParticle.Py();
133 fPd[2] = fMCd.fParticle.Pz();
134 fPd[3] = fMCd.fParticle.P();
135 fX[0] = fMCd.fParticle.Vx();
136 fX[1] = fMCd.fParticle.Vy();
137 fX[2] = fMCd.fParticle.Vz();
138 fR = TMath::Sqrt( fX[0]*fX[0]+
140 fPdg[0] = fMCd.fParticle.GetPdgCode();
141 fPdg[1] = fMCm.fParticle.GetPdgCode();
143 fLab[0] = fMCd.fParticle.GetUniqueID();
144 fLab[1] = fMCm.fParticle.GetUniqueID();
151 /////////////////////////////////////////////////////////////////////////
152 class AliTPCRecInfo: public TObject {
155 AliTPCRecInfo(){fTP = new TClonesArray("AliTPCTrackPoint2",0);}
156 ~AliTPCRecInfo(){if (fTP) {fTP->Delete();delete fTP;}}
158 AliTPCtrack fTPCTrack; // tpc track
159 Float_t fTRLocalCoord[3]; //local coordinates of the track ref.
160 Int_t fReconstructed; //flag if track was reconstructed
161 Double_t fRecPhi; // reconstructed phi angle (0;2*kPI)
162 Double_t fLambda; // reconstructed
163 Double_t fRecPt_1; // reconstructed
164 Float_t fdEdx; // reconstructed dEdx
165 Int_t fFake; // fake track
166 Int_t fMultiple; // number of reconstructions
167 TClonesArray *fTP; //!container with track points
170 ClassDef(AliTPCRecInfo,1) // container for
172 ClassImp(AliTPCRecInfo)
174 void AliTPCRecInfo::Reset()
184 /////////////////////////////////////////////////////////
185 /////////////////////////////////////////////////////////
186 /////////////////////////////////////////////////////////
189 class AliTPCRecV0Info: public TObject {
191 AliTPCRecInfo fT1; //track1
192 AliTPCRecInfo fT2; //track2
193 Double_t fDist1; //info about closest distance according closest MC - linear DCA
194 Double_t fDist2; //info about closest distance parabolic DCA
196 Double_t fPdr[3]; //momentum at vertex daughter - according approx at DCA
197 Double_t fXr[3]; //rec. position according helix
199 Double_t fPm[3]; //momentum at the vertex mother
200 Double_t fAngle[3]; //three angles
201 Double_t fRr; // rec position of the vertex
202 Int_t fLab[2]; //MC label of the partecle
203 ClassDef(AliTPCRecV0Info,1) // container for
206 ClassImp(AliTPCRecV0Info)
213 ////////////////////////////////////////////////////////////////////////
215 // Start of implementation of the class TPCFindGenTracks
217 ////////////////////////////////////////////////////////////////////////
219 class TPCFindGenTracks {
223 TPCFindGenTracks(const char * fnGalice, const char* fnRes ="genTracks.root",
224 Int_t nEvents=1, Int_t firstEvent=0);
225 virtual ~TPCFindGenTracks();
228 Int_t Exec(Int_t nEvents, Int_t firstEventNr);
229 void CreateTreeGenTracks();
230 void CloseOutputFile();
234 //void FillInfo(Int_t iParticle);
235 void SetFirstEventNr(Int_t i) {fFirstEventNr = i;}
236 void SetNEvents(Int_t i) {fNEvents = i;}
237 void SetDebug(Int_t level) {fDebug = level;}
238 Int_t SetIO(Int_t eventNr);
239 Int_t CloseIOEvent();
242 Float_t TR2LocalX(AliTrackReference *trackRef,
243 AliTPCParam *paramTPC);
246 AliTPCGenInfo* fMCInfo; //! information writen per particle
247 Int_t fDebug; //! debug flag
248 Int_t fEventNr; //! current event number
249 Int_t fLabel; //! track label
250 Int_t fNEvents; //! number of events to process
251 Int_t fFirstEventNr; //! first event to process
252 Int_t fNParticles; //! number of particles in TreeK
253 TTree *fTreeGenTracks; //! output tree with generated tracks
254 char fFnRes[1000]; //! output file name with stored tracks
255 TFile *fFileGenTracks; //! output file with stored fTreeGenTracks
257 AliRunLoader * fLoader; //! pointer to the run loader
258 TTree * fTreeD; //! current tree with digits
259 TTree * fTreeTR; //! current tree with TR
260 AliStack *fStack; //! current stack
262 digitRow *fContainerDigitRow; //! big container for partial information
264 AliTrackReference *fReferences; //! container with track references
265 Int_t *fReferenceIndex0; //! first index for given track
266 Int_t *fReferenceIndex1; //! last index for given track
267 AliTrackReference *fDecayRef; //! container with decay track references
269 AliTPCParam* fParamTPC; //! AliTPCParam
270 Double_t fVPrim[3]; //! primary vertex position
271 // the fVDist[3] contains size of the 3-vector
275 // some constants for the original non-pareller tracking (by Y.Belikov)
276 static const Int_t seedRow11 = 158; // nRowUp - 1
277 static const Int_t seedRow12 = 139; // nRowUp - 1 - (Int_t) 0.125*nRowUp
278 static const Int_t seedRow21 = 149; // seedRow11 - shift
279 static const Int_t seedRow22 = 130; // seedRow12 - shift
280 static const Double_t kRaddeg = 180./3.14159265358979312;
282 static const Int_t fgMaxIndexTR = 50000; // maximum number of tracks with a track ref
283 static const Int_t fgMaxTR = 1000000; // maximum number of track refs
285 static const Int_t fgMaxParticles = 2000000; // maximum number of generated particles
286 static const Double_t fgPtCut = 0.05; // do not store particles with generated pT less than this
288 ClassDef(TPCFindGenTracks,1) // class which creates and fills tree with TPCGenTrack objects
290 ClassImp(TPCFindGenTracks)
294 ////////////////////////////////////////////////////////////////////////
296 // Start of implementation of the class TPCCmpTr
298 ////////////////////////////////////////////////////////////////////////
304 TPCCmpTr(const char* fnGenTracks,
305 const char* fnCmpRes ="cmpTracks.root",
306 const char* fnGalice ="galice.root",
307 Int_t nEvents=1, Int_t firstEvent=0);
311 Int_t Exec(Int_t nEvents, Int_t firstEventNr);
313 Int_t SetIO(Int_t eventNr );
314 void CreateTreeCmp();
315 void CloseOutputFile();
316 Bool_t ConnectGenTree();
317 Int_t TreeGenLoop(Int_t eventNr);
318 Int_t TreeTLoop(Int_t eventNr);
319 void SetFirstEventNr(Int_t i) {fFirstEventNr = i;}
320 void SetNEvents(Int_t i) {fNEvents = i;}
321 void SetDebug(Int_t level) {fDebug = level;}
323 // tmp method, should go to TrackReferenceTPC
324 TVector3 TR2Local(AliTrackReference *trackRef,
325 AliTPCParam *paramTPC);
329 Int_t fEventNr; //! current event number
330 Int_t fNEvents; //! number of events to process
331 Int_t fFirstEventNr; //! first event to process
333 char fFnCmp[1000]; //! output file name with cmp tracks
334 TFile *fFileCmp; //! output file with cmp tracks
335 TTree *fTreeCmp; //! output tree with cmp tracks
337 char fFnGenTracks[1000]; //! input file name with gen tracks
338 TFile *fFileGenTracks;
339 TTree *fTreeGenTracks;
342 AliRunLoader * fLoader; //! pointer to the run loader
343 TTree *fTreeRecTracks; //! tree with reconstructed tracks
344 TTree *fTreePoints; //! tree with reconstructed points
346 Int_t *fIndexRecTracks; //! index of particle label in the TreeT_TPC
347 Int_t *fFakeRecTracks; //! number of fake tracks
348 Int_t *fMultiRecTracks; //! number of multiple reconstructions
350 TObjArray * fTracks; //!container with tracks
351 TObjArray * fTrackPoints; //! container with track points
353 AliTPCParam* fParamTPC; //! AliTPCParam
354 Int_t fNParticles; //! number of particles in the input tree genTracks
355 Int_t fDebug; //! debug flag
356 Int_t fNextTreeGenEntryToRead; //! last entry already read from genTracks tree
358 AliTPCGenInfo* fMCInfo; //! MC information writen per particle
359 AliTPCRecInfo* fRecInfo; //! Rec. information writen per particle
361 AliTPCtrack *fTPCTrack; //! pointer to TPC track to connect branch
363 ClassDef(TPCCmpTr,1) // class which creates and fills tree with TPCGenTrack objects