]>
Commit | Line | Data |
---|---|---|
0b75bef2 | 1 | #include "AliESDtrackCuts.h" |
2 | ||
aa93c798 | 3 | |
4 | #include <AliESDtrack.h> | |
5 | #include <AliESD.h> | |
6 | #include <AliLog.h> | |
7 | ||
0b75bef2 | 8 | //____________________________________________________________________ |
f58f1a93 | 9 | ClassImp(AliESDtrackCuts) |
0b75bef2 | 10 | |
ebd60d8e | 11 | // Cut names |
ab2c1f0d | 12 | const Char_t* AliESDtrackCuts::fgkCutNames[kNCuts] = { |
ebd60d8e | 13 | "require TPC refit", |
14 | "require ITS refit", | |
15 | "n clusters TPC", | |
16 | "n clusters ITS", | |
17 | "#Chi^{2}/clusters TPC", | |
18 | "#Chi^{2}/clusters ITS", | |
19 | "cov 11", | |
20 | "cov 22", | |
21 | "cov 33", | |
22 | "cov 44", | |
23 | "cov 55", | |
24 | "trk-to-vtx", | |
25 | "trk-to-vtx failed", | |
26 | "kink daughters", | |
27 | ||
28 | "p", | |
29 | "p_{T}", | |
30 | "p_{x}", | |
31 | "p_{y}", | |
32 | "p_{z}", | |
33 | "y", | |
34 | "eta" | |
35 | }; | |
36 | ||
0b75bef2 | 37 | //____________________________________________________________________ |
ebd60d8e | 38 | AliESDtrackCuts::AliESDtrackCuts() |
39 | { | |
40 | // | |
41 | // constructor | |
42 | // | |
43 | ||
44 | Init(); | |
0b75bef2 | 45 | |
46 | //############################################################################## | |
47 | // setting default cuts | |
0b75bef2 | 48 | SetMinNClustersTPC(); |
ebd60d8e | 49 | SetMinNClustersITS(); |
0b75bef2 | 50 | SetMaxChi2PerClusterTPC(); |
51 | SetMaxChi2PerClusterITS(); | |
52 | SetMaxCovDiagonalElements(); | |
53 | SetRequireTPCRefit(); | |
54 | SetRequireITSRefit(); | |
55 | SetAcceptKingDaughters(); | |
56 | SetMinNsigmaToVertex(); | |
57 | SetRequireSigmaToVertex(); | |
58 | SetPRange(); | |
59 | SetPtRange(); | |
60 | SetPxRange(); | |
61 | SetPyRange(); | |
62 | SetPzRange(); | |
63 | SetEtaRange(); | |
64 | SetRapRange(); | |
65 | ||
66 | SetHistogramsOn(); | |
ebd60d8e | 67 | } |
68 | ||
69 | //_____________________________________________________________________________ | |
70 | AliESDtrackCuts::AliESDtrackCuts(const AliESDtrackCuts &c) : TObject(c) | |
71 | { | |
72 | // | |
73 | // copy constructor | |
74 | // | |
75 | ||
76 | ((AliESDtrackCuts &) c).Copy(*this); | |
77 | } | |
78 | ||
79 | AliESDtrackCuts::~AliESDtrackCuts() | |
80 | { | |
81 | // | |
82 | // destructor | |
83 | // | |
84 | ||
85 | // ## TODO to be implemented | |
86 | } | |
87 | ||
88 | void AliESDtrackCuts::Init() | |
89 | { | |
90 | // | |
91 | // sets everything to zero | |
92 | // | |
93 | ||
ab2c1f0d | 94 | fCutMinNClusterTPC = 0; |
95 | fCutMinNClusterITS = 0; | |
ebd60d8e | 96 | |
ab2c1f0d | 97 | fCutMaxChi2PerClusterTPC = 0; |
98 | fCutMaxChi2PerClusterITS = 0; | |
ebd60d8e | 99 | |
ab2c1f0d | 100 | fCutMaxC11 = 0; |
101 | fCutMaxC22 = 0; | |
102 | fCutMaxC33 = 0; | |
103 | fCutMaxC44 = 0; | |
104 | fCutMaxC55 = 0; | |
ebd60d8e | 105 | |
ab2c1f0d | 106 | fCutAcceptKinkDaughters = 0; |
107 | fCutRequireTPCRefit = 0; | |
108 | fCutRequireITSRefit = 0; | |
ebd60d8e | 109 | |
ab2c1f0d | 110 | fCutNsigmaToVertex = 0; |
111 | fCutSigmaToVertexRequired = 0; | |
ebd60d8e | 112 | |
113 | fPMin = 0; | |
114 | fPMax = 0; | |
115 | fPtMin = 0; | |
116 | fPtMax = 0; | |
117 | fPxMin = 0; | |
118 | fPxMax = 0; | |
119 | fPyMin = 0; | |
120 | fPyMax = 0; | |
121 | fPzMin = 0; | |
122 | fPzMax = 0; | |
123 | fEtaMin = 0; | |
124 | fEtaMax = 0; | |
125 | fRapMin = 0; | |
126 | fRapMax = 0; | |
127 | ||
128 | fHistogramsOn = kFALSE; | |
129 | ||
130 | for (Int_t i=0; i<2; ++i) | |
131 | { | |
132 | fhNClustersITS[i] = 0; | |
133 | fhNClustersTPC[i] = 0; | |
134 | ||
135 | fhChi2PerClusterITS[i] = 0; | |
136 | fhChi2PerClusterTPC[i] = 0; | |
137 | ||
138 | fhC11[i] = 0; | |
139 | fhC22[i] = 0; | |
140 | fhC33[i] = 0; | |
141 | fhC44[i] = 0; | |
142 | fhC55[i] = 0; | |
143 | ||
144 | fhDXY[i] = 0; | |
145 | fhDZ[i] = 0; | |
146 | fhDXYvsDZ[i] = 0; | |
147 | ||
148 | fhDXYNormalized[i] = 0; | |
149 | fhDZNormalized[i] = 0; | |
150 | fhDXYvsDZNormalized[i] = 0; | |
151 | } | |
152 | ||
153 | fhCutStatistics = 0; | |
154 | fhCutCorrelation = 0; | |
155 | } | |
156 | ||
157 | //_____________________________________________________________________________ | |
158 | AliESDtrackCuts &AliESDtrackCuts::operator=(const AliESDtrackCuts &c) | |
159 | { | |
160 | // | |
161 | // Assignment operator | |
162 | // | |
0b75bef2 | 163 | |
ebd60d8e | 164 | if (this != &c) ((AliESDtrackCuts &) c).Copy(*this); |
165 | return *this; | |
166 | } | |
167 | ||
168 | //_____________________________________________________________________________ | |
169 | void AliESDtrackCuts::Copy(TObject &c) const | |
170 | { | |
171 | // | |
172 | // Copy function | |
173 | // | |
174 | ||
175 | AliESDtrackCuts& target = (AliESDtrackCuts &) c; | |
176 | ||
177 | target.Init(); | |
178 | ||
ab2c1f0d | 179 | target.fCutMinNClusterTPC = fCutMinNClusterTPC; |
180 | target.fCutMinNClusterITS = fCutMinNClusterITS; | |
ebd60d8e | 181 | |
ab2c1f0d | 182 | target.fCutMaxChi2PerClusterTPC = fCutMaxChi2PerClusterTPC; |
183 | target.fCutMaxChi2PerClusterITS = fCutMaxChi2PerClusterITS; | |
ebd60d8e | 184 | |
ab2c1f0d | 185 | target.fCutMaxC11 = fCutMaxC11; |
186 | target.fCutMaxC22 = fCutMaxC22; | |
187 | target.fCutMaxC33 = fCutMaxC33; | |
188 | target.fCutMaxC44 = fCutMaxC44; | |
189 | target.fCutMaxC55 = fCutMaxC55; | |
ebd60d8e | 190 | |
ab2c1f0d | 191 | target.fCutAcceptKinkDaughters = fCutAcceptKinkDaughters; |
192 | target.fCutRequireTPCRefit = fCutRequireTPCRefit; | |
193 | target.fCutRequireITSRefit = fCutRequireITSRefit; | |
ebd60d8e | 194 | |
ab2c1f0d | 195 | target.fCutNsigmaToVertex = fCutNsigmaToVertex; |
196 | target.fCutSigmaToVertexRequired = fCutSigmaToVertexRequired; | |
ebd60d8e | 197 | |
198 | target.fPMin = fPMin; | |
199 | target.fPMax = fPMax; | |
200 | target.fPtMin = fPtMin; | |
201 | target.fPtMax = fPtMax; | |
202 | target.fPxMin = fPxMin; | |
203 | target.fPxMax = fPxMax; | |
204 | target.fPyMin = fPyMin; | |
205 | target.fPyMax = fPyMax; | |
206 | target.fPzMin = fPzMin; | |
207 | target.fPzMax = fPzMax; | |
208 | target.fEtaMin = fEtaMin; | |
209 | target.fEtaMax = fEtaMax; | |
210 | target.fRapMin = fRapMin; | |
211 | target.fRapMax = fRapMax; | |
212 | ||
213 | target.fHistogramsOn = fHistogramsOn; | |
214 | ||
215 | for (Int_t i=0; i<2; ++i) | |
216 | { | |
217 | if (fhNClustersITS[i]) target.fhNClustersITS[i] = (TH1F*) fhNClustersITS[i]->Clone(); | |
218 | if (fhNClustersTPC[i]) target.fhNClustersTPC[i] = (TH1F*) fhNClustersTPC[i]->Clone(); | |
219 | ||
220 | if (fhChi2PerClusterITS[i]) target.fhChi2PerClusterITS[i] = (TH1F*) fhChi2PerClusterITS[i]->Clone(); | |
221 | if (fhChi2PerClusterTPC[i]) target.fhChi2PerClusterTPC[i] = (TH1F*) fhChi2PerClusterTPC[i]->Clone(); | |
222 | ||
223 | if (fhC11[i]) target.fhC11[i] = (TH1F*) fhC11[i]->Clone(); | |
224 | if (fhC22[i]) target.fhC22[i] = (TH1F*) fhC22[i]->Clone(); | |
225 | if (fhC33[i]) target.fhC33[i] = (TH1F*) fhC33[i]->Clone(); | |
226 | if (fhC44[i]) target.fhC44[i] = (TH1F*) fhC44[i]->Clone(); | |
227 | if (fhC55[i]) target.fhC55[i] = (TH1F*) fhC55[i]->Clone(); | |
228 | ||
229 | if (fhDXY[i]) target.fhDXY[i] = (TH1F*) fhDXY[i]->Clone(); | |
230 | if (fhDZ[i]) target.fhDZ[i] = (TH1F*) fhDZ[i]->Clone(); | |
231 | if (fhDXYvsDZ[i]) target.fhDXYvsDZ[i] = (TH2F*) fhDXYvsDZ[i]->Clone(); | |
232 | ||
233 | if (fhDXYNormalized[i]) target.fhDXYNormalized[i] = (TH1F*) fhDXYNormalized[i]->Clone(); | |
234 | if (fhDZNormalized[i]) target.fhDZNormalized[i] = (TH1F*) fhDZNormalized[i]->Clone(); | |
235 | if (fhDXYvsDZNormalized[i]) target.fhDXYvsDZNormalized[i] = (TH2F*) fhDXYvsDZNormalized[i]->Clone(); | |
236 | } | |
237 | ||
238 | if (fhCutStatistics) target.fhCutStatistics = (TH1F*) fhCutStatistics->Clone(); | |
239 | if (fhCutCorrelation) target.fhCutCorrelation = (TH2F*) fhCutCorrelation->Clone(); | |
0b75bef2 | 240 | |
ebd60d8e | 241 | TObject::Copy(c); |
0b75bef2 | 242 | } |
243 | ||
0b75bef2 | 244 | //____________________________________________________________________ |
245 | Bool_t | |
246 | AliESDtrackCuts::AcceptTrack(AliESDtrack* esdTrack) { | |
247 | // | |
248 | // figure out if the tracks survives all the track cuts defined | |
249 | // | |
ab2c1f0d | 250 | // the different quality parameter and kinematic values are first |
251 | // retrieved from the track. then it is found out what cuts the | |
252 | // track did not survive and finally the cuts are imposed. | |
0b75bef2 | 253 | |
1ae6c515 | 254 | |
255 | ||
0b75bef2 | 256 | UInt_t status = esdTrack->GetStatus(); |
ebd60d8e | 257 | |
258 | // dummy array | |
259 | Int_t fIdxInt[200]; | |
260 | ||
0b75bef2 | 261 | // getting quality parameters from the ESD track |
262 | Int_t nClustersITS = esdTrack->GetITSclusters(fIdxInt); | |
263 | Int_t nClustersTPC = esdTrack->GetTPCclusters(fIdxInt); | |
264 | ||
1ae6c515 | 265 | |
266 | ||
0b75bef2 | 267 | Float_t chi2PerClusterITS = -1; |
268 | Float_t chi2PerClusterTPC = -1; | |
269 | if (nClustersITS!=0) | |
270 | chi2PerClusterITS = esdTrack->GetITSchi2()/Float_t(nClustersITS); | |
271 | if (nClustersTPC!=0) | |
272 | chi2PerClusterTPC = esdTrack->GetTPCchi2()/Float_t(nClustersTPC); | |
273 | ||
274 | Double_t extCov[15]; | |
ebd60d8e | 275 | esdTrack->GetExternalCovariance(extCov); |
0b75bef2 | 276 | |
277 | // getting the track to vertex parameters | |
278 | Float_t b[2]; | |
279 | Float_t bRes[2]; | |
280 | Float_t bCov[3]; | |
281 | esdTrack->GetImpactParameters(b,bCov); | |
282 | if (bCov[0]<=0 || bCov[2]<=0) { | |
1ae6c515 | 283 | AliDebug(1, "Estimated b resolution lower or equal zero!"); |
284 | bCov[0]=0; bCov[2]=0; | |
285 | } | |
0b75bef2 | 286 | bRes[0] = TMath::Sqrt(bCov[0]); |
287 | bRes[1] = TMath::Sqrt(bCov[2]); | |
288 | ||
aa93c798 | 289 | // ----------------------------------- |
290 | // How to get to a n-sigma cut? | |
291 | // | |
292 | // The accumulated statistics from 0 to d is | |
293 | // | |
294 | // -> Erf(d/Sqrt(2)) for a 1-dim gauss (d = n_sigma) | |
295 | // -> 1 - Exp(-d**2) for a 2-dim gauss (d*d = dx*dx + dy*dy != n_sigma) | |
296 | // | |
297 | // It means that for a 2-dim gauss: n_sigma(d) = Sqrt(2)*ErfInv(1 - Exp((-x**2)/2) | |
298 | // Can this be expressed in a different way? | |
0b75bef2 | 299 | // |
e712d815 | 300 | // |
301 | // FIX: I don't think this is correct!!! Keeping d as n_sigma for now... | |
302 | ||
0b75bef2 | 303 | Float_t nSigmaToVertex = -1; |
aa93c798 | 304 | if (bRes[0]!=0 && bRes[1]!=0) { |
305 | Float_t d = TMath::Sqrt(TMath::Power(b[0]/bRes[0],2) + TMath::Power(b[1]/bRes[1],2)); | |
10ebe68d | 306 | nSigmaToVertex = d; |
307 | ||
308 | // JF solution: | |
309 | //nSigmaToVertex = TMath::ErfInverse(TMath::Sqrt(2.0/TMath::Pi()) * TMath::Erf(d / TMath::Sqrt(2))) * TMath::Sqrt(2); | |
310 | // Claus solution: | |
311 | //nSigmaToVertex = TMath::Sqrt(2)*(TMath::ErfInverse(1 - TMath::Exp(0.5*(-d*d)))); | |
aa93c798 | 312 | } |
0b75bef2 | 313 | |
314 | // getting the kinematic variables of the track | |
315 | // (assuming the mass is known) | |
316 | Double_t p[3]; | |
317 | esdTrack->GetPxPyPz(p); | |
318 | Float_t momentum = TMath::Sqrt(TMath::Power(p[0],2) + TMath::Power(p[1],2) + TMath::Power(p[2],2)); | |
319 | Float_t pt = TMath::Sqrt(TMath::Power(p[0],2) + TMath::Power(p[1],2)); | |
320 | Float_t energy = TMath::Sqrt(TMath::Power(esdTrack->GetMass(),2) + TMath::Power(momentum,2)); | |
321 | ||
1ae6c515 | 322 | |
0b75bef2 | 323 | //y-eta related calculations |
324 | Float_t eta = -100.; | |
325 | Float_t y = -100.; | |
326 | if((momentum != TMath::Abs(p[2]))&&(momentum != 0)) | |
327 | eta = 0.5*TMath::Log((momentum + p[2])/(momentum - p[2])); | |
328 | if((energy != TMath::Abs(p[2]))&&(momentum != 0)) | |
329 | y = 0.5*TMath::Log((energy + p[2])/(energy - p[2])); | |
330 | ||
331 | ||
332 | //######################################################################## | |
333 | // cut the track? | |
334 | ||
ebd60d8e | 335 | Bool_t cuts[kNCuts]; |
336 | for (Int_t i=0; i<kNCuts; i++) cuts[i]=kFALSE; | |
0b75bef2 | 337 | |
338 | // track quality cuts | |
ab2c1f0d | 339 | if (fCutRequireTPCRefit && (status&AliESDtrack::kTPCrefit)==0) |
0b75bef2 | 340 | cuts[0]=kTRUE; |
ab2c1f0d | 341 | if (fCutRequireITSRefit && (status&AliESDtrack::kITSrefit)==0) |
0b75bef2 | 342 | cuts[1]=kTRUE; |
ab2c1f0d | 343 | if (nClustersTPC<fCutMinNClusterTPC) |
0b75bef2 | 344 | cuts[2]=kTRUE; |
ab2c1f0d | 345 | if (nClustersITS<fCutMinNClusterITS) |
0b75bef2 | 346 | cuts[3]=kTRUE; |
ab2c1f0d | 347 | if (chi2PerClusterTPC>fCutMaxChi2PerClusterTPC) |
0b75bef2 | 348 | cuts[4]=kTRUE; |
ab2c1f0d | 349 | if (chi2PerClusterITS>fCutMaxChi2PerClusterITS) |
0b75bef2 | 350 | cuts[5]=kTRUE; |
ab2c1f0d | 351 | if (extCov[0] > fCutMaxC11) |
0b75bef2 | 352 | cuts[6]=kTRUE; |
ab2c1f0d | 353 | if (extCov[2] > fCutMaxC22) |
0b75bef2 | 354 | cuts[7]=kTRUE; |
ab2c1f0d | 355 | if (extCov[5] > fCutMaxC33) |
0b75bef2 | 356 | cuts[8]=kTRUE; |
ab2c1f0d | 357 | if (extCov[9] > fCutMaxC44) |
0b75bef2 | 358 | cuts[9]=kTRUE; |
ab2c1f0d | 359 | if (extCov[14] > fCutMaxC55) |
0b75bef2 | 360 | cuts[10]=kTRUE; |
ab2c1f0d | 361 | if (nSigmaToVertex > fCutNsigmaToVertex) |
0b75bef2 | 362 | cuts[11] = kTRUE; |
363 | // if n sigma could not be calculated | |
10ebe68d | 364 | if (nSigmaToVertex<0 && fCutSigmaToVertexRequired) |
0b75bef2 | 365 | cuts[12]=kTRUE; |
ab2c1f0d | 366 | if (!fCutAcceptKinkDaughters && esdTrack->GetKinkIndex(0)>0) |
0b75bef2 | 367 | cuts[13]=kTRUE; |
368 | // track kinematics cut | |
369 | if((momentum < fPMin) || (momentum > fPMax)) | |
370 | cuts[14]=kTRUE; | |
371 | if((pt < fPtMin) || (pt > fPtMax)) | |
372 | cuts[15] = kTRUE; | |
373 | if((p[0] < fPxMin) || (p[0] > fPxMax)) | |
374 | cuts[16] = kTRUE; | |
375 | if((p[1] < fPyMin) || (p[1] > fPyMax)) | |
376 | cuts[17] = kTRUE; | |
377 | if((p[2] < fPzMin) || (p[2] > fPzMax)) | |
378 | cuts[18] = kTRUE; | |
379 | if((eta < fEtaMin) || (eta > fEtaMax)) | |
380 | cuts[19] = kTRUE; | |
381 | if((y < fRapMin) || (y > fRapMax)) | |
382 | cuts[20] = kTRUE; | |
383 | ||
384 | Bool_t cut=kFALSE; | |
ebd60d8e | 385 | for (Int_t i=0; i<kNCuts; i++) |
0b75bef2 | 386 | if (cuts[i]) cut = kTRUE; |
387 | ||
388 | //######################################################################## | |
389 | // filling histograms | |
390 | if (fHistogramsOn) { | |
f58f1a93 | 391 | fhCutStatistics->Fill(fhCutStatistics->GetBinCenter(fhCutStatistics->GetXaxis()->FindBin("n tracks"))); |
0b75bef2 | 392 | |
393 | if (cut) | |
f58f1a93 | 394 | fhCutStatistics->Fill(fhCutStatistics->GetBinCenter(fhCutStatistics->GetXaxis()->FindBin("n cut tracks"))); |
0b75bef2 | 395 | |
ebd60d8e | 396 | for (Int_t i=0; i<kNCuts; i++) { |
0b75bef2 | 397 | if (cuts[i]) |
ab2c1f0d | 398 | fhCutStatistics->Fill(fhCutStatistics->GetBinCenter(fhCutStatistics->GetXaxis()->FindBin(fgkCutNames[i]))); |
0b75bef2 | 399 | |
ebd60d8e | 400 | for (Int_t j=i; j<kNCuts; j++) { |
0b75bef2 | 401 | if (cuts[i] && cuts[j]) { |
ab2c1f0d | 402 | Float_t x = fhCutCorrelation->GetXaxis()->GetBinCenter(fhCutCorrelation->GetXaxis()->FindBin(fgkCutNames[i])); |
403 | Float_t y = fhCutCorrelation->GetYaxis()->GetBinCenter(fhCutCorrelation->GetYaxis()->FindBin(fgkCutNames[j])); | |
f58f1a93 | 404 | fhCutCorrelation->Fill(x,y); |
0b75bef2 | 405 | } |
406 | } | |
407 | } | |
408 | ||
409 | ||
f58f1a93 | 410 | fhNClustersITS[0]->Fill(nClustersITS); |
411 | fhNClustersTPC[0]->Fill(nClustersTPC); | |
412 | fhChi2PerClusterITS[0]->Fill(chi2PerClusterITS); | |
413 | fhChi2PerClusterTPC[0]->Fill(chi2PerClusterTPC); | |
0b75bef2 | 414 | |
f58f1a93 | 415 | fhC11[0]->Fill(extCov[0]); |
416 | fhC22[0]->Fill(extCov[2]); | |
417 | fhC33[0]->Fill(extCov[5]); | |
418 | fhC44[0]->Fill(extCov[9]); | |
419 | fhC55[0]->Fill(extCov[14]); | |
0b75bef2 | 420 | |
f58f1a93 | 421 | fhDZ[0]->Fill(b[1]); |
422 | fhDXY[0]->Fill(b[0]); | |
423 | fhDXYvsDZ[0]->Fill(b[1],b[0]); | |
0b75bef2 | 424 | |
425 | if (bRes[0]!=0 && bRes[1]!=0) { | |
10ebe68d | 426 | fhDZNormalized[0]->Fill(b[1]/bRes[1]); |
f58f1a93 | 427 | fhDXYNormalized[0]->Fill(b[0]/bRes[0]); |
428 | fhDXYvsDZNormalized[0]->Fill(b[1]/bRes[1], b[0]/bRes[0]); | |
0b75bef2 | 429 | } |
430 | } | |
431 | ||
432 | //######################################################################## | |
433 | // cut the track! | |
434 | if (cut) return kFALSE; | |
435 | ||
436 | //######################################################################## | |
437 | // filling histograms after cut | |
438 | if (fHistogramsOn) { | |
f58f1a93 | 439 | fhNClustersITS[1]->Fill(nClustersITS); |
440 | fhNClustersTPC[1]->Fill(nClustersTPC); | |
441 | fhChi2PerClusterITS[1]->Fill(chi2PerClusterITS); | |
442 | fhChi2PerClusterTPC[1]->Fill(chi2PerClusterTPC); | |
0b75bef2 | 443 | |
f58f1a93 | 444 | fhC11[1]->Fill(extCov[0]); |
445 | fhC22[1]->Fill(extCov[2]); | |
10ebe68d | 446 | fhC33[1]->Fill(extCov[5]); |
f58f1a93 | 447 | fhC44[1]->Fill(extCov[9]); |
448 | fhC55[1]->Fill(extCov[14]); | |
0b75bef2 | 449 | |
f58f1a93 | 450 | fhDZ[1]->Fill(b[1]); |
451 | fhDXY[1]->Fill(b[0]); | |
452 | fhDXYvsDZ[1]->Fill(b[1],b[0]); | |
0b75bef2 | 453 | |
10ebe68d | 454 | if (bRes[0]!=0 && bRes[1]!=0) |
455 | { | |
456 | fhDZNormalized[1]->Fill(b[1]/bRes[1]); | |
457 | fhDXYNormalized[1]->Fill(b[0]/bRes[0]); | |
458 | fhDXYvsDZNormalized[1]->Fill(b[1]/bRes[1], b[0]/bRes[0]); | |
459 | } | |
0b75bef2 | 460 | } |
461 | ||
462 | return kTRUE; | |
463 | } | |
464 | ||
465 | //____________________________________________________________________ | |
466 | TObjArray* | |
ebd60d8e | 467 | AliESDtrackCuts::GetAcceptedTracks(AliESD* esd) |
468 | { | |
469 | // | |
0b75bef2 | 470 | // returns an array of all tracks that pass the cuts |
ebd60d8e | 471 | // |
472 | ||
473 | TObjArray* acceptedTracks = new TObjArray(); | |
c5858666 | 474 | |
0b75bef2 | 475 | // loop over esd tracks |
476 | for (Int_t iTrack = 0; iTrack < esd->GetNumberOfTracks(); iTrack++) { | |
477 | AliESDtrack* track = esd->GetTrack(iTrack); | |
c5858666 | 478 | |
ebd60d8e | 479 | if (AcceptTrack(track)) |
480 | acceptedTracks->Add(track); | |
0b75bef2 | 481 | } |
482 | ||
ebd60d8e | 483 | return acceptedTracks; |
0b75bef2 | 484 | } |
485 | ||
c5858666 | 486 | //____________________________________________________________________ |
487 | Int_t | |
488 | AliESDtrackCuts::CountAcceptedTracks(AliESD* esd) | |
489 | { | |
490 | // | |
491 | // returns an the number of tracks that pass the cuts | |
492 | // | |
493 | ||
494 | Int_t count = 0; | |
495 | ||
496 | // loop over esd tracks | |
497 | for (Int_t iTrack = 0; iTrack < esd->GetNumberOfTracks(); iTrack++) { | |
498 | AliESDtrack* track = esd->GetTrack(iTrack); | |
499 | ||
500 | if (AcceptTrack(track)) | |
501 | count++; | |
502 | } | |
503 | ||
504 | return count; | |
505 | } | |
506 | ||
0b75bef2 | 507 | //____________________________________________________________________ |
f58f1a93 | 508 | void AliESDtrackCuts::DefineHistograms(Int_t color) { |
ab2c1f0d | 509 | // |
510 | // diagnostics histograms are defined | |
511 | // | |
0b75bef2 | 512 | |
f58f1a93 | 513 | fHistogramsOn=kTRUE; |
0b75bef2 | 514 | |
ab2c1f0d | 515 | //################################################################################### |
f58f1a93 | 516 | // defining histograms |
0b75bef2 | 517 | |
ebd60d8e | 518 | fhCutStatistics = new TH1F("cut_statistics","cut statistics",kNCuts+4,-0.5,kNCuts+3.5); |
0b75bef2 | 519 | |
f58f1a93 | 520 | fhCutStatistics->GetXaxis()->SetBinLabel(1,"n tracks"); |
521 | fhCutStatistics->GetXaxis()->SetBinLabel(2,"n cut tracks"); | |
0b75bef2 | 522 | |
ebd60d8e | 523 | fhCutCorrelation = new TH2F("cut_correlation","cut correlation",kNCuts,-0.5,kNCuts-0.5,kNCuts,-0.5,kNCuts-0.5);; |
0b75bef2 | 524 | |
ebd60d8e | 525 | for (Int_t i=0; i<kNCuts; i++) { |
ab2c1f0d | 526 | fhCutStatistics->GetXaxis()->SetBinLabel(i+4,fgkCutNames[i]); |
527 | fhCutCorrelation->GetXaxis()->SetBinLabel(i+1,fgkCutNames[i]); | |
528 | fhCutCorrelation->GetYaxis()->SetBinLabel(i+1,fgkCutNames[i]); | |
f58f1a93 | 529 | } |
530 | ||
531 | fhCutStatistics ->SetLineColor(color); | |
532 | fhCutCorrelation ->SetLineColor(color); | |
533 | fhCutStatistics ->SetLineWidth(2); | |
534 | fhCutCorrelation ->SetLineWidth(2); | |
535 | ||
0b75bef2 | 536 | Char_t str[256]; |
537 | for (Int_t i=0; i<2; i++) { | |
538 | if (i==0) sprintf(str," "); | |
539 | else sprintf(str,"_cut"); | |
540 | ||
ebd60d8e | 541 | fhNClustersITS[i] = new TH1F(Form("nClustersITS%s",str),"",8,-0.5,7.5); |
542 | fhNClustersTPC[i] = new TH1F(Form("nClustersTPC%s",str),"",165,-0.5,164.5); | |
543 | fhChi2PerClusterITS[i] = new TH1F(Form("chi2PerClusterITS%s",str),"",500,0,10); | |
544 | fhChi2PerClusterTPC[i] = new TH1F(Form("chi2PerClusterTPC%s",str),"",500,0,10); | |
545 | ||
546 | fhC11[i] = new TH1F(Form("covMatrixDiagonal11%s",str),"",1000,0,5); | |
547 | fhC22[i] = new TH1F(Form("covMatrixDiagonal22%s",str),"",1000,0,5); | |
548 | fhC33[i] = new TH1F(Form("covMatrixDiagonal33%s",str),"",1000,0,0.5); | |
549 | fhC44[i] = new TH1F(Form("covMatrixDiagonal44%s",str),"",1000,0,5); | |
550 | fhC55[i] = new TH1F(Form("covMatrixDiagonal55%s",str),"",1000,0,5); | |
551 | ||
552 | fhDXY[i] = new TH1F(Form("dXY%s",str),"",500,-10,10); | |
553 | fhDZ[i] = new TH1F(Form("dZ%s",str),"",500,-10,10); | |
554 | fhDXYvsDZ[i] = new TH2F(Form("dXYvsDZ%s",str),"",200,-10,10,200,-10,10); | |
555 | ||
556 | fhDXYNormalized[i] = new TH1F(Form("dXYNormalized%s",str),"",500,-10,10); | |
557 | fhDZNormalized[i] = new TH1F(Form("dZNormalized%s",str),"",500,-10,10); | |
558 | fhDXYvsDZNormalized[i] = new TH2F(Form("dXYvsDZNormalized%s",str),"",200,-10,10,200,-10,10); | |
559 | ||
560 | ||
561 | fhNClustersITS[i]->SetXTitle("n ITS clusters"); | |
562 | fhNClustersTPC[i]->SetXTitle("n TPC clusters"); | |
563 | fhChi2PerClusterITS[i]->SetXTitle("#Chi^{2} per ITS cluster"); | |
564 | fhChi2PerClusterTPC[i]->SetXTitle("#Chi^{2} per TPC cluster"); | |
565 | ||
566 | fhC11[i]->SetXTitle("cov 11 : #sigma_{y}^{2} [cm^{2}]"); | |
567 | fhC22[i]->SetXTitle("cov 22 : #sigma_{z}^{2} [cm^{2}]"); | |
568 | fhC33[i]->SetXTitle("cov 33 : #sigma_{sin(#phi)}^{2}"); | |
569 | fhC44[i]->SetXTitle("cov 44 : #sigma_{tan(#theta_{dip})}^{2}"); | |
570 | fhC55[i]->SetXTitle("cov 55 : #sigma_{1/p_{T}}^{2} [(c/GeV)^2]"); | |
571 | ||
572 | fhDXY[i]->SetXTitle("transverse impact parameter"); | |
573 | fhDZ[i]->SetXTitle("longitudinal impact parameter"); | |
574 | fhDXYvsDZ[i]->SetXTitle("longitudinal impact parameter"); | |
575 | fhDXYvsDZ[i]->SetYTitle("transverse impact parameter"); | |
576 | ||
577 | fhDXYNormalized[i]->SetXTitle("normalized trans impact par"); | |
578 | fhDZNormalized[i]->SetXTitle("normalized long impact par"); | |
579 | fhDXYvsDZNormalized[i]->SetXTitle("normalized long impact par"); | |
580 | fhDXYvsDZNormalized[i]->SetYTitle("normalized trans impact par"); | |
581 | ||
582 | fhNClustersITS[i]->SetLineColor(color); fhNClustersITS[i]->SetLineWidth(2); | |
583 | fhNClustersTPC[i]->SetLineColor(color); fhNClustersTPC[i]->SetLineWidth(2); | |
584 | fhChi2PerClusterITS[i]->SetLineColor(color); fhChi2PerClusterITS[i]->SetLineWidth(2); | |
585 | fhChi2PerClusterTPC[i]->SetLineColor(color); fhChi2PerClusterTPC[i]->SetLineWidth(2); | |
586 | ||
587 | fhC11[i]->SetLineColor(color); fhC11[i]->SetLineWidth(2); | |
588 | fhC22[i]->SetLineColor(color); fhC22[i]->SetLineWidth(2); | |
589 | fhC33[i]->SetLineColor(color); fhC33[i]->SetLineWidth(2); | |
590 | fhC44[i]->SetLineColor(color); fhC44[i]->SetLineWidth(2); | |
591 | fhC55[i]->SetLineColor(color); fhC55[i]->SetLineWidth(2); | |
592 | ||
593 | fhDXY[i]->SetLineColor(color); fhDXY[i]->SetLineWidth(2); | |
594 | fhDZ[i]->SetLineColor(color); fhDZ[i]->SetLineWidth(2); | |
595 | ||
596 | fhDXYNormalized[i]->SetLineColor(color); fhDXYNormalized[i]->SetLineWidth(2); | |
597 | fhDZNormalized[i]->SetLineColor(color); fhDZNormalized[i]->SetLineWidth(2); | |
0b75bef2 | 598 | } |
599 | } | |
600 | ||
601 | //____________________________________________________________________ | |
602 | void | |
49dc84d9 | 603 | AliESDtrackCuts::Print(const Option_t*) const { |
ab2c1f0d | 604 | // |
605 | // print method - still to be implemented | |
606 | // | |
0b75bef2 | 607 | |
608 | AliInfo("AliESDtrackCuts..."); | |
609 | } | |
610 | ||
611 | ||
612 | //____________________________________________________________________ | |
f58f1a93 | 613 | void AliESDtrackCuts::SaveHistograms(Char_t* dir) { |
ab2c1f0d | 614 | // |
615 | // saves the histograms in a directory (dir) | |
616 | // | |
617 | ||
0b75bef2 | 618 | |
619 | if (!fHistogramsOn) { | |
620 | AliDebug(0, "Histograms not on - cannot save histograms!!!"); | |
621 | return; | |
622 | } | |
623 | ||
624 | gDirectory->mkdir(dir); | |
625 | gDirectory->cd(dir); | |
626 | ||
627 | gDirectory->mkdir("before_cuts"); | |
628 | gDirectory->mkdir("after_cuts"); | |
629 | ||
f58f1a93 | 630 | fhCutStatistics->Write(); |
631 | fhCutCorrelation->Write(); | |
0b75bef2 | 632 | |
633 | for (Int_t i=0; i<2; i++) { | |
634 | if (i==0) | |
635 | gDirectory->cd("before_cuts"); | |
636 | else | |
637 | gDirectory->cd("after_cuts"); | |
638 | ||
f58f1a93 | 639 | fhNClustersITS[i] ->Write(); |
640 | fhNClustersTPC[i] ->Write(); | |
641 | fhChi2PerClusterITS[i] ->Write(); | |
642 | fhChi2PerClusterTPC[i] ->Write(); | |
0b75bef2 | 643 | |
f58f1a93 | 644 | fhC11[i] ->Write(); |
645 | fhC22[i] ->Write(); | |
646 | fhC33[i] ->Write(); | |
647 | fhC44[i] ->Write(); | |
648 | fhC55[i] ->Write(); | |
649 | ||
650 | fhDXY[i] ->Write(); | |
651 | fhDZ[i] ->Write(); | |
652 | fhDXYvsDZ[i] ->Write(); | |
0b75bef2 | 653 | |
f58f1a93 | 654 | fhDXYNormalized[i] ->Write(); |
655 | fhDZNormalized[i] ->Write(); | |
656 | fhDXYvsDZNormalized[i] ->Write(); | |
0b75bef2 | 657 | |
658 | gDirectory->cd("../"); | |
659 | } | |
660 | ||
661 | gDirectory->cd("../"); | |
662 | } | |
663 | ||
664 | ||
665 |