]>
Commit | Line | Data |
---|---|---|
7699f61f | 1 | |
2 | ||
e0d98ba6 | 3 | |
4 | class AliTPCComparisonDraw: public TObject{ | |
5 | public: | |
6 | AliTPCComparisonDraw(){fTree = 0;} | |
7 | void SetIO(const char *fname = "cmpTracks.root"); | |
8 | void ResPt(); | |
9 | void Eff(); | |
10 | // | |
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); | |
14 | ||
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); | |
17 | // | |
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); | |
20 | ||
21 | ||
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); | |
24 | // | |
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); | |
28 | ||
29 | ||
30 | ||
31 | TTree * fTree; // | |
32 | ||
33 | ClassDef(AliTPCComparisonDraw,1) | |
34 | }; | |
35 | ClassImp(AliTPCComparisonDraw) | |
36 | ||
37 | ||
38 | ||
39 | ||
7699f61f | 40 | //////////////////////////////////////////////////////////////////////// |
41 | // | |
42 | // Start of implementation of the class digitRow | |
43 | // | |
44 | //////////////////////////////////////////////////////////////////////// | |
45 | const Int_t kgRowBytes = 32; | |
46 | ||
47 | class digitRow: public TObject { | |
48 | ||
49 | public: | |
50 | digitRow(); | |
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); | |
56 | Int_t Last(); | |
57 | Int_t First(); | |
58 | void Reset(); | |
59 | ||
60 | //private: | |
61 | UChar_t fDig[kgRowBytes]; | |
7699f61f | 62 | ClassDef(digitRow,1) // container for digit pattern |
63 | }; | |
64 | ClassImp(digitRow) | |
65 | ||
66 | ||
67 | //////////////////////////////////////////////////////////////////////// | |
68 | // | |
69 | // Start of implementation of the class AliTPCGenInfo | |
70 | // | |
71 | //////////////////////////////////////////////////////////////////////// | |
72 | ||
73 | class AliTPCGenInfo: public TObject { | |
74 | ||
75 | public: | |
76 | AliTPCGenInfo(); | |
77 | ~AliTPCGenInfo(); | |
e0d98ba6 | 78 | void Update(); |
7699f61f | 79 | |
e0d98ba6 | 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 | |
7699f61f | 83 | TParticle fParticle; // generated particle |
84 | Int_t fLabel; // track label | |
85 | Int_t fEventNr; // event number | |
e0d98ba6 | 86 | Int_t fMCtracks; // indication of how many times the track is retuturned back |
87 | Int_t fPdg; //pdg code | |
7699f61f | 88 | Float_t fDecayCoord[3]; // position of particle decay |
89 | Double_t fVDist[4]; //distance of the particle vertex from primary vertex | |
e0d98ba6 | 90 | Bool_t fTPCdecay; //indicates decay in TPC |
7699f61f | 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 | |
99 | }; | |
100 | ClassImp(AliTPCGenInfo) | |
101 | ||
102 | ||
103 | ||
104 | class AliTPCGenV0Info: public TObject { | |
105 | public: | |
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 | |
111 | // | |
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 | |
116 | // | |
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 | |
124 | }; | |
125 | ClassImp(AliTPCGenV0Info) | |
126 | ||
127 | ||
128 | ||
129 | void AliTPCGenV0Info::Update() | |
130 | { | |
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]+ | |
139 | fX[1]*fX[1]); | |
140 | fPdg[0] = fMCd.fParticle.GetPdgCode(); | |
141 | fPdg[1] = fMCm.fParticle.GetPdgCode(); | |
142 | // | |
143 | fLab[0] = fMCd.fParticle.GetUniqueID(); | |
144 | fLab[1] = fMCm.fParticle.GetUniqueID(); | |
145 | ||
146 | } | |
147 | ||
148 | ||
149 | ||
150 | ||
151 | ///////////////////////////////////////////////////////////////////////// | |
152 | class AliTPCRecInfo: public TObject { | |
153 | ||
154 | public: | |
155 | AliTPCRecInfo(){fTP = new TClonesArray("AliTPCTrackPoint2",0);} | |
156 | ~AliTPCRecInfo(){if (fTP) {fTP->Delete();delete fTP;}} | |
157 | // | |
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 | |
e0d98ba6 | 167 | TClonesArray *fTP; //!container with track points |
7699f61f | 168 | void Reset(); |
169 | // | |
170 | ClassDef(AliTPCRecInfo,1) // container for | |
171 | }; | |
172 | ClassImp(AliTPCRecInfo) | |
173 | ||
174 | void AliTPCRecInfo::Reset() | |
175 | { | |
176 | fMultiple =0; | |
177 | fFake =0; | |
178 | fReconstructed=0; | |
179 | fRecPhi =0; | |
180 | fLambda =0; | |
181 | } | |
182 | ||
183 | ||
184 | ///////////////////////////////////////////////////////// | |
185 | ///////////////////////////////////////////////////////// | |
186 | ///////////////////////////////////////////////////////// | |
187 | ||
188 | ||
189 | class AliTPCRecV0Info: public TObject { | |
190 | public: | |
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 | |
195 | // | |
196 | Double_t fPdr[3]; //momentum at vertex daughter - according approx at DCA | |
197 | Double_t fXr[3]; //rec. position according helix | |
198 | // | |
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 | |
204 | }; | |
205 | ||
206 | ClassImp(AliTPCRecV0Info) | |
207 | ||
208 | ||
209 | ||
210 | ||
211 | ||
212 | ||
213 | //////////////////////////////////////////////////////////////////////// | |
214 | // | |
215 | // Start of implementation of the class TPCFindGenTracks | |
216 | // | |
217 | //////////////////////////////////////////////////////////////////////// | |
218 | ||
219 | class TPCFindGenTracks { | |
220 | ||
221 | public: | |
222 | TPCFindGenTracks(); | |
e0d98ba6 | 223 | TPCFindGenTracks(const char * fnGalice, const char* fnRes ="genTracks.root", |
7699f61f | 224 | Int_t nEvents=1, Int_t firstEvent=0); |
225 | virtual ~TPCFindGenTracks(); | |
226 | void Reset(); | |
227 | Int_t Exec(); | |
228 | Int_t Exec(Int_t nEvents, Int_t firstEventNr); | |
229 | void CreateTreeGenTracks(); | |
230 | void CloseOutputFile(); | |
231 | Int_t TreeKLoop(); | |
232 | Int_t TreeTRLoop(); | |
233 | Int_t TreeDLoop(); | |
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); | |
e0d98ba6 | 239 | Int_t CloseIOEvent(); |
240 | Int_t CloseIO(); | |
7699f61f | 241 | Int_t SetIO(); |
242 | Float_t TR2LocalX(AliTrackReference *trackRef, | |
243 | AliTPCParam *paramTPC); | |
244 | ||
245 | public: | |
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 | |
e0d98ba6 | 254 | char fFnRes[1000]; //! output file name with stored tracks |
7699f61f | 255 | TFile *fFileGenTracks; //! output file with stored fTreeGenTracks |
256 | // | |
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 | |
261 | // | |
262 | digitRow *fContainerDigitRow; //! big container for partial information | |
263 | // | |
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 | |
e0d98ba6 | 267 | AliTrackReference *fDecayRef; //! container with decay track references |
7699f61f | 268 | // |
269 | AliTPCParam* fParamTPC; //! AliTPCParam | |
270 | Double_t fVPrim[3]; //! primary vertex position | |
271 | // the fVDist[3] contains size of the 3-vector | |
272 | ||
273 | private: | |
274 | ||
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 | |
927d593f | 280 | static const Double_t kRaddeg = 180./3.14159265358979312; |
7699f61f | 281 | |
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 | |
284 | ||
285 | static const Int_t fgMaxParticles = 2000000; // maximum number of generated particles | |
e0d98ba6 | 286 | static const Double_t fgPtCut = 0.05; // do not store particles with generated pT less than this |
287 | ||
7699f61f | 288 | ClassDef(TPCFindGenTracks,1) // class which creates and fills tree with TPCGenTrack objects |
289 | }; | |
290 | ClassImp(TPCFindGenTracks) | |
291 | ||
292 | ||
293 | ||
294 | //////////////////////////////////////////////////////////////////////// | |
295 | // | |
296 | // Start of implementation of the class TPCCmpTr | |
297 | // | |
298 | //////////////////////////////////////////////////////////////////////// | |
299 | ||
300 | class TPCCmpTr { | |
301 | ||
302 | public: | |
303 | TPCCmpTr(); | |
e0d98ba6 | 304 | TPCCmpTr(const char* fnGenTracks, |
305 | const char* fnCmpRes ="cmpTracks.root", | |
306 | const char* fnGalice ="galice.root", | |
7699f61f | 307 | Int_t nEvents=1, Int_t firstEvent=0); |
308 | virtual ~TPCCmpTr(); | |
309 | void Reset(); | |
310 | Int_t Exec(); | |
311 | Int_t Exec(Int_t nEvents, Int_t firstEventNr); | |
312 | Int_t SetIO(); | |
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;} | |
322 | ||
323 | // tmp method, should go to TrackReferenceTPC | |
324 | TVector3 TR2Local(AliTrackReference *trackRef, | |
325 | AliTPCParam *paramTPC); | |
326 | ||
327 | private: | |
328 | ||
329 | Int_t fEventNr; //! current event number | |
330 | Int_t fNEvents; //! number of events to process | |
331 | Int_t fFirstEventNr; //! first event to process | |
332 | // | |
e0d98ba6 | 333 | char fFnCmp[1000]; //! output file name with cmp tracks |
7699f61f | 334 | TFile *fFileCmp; //! output file with cmp tracks |
335 | TTree *fTreeCmp; //! output tree with cmp tracks | |
336 | // | |
e0d98ba6 | 337 | char fFnGenTracks[1000]; //! input file name with gen tracks |
7699f61f | 338 | TFile *fFileGenTracks; |
339 | TTree *fTreeGenTracks; | |
340 | // | |
341 | // | |
342 | AliRunLoader * fLoader; //! pointer to the run loader | |
343 | TTree *fTreeRecTracks; //! tree with reconstructed tracks | |
344 | TTree *fTreePoints; //! tree with reconstructed points | |
345 | // | |
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 | |
349 | // | |
350 | TObjArray * fTracks; //!container with tracks | |
351 | TObjArray * fTrackPoints; //! container with track points | |
352 | // | |
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 | |
357 | // | |
358 | AliTPCGenInfo* fMCInfo; //! MC information writen per particle | |
359 | AliTPCRecInfo* fRecInfo; //! Rec. information writen per particle | |
360 | // | |
361 | AliTPCtrack *fTPCTrack; //! pointer to TPC track to connect branch | |
362 | ||
363 | ClassDef(TPCCmpTr,1) // class which creates and fills tree with TPCGenTrack objects | |
364 | }; | |
365 | ClassImp(TPCCmpTr) | |
366 | ||
e0d98ba6 | 367 | |
368 |