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