]>
Commit | Line | Data |
---|---|---|
73318471 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
74687314 | 8 | * documentation strictly for non-commercial purposes is hereby granted * |
73318471 | 9 | * without fee, provided that the above copyright notice appears in all * |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
16 | /* $Id: AliESDtrackCuts.cxx 24534 2008-03-16 22:22:11Z fca $ */ | |
17 | ||
18 | #include "AliESDtrackCuts.h" | |
19 | ||
20 | #include <AliESDtrack.h> | |
91c88f16 | 21 | #include <AliESDVertex.h> |
73318471 | 22 | #include <AliESDEvent.h> |
a61ab805 | 23 | #include <AliMultiplicity.h> |
73318471 | 24 | #include <AliLog.h> |
25 | ||
26 | #include <TTree.h> | |
27 | #include <TCanvas.h> | |
28 | #include <TDirectory.h> | |
d95684c0 | 29 | #include <TH2F.h> |
30 | #include <TF1.h> | |
73318471 | 31 | |
32 | //____________________________________________________________________ | |
33 | ClassImp(AliESDtrackCuts) | |
34 | ||
35 | // Cut names | |
36 | const Char_t* AliESDtrackCuts::fgkCutNames[kNCuts] = { | |
37 | "require TPC refit", | |
a86cf7f4 | 38 | "require TPC standalone", |
73318471 | 39 | "require ITS refit", |
40 | "n clusters TPC", | |
41 | "n clusters ITS", | |
86f0e195 | 42 | "#Chi^{2}/cluster TPC", |
43 | "#Chi^{2}/cluster ITS", | |
73318471 | 44 | "cov 11", |
45 | "cov 22", | |
46 | "cov 33", | |
47 | "cov 44", | |
48 | "cov 55", | |
49 | "trk-to-vtx", | |
50 | "trk-to-vtx failed", | |
51 | "kink daughters", | |
52 | "p", | |
53 | "p_{T}", | |
54 | "p_{x}", | |
55 | "p_{y}", | |
56 | "p_{z}", | |
524916f0 | 57 | "eta", |
86f0e195 | 58 | "y", |
133a5e00 | 59 | "trk-to-vtx max dca 2D absolute", |
60 | "trk-to-vtx max dca xy absolute", | |
61 | "trk-to-vtx max dca z absolute", | |
62 | "trk-to-vtx min dca 2D absolute", | |
63 | "trk-to-vtx min dca xy absolute", | |
64 | "trk-to-vtx min dca z absolute", | |
94c06b89 | 65 | "SPD cluster requirement", |
66 | "SDD cluster requirement", | |
d95684c0 | 67 | "SSD cluster requirement", |
025fb458 | 68 | "require ITS stand-alone", |
0274b76f | 69 | "rel 1/pt uncertainty", |
ecd4e3ba | 70 | "TPC n shared clusters", |
71 | "TPC rel shared clusters", | |
07b1b131 | 72 | "require ITS Pid", |
73 | "n crossed rows TPC", | |
74 | "n crossed rows / n findable clusters", | |
4c3dc2a0 | 75 | "missing ITS points", |
76 | "#Chi^{2} TPC constrained vs. global" | |
73318471 | 77 | }; |
78 | ||
a61ab805 | 79 | AliESDtrackCuts* AliESDtrackCuts::fgMultEstTrackCuts[AliESDtrackCuts::kNMultEstTrackCuts] = { 0, 0, 0, 0 }; |
80 | ||
73318471 | 81 | //____________________________________________________________________ |
82 | AliESDtrackCuts::AliESDtrackCuts(const Char_t* name, const Char_t* title) : AliAnalysisCuts(name,title), | |
83 | fCutMinNClusterTPC(0), | |
84 | fCutMinNClusterITS(0), | |
07b1b131 | 85 | fCutMinNCrossedRowsTPC(0), |
86 | fCutMinRatioCrossedRowsOverFindableClustersTPC(0), | |
73318471 | 87 | fCutMaxChi2PerClusterTPC(0), |
88 | fCutMaxChi2PerClusterITS(0), | |
4c3dc2a0 | 89 | fCutMaxChi2TPCConstrainedVsGlobal(0), |
90 | fCutMaxChi2TPCConstrainedVsGlobalVertexType(kVertexTracks | kVertexSPD), | |
9023d7ac | 91 | fCutMaxMissingITSPoints(0), |
73318471 | 92 | fCutMaxC11(0), |
93 | fCutMaxC22(0), | |
94 | fCutMaxC33(0), | |
95 | fCutMaxC44(0), | |
96 | fCutMaxC55(0), | |
025fb458 | 97 | fCutMaxRel1PtUncertainty(0), |
73318471 | 98 | fCutAcceptKinkDaughters(0), |
3128582b | 99 | fCutAcceptSharedTPCClusters(0), |
100 | fCutMaxFractionSharedTPCClusters(0), | |
73318471 | 101 | fCutRequireTPCRefit(0), |
a86cf7f4 | 102 | fCutRequireTPCStandAlone(0), |
0274b76f | 103 | fCutRequireITSRefit(0), |
104 | fCutRequireITSPid(0), | |
d95684c0 | 105 | fCutRequireITSStandAlone(0), |
0274b76f | 106 | fCutRequireITSpureSA(0), |
73318471 | 107 | fCutNsigmaToVertex(0), |
108 | fCutSigmaToVertexRequired(0), | |
133a5e00 | 109 | fCutMaxDCAToVertexXY(0), |
110 | fCutMaxDCAToVertexZ(0), | |
111 | fCutMinDCAToVertexXY(0), | |
112 | fCutMinDCAToVertexZ(0), | |
f4e7aa32 | 113 | fCutMaxDCAToVertexXYPtDep(""), |
114 | fCutMaxDCAToVertexZPtDep(""), | |
115 | fCutMinDCAToVertexXYPtDep(""), | |
116 | fCutMinDCAToVertexZPtDep(""), | |
f328399b | 117 | f1CutMaxDCAToVertexXYPtDep(0x0), |
118 | f1CutMaxDCAToVertexZPtDep(0x0), | |
119 | f1CutMinDCAToVertexXYPtDep(0x0), | |
120 | f1CutMinDCAToVertexZPtDep(0x0), | |
86f0e195 | 121 | fCutDCAToVertex2D(0), |
73318471 | 122 | fPMin(0), |
123 | fPMax(0), | |
124 | fPtMin(0), | |
125 | fPtMax(0), | |
126 | fPxMin(0), | |
127 | fPxMax(0), | |
128 | fPyMin(0), | |
129 | fPyMax(0), | |
130 | fPzMin(0), | |
131 | fPzMax(0), | |
132 | fEtaMin(0), | |
133 | fEtaMax(0), | |
134 | fRapMin(0), | |
135 | fRapMax(0), | |
136 | fHistogramsOn(0), | |
137 | ffDTheoretical(0), | |
138 | fhCutStatistics(0), | |
139 | fhCutCorrelation(0) | |
140 | { | |
141 | // | |
142 | // constructor | |
143 | // | |
144 | ||
145 | Init(); | |
146 | ||
147 | //############################################################################## | |
148 | // setting default cuts | |
149 | SetMinNClustersTPC(); | |
150 | SetMinNClustersITS(); | |
07b1b131 | 151 | SetMinNCrossedRowsTPC(); |
152 | SetMinRatioCrossedRowsOverFindableClustersTPC(); | |
73318471 | 153 | SetMaxChi2PerClusterTPC(); |
4c3dc2a0 | 154 | SetMaxChi2PerClusterITS(); |
155 | SetMaxChi2TPCConstrainedGlobal(); | |
156 | SetMaxChi2TPCConstrainedGlobalVertexType(); | |
9023d7ac | 157 | SetMaxNOfMissingITSPoints(); |
025fb458 | 158 | SetMaxCovDiagonalElements(); |
159 | SetMaxRel1PtUncertainty(); | |
73318471 | 160 | SetRequireTPCRefit(); |
a86cf7f4 | 161 | SetRequireTPCStandAlone(); |
73318471 | 162 | SetRequireITSRefit(); |
0274b76f | 163 | SetRequireITSPid(kFALSE); |
d95684c0 | 164 | SetRequireITSStandAlone(kFALSE); |
0274b76f | 165 | SetRequireITSPureStandAlone(kFALSE); |
58c4f3fb | 166 | SetAcceptKinkDaughters(); |
ecd4e3ba | 167 | SetAcceptSharedTPCClusters(); |
168 | SetMaxFractionSharedTPCClusters(); | |
94c06b89 | 169 | SetMaxNsigmaToVertex(); |
94c06b89 | 170 | SetMaxDCAToVertexXY(); |
171 | SetMaxDCAToVertexZ(); | |
86f0e195 | 172 | SetDCAToVertex2D(); |
133a5e00 | 173 | SetMinDCAToVertexXY(); |
174 | SetMinDCAToVertexZ(); | |
73318471 | 175 | SetPRange(); |
176 | SetPtRange(); | |
177 | SetPxRange(); | |
178 | SetPyRange(); | |
179 | SetPzRange(); | |
180 | SetEtaRange(); | |
181 | SetRapRange(); | |
94c06b89 | 182 | SetClusterRequirementITS(kSPD); |
183 | SetClusterRequirementITS(kSDD); | |
184 | SetClusterRequirementITS(kSSD); | |
73318471 | 185 | |
186 | SetHistogramsOn(); | |
187 | } | |
188 | ||
189 | //_____________________________________________________________________________ | |
190 | AliESDtrackCuts::AliESDtrackCuts(const AliESDtrackCuts &c) : AliAnalysisCuts(c), | |
191 | fCutMinNClusterTPC(0), | |
192 | fCutMinNClusterITS(0), | |
07b1b131 | 193 | fCutMinNCrossedRowsTPC(0), |
194 | fCutMinRatioCrossedRowsOverFindableClustersTPC(0), | |
73318471 | 195 | fCutMaxChi2PerClusterTPC(0), |
196 | fCutMaxChi2PerClusterITS(0), | |
4c3dc2a0 | 197 | fCutMaxChi2TPCConstrainedVsGlobal(0), |
198 | fCutMaxChi2TPCConstrainedVsGlobalVertexType(kVertexTracks | kVertexSPD), | |
9023d7ac | 199 | fCutMaxMissingITSPoints(0), |
73318471 | 200 | fCutMaxC11(0), |
201 | fCutMaxC22(0), | |
202 | fCutMaxC33(0), | |
203 | fCutMaxC44(0), | |
204 | fCutMaxC55(0), | |
025fb458 | 205 | fCutMaxRel1PtUncertainty(0), |
73318471 | 206 | fCutAcceptKinkDaughters(0), |
3128582b | 207 | fCutAcceptSharedTPCClusters(0), |
208 | fCutMaxFractionSharedTPCClusters(0), | |
73318471 | 209 | fCutRequireTPCRefit(0), |
a86cf7f4 | 210 | fCutRequireTPCStandAlone(0), |
73318471 | 211 | fCutRequireITSRefit(0), |
0274b76f | 212 | fCutRequireITSPid(0), |
d95684c0 | 213 | fCutRequireITSStandAlone(0), |
0274b76f | 214 | fCutRequireITSpureSA(0), |
73318471 | 215 | fCutNsigmaToVertex(0), |
216 | fCutSigmaToVertexRequired(0), | |
133a5e00 | 217 | fCutMaxDCAToVertexXY(0), |
218 | fCutMaxDCAToVertexZ(0), | |
219 | fCutMinDCAToVertexXY(0), | |
220 | fCutMinDCAToVertexZ(0), | |
f4e7aa32 | 221 | fCutMaxDCAToVertexXYPtDep(""), |
222 | fCutMaxDCAToVertexZPtDep(""), | |
223 | fCutMinDCAToVertexXYPtDep(""), | |
224 | fCutMinDCAToVertexZPtDep(""), | |
f328399b | 225 | f1CutMaxDCAToVertexXYPtDep(0x0), |
226 | f1CutMaxDCAToVertexZPtDep(0x0), | |
227 | f1CutMinDCAToVertexXYPtDep(0x0), | |
228 | f1CutMinDCAToVertexZPtDep(0x0), | |
86f0e195 | 229 | fCutDCAToVertex2D(0), |
73318471 | 230 | fPMin(0), |
231 | fPMax(0), | |
232 | fPtMin(0), | |
233 | fPtMax(0), | |
234 | fPxMin(0), | |
235 | fPxMax(0), | |
236 | fPyMin(0), | |
237 | fPyMax(0), | |
238 | fPzMin(0), | |
239 | fPzMax(0), | |
240 | fEtaMin(0), | |
241 | fEtaMax(0), | |
242 | fRapMin(0), | |
243 | fRapMax(0), | |
244 | fHistogramsOn(0), | |
245 | ffDTheoretical(0), | |
246 | fhCutStatistics(0), | |
247 | fhCutCorrelation(0) | |
248 | { | |
249 | // | |
250 | // copy constructor | |
251 | // | |
252 | ||
253 | ((AliESDtrackCuts &) c).Copy(*this); | |
254 | } | |
255 | ||
256 | AliESDtrackCuts::~AliESDtrackCuts() | |
257 | { | |
258 | // | |
259 | // destructor | |
260 | // | |
261 | ||
262 | for (Int_t i=0; i<2; i++) { | |
263 | ||
264 | if (fhNClustersITS[i]) | |
265 | delete fhNClustersITS[i]; | |
266 | if (fhNClustersTPC[i]) | |
267 | delete fhNClustersTPC[i]; | |
9023d7ac | 268 | if (fhNSharedClustersTPC[i]) |
269 | delete fhNSharedClustersTPC[i]; | |
07b1b131 | 270 | if (fhNCrossedRowsTPC[i]) |
271 | delete fhNCrossedRowsTPC[i]; | |
272 | if (fhRatioCrossedRowsOverFindableClustersTPC[i]) | |
273 | delete fhRatioCrossedRowsOverFindableClustersTPC[i]; | |
73318471 | 274 | if (fhChi2PerClusterITS[i]) |
275 | delete fhChi2PerClusterITS[i]; | |
276 | if (fhChi2PerClusterTPC[i]) | |
2a35259b | 277 | delete fhChi2PerClusterTPC[i]; |
4c3dc2a0 | 278 | if (fhChi2TPCConstrainedVsGlobal[i]) |
279 | delete fhChi2TPCConstrainedVsGlobal[i]; | |
2a35259b | 280 | if(fhNClustersForITSPID[i]) |
281 | delete fhNClustersForITSPID[i]; | |
282 | if(fhNMissingITSPoints[i]) | |
283 | delete fhNMissingITSPoints[i]; | |
73318471 | 284 | if (fhC11[i]) |
285 | delete fhC11[i]; | |
286 | if (fhC22[i]) | |
287 | delete fhC22[i]; | |
288 | if (fhC33[i]) | |
289 | delete fhC33[i]; | |
290 | if (fhC44[i]) | |
291 | delete fhC44[i]; | |
292 | if (fhC55[i]) | |
025fb458 | 293 | delete fhC55[i]; |
294 | ||
295 | if (fhRel1PtUncertainty[i]) | |
296 | delete fhRel1PtUncertainty[i]; | |
73318471 | 297 | |
298 | if (fhDXY[i]) | |
299 | delete fhDXY[i]; | |
300 | if (fhDZ[i]) | |
524916f0 | 301 | delete fhDZ[i]; |
302 | if (fhDXYDZ[i]) | |
303 | delete fhDXYDZ[i]; | |
73318471 | 304 | if (fhDXYvsDZ[i]) |
524916f0 | 305 | delete fhDXYvsDZ[i]; |
306 | ||
73318471 | 307 | if (fhDXYNormalized[i]) |
308 | delete fhDXYNormalized[i]; | |
309 | if (fhDZNormalized[i]) | |
310 | delete fhDZNormalized[i]; | |
311 | if (fhDXYvsDZNormalized[i]) | |
524916f0 | 312 | delete fhDXYvsDZNormalized[i]; |
73318471 | 313 | if (fhNSigmaToVertex[i]) |
314 | delete fhNSigmaToVertex[i]; | |
315 | if (fhPt[i]) | |
316 | delete fhPt[i]; | |
317 | if (fhEta[i]) | |
318 | delete fhEta[i]; | |
319 | } | |
320 | ||
f328399b | 321 | if(f1CutMaxDCAToVertexXYPtDep)delete f1CutMaxDCAToVertexXYPtDep; |
322 | f1CutMaxDCAToVertexXYPtDep = 0; | |
323 | if( f1CutMaxDCAToVertexZPtDep) delete f1CutMaxDCAToVertexZPtDep; | |
324 | f1CutMaxDCAToVertexZPtDep = 0; | |
325 | if( f1CutMinDCAToVertexXYPtDep)delete f1CutMinDCAToVertexXYPtDep; | |
326 | f1CutMinDCAToVertexXYPtDep = 0; | |
327 | if(f1CutMinDCAToVertexZPtDep)delete f1CutMinDCAToVertexZPtDep; | |
328 | f1CutMinDCAToVertexZPtDep = 0; | |
329 | ||
330 | ||
73318471 | 331 | if (ffDTheoretical) |
332 | delete ffDTheoretical; | |
333 | ||
334 | if (fhCutStatistics) | |
335 | delete fhCutStatistics; | |
336 | if (fhCutCorrelation) | |
337 | delete fhCutCorrelation; | |
338 | } | |
339 | ||
340 | void AliESDtrackCuts::Init() | |
341 | { | |
342 | // | |
343 | // sets everything to zero | |
344 | // | |
345 | ||
346 | fCutMinNClusterTPC = 0; | |
347 | fCutMinNClusterITS = 0; | |
348 | ||
349 | fCutMaxChi2PerClusterTPC = 0; | |
350 | fCutMaxChi2PerClusterITS = 0; | |
4c3dc2a0 | 351 | fCutMaxChi2TPCConstrainedVsGlobal = 0; |
352 | fCutMaxChi2TPCConstrainedVsGlobalVertexType = kVertexTracks | kVertexSPD; | |
9023d7ac | 353 | fCutMaxMissingITSPoints = 0; |
94c06b89 | 354 | |
355 | for (Int_t i = 0; i < 3; i++) | |
356 | fCutClusterRequirementITS[i] = kOff; | |
73318471 | 357 | |
358 | fCutMaxC11 = 0; | |
359 | fCutMaxC22 = 0; | |
360 | fCutMaxC33 = 0; | |
361 | fCutMaxC44 = 0; | |
362 | fCutMaxC55 = 0; | |
025fb458 | 363 | |
364 | fCutMaxRel1PtUncertainty = 0; | |
73318471 | 365 | |
366 | fCutAcceptKinkDaughters = 0; | |
3128582b | 367 | fCutAcceptSharedTPCClusters = 0; |
368 | fCutMaxFractionSharedTPCClusters = 0; | |
73318471 | 369 | fCutRequireTPCRefit = 0; |
a86cf7f4 | 370 | fCutRequireTPCStandAlone = 0; |
73318471 | 371 | fCutRequireITSRefit = 0; |
0274b76f | 372 | fCutRequireITSPid = 0; |
d95684c0 | 373 | fCutRequireITSStandAlone = 0; |
0274b76f | 374 | fCutRequireITSpureSA = 0; |
73318471 | 375 | |
376 | fCutNsigmaToVertex = 0; | |
377 | fCutSigmaToVertexRequired = 0; | |
133a5e00 | 378 | fCutMaxDCAToVertexXY = 0; |
379 | fCutMaxDCAToVertexZ = 0; | |
86f0e195 | 380 | fCutDCAToVertex2D = 0; |
133a5e00 | 381 | fCutMinDCAToVertexXY = 0; |
382 | fCutMinDCAToVertexZ = 0; | |
f4e7aa32 | 383 | fCutMaxDCAToVertexXYPtDep = ""; |
384 | fCutMaxDCAToVertexZPtDep = ""; | |
385 | fCutMinDCAToVertexXYPtDep = ""; | |
386 | fCutMinDCAToVertexZPtDep = ""; | |
133a5e00 | 387 | |
f328399b | 388 | if(f1CutMaxDCAToVertexXYPtDep)delete f1CutMaxDCAToVertexXYPtDep; |
389 | f1CutMaxDCAToVertexXYPtDep = 0; | |
390 | if( f1CutMaxDCAToVertexXYPtDep) delete f1CutMaxDCAToVertexXYPtDep; | |
391 | f1CutMaxDCAToVertexXYPtDep = 0; | |
392 | if( f1CutMaxDCAToVertexZPtDep) delete f1CutMaxDCAToVertexZPtDep; | |
393 | f1CutMaxDCAToVertexZPtDep = 0; | |
394 | if( f1CutMinDCAToVertexXYPtDep)delete f1CutMinDCAToVertexXYPtDep; | |
395 | f1CutMinDCAToVertexXYPtDep = 0; | |
396 | if(f1CutMinDCAToVertexZPtDep)delete f1CutMinDCAToVertexZPtDep; | |
397 | f1CutMinDCAToVertexZPtDep = 0; | |
398 | ||
86f0e195 | 399 | |
73318471 | 400 | fPMin = 0; |
401 | fPMax = 0; | |
402 | fPtMin = 0; | |
403 | fPtMax = 0; | |
404 | fPxMin = 0; | |
405 | fPxMax = 0; | |
406 | fPyMin = 0; | |
407 | fPyMax = 0; | |
408 | fPzMin = 0; | |
409 | fPzMax = 0; | |
410 | fEtaMin = 0; | |
411 | fEtaMax = 0; | |
412 | fRapMin = 0; | |
413 | fRapMax = 0; | |
414 | ||
415 | fHistogramsOn = kFALSE; | |
416 | ||
417 | for (Int_t i=0; i<2; ++i) | |
418 | { | |
419 | fhNClustersITS[i] = 0; | |
420 | fhNClustersTPC[i] = 0; | |
9023d7ac | 421 | fhNSharedClustersTPC[i] = 0; |
07b1b131 | 422 | fhNCrossedRowsTPC[i] = 0; |
423 | fhRatioCrossedRowsOverFindableClustersTPC[i] = 0; | |
73318471 | 424 | |
425 | fhChi2PerClusterITS[i] = 0; | |
426 | fhChi2PerClusterTPC[i] = 0; | |
4c3dc2a0 | 427 | fhChi2TPCConstrainedVsGlobal[i] = 0; |
2a35259b | 428 | fhNClustersForITSPID[i] = 0; |
429 | fhNMissingITSPoints[i] = 0; | |
73318471 | 430 | |
431 | fhC11[i] = 0; | |
432 | fhC22[i] = 0; | |
433 | fhC33[i] = 0; | |
434 | fhC44[i] = 0; | |
435 | fhC55[i] = 0; | |
436 | ||
025fb458 | 437 | fhRel1PtUncertainty[i] = 0; |
438 | ||
73318471 | 439 | fhDXY[i] = 0; |
440 | fhDZ[i] = 0; | |
524916f0 | 441 | fhDXYDZ[i] = 0; |
73318471 | 442 | fhDXYvsDZ[i] = 0; |
443 | ||
444 | fhDXYNormalized[i] = 0; | |
445 | fhDZNormalized[i] = 0; | |
446 | fhDXYvsDZNormalized[i] = 0; | |
447 | fhNSigmaToVertex[i] = 0; | |
448 | ||
449 | fhPt[i] = 0; | |
450 | fhEta[i] = 0; | |
451 | } | |
452 | ffDTheoretical = 0; | |
453 | ||
454 | fhCutStatistics = 0; | |
455 | fhCutCorrelation = 0; | |
456 | } | |
457 | ||
458 | //_____________________________________________________________________________ | |
459 | AliESDtrackCuts &AliESDtrackCuts::operator=(const AliESDtrackCuts &c) | |
460 | { | |
461 | // | |
462 | // Assignment operator | |
463 | // | |
464 | ||
465 | if (this != &c) ((AliESDtrackCuts &) c).Copy(*this); | |
466 | return *this; | |
467 | } | |
468 | ||
469 | //_____________________________________________________________________________ | |
470 | void AliESDtrackCuts::Copy(TObject &c) const | |
471 | { | |
472 | // | |
473 | // Copy function | |
474 | // | |
475 | ||
476 | AliESDtrackCuts& target = (AliESDtrackCuts &) c; | |
477 | ||
478 | target.Init(); | |
479 | ||
480 | target.fCutMinNClusterTPC = fCutMinNClusterTPC; | |
481 | target.fCutMinNClusterITS = fCutMinNClusterITS; | |
07b1b131 | 482 | target.fCutMinNCrossedRowsTPC = fCutMinNCrossedRowsTPC; |
483 | target.fCutMinRatioCrossedRowsOverFindableClustersTPC = fCutMinRatioCrossedRowsOverFindableClustersTPC; | |
484 | ||
73318471 | 485 | |
486 | target.fCutMaxChi2PerClusterTPC = fCutMaxChi2PerClusterTPC; | |
487 | target.fCutMaxChi2PerClusterITS = fCutMaxChi2PerClusterITS; | |
4c3dc2a0 | 488 | target.fCutMaxChi2TPCConstrainedVsGlobal = fCutMaxChi2TPCConstrainedVsGlobal; |
489 | target.fCutMaxChi2TPCConstrainedVsGlobalVertexType = fCutMaxChi2TPCConstrainedVsGlobalVertexType; | |
9023d7ac | 490 | target.fCutMaxMissingITSPoints = fCutMaxMissingITSPoints; |
73318471 | 491 | |
94c06b89 | 492 | for (Int_t i = 0; i < 3; i++) |
493 | target.fCutClusterRequirementITS[i] = fCutClusterRequirementITS[i]; | |
494 | ||
73318471 | 495 | target.fCutMaxC11 = fCutMaxC11; |
496 | target.fCutMaxC22 = fCutMaxC22; | |
497 | target.fCutMaxC33 = fCutMaxC33; | |
498 | target.fCutMaxC44 = fCutMaxC44; | |
499 | target.fCutMaxC55 = fCutMaxC55; | |
500 | ||
025fb458 | 501 | target.fCutMaxRel1PtUncertainty = fCutMaxRel1PtUncertainty; |
502 | ||
73318471 | 503 | target.fCutAcceptKinkDaughters = fCutAcceptKinkDaughters; |
3128582b | 504 | target.fCutAcceptSharedTPCClusters = fCutAcceptSharedTPCClusters; |
505 | target.fCutMaxFractionSharedTPCClusters = fCutMaxFractionSharedTPCClusters; | |
73318471 | 506 | target.fCutRequireTPCRefit = fCutRequireTPCRefit; |
a86cf7f4 | 507 | target.fCutRequireTPCStandAlone = fCutRequireTPCStandAlone; |
73318471 | 508 | target.fCutRequireITSRefit = fCutRequireITSRefit; |
0274b76f | 509 | target.fCutRequireITSPid = fCutRequireITSPid; |
d95684c0 | 510 | target.fCutRequireITSStandAlone = fCutRequireITSStandAlone; |
0274b76f | 511 | target.fCutRequireITSpureSA = fCutRequireITSpureSA; |
73318471 | 512 | |
513 | target.fCutNsigmaToVertex = fCutNsigmaToVertex; | |
514 | target.fCutSigmaToVertexRequired = fCutSigmaToVertexRequired; | |
133a5e00 | 515 | target.fCutMaxDCAToVertexXY = fCutMaxDCAToVertexXY; |
516 | target.fCutMaxDCAToVertexZ = fCutMaxDCAToVertexZ; | |
86f0e195 | 517 | target.fCutDCAToVertex2D = fCutDCAToVertex2D; |
133a5e00 | 518 | target.fCutMinDCAToVertexXY = fCutMinDCAToVertexXY; |
519 | target.fCutMinDCAToVertexZ = fCutMinDCAToVertexZ; | |
f328399b | 520 | |
f4e7aa32 | 521 | target.fCutMaxDCAToVertexXYPtDep = fCutMaxDCAToVertexXYPtDep; |
f328399b | 522 | target.SetMaxDCAToVertexXYPtDep(fCutMaxDCAToVertexXYPtDep.Data()); |
523 | ||
f4e7aa32 | 524 | target.fCutMaxDCAToVertexZPtDep = fCutMaxDCAToVertexZPtDep; |
f328399b | 525 | target.SetMaxDCAToVertexZPtDep(fCutMaxDCAToVertexZPtDep.Data()); |
526 | ||
f4e7aa32 | 527 | target.fCutMinDCAToVertexXYPtDep = fCutMinDCAToVertexXYPtDep; |
f328399b | 528 | target.SetMinDCAToVertexXYPtDep(fCutMinDCAToVertexXYPtDep.Data()); |
529 | ||
f4e7aa32 | 530 | target.fCutMinDCAToVertexZPtDep = fCutMinDCAToVertexZPtDep; |
f328399b | 531 | target.SetMinDCAToVertexZPtDep(fCutMinDCAToVertexZPtDep.Data()); |
73318471 | 532 | |
533 | target.fPMin = fPMin; | |
534 | target.fPMax = fPMax; | |
535 | target.fPtMin = fPtMin; | |
536 | target.fPtMax = fPtMax; | |
537 | target.fPxMin = fPxMin; | |
538 | target.fPxMax = fPxMax; | |
539 | target.fPyMin = fPyMin; | |
540 | target.fPyMax = fPyMax; | |
541 | target.fPzMin = fPzMin; | |
542 | target.fPzMax = fPzMax; | |
543 | target.fEtaMin = fEtaMin; | |
544 | target.fEtaMax = fEtaMax; | |
545 | target.fRapMin = fRapMin; | |
546 | target.fRapMax = fRapMax; | |
547 | ||
548 | target.fHistogramsOn = fHistogramsOn; | |
549 | ||
550 | for (Int_t i=0; i<2; ++i) | |
551 | { | |
552 | if (fhNClustersITS[i]) target.fhNClustersITS[i] = (TH1F*) fhNClustersITS[i]->Clone(); | |
553 | if (fhNClustersTPC[i]) target.fhNClustersTPC[i] = (TH1F*) fhNClustersTPC[i]->Clone(); | |
9023d7ac | 554 | if (fhNSharedClustersTPC[i]) target.fhNSharedClustersTPC[i] = (TH1F*) fhNSharedClustersTPC[i]->Clone(); |
07b1b131 | 555 | if (fhNCrossedRowsTPC[i]) target.fhNCrossedRowsTPC[i] = (TH1F*) fhNCrossedRowsTPC[i]->Clone(); |
556 | if (fhRatioCrossedRowsOverFindableClustersTPC[i]) target.fhRatioCrossedRowsOverFindableClustersTPC[i] = (TH1F*) fhRatioCrossedRowsOverFindableClustersTPC[i]->Clone(); | |
73318471 | 557 | |
558 | if (fhChi2PerClusterITS[i]) target.fhChi2PerClusterITS[i] = (TH1F*) fhChi2PerClusterITS[i]->Clone(); | |
559 | if (fhChi2PerClusterTPC[i]) target.fhChi2PerClusterTPC[i] = (TH1F*) fhChi2PerClusterTPC[i]->Clone(); | |
4c3dc2a0 | 560 | if (fhChi2TPCConstrainedVsGlobal[i]) target.fhChi2TPCConstrainedVsGlobal[i] = (TH1F*) fhChi2TPCConstrainedVsGlobal[i]->Clone(); |
2a35259b | 561 | if (fhNClustersForITSPID[i]) target.fhNClustersForITSPID[i] = (TH1F*) fhNClustersForITSPID[i]->Clone(); |
562 | if (fhNMissingITSPoints[i]) target.fhNMissingITSPoints[i] = (TH1F*) fhNMissingITSPoints[i]->Clone(); | |
73318471 | 563 | |
564 | if (fhC11[i]) target.fhC11[i] = (TH1F*) fhC11[i]->Clone(); | |
565 | if (fhC22[i]) target.fhC22[i] = (TH1F*) fhC22[i]->Clone(); | |
566 | if (fhC33[i]) target.fhC33[i] = (TH1F*) fhC33[i]->Clone(); | |
567 | if (fhC44[i]) target.fhC44[i] = (TH1F*) fhC44[i]->Clone(); | |
568 | if (fhC55[i]) target.fhC55[i] = (TH1F*) fhC55[i]->Clone(); | |
569 | ||
025fb458 | 570 | if (fhRel1PtUncertainty[i]) target.fhRel1PtUncertainty[i] = (TH1F*) fhRel1PtUncertainty[i]->Clone(); |
571 | ||
73318471 | 572 | if (fhDXY[i]) target.fhDXY[i] = (TH1F*) fhDXY[i]->Clone(); |
573 | if (fhDZ[i]) target.fhDZ[i] = (TH1F*) fhDZ[i]->Clone(); | |
524916f0 | 574 | if (fhDXYDZ[i]) target.fhDXYDZ[i] = (TH1F*) fhDXYDZ[i]->Clone(); |
73318471 | 575 | if (fhDXYvsDZ[i]) target.fhDXYvsDZ[i] = (TH2F*) fhDXYvsDZ[i]->Clone(); |
576 | ||
577 | if (fhDXYNormalized[i]) target.fhDXYNormalized[i] = (TH1F*) fhDXYNormalized[i]->Clone(); | |
578 | if (fhDZNormalized[i]) target.fhDZNormalized[i] = (TH1F*) fhDZNormalized[i]->Clone(); | |
579 | if (fhDXYvsDZNormalized[i]) target.fhDXYvsDZNormalized[i] = (TH2F*) fhDXYvsDZNormalized[i]->Clone(); | |
580 | if (fhNSigmaToVertex[i]) target.fhNSigmaToVertex[i] = (TH1F*) fhNSigmaToVertex[i]->Clone(); | |
581 | ||
582 | if (fhPt[i]) target.fhPt[i] = (TH1F*) fhPt[i]->Clone(); | |
583 | if (fhEta[i]) target.fhEta[i] = (TH1F*) fhEta[i]->Clone(); | |
584 | } | |
585 | if (ffDTheoretical) target.ffDTheoretical = (TF1*) ffDTheoretical->Clone(); | |
586 | ||
587 | if (fhCutStatistics) target.fhCutStatistics = (TH1F*) fhCutStatistics->Clone(); | |
588 | if (fhCutCorrelation) target.fhCutCorrelation = (TH2F*) fhCutCorrelation->Clone(); | |
589 | ||
590 | TNamed::Copy(c); | |
591 | } | |
592 | ||
593 | //_____________________________________________________________________________ | |
594 | Long64_t AliESDtrackCuts::Merge(TCollection* list) { | |
595 | // Merge a list of AliESDtrackCuts objects with this (needed for PROOF) | |
596 | // Returns the number of merged objects (including this) | |
73318471 | 597 | if (!list) |
598 | return 0; | |
73318471 | 599 | if (list->IsEmpty()) |
600 | return 1; | |
73318471 | 601 | if (!fHistogramsOn) |
602 | return 0; | |
73318471 | 603 | TIterator* iter = list->MakeIterator(); |
604 | TObject* obj; | |
605 | ||
73318471 | 606 | // collection of measured and generated histograms |
607 | Int_t count = 0; | |
608 | while ((obj = iter->Next())) { | |
609 | ||
610 | AliESDtrackCuts* entry = dynamic_cast<AliESDtrackCuts*>(obj); | |
611 | if (entry == 0) | |
612 | continue; | |
613 | ||
614 | if (!entry->fHistogramsOn) | |
615 | continue; | |
524916f0 | 616 | |
73318471 | 617 | for (Int_t i=0; i<2; i++) { |
618 | ||
619 | fhNClustersITS[i] ->Add(entry->fhNClustersITS[i] ); | |
620 | fhNClustersTPC[i] ->Add(entry->fhNClustersTPC[i] ); | |
9023d7ac | 621 | if (fhNSharedClustersTPC[i]) |
622 | fhNSharedClustersTPC[i] ->Add(entry->fhNSharedClustersTPC[i] ); | |
623 | if (fhNCrossedRowsTPC[i]) | |
624 | fhNCrossedRowsTPC[i] ->Add(entry->fhNCrossedRowsTPC[i] ); | |
625 | if (fhRatioCrossedRowsOverFindableClustersTPC[i]) | |
626 | fhRatioCrossedRowsOverFindableClustersTPC[i] ->Add(entry->fhRatioCrossedRowsOverFindableClustersTPC[i] ); | |
73318471 | 627 | |
628 | fhChi2PerClusterITS[i] ->Add(entry->fhChi2PerClusterITS[i]); | |
629 | fhChi2PerClusterTPC[i] ->Add(entry->fhChi2PerClusterTPC[i]); | |
4c3dc2a0 | 630 | if (fhChi2TPCConstrainedVsGlobal[i]) |
631 | fhChi2TPCConstrainedVsGlobal[i]->Add(entry->fhChi2TPCConstrainedVsGlobal[i]); | |
9006de35 | 632 | if (fhNClustersForITSPID[i]) |
633 | fhNClustersForITSPID[i]->Add(entry->fhNClustersForITSPID[i]); | |
634 | if (fhNMissingITSPoints[i]) | |
635 | fhNMissingITSPoints[i] ->Add(entry->fhNMissingITSPoints[i]); | |
2a35259b | 636 | |
73318471 | 637 | fhC11[i] ->Add(entry->fhC11[i] ); |
638 | fhC22[i] ->Add(entry->fhC22[i] ); | |
639 | fhC33[i] ->Add(entry->fhC33[i] ); | |
640 | fhC44[i] ->Add(entry->fhC44[i] ); | |
025fb458 | 641 | fhC55[i] ->Add(entry->fhC55[i] ); |
642 | ||
643 | fhRel1PtUncertainty[i] ->Add(entry->fhRel1PtUncertainty[i]); | |
73318471 | 644 | |
645 | fhDXY[i] ->Add(entry->fhDXY[i] ); | |
646 | fhDZ[i] ->Add(entry->fhDZ[i] ); | |
524916f0 | 647 | fhDXYDZ[i] ->Add(entry->fhDXYDZ[i] ); |
648 | fhDXYvsDZ[i] ->Add(entry->fhDXYvsDZ[i] ); | |
649 | ||
650 | fhDXYNormalized[i] ->Add(entry->fhDXYNormalized[i] ); | |
73318471 | 651 | fhDZNormalized[i] ->Add(entry->fhDZNormalized[i] ); |
524916f0 | 652 | fhDXYvsDZNormalized[i] ->Add(entry->fhDXYvsDZNormalized[i]); |
73318471 | 653 | fhNSigmaToVertex[i] ->Add(entry->fhNSigmaToVertex[i]); |
654 | ||
655 | fhPt[i] ->Add(entry->fhPt[i]); | |
656 | fhEta[i] ->Add(entry->fhEta[i]); | |
657 | } | |
658 | ||
659 | fhCutStatistics ->Add(entry->fhCutStatistics); | |
660 | fhCutCorrelation ->Add(entry->fhCutCorrelation); | |
661 | ||
662 | count++; | |
663 | } | |
73318471 | 664 | return count+1; |
665 | } | |
666 | ||
1bf80d20 | 667 | //____________________________________________________________________ |
668 | AliESDtrackCuts* AliESDtrackCuts::GetStandardTPCOnlyTrackCuts() | |
669 | { | |
ce3be819 | 670 | // creates an AliESDtrackCuts object and fills it with standard (pre data-taking) values for TPC-only cuts |
1bf80d20 | 671 | |
28348fb4 | 672 | AliInfoClass("Creating track cuts for TPC-only."); |
1bf80d20 | 673 | |
674 | AliESDtrackCuts* esdTrackCuts = new AliESDtrackCuts; | |
675 | ||
676 | esdTrackCuts->SetMinNClustersTPC(50); | |
677 | esdTrackCuts->SetMaxChi2PerClusterTPC(4); | |
678 | esdTrackCuts->SetAcceptKinkDaughters(kFALSE); | |
679 | ||
680 | esdTrackCuts->SetMaxDCAToVertexZ(3.2); | |
681 | esdTrackCuts->SetMaxDCAToVertexXY(2.4); | |
682 | esdTrackCuts->SetDCAToVertex2D(kTRUE); | |
683 | ||
684 | return esdTrackCuts; | |
685 | } | |
686 | ||
f4e7aa32 | 687 | //____________________________________________________________________ |
688 | AliESDtrackCuts* AliESDtrackCuts::GetStandardITSTPCTrackCuts2009(Bool_t selPrimaries) | |
689 | { | |
690 | // creates an AliESDtrackCuts object and fills it with standard values for ITS-TPC cuts for pp 2009 data | |
691 | ||
28348fb4 | 692 | AliInfoClass("Creating track cuts for ITS+TPC (2009 definition)."); |
f4e7aa32 | 693 | |
694 | AliESDtrackCuts* esdTrackCuts = new AliESDtrackCuts; | |
695 | ||
696 | // TPC | |
2dc88643 | 697 | esdTrackCuts->SetRequireTPCStandAlone(kTRUE); // to get chi2 and ncls of kTPCin |
f4e7aa32 | 698 | esdTrackCuts->SetMinNClustersTPC(70); |
699 | esdTrackCuts->SetMaxChi2PerClusterTPC(4); | |
700 | esdTrackCuts->SetAcceptKinkDaughters(kFALSE); | |
ce3be819 | 701 | esdTrackCuts->SetRequireTPCRefit(kTRUE); |
f4e7aa32 | 702 | // ITS |
703 | esdTrackCuts->SetRequireITSRefit(kTRUE); | |
704 | esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, | |
705 | AliESDtrackCuts::kAny); | |
706 | if(selPrimaries) { | |
707 | // 7*(0.0050+0.0060/pt^0.9) | |
708 | esdTrackCuts->SetMaxDCAToVertexXYPtDep("0.0350+0.0420/pt^0.9"); | |
709 | } | |
710 | esdTrackCuts->SetMaxDCAToVertexZ(1.e6); | |
711 | esdTrackCuts->SetDCAToVertex2D(kFALSE); | |
712 | esdTrackCuts->SetRequireSigmaToVertex(kFALSE); | |
713 | //esdTrackCuts->SetEtaRange(-0.8,+0.8); | |
714 | ||
d12b3d70 | 715 | esdTrackCuts->SetMaxChi2PerClusterITS(36); |
716 | esdTrackCuts->SetMaxChi2TPCConstrainedGlobal(36); | |
717 | ||
f4e7aa32 | 718 | return esdTrackCuts; |
719 | } | |
ccfc2389 | 720 | |
721 | //____________________________________________________________________ | |
07b1b131 | 722 | AliESDtrackCuts* AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(Bool_t selPrimaries,Int_t clusterCut) |
ccfc2389 | 723 | { |
07b1b131 | 724 | // creates an AliESDtrackCuts object and fills it with standard values for ITS-TPC cuts for pp 2010 data |
725 | // if clusterCut = 1, the cut on the number of clusters is replaced by | |
726 | // a cut on the number of crossed rows and on the ration crossed | |
727 | // rows/findable clusters | |
728 | ||
28348fb4 | 729 | AliInfoClass("Creating track cuts for ITS+TPC (2010 definition)."); |
ccfc2389 | 730 | |
731 | AliESDtrackCuts* esdTrackCuts = new AliESDtrackCuts; | |
732 | ||
733 | // TPC | |
07b1b131 | 734 | if(clusterCut == 0) esdTrackCuts->SetMinNClustersTPC(70); |
735 | else if (clusterCut == 1) { | |
736 | esdTrackCuts->SetMinNCrossedRowsTPC(70); | |
737 | esdTrackCuts->SetMinRatioCrossedRowsOverFindableClustersTPC(0.8); | |
738 | } | |
739 | else { | |
28348fb4 | 740 | AliWarningClass(Form("Wrong value of the clusterCut parameter (%d), using cut on Nclusters",clusterCut)); |
07b1b131 | 741 | esdTrackCuts->SetMinNClustersTPC(70); |
742 | } | |
ccfc2389 | 743 | esdTrackCuts->SetMaxChi2PerClusterTPC(4); |
744 | esdTrackCuts->SetAcceptKinkDaughters(kFALSE); | |
745 | esdTrackCuts->SetRequireTPCRefit(kTRUE); | |
746 | // ITS | |
747 | esdTrackCuts->SetRequireITSRefit(kTRUE); | |
748 | esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, | |
749 | AliESDtrackCuts::kAny); | |
750 | if(selPrimaries) { | |
751 | // 7*(0.0026+0.0050/pt^1.01) | |
752 | esdTrackCuts->SetMaxDCAToVertexXYPtDep("0.0182+0.0350/pt^1.01"); | |
753 | } | |
754 | esdTrackCuts->SetMaxDCAToVertexZ(2); | |
755 | esdTrackCuts->SetDCAToVertex2D(kFALSE); | |
756 | esdTrackCuts->SetRequireSigmaToVertex(kFALSE); | |
ccfc2389 | 757 | |
d12b3d70 | 758 | esdTrackCuts->SetMaxChi2PerClusterITS(36); |
759 | esdTrackCuts->SetMaxChi2TPCConstrainedGlobal(36); | |
760 | ||
ccfc2389 | 761 | return esdTrackCuts; |
762 | } | |
763 | ||
0274b76f | 764 | //____________________________________________________________________ |
765 | AliESDtrackCuts* AliESDtrackCuts::GetStandardITSPureSATrackCuts2009(Bool_t selPrimaries, Bool_t useForPid) | |
766 | { | |
767 | // creates an AliESDtrackCuts object and fills it with standard values for ITS pure SA tracks | |
768 | ||
769 | AliESDtrackCuts* esdTrackCuts = new AliESDtrackCuts; | |
770 | esdTrackCuts->SetRequireITSPureStandAlone(kTRUE); | |
771 | esdTrackCuts->SetRequireITSRefit(kTRUE); | |
772 | esdTrackCuts->SetMinNClustersITS(4); | |
773 | esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, | |
774 | AliESDtrackCuts::kAny); | |
775 | esdTrackCuts->SetMaxChi2PerClusterITS(1.); | |
776 | ||
777 | if(selPrimaries) { | |
778 | // 7*(0.0085+0.0026/pt^1.55) | |
779 | esdTrackCuts->SetMaxDCAToVertexXYPtDep("0.0595+0.0182/pt^1.55"); | |
780 | } | |
781 | if(useForPid){ | |
782 | esdTrackCuts->SetRequireITSPid(kTRUE); | |
783 | } | |
784 | return esdTrackCuts; | |
785 | } | |
ccfc2389 | 786 | |
97b2cf9e | 787 | //____________________________________________________________________ |
788 | AliESDtrackCuts* AliESDtrackCuts::GetStandardITSPureSATrackCuts2010(Bool_t selPrimaries, Bool_t useForPid) | |
789 | { | |
790 | // creates an AliESDtrackCuts object and fills it with standard values for ITS pure SA tracks - pp 2010 | |
791 | ||
792 | AliESDtrackCuts* esdTrackCuts = new AliESDtrackCuts; | |
793 | esdTrackCuts->SetRequireITSPureStandAlone(kTRUE); | |
794 | esdTrackCuts->SetRequireITSRefit(kTRUE); | |
795 | esdTrackCuts->SetMinNClustersITS(4); | |
796 | esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, | |
797 | AliESDtrackCuts::kAny); | |
798 | esdTrackCuts->SetMaxChi2PerClusterITS(2.5); | |
799 | ||
800 | if(selPrimaries) { | |
801 | // 7*(0.0033+0.0045/pt^1.3) | |
802 | esdTrackCuts->SetMaxDCAToVertexXYPtDep("0.0231+0.0315/pt^1.3"); | |
803 | } | |
804 | if(useForPid){ | |
805 | esdTrackCuts->SetRequireITSPid(kTRUE); | |
806 | } | |
807 | return esdTrackCuts; | |
808 | } | |
809 | ||
0274b76f | 810 | //____________________________________________________________________ |
811 | AliESDtrackCuts* AliESDtrackCuts::GetStandardITSSATrackCuts2009(Bool_t selPrimaries, Bool_t useForPid) | |
812 | { | |
813 | // creates an AliESDtrackCuts object and fills it with standard values for ITS pure SA tracks | |
814 | ||
815 | AliESDtrackCuts* esdTrackCuts = new AliESDtrackCuts; | |
816 | esdTrackCuts->SetRequireITSStandAlone(kTRUE); | |
817 | esdTrackCuts->SetRequireITSPureStandAlone(kFALSE); | |
818 | esdTrackCuts->SetRequireITSRefit(kTRUE); | |
819 | esdTrackCuts->SetMinNClustersITS(4); | |
820 | esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, | |
821 | AliESDtrackCuts::kAny); | |
822 | esdTrackCuts->SetMaxChi2PerClusterITS(1.); | |
823 | ||
824 | if(selPrimaries) { | |
825 | // 7*(0.0085+0.0026/pt^1.55) | |
826 | esdTrackCuts->SetMaxDCAToVertexXYPtDep("0.0595+0.0182/pt^1.55"); | |
827 | } | |
828 | if(useForPid){ | |
829 | esdTrackCuts->SetRequireITSPid(kTRUE); | |
830 | } | |
831 | return esdTrackCuts; | |
832 | } | |
833 | ||
97b2cf9e | 834 | //____________________________________________________________________ |
835 | AliESDtrackCuts* AliESDtrackCuts::GetStandardITSSATrackCuts2010(Bool_t selPrimaries, Bool_t useForPid) | |
836 | { | |
837 | // creates an AliESDtrackCuts object and fills it with standard values for ITS pure SA tracks --pp 2010 | |
838 | ||
839 | AliESDtrackCuts* esdTrackCuts = new AliESDtrackCuts; | |
840 | esdTrackCuts->SetRequireITSStandAlone(kTRUE); | |
841 | esdTrackCuts->SetRequireITSPureStandAlone(kFALSE); | |
842 | esdTrackCuts->SetRequireITSRefit(kTRUE); | |
843 | esdTrackCuts->SetMinNClustersITS(4); | |
844 | esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, | |
845 | AliESDtrackCuts::kAny); | |
846 | esdTrackCuts->SetMaxChi2PerClusterITS(2.5); | |
847 | ||
848 | if(selPrimaries) { | |
849 | // 7*(0.0033+0.0045/pt^1.3) | |
850 | esdTrackCuts->SetMaxDCAToVertexXYPtDep("0.0231+0.0315/pt^1.3"); | |
851 | } | |
852 | if(useForPid){ | |
853 | esdTrackCuts->SetRequireITSPid(kTRUE); | |
854 | } | |
855 | return esdTrackCuts; | |
856 | } | |
f4e7aa32 | 857 | |
9023d7ac | 858 | //____________________________________________________________________ |
859 | AliESDtrackCuts* AliESDtrackCuts::GetStandardITSSATrackCutsPbPb2010(Bool_t selPrimaries, Bool_t useForPid) | |
860 | { | |
861 | // creates an AliESDtrackCuts object and fills it with standard values for ITS pure SA tracks -- PbPb 2010 | |
862 | ||
863 | AliESDtrackCuts* esdTrackCuts = GetStandardITSSATrackCuts2010(selPrimaries, useForPid); | |
864 | esdTrackCuts->SetMaxNOfMissingITSPoints(1); | |
865 | ||
866 | return esdTrackCuts; | |
867 | } | |
28348fb4 | 868 | //____________________________________________________________________ |
869 | ||
870 | AliESDtrackCuts* AliESDtrackCuts::GetStandardV0DaughterCuts() | |
871 | { | |
872 | // creates a AliESDtrackCuts object and fills it with standard cuts for V0 daughters | |
873 | AliESDtrackCuts* esdTrackCuts = new AliESDtrackCuts; | |
874 | esdTrackCuts->SetRequireTPCRefit(kTRUE); | |
875 | esdTrackCuts->SetMinNClustersTPC(70); | |
876 | esdTrackCuts->SetAcceptKinkDaughters(kFALSE); | |
877 | return esdTrackCuts; | |
878 | } | |
9023d7ac | 879 | |
1bf80d20 | 880 | //____________________________________________________________________ |
f7ce7a37 | 881 | Int_t AliESDtrackCuts::GetReferenceMultiplicity(const AliESDEvent* esd, Bool_t tpcOnly) |
1bf80d20 | 882 | { |
883 | // Gets reference multiplicity following the standard cuts and a defined fiducial volume | |
884 | // tpcOnly = kTRUE -> consider TPC-only tracks | |
885 | // = kFALSE -> consider global tracks | |
a61ab805 | 886 | // |
887 | // DEPRECATED Use GetReferenceMultiplicity with the enum as second argument instead | |
1bf80d20 | 888 | |
889 | if (!tpcOnly) | |
890 | { | |
28348fb4 | 891 | AliErrorClass("Not implemented for global tracks!"); |
1bf80d20 | 892 | return -1; |
893 | } | |
894 | ||
8fb3df98 | 895 | static AliESDtrackCuts* esdTrackCuts = 0; |
896 | if (!esdTrackCuts) | |
897 | { | |
898 | esdTrackCuts = GetStandardTPCOnlyTrackCuts(); | |
899 | esdTrackCuts->SetEtaRange(-0.8, 0.8); | |
900 | esdTrackCuts->SetPtRange(0.15); | |
901 | } | |
1bf80d20 | 902 | |
903 | Int_t nTracks = esdTrackCuts->CountAcceptedTracks(esd); | |
904 | ||
1bf80d20 | 905 | return nTracks; |
906 | } | |
73318471 | 907 | |
908 | //____________________________________________________________________ | |
4c3dc2a0 | 909 | Float_t AliESDtrackCuts::GetSigmaToVertex(const AliESDtrack* const esdTrack) |
73318471 | 910 | { |
911 | // Calculates the number of sigma to the vertex. | |
912 | ||
913 | Float_t b[2]; | |
914 | Float_t bRes[2]; | |
915 | Float_t bCov[3]; | |
916 | esdTrack->GetImpactParameters(b,bCov); | |
36853ddd | 917 | |
73318471 | 918 | if (bCov[0]<=0 || bCov[2]<=0) { |
57fddfbc | 919 | AliDebugClass(1, "Estimated b resolution lower or equal zero!"); |
73318471 | 920 | bCov[0]=0; bCov[2]=0; |
921 | } | |
922 | bRes[0] = TMath::Sqrt(bCov[0]); | |
923 | bRes[1] = TMath::Sqrt(bCov[2]); | |
924 | ||
925 | // ----------------------------------- | |
926 | // How to get to a n-sigma cut? | |
927 | // | |
928 | // The accumulated statistics from 0 to d is | |
929 | // | |
930 | // -> Erf(d/Sqrt(2)) for a 1-dim gauss (d = n_sigma) | |
931 | // -> 1 - Exp(-d**2) for a 2-dim gauss (d*d = dx*dx + dy*dy != n_sigma) | |
932 | // | |
cae2c21a | 933 | // It means that for a 2-dim gauss: n_sigma(d) = Sqrt(2)*ErfInv(1 - Exp((-d**2)/2) |
73318471 | 934 | // Can this be expressed in a different way? |
935 | ||
936 | if (bRes[0] == 0 || bRes[1] ==0) | |
937 | return -1; | |
938 | ||
939 | Float_t d = TMath::Sqrt(TMath::Power(b[0]/bRes[0],2) + TMath::Power(b[1]/bRes[1],2)); | |
940 | ||
0f712a2e | 941 | // work around precision problem |
73318471 | 942 | // if d is too big, TMath::Exp(...) gets 0, and TMath::ErfInverse(1) that should be infinite, gets 0 :( |
0f712a2e | 943 | // 1e-15 corresponds to nsigma ~ 7.7 |
944 | if (TMath::Exp(-d * d / 2) < 1e-15) | |
73318471 | 945 | return 1000; |
946 | ||
0f712a2e | 947 | Float_t nSigma = TMath::ErfInverse(1 - TMath::Exp(-d * d / 2)) * TMath::Sqrt(2); |
948 | return nSigma; | |
73318471 | 949 | } |
950 | ||
951 | void AliESDtrackCuts::EnableNeededBranches(TTree* tree) | |
952 | { | |
953 | // enables the branches needed by AcceptTrack, for a list see comment of AcceptTrack | |
954 | ||
955 | tree->SetBranchStatus("fTracks.fFlags", 1); | |
956 | tree->SetBranchStatus("fTracks.fITSncls", 1); | |
957 | tree->SetBranchStatus("fTracks.fTPCncls", 1); | |
958 | tree->SetBranchStatus("fTracks.fITSchi2", 1); | |
959 | tree->SetBranchStatus("fTracks.fTPCchi2", 1); | |
960 | tree->SetBranchStatus("fTracks.fC*", 1); | |
961 | tree->SetBranchStatus("fTracks.fD", 1); | |
962 | tree->SetBranchStatus("fTracks.fZ", 1); | |
963 | tree->SetBranchStatus("fTracks.fCdd", 1); | |
964 | tree->SetBranchStatus("fTracks.fCdz", 1); | |
965 | tree->SetBranchStatus("fTracks.fCzz", 1); | |
966 | tree->SetBranchStatus("fTracks.fP*", 1); | |
967 | tree->SetBranchStatus("fTracks.fR*", 1); | |
968 | tree->SetBranchStatus("fTracks.fKinkIndexes*", 1); | |
969 | } | |
970 | ||
971 | //____________________________________________________________________ | |
4c3dc2a0 | 972 | Bool_t AliESDtrackCuts::AcceptTrack(const AliESDtrack* esdTrack, const AliESDEvent* esdEvent) |
d95684c0 | 973 | { |
73318471 | 974 | // |
975 | // figure out if the tracks survives all the track cuts defined | |
976 | // | |
977 | // the different quality parameter and kinematic values are first | |
978 | // retrieved from the track. then it is found out what cuts the | |
979 | // track did not survive and finally the cuts are imposed. | |
980 | ||
981 | // this function needs the following branches: | |
982 | // fTracks.fFlags | |
983 | // fTracks.fITSncls | |
984 | // fTracks.fTPCncls | |
985 | // fTracks.fITSchi2 | |
986 | // fTracks.fTPCchi2 | |
987 | // fTracks.fC //GetExternalCovariance | |
988 | // fTracks.fD //GetImpactParameters | |
989 | // fTracks.fZ //GetImpactParameters | |
990 | // fTracks.fCdd //GetImpactParameters | |
991 | // fTracks.fCdz //GetImpactParameters | |
992 | // fTracks.fCzz //GetImpactParameters | |
993 | // fTracks.fP //GetPxPyPz | |
994 | // fTracks.fR //GetMass | |
995 | // fTracks.fP //GetMass | |
996 | // fTracks.fKinkIndexes | |
4c3dc2a0 | 997 | // |
998 | // esdEvent is only required for the MaxChi2TPCConstrainedVsGlobal | |
73318471 | 999 | |
1000 | UInt_t status = esdTrack->GetStatus(); | |
1001 | ||
73318471 | 1002 | // getting quality parameters from the ESD track |
524916f0 | 1003 | Int_t nClustersITS = esdTrack->GetITSclusters(0); |
a86cf7f4 | 1004 | Int_t nClustersTPC = -1; |
1005 | if(fCutRequireTPCStandAlone) { | |
1006 | nClustersTPC = esdTrack->GetTPCNclsIter1(); | |
1007 | } | |
1008 | else { | |
1009 | nClustersTPC = esdTrack->GetTPCclusters(0); | |
1010 | } | |
4c3dc2a0 | 1011 | Float_t nCrossedRowsTPC = esdTrack->GetTPCCrossedRows(); |
3be03022 | 1012 | Float_t ratioCrossedRowsOverFindableClustersTPC = 1.0; |
1013 | if (esdTrack->GetTPCNclsF()>0) { | |
9006de35 | 1014 | ratioCrossedRowsOverFindableClustersTPC = nCrossedRowsTPC / esdTrack->GetTPCNclsF(); |
3be03022 | 1015 | } |
07b1b131 | 1016 | |
3128582b | 1017 | Int_t nClustersTPCShared = esdTrack->GetTPCnclsS(); |
1018 | Float_t fracClustersTPCShared = -1.; | |
1019 | ||
73318471 | 1020 | Float_t chi2PerClusterITS = -1; |
1021 | Float_t chi2PerClusterTPC = -1; | |
1022 | if (nClustersITS!=0) | |
1023 | chi2PerClusterITS = esdTrack->GetITSchi2()/Float_t(nClustersITS); | |
a86cf7f4 | 1024 | if (nClustersTPC!=0) { |
1025 | if(fCutRequireTPCStandAlone) { | |
1026 | chi2PerClusterTPC = esdTrack->GetTPCchi2Iter1()/Float_t(nClustersTPC); | |
1027 | } else { | |
1028 | chi2PerClusterTPC = esdTrack->GetTPCchi2()/Float_t(nClustersTPC); | |
1029 | } | |
3128582b | 1030 | fracClustersTPCShared = Float_t(nClustersTPCShared)/Float_t(nClustersTPC); |
a86cf7f4 | 1031 | } |
1032 | ||
73318471 | 1033 | Double_t extCov[15]; |
1034 | esdTrack->GetExternalCovariance(extCov); | |
1035 | ||
524916f0 | 1036 | Float_t b[2]; |
1037 | Float_t bCov[3]; | |
1038 | esdTrack->GetImpactParameters(b,bCov); | |
1039 | if (bCov[0]<=0 || bCov[2]<=0) { | |
1040 | AliDebug(1, "Estimated b resolution lower or equal zero!"); | |
1041 | bCov[0]=0; bCov[2]=0; | |
1042 | } | |
74687314 | 1043 | |
f4e7aa32 | 1044 | |
1045 | // set pt-dependent DCA cuts, if requested | |
1046 | SetPtDepDCACuts(esdTrack->Pt()); | |
1047 | ||
1048 | ||
e4617f4e | 1049 | Float_t dcaToVertexXY = b[0]; |
74687314 | 1050 | Float_t dcaToVertexZ = b[1]; |
1051 | ||
86f0e195 | 1052 | Float_t dcaToVertex = -1; |
1053 | ||
1054 | if (fCutDCAToVertex2D) | |
1055 | { | |
133a5e00 | 1056 | dcaToVertex = TMath::Sqrt(dcaToVertexXY*dcaToVertexXY/fCutMaxDCAToVertexXY/fCutMaxDCAToVertexXY + dcaToVertexZ*dcaToVertexZ/fCutMaxDCAToVertexZ/fCutMaxDCAToVertexZ); |
86f0e195 | 1057 | } |
1058 | else | |
1059 | dcaToVertex = TMath::Sqrt(dcaToVertexXY*dcaToVertexXY + dcaToVertexZ*dcaToVertexZ); | |
133a5e00 | 1060 | |
73318471 | 1061 | // getting the kinematic variables of the track |
1062 | // (assuming the mass is known) | |
1063 | Double_t p[3]; | |
1064 | esdTrack->GetPxPyPz(p); | |
36853ddd | 1065 | |
73318471 | 1066 | Float_t momentum = TMath::Sqrt(TMath::Power(p[0],2) + TMath::Power(p[1],2) + TMath::Power(p[2],2)); |
1067 | Float_t pt = TMath::Sqrt(TMath::Power(p[0],2) + TMath::Power(p[1],2)); | |
1068 | Float_t energy = TMath::Sqrt(TMath::Power(esdTrack->GetMass(),2) + TMath::Power(momentum,2)); | |
1069 | ||
73318471 | 1070 | //y-eta related calculations |
1071 | Float_t eta = -100.; | |
1072 | Float_t y = -100.; | |
1073 | if((momentum != TMath::Abs(p[2]))&&(momentum != 0)) | |
1074 | eta = 0.5*TMath::Log((momentum + p[2])/(momentum - p[2])); | |
1075 | if((energy != TMath::Abs(p[2]))&&(momentum != 0)) | |
1076 | y = 0.5*TMath::Log((energy + p[2])/(energy - p[2])); | |
025fb458 | 1077 | |
4853f638 | 1078 | if (extCov[14] < 0) |
1079 | { | |
28348fb4 | 1080 | AliWarning(Form("GetSigma1Pt2() returns negative value for external covariance matrix element fC[14]: %f. Corrupted track information, track will not be accepted!", extCov[14])); |
4853f638 | 1081 | return kFALSE; |
1082 | } | |
025fb458 | 1083 | Float_t relUncertainty1Pt = TMath::Sqrt(extCov[14])*pt; |
73318471 | 1084 | |
1085 | //######################################################################## | |
1086 | // cut the track? | |
1087 | ||
1088 | Bool_t cuts[kNCuts]; | |
1089 | for (Int_t i=0; i<kNCuts; i++) cuts[i]=kFALSE; | |
1090 | ||
1091 | // track quality cuts | |
1092 | if (fCutRequireTPCRefit && (status&AliESDtrack::kTPCrefit)==0) | |
1093 | cuts[0]=kTRUE; | |
a86cf7f4 | 1094 | if (fCutRequireTPCStandAlone && (status&AliESDtrack::kTPCin)==0) |
73318471 | 1095 | cuts[1]=kTRUE; |
a86cf7f4 | 1096 | if (fCutRequireITSRefit && (status&AliESDtrack::kITSrefit)==0) |
73318471 | 1097 | cuts[2]=kTRUE; |
a86cf7f4 | 1098 | if (nClustersTPC<fCutMinNClusterTPC) |
73318471 | 1099 | cuts[3]=kTRUE; |
a86cf7f4 | 1100 | if (nClustersITS<fCutMinNClusterITS) |
1101 | cuts[4]=kTRUE; | |
73318471 | 1102 | if (chi2PerClusterTPC>fCutMaxChi2PerClusterTPC) |
a86cf7f4 | 1103 | cuts[5]=kTRUE; |
73318471 | 1104 | if (chi2PerClusterITS>fCutMaxChi2PerClusterITS) |
a86cf7f4 | 1105 | cuts[6]=kTRUE; |
73318471 | 1106 | if (extCov[0] > fCutMaxC11) |
73318471 | 1107 | cuts[7]=kTRUE; |
a86cf7f4 | 1108 | if (extCov[2] > fCutMaxC22) |
73318471 | 1109 | cuts[8]=kTRUE; |
a86cf7f4 | 1110 | if (extCov[5] > fCutMaxC33) |
73318471 | 1111 | cuts[9]=kTRUE; |
a86cf7f4 | 1112 | if (extCov[9] > fCutMaxC44) |
73318471 | 1113 | cuts[10]=kTRUE; |
a86cf7f4 | 1114 | if (extCov[14] > fCutMaxC55) |
1115 | cuts[11]=kTRUE; | |
4c3dc2a0 | 1116 | |
1117 | // cut 12 and 13 see below | |
1118 | ||
a86cf7f4 | 1119 | if (!fCutAcceptKinkDaughters && esdTrack->GetKinkIndex(0)>0) |
1120 | cuts[14]=kTRUE; | |
73318471 | 1121 | // track kinematics cut |
1122 | if((momentum < fPMin) || (momentum > fPMax)) | |
a86cf7f4 | 1123 | cuts[15]=kTRUE; |
73318471 | 1124 | if((pt < fPtMin) || (pt > fPtMax)) |
73318471 | 1125 | cuts[16] = kTRUE; |
a86cf7f4 | 1126 | if((p[0] < fPxMin) || (p[0] > fPxMax)) |
73318471 | 1127 | cuts[17] = kTRUE; |
a86cf7f4 | 1128 | if((p[1] < fPyMin) || (p[1] > fPyMax)) |
73318471 | 1129 | cuts[18] = kTRUE; |
a86cf7f4 | 1130 | if((p[2] < fPzMin) || (p[2] > fPzMax)) |
73318471 | 1131 | cuts[19] = kTRUE; |
a86cf7f4 | 1132 | if((eta < fEtaMin) || (eta > fEtaMax)) |
73318471 | 1133 | cuts[20] = kTRUE; |
a86cf7f4 | 1134 | if((y < fRapMin) || (y > fRapMax)) |
524916f0 | 1135 | cuts[21] = kTRUE; |
a86cf7f4 | 1136 | if (fCutDCAToVertex2D && dcaToVertex > 1) |
e4617f4e | 1137 | cuts[22] = kTRUE; |
a86cf7f4 | 1138 | if (!fCutDCAToVertex2D && TMath::Abs(dcaToVertexXY) > fCutMaxDCAToVertexXY) |
74687314 | 1139 | cuts[23] = kTRUE; |
a86cf7f4 | 1140 | if (!fCutDCAToVertex2D && TMath::Abs(dcaToVertexZ) > fCutMaxDCAToVertexZ) |
133a5e00 | 1141 | cuts[24] = kTRUE; |
a86cf7f4 | 1142 | if (fCutDCAToVertex2D && fCutMinDCAToVertexXY > 0 && fCutMinDCAToVertexZ > 0 && dcaToVertexXY*dcaToVertexXY/fCutMinDCAToVertexXY/fCutMinDCAToVertexXY + dcaToVertexZ*dcaToVertexZ/fCutMinDCAToVertexZ/fCutMinDCAToVertexZ < 1) |
133a5e00 | 1143 | cuts[25] = kTRUE; |
a86cf7f4 | 1144 | if (!fCutDCAToVertex2D && TMath::Abs(dcaToVertexXY) < fCutMinDCAToVertexXY) |
133a5e00 | 1145 | cuts[26] = kTRUE; |
a86cf7f4 | 1146 | if (!fCutDCAToVertex2D && TMath::Abs(dcaToVertexZ) < fCutMinDCAToVertexZ) |
1147 | cuts[27] = kTRUE; | |
94c06b89 | 1148 | |
1149 | for (Int_t i = 0; i < 3; i++) | |
a86cf7f4 | 1150 | cuts[28+i] = !CheckITSClusterRequirement(fCutClusterRequirementITS[i], esdTrack->HasPointOnITSLayer(i*2), esdTrack->HasPointOnITSLayer(i*2+1)); |
d95684c0 | 1151 | |
0274b76f | 1152 | if(fCutRequireITSStandAlone || fCutRequireITSpureSA){ |
1153 | if ((status & AliESDtrack::kITSin) == 0 || (status & AliESDtrack::kTPCin)){ | |
1154 | // TPC tracks | |
1155 | cuts[31] = kTRUE; | |
1156 | }else{ | |
1157 | // ITS standalone tracks | |
1158 | if(fCutRequireITSStandAlone && !fCutRequireITSpureSA){ | |
1159 | if(status & AliESDtrack::kITSpureSA) cuts[31] = kTRUE; | |
1160 | }else if(fCutRequireITSpureSA){ | |
1161 | if(!(status & AliESDtrack::kITSpureSA)) cuts[31] = kTRUE; | |
1162 | } | |
1163 | } | |
1164 | } | |
f4e7aa32 | 1165 | |
025fb458 | 1166 | if (relUncertainty1Pt > fCutMaxRel1PtUncertainty) |
3128582b | 1167 | cuts[32] = kTRUE; |
1168 | ||
1169 | if (!fCutAcceptSharedTPCClusters && nClustersTPCShared!=0) | |
1170 | cuts[33] = kTRUE; | |
1171 | ||
1172 | if (fracClustersTPCShared > fCutMaxFractionSharedTPCClusters) | |
1173 | cuts[34] = kTRUE; | |
1174 | ||
2a35259b | 1175 | Int_t nITSPointsForPid=0; |
1176 | UChar_t clumap=esdTrack->GetITSClusterMap(); | |
1177 | for(Int_t i=2; i<6; i++){ | |
1178 | if(clumap&(1<<i)) ++nITSPointsForPid; | |
0274b76f | 1179 | } |
2a35259b | 1180 | if(fCutRequireITSPid && nITSPointsForPid<3) cuts[35] = kTRUE; |
1181 | ||
0274b76f | 1182 | |
07b1b131 | 1183 | if (nCrossedRowsTPC<fCutMinNCrossedRowsTPC) |
1184 | cuts[36]=kTRUE; | |
1185 | if (ratioCrossedRowsOverFindableClustersTPC<fCutMinRatioCrossedRowsOverFindableClustersTPC) | |
1186 | cuts[37]=kTRUE; | |
1187 | ||
9023d7ac | 1188 | Int_t nMissITSpts=0; |
1189 | Int_t idet,statusLay; | |
1190 | Float_t xloc,zloc; | |
1191 | for(Int_t iLay=0; iLay<6; iLay++){ | |
1192 | Bool_t retc=esdTrack->GetITSModuleIndexInfo(iLay,idet,statusLay,xloc,zloc); | |
1193 | if(retc && statusLay==5) ++nMissITSpts; | |
1194 | } | |
1195 | if(nMissITSpts>fCutMaxMissingITSPoints) cuts[38] = kTRUE; | |
4c3dc2a0 | 1196 | |
73318471 | 1197 | Bool_t cut=kFALSE; |
1198 | for (Int_t i=0; i<kNCuts; i++) | |
133a5e00 | 1199 | if (cuts[i]) {cut = kTRUE;} |
524916f0 | 1200 | |
4c3dc2a0 | 1201 | // for performance evaluate the CPU intensive cuts only when the others have passed, and when they are requested |
1202 | Double_t chi2TPCConstrainedVsGlobal = -2; | |
1203 | Float_t nSigmaToVertex = -2; | |
1204 | if (!cut) | |
1205 | { | |
1206 | // getting the track to vertex parameters | |
1207 | if (fCutSigmaToVertexRequired) | |
1208 | { | |
1209 | nSigmaToVertex = GetSigmaToVertex(esdTrack); | |
1210 | if (nSigmaToVertex > fCutNsigmaToVertex && fCutSigmaToVertexRequired) | |
1211 | { | |
1212 | cuts[12] = kTRUE; | |
1213 | cut = kTRUE; | |
1214 | } | |
1215 | // if n sigma could not be calculated | |
1216 | if (nSigmaToVertex<0 && fCutSigmaToVertexRequired) | |
1217 | { | |
1218 | cuts[13] = kTRUE; | |
1219 | cut = kTRUE; | |
1220 | } | |
1221 | } | |
1222 | ||
1223 | // max chi2 TPC constrained vs global track only if track passed the other cut | |
1224 | if (fCutMaxChi2TPCConstrainedVsGlobal < 1e9) | |
1225 | { | |
1226 | if (!esdEvent) | |
1227 | AliFatal("fCutMaxChi2TPCConstrainedVsGlobal set but ESD event not provided."); | |
1228 | ||
1229 | // get vertex | |
1230 | const AliESDVertex* vertex = 0; | |
1231 | if (fCutMaxChi2TPCConstrainedVsGlobalVertexType & kVertexTracks) | |
1232 | vertex = esdEvent->GetPrimaryVertexTracks(); | |
1233 | ||
1234 | if ((!vertex || !vertex->GetStatus()) && fCutMaxChi2TPCConstrainedVsGlobalVertexType & kVertexSPD) | |
1235 | vertex = esdEvent->GetPrimaryVertexSPD(); | |
1236 | ||
1237 | if ((!vertex || !vertex->GetStatus()) && fCutMaxChi2TPCConstrainedVsGlobalVertexType & kVertexTPC) | |
1238 | vertex = esdEvent->GetPrimaryVertexTPC(); | |
1239 | ||
1240 | if (vertex->GetStatus()) | |
1241 | chi2TPCConstrainedVsGlobal = esdTrack->GetChi2TPCConstrainedVsGlobal(vertex); | |
1242 | ||
1243 | if (chi2TPCConstrainedVsGlobal < 0 || chi2TPCConstrainedVsGlobal > fCutMaxChi2TPCConstrainedVsGlobal) | |
1244 | { | |
1245 | cuts[39] = kTRUE; | |
1246 | cut = kTRUE; | |
1247 | } | |
1248 | } | |
1249 | } | |
1250 | ||
73318471 | 1251 | //######################################################################## |
1252 | // filling histograms | |
1253 | if (fHistogramsOn) { | |
1254 | fhCutStatistics->Fill(fhCutStatistics->GetBinCenter(fhCutStatistics->GetXaxis()->FindBin("n tracks"))); | |
73318471 | 1255 | if (cut) |
1256 | fhCutStatistics->Fill(fhCutStatistics->GetBinCenter(fhCutStatistics->GetXaxis()->FindBin("n cut tracks"))); | |
1257 | ||
1258 | for (Int_t i=0; i<kNCuts; i++) { | |
ecd4e3ba | 1259 | if (fhCutStatistics->GetXaxis()->FindBin(fgkCutNames[i]) < 1) |
1260 | AliFatal(Form("Inconsistency! Cut %d with name %s not found", i, fgkCutNames[i])); | |
1261 | ||
73318471 | 1262 | if (cuts[i]) |
524916f0 | 1263 | fhCutStatistics->Fill(fhCutStatistics->GetBinCenter(fhCutStatistics->GetXaxis()->FindBin(fgkCutNames[i]))); |
1264 | ||
73318471 | 1265 | for (Int_t j=i; j<kNCuts; j++) { |
524916f0 | 1266 | if (cuts[i] && cuts[j]) { |
1267 | Float_t xC = fhCutCorrelation->GetXaxis()->GetBinCenter(fhCutCorrelation->GetXaxis()->FindBin(fgkCutNames[i])); | |
1268 | Float_t yC = fhCutCorrelation->GetYaxis()->GetBinCenter(fhCutCorrelation->GetYaxis()->FindBin(fgkCutNames[j])); | |
1269 | fhCutCorrelation->Fill(xC, yC); | |
1270 | } | |
73318471 | 1271 | } |
1272 | } | |
73318471 | 1273 | } |
ecd4e3ba | 1274 | |
524916f0 | 1275 | // now we loop over the filling of the histograms twice: once "before" the cut, once "after" |
1276 | // the code is not in a function due to too many local variables that would need to be passed | |
73318471 | 1277 | |
524916f0 | 1278 | for (Int_t id = 0; id < 2; id++) |
1279 | { | |
1280 | // id = 0 --> before cut | |
1281 | // id = 1 --> after cut | |
73318471 | 1282 | |
524916f0 | 1283 | if (fHistogramsOn) |
73318471 | 1284 | { |
524916f0 | 1285 | fhNClustersITS[id]->Fill(nClustersITS); |
1286 | fhNClustersTPC[id]->Fill(nClustersTPC); | |
9023d7ac | 1287 | fhNSharedClustersTPC[id]->Fill(nClustersTPCShared); |
07b1b131 | 1288 | fhNCrossedRowsTPC[id]->Fill(nCrossedRowsTPC); |
1289 | fhRatioCrossedRowsOverFindableClustersTPC[id]->Fill(ratioCrossedRowsOverFindableClustersTPC); | |
524916f0 | 1290 | fhChi2PerClusterITS[id]->Fill(chi2PerClusterITS); |
1291 | fhChi2PerClusterTPC[id]->Fill(chi2PerClusterTPC); | |
4c3dc2a0 | 1292 | fhChi2TPCConstrainedVsGlobal[id]->Fill(chi2TPCConstrainedVsGlobal); |
2a35259b | 1293 | fhNClustersForITSPID[id]->Fill(nITSPointsForPid); |
1294 | fhNMissingITSPoints[id]->Fill(nMissITSpts); | |
524916f0 | 1295 | |
1296 | fhC11[id]->Fill(extCov[0]); | |
1297 | fhC22[id]->Fill(extCov[2]); | |
1298 | fhC33[id]->Fill(extCov[5]); | |
1299 | fhC44[id]->Fill(extCov[9]); | |
1300 | fhC55[id]->Fill(extCov[14]); | |
1301 | ||
025fb458 | 1302 | fhRel1PtUncertainty[id]->Fill(relUncertainty1Pt); |
1303 | ||
524916f0 | 1304 | fhPt[id]->Fill(pt); |
1305 | fhEta[id]->Fill(eta); | |
1306 | ||
1307 | Float_t bRes[2]; | |
1308 | bRes[0] = TMath::Sqrt(bCov[0]); | |
1309 | bRes[1] = TMath::Sqrt(bCov[2]); | |
1310 | ||
1311 | fhDZ[id]->Fill(b[1]); | |
1312 | fhDXY[id]->Fill(b[0]); | |
1313 | fhDXYDZ[id]->Fill(dcaToVertex); | |
1314 | fhDXYvsDZ[id]->Fill(b[1],b[0]); | |
1315 | ||
1316 | if (bRes[0]!=0 && bRes[1]!=0) { | |
1317 | fhDZNormalized[id]->Fill(b[1]/bRes[1]); | |
1318 | fhDXYNormalized[id]->Fill(b[0]/bRes[0]); | |
1319 | fhDXYvsDZNormalized[id]->Fill(b[1]/bRes[1], b[0]/bRes[0]); | |
1320 | fhNSigmaToVertex[id]->Fill(nSigmaToVertex); | |
1321 | } | |
73318471 | 1322 | } |
524916f0 | 1323 | |
1324 | // cut the track | |
1325 | if (cut) | |
1326 | return kFALSE; | |
73318471 | 1327 | } |
1328 | ||
1329 | return kTRUE; | |
1330 | } | |
1331 | ||
94c06b89 | 1332 | //____________________________________________________________________ |
1333 | Bool_t AliESDtrackCuts::CheckITSClusterRequirement(ITSClusterRequirement req, Bool_t clusterL1, Bool_t clusterL2) | |
1334 | { | |
1335 | // checks if the cluster requirement is fullfilled (in this case: return kTRUE) | |
1336 | ||
1337 | switch (req) | |
1338 | { | |
1339 | case kOff: return kTRUE; | |
1340 | case kNone: return !clusterL1 && !clusterL2; | |
1341 | case kAny: return clusterL1 || clusterL2; | |
1342 | case kFirst: return clusterL1; | |
1343 | case kOnlyFirst: return clusterL1 && !clusterL2; | |
1344 | case kSecond: return clusterL2; | |
1345 | case kOnlySecond: return clusterL2 && !clusterL1; | |
1346 | case kBoth: return clusterL1 && clusterL2; | |
1347 | } | |
1348 | ||
1349 | return kFALSE; | |
1350 | } | |
1351 | ||
73318471 | 1352 | //____________________________________________________________________ |
4fd6a75d | 1353 | AliESDtrack* AliESDtrackCuts::GetTPCOnlyTrack(const AliESDEvent* esd, Int_t iTrack) |
73318471 | 1354 | { |
4c3dc2a0 | 1355 | // Utility function to create a TPC only track from the given esd track |
b7b857f0 | 1356 | // |
1357 | // IMPORTANT: The track has to be deleted by the user | |
73318471 | 1358 | // |
524916f0 | 1359 | // NB. most of the functionality to get a TPC only track from an ESD track is in AliESDtrack, where it should be |
1360 | // there are only missing propagations here that are needed for old data | |
1361 | // this function will therefore become obsolete | |
73318471 | 1362 | // |
524916f0 | 1363 | // adapted from code provided by CKB |
73318471 | 1364 | |
524916f0 | 1365 | if (!esd->GetPrimaryVertexTPC()) |
1366 | return 0; // No TPC vertex no TPC tracks | |
73318471 | 1367 | |
91c88f16 | 1368 | if(!esd->GetPrimaryVertexTPC()->GetStatus()) |
1369 | return 0; // TPC Vertex is created by default in AliESDEvent, do not use in this case | |
91c88f16 | 1370 | |
524916f0 | 1371 | AliESDtrack* track = esd->GetTrack(iTrack); |
1372 | if (!track) | |
1373 | return 0; | |
36853ddd | 1374 | |
524916f0 | 1375 | AliESDtrack *tpcTrack = new AliESDtrack(); |
73318471 | 1376 | |
524916f0 | 1377 | // only true if we have a tpc track |
1378 | if (!track->FillTPCOnlyTrack(*tpcTrack)) | |
1379 | { | |
1380 | delete tpcTrack; | |
1381 | return 0; | |
73318471 | 1382 | } |
1383 | ||
524916f0 | 1384 | return tpcTrack; |
73318471 | 1385 | } |
1386 | ||
1387 | //____________________________________________________________________ | |
4c3dc2a0 | 1388 | TObjArray* AliESDtrackCuts::GetAcceptedTracks(const AliESDEvent* esd, Bool_t bTPC) |
73318471 | 1389 | { |
1390 | // | |
1391 | // returns an array of all tracks that pass the cuts | |
36853ddd | 1392 | // or an array of TPC only tracks (propagated to the TPC vertex during reco) |
1393 | // tracks that pass the cut | |
ecd4e3ba | 1394 | // |
1395 | // NOTE: List has to be deleted by the user | |
73318471 | 1396 | |
1397 | TObjArray* acceptedTracks = new TObjArray(); | |
1398 | ||
1399 | // loop over esd tracks | |
1400 | for (Int_t iTrack = 0; iTrack < esd->GetNumberOfTracks(); iTrack++) { | |
36853ddd | 1401 | if(bTPC){ |
1402 | if(!esd->GetPrimaryVertexTPC())return acceptedTracks; // No TPC vertex no TPC tracks | |
91c88f16 | 1403 | if(!esd->GetPrimaryVertexTPC()->GetStatus())return acceptedTracks; // No proper TPC vertex, only the default |
36853ddd | 1404 | |
524916f0 | 1405 | AliESDtrack *tpcTrack = GetTPCOnlyTrack(esd, iTrack); |
1406 | if (!tpcTrack) | |
1407 | continue; | |
1408 | ||
4c3dc2a0 | 1409 | if (AcceptTrack(tpcTrack, esd)) { |
524916f0 | 1410 | acceptedTracks->Add(tpcTrack); |
36853ddd | 1411 | } |
524916f0 | 1412 | else |
1413 | delete tpcTrack; | |
1414 | } | |
1415 | else | |
1416 | { | |
1417 | AliESDtrack* track = esd->GetTrack(iTrack); | |
4c3dc2a0 | 1418 | if(AcceptTrack(track, esd)) |
524916f0 | 1419 | acceptedTracks->Add(track); |
36853ddd | 1420 | } |
36853ddd | 1421 | } |
1422 | if(bTPC)acceptedTracks->SetOwner(kTRUE); | |
73318471 | 1423 | return acceptedTracks; |
1424 | } | |
1425 | ||
1426 | //____________________________________________________________________ | |
f7ce7a37 | 1427 | Int_t AliESDtrackCuts::CountAcceptedTracks(const AliESDEvent* const esd) |
73318471 | 1428 | { |
1429 | // | |
1430 | // returns an the number of tracks that pass the cuts | |
1431 | // | |
1432 | ||
1433 | Int_t count = 0; | |
1434 | ||
1435 | // loop over esd tracks | |
1436 | for (Int_t iTrack = 0; iTrack < esd->GetNumberOfTracks(); iTrack++) { | |
1437 | AliESDtrack* track = esd->GetTrack(iTrack); | |
4c3dc2a0 | 1438 | if (AcceptTrack(track, esd)) |
73318471 | 1439 | count++; |
1440 | } | |
1441 | ||
1442 | return count; | |
1443 | } | |
1444 | ||
1445 | //____________________________________________________________________ | |
1446 | void AliESDtrackCuts::DefineHistograms(Int_t color) { | |
1447 | // | |
1448 | // diagnostics histograms are defined | |
1449 | // | |
1450 | ||
1451 | fHistogramsOn=kTRUE; | |
1452 | ||
1453 | Bool_t oldStatus = TH1::AddDirectoryStatus(); | |
1454 | TH1::AddDirectory(kFALSE); | |
1455 | ||
1456 | //################################################################################### | |
1457 | // defining histograms | |
1458 | ||
1459 | fhCutStatistics = new TH1F("cut_statistics","cut statistics",kNCuts+4,-0.5,kNCuts+3.5); | |
1460 | ||
1461 | fhCutStatistics->GetXaxis()->SetBinLabel(1,"n tracks"); | |
1462 | fhCutStatistics->GetXaxis()->SetBinLabel(2,"n cut tracks"); | |
1463 | ||
1464 | fhCutCorrelation = new TH2F("cut_correlation","cut correlation",kNCuts,-0.5,kNCuts-0.5,kNCuts,-0.5,kNCuts-0.5);; | |
1465 | ||
1466 | for (Int_t i=0; i<kNCuts; i++) { | |
1467 | fhCutStatistics->GetXaxis()->SetBinLabel(i+4,fgkCutNames[i]); | |
1468 | fhCutCorrelation->GetXaxis()->SetBinLabel(i+1,fgkCutNames[i]); | |
1469 | fhCutCorrelation->GetYaxis()->SetBinLabel(i+1,fgkCutNames[i]); | |
0f712a2e | 1470 | } |
73318471 | 1471 | |
1472 | fhCutStatistics ->SetLineColor(color); | |
1473 | fhCutCorrelation ->SetLineColor(color); | |
1474 | fhCutStatistics ->SetLineWidth(2); | |
1475 | fhCutCorrelation ->SetLineWidth(2); | |
1476 | ||
73318471 | 1477 | for (Int_t i=0; i<2; i++) { |
524916f0 | 1478 | fhNClustersITS[i] = new TH1F("nClustersITS" ,"",8,-0.5,7.5); |
1479 | fhNClustersTPC[i] = new TH1F("nClustersTPC" ,"",165,-0.5,164.5); | |
9023d7ac | 1480 | fhNSharedClustersTPC[i] = new TH1F("nSharedClustersTPC" ,"",165,-0.5,164.5); |
07b1b131 | 1481 | fhNCrossedRowsTPC[i] = new TH1F("nCrossedRowsTPC" ,"",165,-0.5,164.5); |
1482 | fhRatioCrossedRowsOverFindableClustersTPC[i] = new TH1F("ratioCrossedRowsOverFindableClustersTPC" ,"",60,0,1.5); | |
524916f0 | 1483 | fhChi2PerClusterITS[i] = new TH1F("chi2PerClusterITS","",500,0,10); |
1484 | fhChi2PerClusterTPC[i] = new TH1F("chi2PerClusterTPC","",500,0,10); | |
4c3dc2a0 | 1485 | fhChi2TPCConstrainedVsGlobal[i] = new TH1F("chi2TPCConstrainedVsGlobal","",600,-2,50); |
2a35259b | 1486 | fhNClustersForITSPID[i] = new TH1F("nPointsForITSpid","",5,-0.5,4.5); |
1487 | fhNMissingITSPoints[i] = new TH1F("nMissingITSClusters","",7,-0.5,6.5); | |
524916f0 | 1488 | |
1489 | fhC11[i] = new TH1F("covMatrixDiagonal11","",2000,0,20); | |
1490 | fhC22[i] = new TH1F("covMatrixDiagonal22","",2000,0,20); | |
0f712a2e | 1491 | fhC33[i] = new TH1F("covMatrixDiagonal33","",1000,0,0.1); |
1492 | fhC44[i] = new TH1F("covMatrixDiagonal44","",1000,0,0.1); | |
524916f0 | 1493 | fhC55[i] = new TH1F("covMatrixDiagonal55","",1000,0,5); |
1494 | ||
025fb458 | 1495 | fhRel1PtUncertainty[i] = new TH1F("rel1PtUncertainty","",1000,0,5); |
1496 | ||
524916f0 | 1497 | fhDXY[i] = new TH1F("dXY" ,"",500,-10,10); |
1498 | fhDZ[i] = new TH1F("dZ" ,"",500,-10,10); | |
1499 | fhDXYDZ[i] = new TH1F("dXYDZ" ,"",500,0,10); | |
1500 | fhDXYvsDZ[i] = new TH2F("dXYvsDZ","",200,-10,10,200,-10,10); | |
1501 | ||
1502 | fhDXYNormalized[i] = new TH1F("dXYNormalized" ,"",500,-10,10); | |
1503 | fhDZNormalized[i] = new TH1F("dZNormalized" ,"",500,-10,10); | |
1504 | fhDXYvsDZNormalized[i] = new TH2F("dXYvsDZNormalized","",200,-10,10,200,-10,10); | |
1505 | ||
1506 | fhNSigmaToVertex[i] = new TH1F("nSigmaToVertex","",500,0,10); | |
1507 | ||
86f0e195 | 1508 | fhPt[i] = new TH1F("pt" ,"p_{T} distribution;p_{T} (GeV/c)", 800, 0.0, 10.0); |
524916f0 | 1509 | fhEta[i] = new TH1F("eta" ,"#eta distribution;#eta",40,-2.0,2.0); |
73318471 | 1510 | |
1511 | fhNClustersITS[i]->SetTitle("n ITS clusters"); | |
1512 | fhNClustersTPC[i]->SetTitle("n TPC clusters"); | |
9023d7ac | 1513 | fhNSharedClustersTPC[i]->SetTitle("n TPC shared clusters"); |
73318471 | 1514 | fhChi2PerClusterITS[i]->SetTitle("#Chi^{2} per ITS cluster"); |
1515 | fhChi2PerClusterTPC[i]->SetTitle("#Chi^{2} per TPC cluster"); | |
4c3dc2a0 | 1516 | fhChi2TPCConstrainedVsGlobal[i]->SetTitle("#Chi^{2} TPC constrained track vs global track"); |
2a35259b | 1517 | fhNClustersForITSPID[i]->SetTitle("n ITS points for PID"); |
1518 | fhNMissingITSPoints[i]->SetTitle("n ITS layers with missing cluster"); | |
73318471 | 1519 | |
1520 | fhC11[i]->SetTitle("cov 11 : #sigma_{y}^{2} [cm^{2}]"); | |
1521 | fhC22[i]->SetTitle("cov 22 : #sigma_{z}^{2} [cm^{2}]"); | |
1522 | fhC33[i]->SetTitle("cov 33 : #sigma_{sin(#phi)}^{2}"); | |
1523 | fhC44[i]->SetTitle("cov 44 : #sigma_{tan(#theta_{dip})}^{2}"); | |
1524 | fhC55[i]->SetTitle("cov 55 : #sigma_{1/p_{T}}^{2} [(c/GeV)^2]"); | |
1525 | ||
025fb458 | 1526 | fhRel1PtUncertainty[i]->SetTitle("rel. uncertainty of 1/p_{T}"); |
1527 | ||
86f0e195 | 1528 | fhDXY[i]->SetXTitle("transverse impact parameter (cm)"); |
1529 | fhDZ[i]->SetXTitle("longitudinal impact parameter (cm)"); | |
1530 | fhDXYDZ[i]->SetTitle("absolute impact parameter;sqrt(dXY**2 + dZ**2) (cm)"); | |
1531 | fhDXYvsDZ[i]->SetXTitle("longitudinal impact parameter (cm)"); | |
1532 | fhDXYvsDZ[i]->SetYTitle("transverse impact parameter (cm)"); | |
73318471 | 1533 | |
86f0e195 | 1534 | fhDXYNormalized[i]->SetTitle("normalized trans impact par (n#sigma)"); |
1535 | fhDZNormalized[i]->SetTitle("normalized long impact par (n#sigma)"); | |
1536 | fhDXYvsDZNormalized[i]->SetTitle("normalized long impact par (n#sigma)"); | |
1537 | fhDXYvsDZNormalized[i]->SetYTitle("normalized trans impact par (n#sigma)"); | |
73318471 | 1538 | fhNSigmaToVertex[i]->SetTitle("n #sigma to vertex"); |
1539 | ||
1540 | fhNClustersITS[i]->SetLineColor(color); fhNClustersITS[i]->SetLineWidth(2); | |
1541 | fhNClustersTPC[i]->SetLineColor(color); fhNClustersTPC[i]->SetLineWidth(2); | |
9023d7ac | 1542 | fhNSharedClustersTPC[i]->SetLineColor(color); fhNSharedClustersTPC[i]->SetLineWidth(2); |
73318471 | 1543 | fhChi2PerClusterITS[i]->SetLineColor(color); fhChi2PerClusterITS[i]->SetLineWidth(2); |
1544 | fhChi2PerClusterTPC[i]->SetLineColor(color); fhChi2PerClusterTPC[i]->SetLineWidth(2); | |
4c3dc2a0 | 1545 | fhChi2TPCConstrainedVsGlobal[i]->SetLineColor(color); fhChi2TPCConstrainedVsGlobal[i]->SetLineWidth(2); |
2a35259b | 1546 | fhNClustersForITSPID[i]->SetLineColor(color); fhNClustersForITSPID[i]->SetLineWidth(2); |
1547 | fhNMissingITSPoints[i]->SetLineColor(color); fhNMissingITSPoints[i]->SetLineWidth(2); | |
73318471 | 1548 | |
1549 | fhC11[i]->SetLineColor(color); fhC11[i]->SetLineWidth(2); | |
1550 | fhC22[i]->SetLineColor(color); fhC22[i]->SetLineWidth(2); | |
1551 | fhC33[i]->SetLineColor(color); fhC33[i]->SetLineWidth(2); | |
1552 | fhC44[i]->SetLineColor(color); fhC44[i]->SetLineWidth(2); | |
1553 | fhC55[i]->SetLineColor(color); fhC55[i]->SetLineWidth(2); | |
1554 | ||
025fb458 | 1555 | fhRel1PtUncertainty[i]->SetLineColor(color); fhRel1PtUncertainty[i]->SetLineWidth(2); |
1556 | ||
73318471 | 1557 | fhDXY[i]->SetLineColor(color); fhDXY[i]->SetLineWidth(2); |
524916f0 | 1558 | fhDZ[i]->SetLineColor(color); fhDZ[i]->SetLineWidth(2); |
1559 | fhDXYDZ[i]->SetLineColor(color); fhDXYDZ[i]->SetLineWidth(2); | |
73318471 | 1560 | |
1561 | fhDXYNormalized[i]->SetLineColor(color); fhDXYNormalized[i]->SetLineWidth(2); | |
1562 | fhDZNormalized[i]->SetLineColor(color); fhDZNormalized[i]->SetLineWidth(2); | |
1563 | fhNSigmaToVertex[i]->SetLineColor(color); fhNSigmaToVertex[i]->SetLineWidth(2); | |
1564 | } | |
1565 | ||
1566 | // The number of sigmas to the vertex is per definition gaussian | |
1567 | ffDTheoretical = new TF1("nSigmaToVertexTheoretical","([0]/2.506628274)*exp(-(x**2)/2)",0,50); | |
1568 | ffDTheoretical->SetParameter(0,1); | |
524916f0 | 1569 | |
73318471 | 1570 | TH1::AddDirectory(oldStatus); |
1571 | } | |
1572 | ||
1573 | //____________________________________________________________________ | |
1574 | Bool_t AliESDtrackCuts::LoadHistograms(const Char_t* dir) | |
1575 | { | |
1576 | // | |
1577 | // loads the histograms from a file | |
1578 | // if dir is empty a directory with the name of this object is taken (like in SaveHistogram) | |
1579 | // | |
1580 | ||
1581 | if (!dir) | |
1582 | dir = GetName(); | |
1583 | ||
1584 | if (!gDirectory->cd(dir)) | |
1585 | return kFALSE; | |
1586 | ||
1587 | ffDTheoretical = dynamic_cast<TF1*> (gDirectory->Get("nSigmaToVertexTheory")); | |
1588 | ||
1589 | fhCutStatistics = dynamic_cast<TH1F*> (gDirectory->Get("cut_statistics")); | |
1590 | fhCutCorrelation = dynamic_cast<TH2F*> (gDirectory->Get("cut_correlation")); | |
1591 | ||
73318471 | 1592 | for (Int_t i=0; i<2; i++) { |
1593 | if (i==0) | |
1594 | { | |
1595 | gDirectory->cd("before_cuts"); | |
73318471 | 1596 | } |
1597 | else | |
73318471 | 1598 | gDirectory->cd("after_cuts"); |
73318471 | 1599 | |
524916f0 | 1600 | fhNClustersITS[i] = dynamic_cast<TH1F*> (gDirectory->Get("nClustersITS" )); |
1601 | fhNClustersTPC[i] = dynamic_cast<TH1F*> (gDirectory->Get("nClustersTPC" )); | |
9023d7ac | 1602 | fhNSharedClustersTPC[i] = dynamic_cast<TH1F*> (gDirectory->Get("nSharedClustersTPC" )); |
07b1b131 | 1603 | fhNCrossedRowsTPC[i] = dynamic_cast<TH1F*> (gDirectory->Get("nCrossedRowsTPC" )); |
1604 | fhRatioCrossedRowsOverFindableClustersTPC[i] = dynamic_cast<TH1F*> (gDirectory->Get("ratioCrossedRowsOverFindableClustersTPC" )); | |
524916f0 | 1605 | fhChi2PerClusterITS[i] = dynamic_cast<TH1F*> (gDirectory->Get("chi2PerClusterITS")); |
1606 | fhChi2PerClusterTPC[i] = dynamic_cast<TH1F*> (gDirectory->Get("chi2PerClusterTPC")); | |
4c3dc2a0 | 1607 | fhChi2TPCConstrainedVsGlobal[i] = dynamic_cast<TH1F*> (gDirectory->Get("fhChi2TPCConstrainedVsGlobal")); |
2a35259b | 1608 | fhNClustersForITSPID[i] = dynamic_cast<TH1F*> (gDirectory->Get("nPointsForITSpid")); |
1609 | fhNMissingITSPoints[i] = dynamic_cast<TH1F*> (gDirectory->Get("nMissingITSClusters")); | |
73318471 | 1610 | |
524916f0 | 1611 | fhC11[i] = dynamic_cast<TH1F*> (gDirectory->Get("covMatrixDiagonal11")); |
1612 | fhC22[i] = dynamic_cast<TH1F*> (gDirectory->Get("covMatrixDiagonal22")); | |
1613 | fhC33[i] = dynamic_cast<TH1F*> (gDirectory->Get("covMatrixDiagonal33")); | |
1614 | fhC44[i] = dynamic_cast<TH1F*> (gDirectory->Get("covMatrixDiagonal44")); | |
1615 | fhC55[i] = dynamic_cast<TH1F*> (gDirectory->Get("covMatrixDiagonal55")); | |
73318471 | 1616 | |
025fb458 | 1617 | fhRel1PtUncertainty[i] = dynamic_cast<TH1F*> (gDirectory->Get("rel1PtUncertainty")); |
1618 | ||
524916f0 | 1619 | fhDXY[i] = dynamic_cast<TH1F*> (gDirectory->Get("dXY" )); |
1620 | fhDZ[i] = dynamic_cast<TH1F*> (gDirectory->Get("dZ" )); | |
1621 | fhDXYDZ[i] = dynamic_cast<TH1F*> (gDirectory->Get("dXYDZ")); | |
1622 | fhDXYvsDZ[i] = dynamic_cast<TH2F*> (gDirectory->Get("dXYvsDZ")); | |
73318471 | 1623 | |
524916f0 | 1624 | fhDXYNormalized[i] = dynamic_cast<TH1F*> (gDirectory->Get("dXYNormalized" )); |
1625 | fhDZNormalized[i] = dynamic_cast<TH1F*> (gDirectory->Get("dZNormalized" )); | |
1626 | fhDXYvsDZNormalized[i] = dynamic_cast<TH2F*> (gDirectory->Get("dXYvsDZNormalized")); | |
1627 | fhNSigmaToVertex[i] = dynamic_cast<TH1F*> (gDirectory->Get("nSigmaToVertex")); | |
73318471 | 1628 | |
524916f0 | 1629 | fhPt[i] = dynamic_cast<TH1F*> (gDirectory->Get("pt")); |
1630 | fhEta[i] = dynamic_cast<TH1F*> (gDirectory->Get("eta")); | |
73318471 | 1631 | |
1632 | gDirectory->cd("../"); | |
1633 | } | |
1634 | ||
1635 | gDirectory->cd(".."); | |
1636 | ||
1637 | return kTRUE; | |
1638 | } | |
1639 | ||
1640 | //____________________________________________________________________ | |
1641 | void AliESDtrackCuts::SaveHistograms(const Char_t* dir) { | |
1642 | // | |
1643 | // saves the histograms in a directory (dir) | |
1644 | // | |
1645 | ||
1646 | if (!fHistogramsOn) { | |
1647 | AliDebug(0, "Histograms not on - cannot save histograms!!!"); | |
1648 | return; | |
1649 | } | |
1650 | ||
1651 | if (!dir) | |
1652 | dir = GetName(); | |
1653 | ||
1654 | gDirectory->mkdir(dir); | |
1655 | gDirectory->cd(dir); | |
1656 | ||
1657 | gDirectory->mkdir("before_cuts"); | |
1658 | gDirectory->mkdir("after_cuts"); | |
1659 | ||
1660 | // a factor of 2 is needed since n sigma is positive | |
1661 | ffDTheoretical->SetParameter(0,2*fhNSigmaToVertex[0]->Integral("width")); | |
1662 | ffDTheoretical->Write("nSigmaToVertexTheory"); | |
1663 | ||
1664 | fhCutStatistics->Write(); | |
1665 | fhCutCorrelation->Write(); | |
1666 | ||
1667 | for (Int_t i=0; i<2; i++) { | |
1668 | if (i==0) | |
1669 | gDirectory->cd("before_cuts"); | |
1670 | else | |
1671 | gDirectory->cd("after_cuts"); | |
1672 | ||
1673 | fhNClustersITS[i] ->Write(); | |
1674 | fhNClustersTPC[i] ->Write(); | |
9023d7ac | 1675 | fhNSharedClustersTPC[i] ->Write(); |
07b1b131 | 1676 | fhNCrossedRowsTPC[i] ->Write(); |
1677 | fhRatioCrossedRowsOverFindableClustersTPC[i] ->Write(); | |
73318471 | 1678 | fhChi2PerClusterITS[i] ->Write(); |
1679 | fhChi2PerClusterTPC[i] ->Write(); | |
4c3dc2a0 | 1680 | fhChi2TPCConstrainedVsGlobal[i] ->Write(); |
2a35259b | 1681 | fhNClustersForITSPID[i] ->Write(); |
1682 | fhNMissingITSPoints[i] ->Write(); | |
73318471 | 1683 | |
1684 | fhC11[i] ->Write(); | |
1685 | fhC22[i] ->Write(); | |
1686 | fhC33[i] ->Write(); | |
1687 | fhC44[i] ->Write(); | |
1688 | fhC55[i] ->Write(); | |
1689 | ||
025fb458 | 1690 | fhRel1PtUncertainty[i] ->Write(); |
1691 | ||
73318471 | 1692 | fhDXY[i] ->Write(); |
1693 | fhDZ[i] ->Write(); | |
524916f0 | 1694 | fhDXYDZ[i] ->Write(); |
73318471 | 1695 | fhDXYvsDZ[i] ->Write(); |
1696 | ||
1697 | fhDXYNormalized[i] ->Write(); | |
1698 | fhDZNormalized[i] ->Write(); | |
1699 | fhDXYvsDZNormalized[i] ->Write(); | |
1700 | fhNSigmaToVertex[i] ->Write(); | |
1701 | ||
1702 | fhPt[i] ->Write(); | |
1703 | fhEta[i] ->Write(); | |
1704 | ||
1705 | gDirectory->cd("../"); | |
1706 | } | |
1707 | ||
1708 | gDirectory->cd("../"); | |
1709 | } | |
1710 | ||
1711 | //____________________________________________________________________ | |
1712 | void AliESDtrackCuts::DrawHistograms() | |
1713 | { | |
1714 | // draws some histograms | |
1715 | ||
1716 | TCanvas* canvas1 = new TCanvas(Form("%s_1", GetName()), "Track Quality Results1", 800, 800); | |
1717 | canvas1->Divide(2, 2); | |
1718 | ||
1719 | canvas1->cd(1); | |
1720 | fhNClustersTPC[0]->SetStats(kFALSE); | |
1721 | fhNClustersTPC[0]->Draw(); | |
1722 | ||
1723 | canvas1->cd(2); | |
1724 | fhChi2PerClusterTPC[0]->SetStats(kFALSE); | |
1725 | fhChi2PerClusterTPC[0]->Draw(); | |
1726 | ||
1727 | canvas1->cd(3); | |
1728 | fhNSigmaToVertex[0]->SetStats(kFALSE); | |
1729 | fhNSigmaToVertex[0]->GetXaxis()->SetRangeUser(0, 10); | |
1730 | fhNSigmaToVertex[0]->Draw(); | |
1731 | ||
1732 | canvas1->SaveAs(Form("%s_%s.gif", GetName(), canvas1->GetName())); | |
1733 | ||
1734 | TCanvas* canvas2 = new TCanvas(Form("%s_2", GetName()), "Track Quality Results2", 1200, 800); | |
1735 | canvas2->Divide(3, 2); | |
1736 | ||
1737 | canvas2->cd(1); | |
1738 | fhC11[0]->SetStats(kFALSE); | |
1739 | gPad->SetLogy(); | |
1740 | fhC11[0]->Draw(); | |
1741 | ||
1742 | canvas2->cd(2); | |
1743 | fhC22[0]->SetStats(kFALSE); | |
1744 | gPad->SetLogy(); | |
1745 | fhC22[0]->Draw(); | |
1746 | ||
1747 | canvas2->cd(3); | |
1748 | fhC33[0]->SetStats(kFALSE); | |
1749 | gPad->SetLogy(); | |
1750 | fhC33[0]->Draw(); | |
1751 | ||
1752 | canvas2->cd(4); | |
1753 | fhC44[0]->SetStats(kFALSE); | |
1754 | gPad->SetLogy(); | |
1755 | fhC44[0]->Draw(); | |
1756 | ||
1757 | canvas2->cd(5); | |
1758 | fhC55[0]->SetStats(kFALSE); | |
1759 | gPad->SetLogy(); | |
1760 | fhC55[0]->Draw(); | |
1761 | ||
025fb458 | 1762 | canvas2->cd(6); |
1763 | fhRel1PtUncertainty[0]->SetStats(kFALSE); | |
1764 | gPad->SetLogy(); | |
1765 | fhRel1PtUncertainty[0]->Draw(); | |
1766 | ||
73318471 | 1767 | canvas2->SaveAs(Form("%s_%s.gif", GetName(), canvas2->GetName())); |
1768 | ||
1769 | TCanvas* canvas3 = new TCanvas(Form("%s_3", GetName()), "Track Quality Results3", 1200, 800); | |
1770 | canvas3->Divide(3, 2); | |
1771 | ||
1772 | canvas3->cd(1); | |
1773 | fhDXY[0]->SetStats(kFALSE); | |
1774 | gPad->SetLogy(); | |
1775 | fhDXY[0]->Draw(); | |
1776 | ||
1777 | canvas3->cd(2); | |
1778 | fhDZ[0]->SetStats(kFALSE); | |
1779 | gPad->SetLogy(); | |
1780 | fhDZ[0]->Draw(); | |
1781 | ||
1782 | canvas3->cd(3); | |
1783 | fhDXYvsDZ[0]->SetStats(kFALSE); | |
1784 | gPad->SetLogz(); | |
1785 | gPad->SetRightMargin(0.15); | |
1786 | fhDXYvsDZ[0]->Draw("COLZ"); | |
1787 | ||
1788 | canvas3->cd(4); | |
1789 | fhDXYNormalized[0]->SetStats(kFALSE); | |
1790 | gPad->SetLogy(); | |
1791 | fhDXYNormalized[0]->Draw(); | |
1792 | ||
1793 | canvas3->cd(5); | |
1794 | fhDZNormalized[0]->SetStats(kFALSE); | |
1795 | gPad->SetLogy(); | |
1796 | fhDZNormalized[0]->Draw(); | |
1797 | ||
1798 | canvas3->cd(6); | |
1799 | fhDXYvsDZNormalized[0]->SetStats(kFALSE); | |
1800 | gPad->SetLogz(); | |
1801 | gPad->SetRightMargin(0.15); | |
1802 | fhDXYvsDZNormalized[0]->Draw("COLZ"); | |
1803 | ||
1804 | canvas3->SaveAs(Form("%s_%s.gif", GetName(), canvas3->GetName())); | |
1805 | ||
1806 | TCanvas* canvas4 = new TCanvas(Form("%s_4", GetName()), "Track Quality Results4", 800, 500); | |
1807 | canvas4->Divide(2, 1); | |
1808 | ||
1809 | canvas4->cd(1); | |
1810 | fhCutStatistics->SetStats(kFALSE); | |
1811 | fhCutStatistics->LabelsOption("v"); | |
1812 | gPad->SetBottomMargin(0.3); | |
1813 | fhCutStatistics->Draw(); | |
1814 | ||
1815 | canvas4->cd(2); | |
1816 | fhCutCorrelation->SetStats(kFALSE); | |
1817 | fhCutCorrelation->LabelsOption("v"); | |
1818 | gPad->SetBottomMargin(0.3); | |
1819 | gPad->SetLeftMargin(0.3); | |
1820 | fhCutCorrelation->Draw("COLZ"); | |
1821 | ||
1822 | canvas4->SaveAs(Form("%s_%s.gif", GetName(), canvas4->GetName())); | |
1823 | ||
1824 | /*canvas->cd(1); | |
1825 | fhDXYvsDZNormalized[0]->SetStats(kFALSE); | |
1826 | fhDXYvsDZNormalized[0]->DrawCopy("COLZ"); | |
1827 | ||
1828 | canvas->cd(2); | |
1829 | fhNClustersTPC[0]->SetStats(kFALSE); | |
1830 | fhNClustersTPC[0]->DrawCopy(); | |
1831 | ||
1832 | canvas->cd(3); | |
1833 | fhChi2PerClusterITS[0]->SetStats(kFALSE); | |
1834 | fhChi2PerClusterITS[0]->DrawCopy(); | |
1835 | fhChi2PerClusterITS[1]->SetLineColor(2); | |
1836 | fhChi2PerClusterITS[1]->DrawCopy("SAME"); | |
1837 | ||
1838 | canvas->cd(4); | |
1839 | fhChi2PerClusterTPC[0]->SetStats(kFALSE); | |
1840 | fhChi2PerClusterTPC[0]->DrawCopy(); | |
1841 | fhChi2PerClusterTPC[1]->SetLineColor(2); | |
1842 | fhChi2PerClusterTPC[1]->DrawCopy("SAME");*/ | |
1843 | } | |
f4e7aa32 | 1844 | //-------------------------------------------------------------------------- |
1845 | void AliESDtrackCuts::SetPtDepDCACuts(Double_t pt) { | |
1846 | // | |
1847 | // set the pt-dependent DCA cuts | |
1848 | // | |
1849 | ||
f328399b | 1850 | if(f1CutMaxDCAToVertexXYPtDep) { |
1851 | fCutMaxDCAToVertexXY=f1CutMaxDCAToVertexXYPtDep->Eval(pt); | |
f4e7aa32 | 1852 | } |
1853 | ||
f328399b | 1854 | if(f1CutMaxDCAToVertexZPtDep) { |
1855 | fCutMaxDCAToVertexZ=f1CutMaxDCAToVertexZPtDep->Eval(pt); | |
f4e7aa32 | 1856 | } |
1857 | ||
f328399b | 1858 | if(f1CutMinDCAToVertexXYPtDep) { |
1859 | fCutMinDCAToVertexXY=f1CutMinDCAToVertexXYPtDep->Eval(pt); | |
f4e7aa32 | 1860 | } |
1861 | ||
f328399b | 1862 | if(f1CutMinDCAToVertexZPtDep) { |
1863 | fCutMinDCAToVertexZ=f1CutMinDCAToVertexZPtDep->Eval(pt); | |
f4e7aa32 | 1864 | } |
1865 | ||
1866 | ||
1867 | return; | |
1868 | } | |
f328399b | 1869 | |
1870 | ||
1871 | ||
f4e7aa32 | 1872 | //-------------------------------------------------------------------------- |
1873 | Bool_t AliESDtrackCuts::CheckPtDepDCA(TString dist,Bool_t print) const { | |
1874 | // | |
1875 | // Check the correctness of the string syntax | |
1876 | // | |
1877 | Bool_t retval=kTRUE; | |
1878 | ||
1879 | if(!dist.Contains("pt")) { | |
28348fb4 | 1880 | if(print) AliError("string must contain \"pt\""); |
f4e7aa32 | 1881 | retval= kFALSE; |
1882 | } | |
1883 | return retval; | |
1884 | } | |
73318471 | 1885 | |
f328399b | 1886 | void AliESDtrackCuts::SetMaxDCAToVertexXYPtDep(const char *dist){ |
34aef0ad | 1887 | |
1888 | if(f1CutMaxDCAToVertexXYPtDep){ | |
1889 | delete f1CutMaxDCAToVertexXYPtDep; | |
1890 | // resetiing both | |
1891 | f1CutMaxDCAToVertexXYPtDep = 0; | |
1892 | fCutMaxDCAToVertexXYPtDep = ""; | |
1893 | } | |
1894 | if(!CheckPtDepDCA(dist,kTRUE)){ | |
1895 | return; | |
1896 | } | |
f328399b | 1897 | fCutMaxDCAToVertexXYPtDep = dist; |
1898 | TString tmp(dist); | |
1899 | tmp.ReplaceAll("pt","x"); | |
1900 | f1CutMaxDCAToVertexXYPtDep = new TFormula("f1CutMaxDCAToVertexXYPtDep",tmp.Data()); | |
1901 | ||
1902 | } | |
1903 | ||
1904 | void AliESDtrackCuts::SetMaxDCAToVertexZPtDep(const char *dist){ | |
34aef0ad | 1905 | |
1906 | ||
1907 | if(f1CutMaxDCAToVertexZPtDep){ | |
1908 | delete f1CutMaxDCAToVertexZPtDep; | |
1909 | // resetiing both | |
1910 | f1CutMaxDCAToVertexZPtDep = 0; | |
1911 | fCutMaxDCAToVertexZPtDep = ""; | |
1912 | } | |
1913 | if(!CheckPtDepDCA(dist,kTRUE))return; | |
1914 | ||
f328399b | 1915 | fCutMaxDCAToVertexZPtDep = dist; |
1916 | TString tmp(dist); | |
1917 | tmp.ReplaceAll("pt","x"); | |
1918 | f1CutMaxDCAToVertexZPtDep = new TFormula("f1CutMaxDCAToVertexZPtDep",tmp.Data()); | |
1919 | ||
1920 | ||
1921 | } | |
1922 | ||
1923 | ||
1924 | void AliESDtrackCuts::SetMinDCAToVertexXYPtDep(const char *dist){ | |
34aef0ad | 1925 | |
1926 | ||
1927 | if(f1CutMinDCAToVertexXYPtDep){ | |
1928 | delete f1CutMinDCAToVertexXYPtDep; | |
1929 | // resetiing both | |
1930 | f1CutMinDCAToVertexXYPtDep = 0; | |
1931 | fCutMinDCAToVertexXYPtDep = ""; | |
1932 | } | |
1933 | if(!CheckPtDepDCA(dist,kTRUE))return; | |
1934 | ||
f328399b | 1935 | fCutMinDCAToVertexXYPtDep = dist; |
1936 | TString tmp(dist); | |
1937 | tmp.ReplaceAll("pt","x"); | |
1938 | f1CutMinDCAToVertexXYPtDep = new TFormula("f1CutMinDCAToVertexXYPtDep",tmp.Data()); | |
1939 | ||
1940 | } | |
1941 | ||
1942 | ||
1943 | void AliESDtrackCuts::SetMinDCAToVertexZPtDep(const char *dist){ | |
34aef0ad | 1944 | |
1945 | ||
1946 | ||
1947 | if(f1CutMinDCAToVertexZPtDep){ | |
1948 | delete f1CutMinDCAToVertexZPtDep; | |
1949 | // resetiing both | |
1950 | f1CutMinDCAToVertexZPtDep = 0; | |
1951 | fCutMinDCAToVertexZPtDep = ""; | |
1952 | } | |
1953 | if(!CheckPtDepDCA(dist,kTRUE))return; | |
f328399b | 1954 | fCutMinDCAToVertexZPtDep = dist; |
1955 | TString tmp(dist); | |
1956 | tmp.ReplaceAll("pt","x"); | |
1957 | f1CutMinDCAToVertexZPtDep = new TFormula("f1CutMinDCAToVertexZPtDep",tmp.Data()); | |
1958 | } | |
a61ab805 | 1959 | |
1960 | AliESDtrackCuts* AliESDtrackCuts::GetMultEstTrackCuts(MultEstTrackCuts cut) | |
1961 | { | |
1962 | // returns the multiplicity estimator track cuts objects to allow for user configuration | |
1963 | // upon first call the objects are created | |
1964 | // | |
1965 | // the cut defined here correspond to GetStandardITSTPCTrackCuts2010 (apart from the one for without SPD) | |
1966 | ||
1967 | if (!fgMultEstTrackCuts[kMultEstTrackCutGlobal]) | |
1968 | { | |
1969 | // quality cut on ITS+TPC tracks | |
1970 | fgMultEstTrackCuts[kMultEstTrackCutGlobal] = new AliESDtrackCuts(); | |
1971 | fgMultEstTrackCuts[kMultEstTrackCutGlobal]->SetMinNClustersTPC(70); | |
1972 | fgMultEstTrackCuts[kMultEstTrackCutGlobal]->SetMaxChi2PerClusterTPC(4); | |
1973 | fgMultEstTrackCuts[kMultEstTrackCutGlobal]->SetAcceptKinkDaughters(kFALSE); | |
1974 | fgMultEstTrackCuts[kMultEstTrackCutGlobal]->SetRequireTPCRefit(kTRUE); | |
1975 | fgMultEstTrackCuts[kMultEstTrackCutGlobal]->SetRequireITSRefit(kTRUE); | |
1976 | //multiplicity underestimate if we use global tracks with |eta| > 0.9 | |
1977 | fgMultEstTrackCuts[kMultEstTrackCutGlobal]->SetEtaRange(-0.9, 0.9); | |
1978 | ||
1979 | // quality cut on ITS_SA tracks (complementary to ITS+TPC) | |
1980 | fgMultEstTrackCuts[kMultEstTrackCutITSSA] = new AliESDtrackCuts(); | |
1981 | fgMultEstTrackCuts[kMultEstTrackCutITSSA]->SetRequireITSRefit(kTRUE); | |
1982 | ||
1983 | // primary selection for tracks with SPD hits | |
1984 | fgMultEstTrackCuts[kMultEstTrackCutDCAwSPD] = new AliESDtrackCuts(); | |
1985 | fgMultEstTrackCuts[kMultEstTrackCutDCAwSPD]->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny); | |
1986 | fgMultEstTrackCuts[kMultEstTrackCutDCAwSPD]->SetMaxDCAToVertexXYPtDep("0.0182+0.0350/pt^1.01"); | |
1987 | fgMultEstTrackCuts[kMultEstTrackCutDCAwSPD]->SetMaxDCAToVertexZ(2); | |
1988 | ||
1989 | // primary selection for tracks w/o SPD hits | |
1990 | fgMultEstTrackCuts[kMultEstTrackCutDCAwoSPD] = new AliESDtrackCuts(); | |
1991 | fgMultEstTrackCuts[kMultEstTrackCutDCAwoSPD]->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kNone); | |
1992 | fgMultEstTrackCuts[kMultEstTrackCutDCAwoSPD]->SetMaxDCAToVertexXYPtDep("1.5*(0.0182+0.0350/pt^1.01)"); | |
1993 | fgMultEstTrackCuts[kMultEstTrackCutDCAwoSPD]->SetMaxDCAToVertexZ(2); | |
1994 | } | |
1995 | ||
1996 | return fgMultEstTrackCuts[cut]; | |
1997 | } | |
1998 | ||
1999 | Int_t AliESDtrackCuts::GetReferenceMultiplicity(const AliESDEvent* esd, MultEstTrackType trackType, Float_t etaRange) | |
2000 | { | |
2001 | // Get multiplicity estimate based on TPC/ITS tracks and tracklets | |
2002 | // Adapted for AliESDtrackCuts from a version developed by: Ruben Shahoyan, Anton Alkin, Arvinder Palaha | |
2003 | // | |
2004 | // Returns a negative value if no reliable estimate can be provided: | |
2005 | // -1 SPD vertex missing | |
2006 | // -2 SPD VertexerZ dispersion too large | |
2007 | // -3 Track vertex missing (not checked for kTracklets) | |
2008 | // -4 Distance between SPD and track vertices too large (not checked for kTracklets) | |
2009 | // | |
2010 | // WARNING This functions does not cut on the z vtx. Depending on the eta range requested, you need to restrict your z vertex range! | |
2011 | // | |
2012 | // Strategy for combined estimators | |
2013 | // 1. Count global tracks and flag them | |
2014 | // 2. Count ITSSA as complementaries for ITSTPC+ or as main tracks | |
2015 | // 3. Count the complementary SPD tracklets | |
2016 | ||
2017 | const AliESDVertex* vertices[2]; | |
2018 | vertices[0] = esd->GetPrimaryVertexSPD(); | |
2019 | vertices[1] = esd->GetPrimaryVertexTracks(); | |
2020 | ||
2021 | if (!vertices[0]->GetStatus()) | |
2022 | { | |
2023 | AliDebugClass(AliLog::kDebug, "No SPD vertex. Not able to make a reliable multiplicity estimate."); | |
2024 | return -1; | |
2025 | } | |
2026 | ||
2027 | if (vertices[0]->IsFromVertexerZ() && vertices[0]->GetDispersion() > 0.02) | |
2028 | { | |
2029 | AliDebugClass(AliLog::kDebug, "Vertexer z dispersion > 0.02. Not able to make a reliable multiplicity estimate."); | |
2030 | return -2; | |
2031 | } | |
2032 | ||
2033 | Int_t multiplicityEstimate = 0; | |
2034 | ||
2035 | // SPD tracklet-only estimate | |
2036 | if (trackType == kTracklets) | |
2037 | { | |
2038 | const AliMultiplicity* spdmult = esd->GetMultiplicity(); // spd multiplicity object | |
2039 | for (Int_t i=0; i<spdmult->GetNumberOfTracklets(); ++i) | |
2040 | { | |
2041 | if (TMath::Abs(spdmult->GetEta(i)) > etaRange) | |
2042 | continue; // eta selection for tracklets | |
2043 | multiplicityEstimate++; | |
2044 | } | |
2045 | return multiplicityEstimate; | |
2046 | } | |
2047 | ||
2048 | if (!vertices[1]->GetStatus()) | |
2049 | { | |
2050 | AliDebugClass(AliLog::kDebug, "No track vertex. Not able to make a reliable multiplicity estimate."); | |
2051 | return -3; | |
2052 | } | |
2053 | ||
2054 | // TODO value of displacement to be studied | |
2055 | const Float_t maxDisplacement = 0.5; | |
2056 | //check for displaced vertices | |
2057 | Double_t displacement = TMath::Abs(vertices[0]->GetZ() - vertices[1]->GetZ()); | |
2058 | if (displacement > maxDisplacement) | |
2059 | { | |
2060 | AliDebugClass(AliLog::kDebug, Form("Displaced vertices %f > %f",displacement,maxDisplacement)); | |
2061 | return -4; | |
2062 | } | |
2063 | ||
2064 | // update eta range in track cuts | |
2065 | GetMultEstTrackCuts(kMultEstTrackCutITSSA)->SetEtaRange(-etaRange, etaRange); | |
2066 | GetMultEstTrackCuts(kMultEstTrackCutDCAwSPD)->SetEtaRange(-etaRange, etaRange); | |
2067 | GetMultEstTrackCuts(kMultEstTrackCutDCAwoSPD)->SetEtaRange(-etaRange, etaRange); | |
2068 | ||
2069 | //******************************************************************************************************* | |
2070 | //set counters to initial zeros | |
2071 | Int_t tracksITSTPC = 0; //number of global tracks for a given event | |
2072 | Int_t tracksITSSA = 0; //number of ITS standalone tracks for a given event | |
2073 | Int_t tracksITSTPCSA_complementary = 0; //number of ITS standalone tracks complementary to TPC for a given event | |
2074 | Int_t trackletsITSTPC_complementary = 0;//number of SPD tracklets complementary to global/ITSSA tracks for a given events | |
2075 | Int_t trackletsITSSA_complementary = 0; //number of SPD tracklets complementary to ITSSA tracks for a given event | |
2076 | ||
2077 | const Int_t nESDTracks = esd->GetNumberOfTracks(); | |
2078 | Int_t highestID = 0; | |
2079 | ||
2080 | // flags for secondary and rejected tracks | |
2081 | const Int_t kRejBit = BIT(15); // set this bit in global tracks if it is rejected by a cut | |
2082 | const Int_t kSecBit = BIT(16); // set this bit in global tracks if it is secondary according to a cut | |
2083 | ||
2084 | for(Int_t itracks=0; itracks < nESDTracks; itracks++) { | |
2085 | if(esd->GetTrack(itracks)->GetLabel() > highestID) highestID = esd->GetTrack(itracks)->GetLabel(); | |
2086 | esd->GetTrack(itracks)->ResetBit(kSecBit|kRejBit); //reset bits used for flagging secondaries and rejected tracks in case they were changed before this analysis | |
2087 | } | |
2088 | const Int_t maxid = highestID+1; // used to define bool array for check multiple associations of tracklets to one track. array starts at 0. | |
2089 | ||
2090 | // bit mask for esd tracks, to check if multiple tracklets are associated to it | |
2091 | Bool_t globalBits[maxid], pureITSBits[maxid]; | |
2092 | for(Int_t i=0; i<maxid; i++){ // set all bools to false | |
2093 | globalBits[i]=kFALSE; | |
2094 | pureITSBits[i]=kFALSE; | |
2095 | } | |
2096 | ||
2097 | //******************************************************************************************************* | |
2098 | // get multiplicity from global tracks | |
2099 | for(Int_t itracks = 0; itracks < nESDTracks; itracks++) { // flag the tracks | |
2100 | AliESDtrack* track = esd->GetTrack(itracks); | |
2101 | ||
2102 | // if track is a secondary from a V0, flag as a secondary | |
2103 | if (track->IsOn(AliESDtrack::kMultInV0)) { | |
2104 | track->SetBit(kSecBit); | |
2105 | continue; | |
2106 | } | |
2107 | ||
2108 | //secondary? | |
2109 | if (track->IsOn(AliESDtrack::kMultSec)) { | |
2110 | track->SetBit(kSecBit); | |
2111 | continue; | |
2112 | } | |
2113 | ||
2114 | // check tracks with ITS part | |
2115 | //******************************************************************************************************* | |
2116 | if (track->IsOn(AliESDtrack::kITSin) && !track->IsOn(AliESDtrack::kITSpureSA) && trackType == kTrackletsITSTPC) { // track has ITS part but is not an ITS_SA | |
2117 | //******************************************************************************************************* | |
2118 | // TPC+ITS | |
2119 | if (track->IsOn(AliESDtrack::kTPCin)) { // Global track, has ITS and TPC contributions | |
2120 | if (fgMultEstTrackCuts[kMultEstTrackCutGlobal]->AcceptTrack(track)) { // good ITSTPC track | |
2121 | if (fgMultEstTrackCuts[kMultEstTrackCutDCAwSPD]->AcceptTrack(track) || fgMultEstTrackCuts[kMultEstTrackCutDCAwoSPD]->AcceptTrack(track)) { | |
2122 | tracksITSTPC++; //global track counted | |
2123 | globalBits[itracks] = kTRUE; | |
2124 | } | |
2125 | else track->SetBit(kSecBit); // large DCA -> secondary, don't count either track not associated tracklet | |
2126 | } | |
2127 | else track->SetBit(kRejBit); // bad quality, don't count the track, but may count tracklet if associated | |
2128 | } | |
2129 | //******************************************************************************************************* | |
2130 | // ITS complementary | |
2131 | else if (fgMultEstTrackCuts[kMultEstTrackCutITSSA]->AcceptTrack(track)) { // good ITS complementary track | |
2132 | if (fgMultEstTrackCuts[kMultEstTrackCutDCAwSPD]->AcceptTrack(track) || fgMultEstTrackCuts[kMultEstTrackCutDCAwoSPD]->AcceptTrack(track)) { | |
2133 | tracksITSTPCSA_complementary++; | |
2134 | globalBits[itracks] = kTRUE; | |
2135 | } | |
2136 | else track->SetBit(kSecBit); // large DCA -> secondary, don't count either track not associated tracklet | |
2137 | } | |
2138 | else track->SetBit(kRejBit); // bad quality, don't count the track, but may count tracklet if associated | |
2139 | } | |
2140 | //******************************************************************************************************* | |
2141 | // check tracks from ITS_SA_PURE | |
2142 | if (track->IsOn(AliESDtrack::kITSin) && track->IsOn(AliESDtrack::kITSpureSA) && trackType == kTrackletsITSSA){ | |
2143 | if (fgMultEstTrackCuts[kMultEstTrackCutITSSA]->AcceptTrack(track)) { // good ITSSA track | |
2144 | if (fgMultEstTrackCuts[kMultEstTrackCutDCAwSPD]->AcceptTrack(track) || fgMultEstTrackCuts[kMultEstTrackCutDCAwoSPD]->AcceptTrack(track)) { | |
2145 | tracksITSSA++; | |
2146 | pureITSBits[itracks] = kTRUE; | |
2147 | } | |
2148 | else track->SetBit(kRejBit); | |
2149 | } | |
2150 | else track->SetBit(kRejBit); | |
2151 | } | |
2152 | }//ESD tracks counted | |
2153 | ||
2154 | //******************************************************************************************************* | |
2155 | // get multiplicity from ITS tracklets to complement TPC+ITS, and ITSpureSA | |
2156 | const AliMultiplicity* spdmult = esd->GetMultiplicity(); // spd multiplicity object | |
2157 | for (Int_t i=0; i<spdmult->GetNumberOfTracklets(); ++i) { | |
2158 | if (TMath::Abs(spdmult->GetEta(i)) > etaRange) continue; // eta selection for tracklets | |
2159 | ||
2160 | // if counting tracks+tracklets, check if clusters were already used in tracks | |
2161 | Int_t id1,id2,id3,id4; | |
2162 | spdmult->GetTrackletTrackIDs(i,0,id1,id2); // references for eventual Global/ITS_SA tracks | |
2163 | AliESDtrack* tr1 = id1>=0 ? esd->GetTrack(id1) : 0; | |
2164 | spdmult->GetTrackletTrackIDs(i,1,id3,id4); // references for eventual ITS_SA_pure tracks | |
2165 | AliESDtrack* tr3 = id3>=0 ? esd->GetTrack(id3) : 0; | |
2166 | ||
2167 | // are both clusters from the same tracks? If not, skip the tracklet (shouldn't change things much) | |
2168 | if ((id1!=id2 && id1>=0 && id2>=0) || (id3!=id4 && id3>=0 && id4>=0)) continue; | |
2169 | ||
2170 | Bool_t bUsedInGlobal = (id1 != -1) ? globalBits[id1] : 0;// has associated global track been associated to a previous tracklet? | |
2171 | Bool_t bUsedInPureITS = (id3 != -1) ? pureITSBits[id3] : 0;// has associated pure ITS track been associated to a previous tracklet? | |
2172 | //******************************************************************************************************* | |
2173 | if (trackType == kTrackletsITSTPC) { | |
2174 | // count tracklets towards global+complementary tracks | |
2175 | if ( (tr1 && !tr1->TestBit(kSecBit)) && // reject as secondary | |
2176 | (tr1 && tr1->TestBit(kRejBit)) ) { // count tracklet as bad quality track | |
2177 | if(!bUsedInGlobal){ | |
2178 | ++trackletsITSTPC_complementary; | |
2179 | if(id1>0) globalBits[id1] = kTRUE; // mark global track linked to this tracklet as "associated" | |
2180 | } | |
2181 | } | |
2182 | else if(id1<0) { | |
2183 | ++trackletsITSTPC_complementary; // if no associated track, count the tracklet | |
2184 | } | |
2185 | } else { | |
2186 | // count tracklets towards ITS_SA_pure tracks | |
2187 | if ( (tr3 && !tr3->TestBit(kSecBit)) && // reject as secondary | |
2188 | (tr3 && tr3->TestBit(kRejBit)) ) { // count tracklet as bad quality track | |
2189 | if(!bUsedInPureITS) { | |
2190 | ++trackletsITSSA_complementary; | |
2191 | if(id3>0) pureITSBits[id3] = kTRUE; // mark global track linked to this tracklet as "associated" | |
2192 | } | |
2193 | } | |
2194 | else if(id3<0) { | |
2195 | ++trackletsITSSA_complementary; // if no associated track, count the tracklet | |
2196 | } | |
2197 | } | |
2198 | } | |
2199 | ||
2200 | //******************************************************************************************************* | |
2201 | if (trackType == kTrackletsITSTPC) | |
2202 | multiplicityEstimate = tracksITSTPC + tracksITSTPCSA_complementary + trackletsITSTPC_complementary; | |
2203 | else | |
2204 | multiplicityEstimate = tracksITSSA + trackletsITSSA_complementary; | |
2205 | ||
2206 | return multiplicityEstimate; | |
2207 | } |