]>
Commit | Line | Data |
---|---|---|
35e49ca5 | 1 | // |
2 | // Class AliRsnCutTrackQuality | |
3 | // | |
4 | // General implementation of a single cut strategy, which can be: | |
5 | // - a value contained in a given interval [--> IsBetween() ] | |
6 | // - a value equal to a given reference [--> MatchesValue()] | |
7 | // | |
8 | // In all cases, the reference value(s) is (are) given as data members | |
9 | // and each kind of cut requires a given value type (Int, UInt, Double), | |
10 | // but the cut check procedure is then automatized and chosen thanks to | |
11 | // an enumeration of the implemented cut types. | |
12 | // At the end, the user (or any other point which uses this object) has | |
13 | // to use the method IsSelected() to check if this cut has been passed. | |
14 | // | |
15 | // authors: Martin Vala (martin.vala@cern.ch) | |
16 | // Alberto Pulvirenti (alberto.pulvirenti@ct.infn.it) | |
17 | // | |
18 | ||
19 | #include <Riostream.h> | |
20 | #include <TFormula.h> | |
21 | #include <TBits.h> | |
22 | ||
23 | #include "AliLog.h" | |
35e49ca5 | 24 | #include "AliESDtrackCuts.h" |
25 | ||
26 | #include "AliRsnEvent.h" | |
27 | #include "AliRsnDaughter.h" | |
28 | #include "AliRsnCutTrackQuality.h" | |
29 | ||
30 | ClassImp(AliRsnCutTrackQuality) | |
31 | ||
32 | //_________________________________________________________________________________________________ | |
33 | AliRsnCutTrackQuality::AliRsnCutTrackQuality(const char *name) : | |
f34f960b | 34 | AliRsnCut(name, AliRsnTarget::kDaughter, 0.0, 0.0), |
2a1c7696 | 35 | fFlagsOn(0x0), |
36 | fFlagsOff(0x0), | |
37 | fRejectKinkDaughters(kTRUE), | |
38 | fDCARfixed(kTRUE), | |
39 | fDCARptFormula(""), | |
d7712d44 | 40 | fDCARmax(1E20), |
2a1c7696 | 41 | fDCAZfixed(kTRUE), |
42 | fDCAZptFormula(""), | |
d7712d44 | 43 | fDCAZmax(1E20), |
2a1c7696 | 44 | fSPDminNClusters(0), |
45 | fITSminNClusters(0), | |
d7712d44 | 46 | fITSmaxChi2(1E20), |
2a1c7696 | 47 | fTPCminNClusters(0), |
f34f960b | 48 | fTPCmaxChi2(1E20), |
74d60285 | 49 | fCutMaxChi2TPCConstrainedVsGlobal(1E20), |
e1fec9d4 | 50 | fTPCminNCrossedRows(0), |
51 | fTPCminCrossedRowsOverFindableCls(0), | |
52 | fCutMinLengthActiveVolumeTPC(0), | |
74d60285 | 53 | fAODTestFilterBit(-1), |
9c569d46 | 54 | fCheckOnlyFilterBit(kTRUE), |
74d60285 | 55 | fESDtrackCuts(0x0) |
35e49ca5 | 56 | { |
57 | // | |
58 | // Default constructor. | |
59 | // Initializes all cuts in such a way that all of them are disabled. | |
60 | // | |
d7712d44 | 61 | SetPtRange(0.0, 1E20); |
62 | SetEtaRange(-1E20, 1E20); | |
35e49ca5 | 63 | } |
64 | ||
65 | //_________________________________________________________________________________________________ | |
66 | AliRsnCutTrackQuality::AliRsnCutTrackQuality(const AliRsnCutTrackQuality ©) : | |
2a1c7696 | 67 | AliRsnCut(copy), |
68 | fFlagsOn(copy.fFlagsOn), | |
69 | fFlagsOff(copy.fFlagsOff), | |
70 | fRejectKinkDaughters(copy.fRejectKinkDaughters), | |
71 | fDCARfixed(copy.fDCARfixed), | |
72 | fDCARptFormula(copy.fDCARptFormula), | |
73 | fDCARmax(copy.fDCARmax), | |
74 | fDCAZfixed(copy.fDCAZfixed), | |
75 | fDCAZptFormula(copy.fDCAZptFormula), | |
76 | fDCAZmax(copy.fDCAZmax), | |
77 | fSPDminNClusters(copy.fSPDminNClusters), | |
78 | fITSminNClusters(copy.fITSminNClusters), | |
79 | fITSmaxChi2(copy.fITSmaxChi2), | |
80 | fTPCminNClusters(copy.fTPCminNClusters), | |
f34f960b | 81 | fTPCmaxChi2(copy.fTPCmaxChi2), |
74d60285 | 82 | fCutMaxChi2TPCConstrainedVsGlobal(copy.fCutMaxChi2TPCConstrainedVsGlobal), |
e1fec9d4 | 83 | fTPCminNCrossedRows(copy.fTPCminNCrossedRows), |
84 | fTPCminCrossedRowsOverFindableCls(copy.fTPCminCrossedRowsOverFindableCls), | |
85 | fCutMinLengthActiveVolumeTPC(copy.fCutMinLengthActiveVolumeTPC), | |
5f17a44d | 86 | fAODTestFilterBit(copy.fAODTestFilterBit), |
9c569d46 | 87 | fCheckOnlyFilterBit(copy.fCheckOnlyFilterBit), |
5f17a44d | 88 | fESDtrackCuts(copy.fESDtrackCuts) |
35e49ca5 | 89 | { |
90 | // | |
91 | // Copy constructor. | |
92 | // Just copy all data member values. | |
93 | // | |
94 | ||
2a1c7696 | 95 | SetPtRange(copy.fPt[0], copy.fPt[1]); |
96 | SetEtaRange(copy.fEta[0], copy.fEta[1]); | |
35e49ca5 | 97 | } |
98 | ||
99 | //_________________________________________________________________________________________________ | |
61f275d1 | 100 | AliRsnCutTrackQuality &AliRsnCutTrackQuality::operator=(const AliRsnCutTrackQuality ©) |
35e49ca5 | 101 | { |
102 | // | |
103 | // Assignment operator. | |
104 | // Just copy all data member values. | |
105 | // | |
106 | ||
61f275d1 | 107 | if (this == ©) |
108 | return *this; | |
109 | ||
2a1c7696 | 110 | fFlagsOn = copy.fFlagsOn; |
111 | fFlagsOff = copy.fFlagsOff; | |
112 | fRejectKinkDaughters = copy.fRejectKinkDaughters; | |
113 | fDCARfixed = copy.fDCARfixed; | |
114 | fDCARptFormula = copy.fDCARptFormula; | |
115 | fDCARmax = copy.fDCARmax; | |
116 | fDCAZfixed = copy.fDCAZfixed; | |
117 | fDCAZptFormula = copy.fDCAZptFormula; | |
118 | fDCAZmax = copy.fDCAZmax; | |
119 | fSPDminNClusters = copy.fSPDminNClusters; | |
120 | fITSminNClusters = copy.fITSminNClusters; | |
121 | fITSmaxChi2 = copy.fITSmaxChi2; | |
122 | fTPCminNClusters = copy.fTPCminNClusters; | |
123 | fTPCmaxChi2 = copy.fTPCmaxChi2; | |
e1fec9d4 | 124 | fCutMaxChi2TPCConstrainedVsGlobal = copy.fCutMaxChi2TPCConstrainedVsGlobal; |
125 | fTPCminNCrossedRows = copy.fTPCminNCrossedRows; | |
126 | fTPCminCrossedRowsOverFindableCls = copy.fTPCminCrossedRowsOverFindableCls; | |
127 | fCutMinLengthActiveVolumeTPC = copy.fCutMinLengthActiveVolumeTPC; | |
128 | ||
f34f960b | 129 | fAODTestFilterBit = copy.fAODTestFilterBit; |
9c569d46 | 130 | fCheckOnlyFilterBit = copy.fCheckOnlyFilterBit; |
5f17a44d | 131 | fESDtrackCuts = copy.fESDtrackCuts; |
2a1c7696 | 132 | SetPtRange(copy.fPt[0], copy.fPt[1]); |
133 | SetEtaRange(copy.fEta[0], copy.fEta[1]); | |
134 | ||
135 | return (*this); | |
35e49ca5 | 136 | } |
137 | ||
138 | //_________________________________________________________________________________________________ | |
139 | void AliRsnCutTrackQuality::DisableAll() | |
140 | { | |
141 | // | |
142 | // Disable all cuts | |
143 | // | |
2a1c7696 | 144 | |
145 | fFlagsOn = 0x0; | |
146 | fFlagsOff = 0x0; | |
147 | fRejectKinkDaughters = kFALSE; | |
148 | fDCARfixed = kTRUE; | |
149 | fDCARptFormula = ""; | |
d7712d44 | 150 | fDCARmax = 1E20; |
2a1c7696 | 151 | fDCAZfixed = kTRUE; |
152 | fDCAZptFormula = ""; | |
d7712d44 | 153 | fDCAZmax = 1E20; |
2a1c7696 | 154 | fSPDminNClusters = 0; |
155 | fITSminNClusters = 0; | |
d7712d44 | 156 | fITSmaxChi2 = 1E20; |
2a1c7696 | 157 | fTPCminNClusters = 0; |
d7712d44 | 158 | fTPCmaxChi2 = 1E20; |
f34f960b | 159 | fAODTestFilterBit = -1; |
e1fec9d4 | 160 | fCutMaxChi2TPCConstrainedVsGlobal = 1E20; |
161 | fTPCminNCrossedRows = 0; | |
162 | fTPCminCrossedRowsOverFindableCls = 0; | |
163 | fCutMinLengthActiveVolumeTPC = 0.0; | |
164 | ||
5f17a44d | 165 | if (fESDtrackCuts) { |
74d60285 | 166 | const char *cutsName = fESDtrackCuts->GetName(); |
167 | const char *cutsTitle = fESDtrackCuts->GetTitle(); | |
168 | delete fESDtrackCuts; | |
169 | fESDtrackCuts = new AliESDtrackCuts(cutsName,cutsTitle); | |
5f17a44d | 170 | } |
d7712d44 | 171 | SetPtRange(0.0, 1E20); |
172 | SetEtaRange(-1E20, 1E20); | |
35e49ca5 | 173 | } |
174 | ||
175 | //_________________________________________________________________________________________________ | |
176 | Bool_t AliRsnCutTrackQuality::IsSelected(TObject *object) | |
177 | { | |
178 | // | |
179 | // Cut checker. | |
180 | // Checks the type of object being evaluated | |
181 | // and then calls the appropriate sub-function (for ESD or AOD) | |
182 | // | |
183 | ||
2a1c7696 | 184 | // coherence check |
185 | if (!TargetOK(object)) return kFALSE; | |
186 | ||
187 | // status is checked in the same way for all tracks, using AliVTrack | |
188 | // as a convention, if a the collection of 'on' flags is '0x0', it | |
189 | // is assumed that no flags are required, and this check is skipped; | |
190 | // for the collection of 'off' flags this is not needed | |
f34f960b | 191 | AliVTrack *vtrack = fDaughter->Ref2Vtrack(); |
2a1c7696 | 192 | if (!vtrack) { |
f34f960b | 193 | AliDebug(AliLog::kDebug + 2, "This object is not either an ESD nor AOD track"); |
2a1c7696 | 194 | return kFALSE; |
195 | } | |
196 | ULong_t status = (ULong_t)vtrack->GetStatus(); | |
197 | ULong_t checkOn = status & fFlagsOn; | |
198 | ULong_t checkOff = status & fFlagsOff; | |
199 | if (fFlagsOn != 0x0 && checkOn != fFlagsOn) { | |
f34f960b | 200 | AliDebug(AliLog::kDebug + 2, Form("Failed flag check: required %s", Binary(fFlagsOn))); |
201 | AliDebug(AliLog::kDebug + 2, Form(" track has %s", Binary(status ))); | |
2a1c7696 | 202 | return kFALSE; |
203 | } | |
204 | if (checkOff != 0) { | |
f34f960b | 205 | AliDebug(AliLog::kDebug + 2, Form("Failed flag check: forbidden %s", Binary(fFlagsOff))); |
206 | AliDebug(AliLog::kDebug + 2, Form(" track has %s", Binary(status ))); | |
2a1c7696 | 207 | return kFALSE; |
208 | } | |
f34f960b | 209 | AliDebug(AliLog::kDebug + 3, Form("Flag check OK: required %s", Binary(fFlagsOn))); |
210 | AliDebug(AliLog::kDebug + 3, Form(" forbidden %s", Binary(fFlagsOff))); | |
211 | AliDebug(AliLog::kDebug + 3, Form(" track has %s", Binary(status ))); | |
2a1c7696 | 212 | |
213 | // retrieve real object type | |
f34f960b | 214 | AliESDtrack *esdTrack = fDaughter->Ref2ESDtrack(); |
215 | AliAODTrack *aodTrack = fDaughter->Ref2AODtrack(); | |
2a1c7696 | 216 | if (esdTrack) { |
217 | AliDebug(AliLog::kDebug + 2, "Checking an ESD track"); | |
74d60285 | 218 | if (fESDtrackCuts) |
219 | return fESDtrackCuts->IsSelected(esdTrack); | |
220 | else | |
221 | return CheckESD(esdTrack); | |
2a1c7696 | 222 | } else if (aodTrack) { |
223 | AliDebug(AliLog::kDebug + 2, "Checking an AOD track"); | |
224 | return CheckAOD(aodTrack); | |
225 | } else { | |
226 | AliDebug(AliLog::kDebug + 2, Form("This object is not either an ESD nor AOD track, it is an %s", fDaughter->GetRef()->ClassName())); | |
227 | return kFALSE; | |
228 | } | |
35e49ca5 | 229 | } |
230 | ||
231 | //_________________________________________________________________________________________________ | |
232 | Bool_t AliRsnCutTrackQuality::CheckESD(AliESDtrack *track) | |
233 | { | |
234 | // | |
235 | // Check an ESD track. | |
236 | // This is done using the default track checker for ESD. | |
237 | // It is declared static, not to recreate it every time. | |
238 | // | |
4fb0dfa3 | 239 | //static AliESDtrackCuts cuts; |
240 | AliESDtrackCuts cuts; | |
2a1c7696 | 241 | |
242 | // general acceptance/pt cuts | |
243 | cuts.SetPtRange(fPt[0], fPt[1]); | |
244 | cuts.SetEtaRange(fEta[0], fEta[1]); | |
245 | ||
246 | // transverse DCA cuts | |
247 | if (fDCARfixed) | |
248 | cuts.SetMaxDCAToVertexXY(fDCARmax); | |
249 | else | |
250 | cuts.SetMaxDCAToVertexXYPtDep(fDCARptFormula.Data()); | |
251 | ||
252 | // longitudinal DCA cuts | |
253 | if (fDCAZfixed) | |
254 | cuts.SetMaxDCAToVertexZ(fDCAZmax); | |
255 | else | |
256 | cuts.SetMaxDCAToVertexZPtDep(fDCAZptFormula.Data()); | |
257 | ||
258 | // these options are always disabled in current version | |
259 | cuts.SetDCAToVertex2D(kFALSE); | |
260 | cuts.SetRequireSigmaToVertex(kFALSE); | |
261 | ||
262 | // TPC related cuts for TPC+ITS tracks | |
953fadb4 FB |
263 | if (fIsUseCrossedRowsCut) { |
264 | cuts.SetMinNCrossedRowsTPC(fTPCminNCrossedRows); | |
265 | cuts.SetMinRatioCrossedRowsOverFindableClustersTPC(fTPCminCrossedRowsOverFindableCls); | |
266 | } else { | |
267 | cuts.SetMinNClustersTPC(fTPCminNClusters); | |
268 | } | |
2a1c7696 | 269 | cuts.SetMaxChi2PerClusterTPC(fTPCmaxChi2); |
270 | cuts.SetAcceptKinkDaughters(!fRejectKinkDaughters); | |
5f17a44d | 271 | cuts.SetMaxChi2TPCConstrainedGlobal(fCutMaxChi2TPCConstrainedVsGlobal); |
953fadb4 FB |
272 | |
273 | if (fIsUseLengthActiveVolumeTPCCut) | |
274 | cuts.SetMinLengthActiveVolumeTPC(fCutMinLengthActiveVolumeTPC); | |
74d60285 | 275 | |
2a1c7696 | 276 | // ITS related cuts for TPC+ITS tracks |
277 | if (fSPDminNClusters > 0) | |
74d60285 | 278 | cuts.SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny); |
5f17a44d | 279 | cuts.SetMaxChi2PerClusterITS(fITSmaxChi2); |
2a1c7696 | 280 | |
281 | // now that all is initialized, do the check | |
282 | return cuts.IsSelected(track); | |
35e49ca5 | 283 | } |
284 | ||
285 | //_________________________________________________________________________________________________ | |
286 | Bool_t AliRsnCutTrackQuality::CheckAOD(AliAODTrack *track) | |
287 | { | |
288 | // | |
289 | // Check an AOD track. | |
290 | // This is done doing directly all checks, since there is not | |
291 | // an equivalend checker for AOD tracks | |
292 | // | |
2a1c7696 | 293 | |
f34f960b | 294 | // if a test bit is used, check it and skip the following |
295 | if (fAODTestFilterBit >= 0) { | |
e5ebff7e | 296 | UInt_t bit = 1 << fAODTestFilterBit; |
f34f960b | 297 | AliDebugClass(2, Form("Required a test filter bit for AOD check: %u (result: %s)", bit, (track->TestFilterBit(bit) ? "accept" : "reject"))); |
61f275d1 | 298 | if (!track->TestFilterBit(bit)) |
f34f960b | 299 | return kFALSE; |
300 | else { | |
301 | if (track->Pt() < fPt[0] || track->Pt() > fPt[1]) return kFALSE; | |
302 | if (track->Eta() < fEta[0] || track->Eta() > fEta[1]) return kFALSE; | |
9c569d46 | 303 | if (fCheckOnlyFilterBit) return kTRUE; |
f34f960b | 304 | } |
305 | } | |
61f275d1 | 306 | |
d7712d44 | 307 | // try to retrieve the reference AOD event |
308 | AliAODEvent *aodEvent = 0x0; | |
309 | if (fEvent) aodEvent = fEvent->GetRefAOD(); | |
310 | if (!aodEvent) { | |
311 | AliError("AOD reference event is not initialized!"); | |
312 | return kFALSE; | |
313 | } | |
314 | ||
2a1c7696 | 315 | // step #0: check SPD and ITS clusters |
316 | Int_t nSPD = 0; | |
317 | nSPD = TESTBIT(track->GetITSClusterMap(), 0); | |
318 | nSPD += TESTBIT(track->GetITSClusterMap(), 1); | |
319 | if (nSPD < fSPDminNClusters) { | |
320 | AliDebug(AliLog::kDebug + 2, "Not enough SPD clusters in this track. Rejected"); | |
35e49ca5 | 321 | return kFALSE; |
2a1c7696 | 322 | } |
323 | ||
5f17a44d | 324 | |
e1fec9d4 | 325 | //step #1: check number of clusters |
953fadb4 | 326 | if ((!fIsUseCrossedRowsCut) && (track->GetTPCNcls() < fTPCminNClusters)) { |
2a1c7696 | 327 | AliDebug(AliLog::kDebug + 2, "Too few TPC clusters. Rejected"); |
328 | return kFALSE; | |
329 | } | |
953fadb4 | 330 | |
2a1c7696 | 331 | if (track->GetITSNcls() < fITSminNClusters) { |
332 | AliDebug(AliLog::kDebug + 2, "Too few ITS clusters. Rejected"); | |
333 | return kFALSE; | |
334 | } | |
335 | ||
e1fec9d4 | 336 | //check chi square |
2a1c7696 | 337 | if (track->Chi2perNDF() > fTPCmaxChi2) { |
338 | AliDebug(AliLog::kDebug + 2, "Bad chi2. Rejected"); | |
339 | return kFALSE; | |
340 | } | |
341 | if (track->Chi2perNDF() > fITSmaxChi2) { | |
342 | AliDebug(AliLog::kDebug + 2, "Bad chi2. Rejected"); | |
343 | return kFALSE; | |
344 | } | |
345 | ||
e1fec9d4 | 346 | //step #2a: check number of crossed rows in TPC |
953fadb4 FB |
347 | if (fIsUseCrossedRowsCut) { |
348 | Float_t nCrossedRowsTPC = track->GetTPCNCrossedRows(); | |
349 | if (nCrossedRowsTPC < fTPCminNCrossedRows) { | |
350 | AliDebug(AliLog::kDebug + 2, "Too few TPC crossed rows. Rejected"); | |
351 | return kFALSE; | |
352 | } | |
353 | if (track->GetTPCNclsF()>0) { | |
354 | Float_t ratioCrossedRowsOverFindableClustersTPC = nCrossedRowsTPC / track->GetTPCNclsF(); | |
355 | if (ratioCrossedRowsOverFindableClustersTPC < fTPCminCrossedRowsOverFindableCls){ | |
356 | AliDebug(AliLog::kDebug + 2, "Too few TPC crossed rows/findable clusters. Rejected"); | |
357 | return kFALSE; | |
358 | } | |
359 | } else { | |
360 | AliDebug(AliLog::kDebug + 2, "Negative value for TPC crossed rows/findable clusters. Rejected"); | |
e1fec9d4 | 361 | return kFALSE; |
362 | } | |
e1fec9d4 | 363 | } |
364 | //step #2b: check on track length in active volume of TPC implemented only for ESD tracks | |
953fadb4 FB |
365 | //if (fIsUseLengthActiveVolumeTPCCut) { // not yet implemented in AODs} |
366 | ||
e1fec9d4 | 367 | //step #3: reject kink daughters |
2a1c7696 | 368 | AliAODVertex *vertex = track->GetProdVertex(); |
369 | if (vertex && fRejectKinkDaughters) { | |
370 | if (vertex->GetType() == AliAODVertex::kKink) { | |
371 | AliDebug(AliLog::kDebug + 2, "Kink daughter. Rejected"); | |
372 | return kFALSE; | |
373 | } | |
374 | } | |
375 | ||
376 | // step #4: DCA cut (transverse) | |
c865cb1d | 377 | // --> reject all tracks not ITS refitted |
2a1c7696 | 378 | Double_t b[2], cov[3]; |
d7712d44 | 379 | vertex = aodEvent->GetPrimaryVertex(); |
2a1c7696 | 380 | if (!vertex) { |
381 | AliDebug(AliLog::kDebug + 2, "NULL vertex"); | |
382 | return kFALSE; | |
383 | } | |
c865cb1d | 384 | if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) { |
385 | AliDebug(AliLog::kDebug + 2, "Not ITS refitted"); | |
386 | return kFALSE; | |
387 | } | |
d7712d44 | 388 | if (!track->PropagateToDCA(vertex, aodEvent->GetMagneticField(), kVeryBig, b, cov)) { |
2a1c7696 | 389 | AliDebug(AliLog::kDebug + 2, "Failed propagation to vertex"); |
390 | return kFALSE; | |
391 | } | |
392 | // if the DCA cut is not fixed, compute current value | |
393 | if (!fDCARfixed) { | |
9c569d46 | 394 | TString str(fDCARptFormula); |
2a1c7696 | 395 | str.ReplaceAll("pt", "x"); |
9c569d46 | 396 | TFormula dcaXY(Form("%s_dcaXY", GetName()), str.Data()); |
2a1c7696 | 397 | fDCARmax = dcaXY.Eval(track->Pt()); |
398 | } | |
399 | // check the cut | |
400 | if (TMath::Abs(b[0]) > fDCARmax) { | |
401 | AliDebug(AliLog::kDebug + 2, "Too large transverse DCA"); | |
402 | return kFALSE; | |
403 | } | |
404 | ||
405 | // step #5: DCA cut (longitudinal) | |
406 | // the DCA has already been computed above | |
407 | // if the DCA cut is not fixed, compute current value | |
408 | if (!fDCAZfixed) { | |
9c569d46 | 409 | TString str(fDCAZptFormula); |
2a1c7696 | 410 | str.ReplaceAll("pt", "x"); |
9c569d46 | 411 | TFormula dcaZ(Form("%s_dcaXY", GetName()), str.Data()); |
2a1c7696 | 412 | fDCAZmax = dcaZ.Eval(track->Pt()); |
413 | } | |
414 | // check the cut | |
415 | if (TMath::Abs(b[1]) > fDCAZmax) { | |
416 | AliDebug(AliLog::kDebug + 2, "Too large longitudinal DCA"); | |
417 | return kFALSE; | |
418 | } | |
419 | ||
420 | // step #6: check eta/pt range | |
421 | if (track->Eta() < fEta[0] || track->Eta() > fEta[1]) { | |
422 | AliDebug(AliLog::kDebug + 2, "Outside ETA acceptance"); | |
423 | return kFALSE; | |
424 | } | |
425 | if (track->Pt() < fPt[0] || track->Pt() > fPt[1]) { | |
426 | AliDebug(AliLog::kDebug + 2, "Outside PT acceptance"); | |
427 | return kFALSE; | |
428 | } | |
429 | ||
430 | // if we are here, all cuts were passed and no exit point was got | |
c865cb1d | 431 | AliDebug(AliLog::kDebug + 2, "============================= ACCEPTED TRACK ====================================================="); |
2a1c7696 | 432 | return kTRUE; |
35e49ca5 | 433 | } |
a909ffad | 434 | |
435 | //_________________________________________________________________________________________________ | |
436 | void AliRsnCutTrackQuality::Print(const Option_t *) const | |
437 | { | |
438 | // | |
439 | // Print information on this cut | |
440 | // | |
441 | ||
2a1c7696 | 442 | AliInfo(Form("Cut name : %s", GetName())); |
443 | AliInfo(Form("Required flags (off, on): %lx %lx", fFlagsOn, fFlagsOff)); | |
444 | AliInfo(Form("Ranges in eta, pt : %.2f - %.2f, %.2f - %.2f", fEta[0], fEta[1], fPt[0], fPt[1])); | |
445 | AliInfo(Form("Kink daughters are : %s", (fRejectKinkDaughters ? "rejected" : "accepted"))); | |
e1fec9d4 | 446 | AliInfo(Form("TPC requirements (clusters) : min. cluster = %i, max chi2 = %f", fTPCminNClusters, fTPCmaxChi2)); |
447 | AliInfo(Form("TPC requirements (crossed rows) : min. crossed rows = %f, min. crossed rows/findable clusters = %f", fTPCminNCrossedRows, fTPCminCrossedRowsOverFindableCls)); | |
448 | AliInfo(Form("TPC requirements (track length) : min. track length in active volume TPC = %f", fCutMinLengthActiveVolumeTPC)); | |
449 | ||
2a1c7696 | 450 | AliInfo(Form("ITS requirements : min. cluster = %d (all), %d (SPD), max chi2 = %f", fITSminNClusters, fSPDminNClusters, fITSmaxChi2)); |
451 | ||
452 | if (fDCARfixed) { | |
453 | AliInfo(Form("DCA r cut : fixed to %f cm", fDCARmax)); | |
454 | } else { | |
455 | AliInfo(Form("DCA r cut formula : %s", fDCARptFormula.Data())); | |
456 | } | |
457 | ||
458 | if (fDCAZfixed) { | |
459 | AliInfo(Form("DCA z cut : fixed to %f cm", fDCAZmax)); | |
460 | } else { | |
461 | AliInfo(Form("DCA z cut formula : %s", fDCAZptFormula.Data())); | |
462 | } | |
9c569d46 | 463 | |
464 | AliInfo(Form("fAODTestFilterBit : filter bit %i",fAODTestFilterBit)); | |
465 | AliInfo(Form("fCheckOnlyFilterBit : %i",((int) fCheckOnlyFilterBit))); | |
a909ffad | 466 | } |
5f17a44d | 467 | //__________________________________________________________________________________________________ |
468 | void AliRsnCutTrackQuality::SetDefaults2010() | |
469 | { | |
470 | // | |
471 | // Default settings for cuts used in 2010 | |
472 | // | |
473 | AddStatusFlag(AliESDtrack::kTPCin , kTRUE); | |
474 | AddStatusFlag(AliESDtrack::kTPCrefit, kTRUE); | |
475 | AddStatusFlag(AliESDtrack::kITSrefit, kTRUE); | |
476 | SetPtRange(0.15, 1E+20); | |
477 | SetEtaRange(-0.8, 0.8); | |
478 | SetDCARPtFormula("0.0182+0.0350/pt^1.01"); | |
479 | SetDCAZmax(2.0); | |
480 | SetSPDminNClusters(1); | |
481 | SetITSminNClusters(0); | |
cc5e9900 | 482 | // SetITSmaxChi2(36); |
483 | // SetMaxChi2TPCConstrainedGlobal(36); | |
5f17a44d | 484 | SetTPCminNClusters(70); |
485 | SetTPCmaxChi2(4.0); | |
486 | SetRejectKinkDaughters(); | |
487 | SetAODTestFilterBit(5); | |
488 | } | |
489 | ||
b307bb43 | 490 | //__________________________________________________________________________________________________ |
953fadb4 | 491 | void AliRsnCutTrackQuality::SetDefaultsHighPt2011(Bool_t useTPCCrossedRows) |
b307bb43 | 492 | { |
493 | // | |
e1fec9d4 | 494 | // Default settings for cuts used in 2011 (for high-pT) |
b307bb43 | 495 | // |
953fadb4 FB |
496 | fIsUseCrossedRowsCut=useTPCCrossedRows; |
497 | fESDtrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2011(kTRUE, useTPCCrossedRows); | |
e1fec9d4 | 498 | fESDtrackCuts->SetMinNCrossedRowsTPC(120); //default is min 70 crossed rows -> use 120 to go to higher pt |
e1fec9d4 | 499 | fESDtrackCuts->SetMaxFractionSharedTPCClusters(0.4);//default is not set --> use to go to higher pt |
953fadb4 FB |
500 | //fESDtrackCuts->SetMinRatioCrossedRowsOverFindableClustersTPC(0.8);//already in 2011 std |
501 | //fESDtrackCuts->SetMaxChi2PerClusterITS(36);//already in 2011 std | |
502 | //fESDtrackCuts->SetMaxChi2TPCConstrainedGlobal(36);//already in 2011 std | |
503 | // AddStatusFlag(AliESDtrack::kTPCin , kTRUE); //already in 2011 std | |
504 | // AddStatusFlag(AliESDtrack::kTPCrefit, kTRUE);//already in 2011 std | |
505 | // AddStatusFlag(AliESDtrack::kITSrefit, kTRUE);//already in 2011 std | |
b307bb43 | 506 | SetPtRange(0.15, 1E+20); |
507 | SetEtaRange(-0.8, 0.8); | |
508 | SetAODTestFilterBit(10); | |
953fadb4 | 509 | return; |
b307bb43 | 510 | } |
511 | ||
953fadb4 FB |
512 | //__________________________________________________________________________________________________ |
513 | void AliRsnCutTrackQuality::SetDefaults2011(Bool_t useTPCCrossedRows) | |
514 | { | |
515 | // | |
516 | // Default std cuts 2011 with crossed rows (=70) | |
517 | // | |
518 | fIsUseCrossedRowsCut=useTPCCrossedRows; | |
519 | fESDtrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2011(kTRUE,useTPCCrossedRows); | |
520 | SetPtRange(0.15, 1E+20); | |
521 | SetEtaRange(-0.8, 0.8); | |
522 | SetAODTestFilterBit(5); | |
523 | return; | |
524 | } | |
5f17a44d | 525 | //__________________________________________________________________________________________________ |
526 | const char *AliRsnCutTrackQuality::Binary(UInt_t number) | |
527 | { | |
528 | // | |
529 | // Convert an integer in binary | |
530 | // | |
531 | ||
532 | static char b[50]; | |
533 | b[0] = '\0'; | |
534 | ||
535 | UInt_t z; | |
536 | for (z = 512; z > 0; z >>= 1) | |
537 | strncat(b, ((number & z) == z) ? "1" : "0", 1); | |
538 | ||
539 | return b; | |
540 | } |