]>
Commit | Line | Data |
---|---|---|
47c1a0e0 | 1 | // |
2 | // Class AliRsnCutAOD2010 | |
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 | ||
21 | #include <TBits.h> | |
22 | ||
23 | #include "AliESDtrack.h" | |
24 | #include "AliAODTrack.h" | |
25 | ||
26 | #include "AliRsnEvent.h" | |
27 | #include "AliRsnDaughter.h" | |
28 | #include "AliRsnCutAOD2010.h" | |
29 | ||
30 | ClassImp(AliRsnCutAOD2010) | |
31 | ||
47c1a0e0 | 32 | |
33 | //_________________________________________________________________________________________________ | |
89202f72 | 34 | AliRsnCutAOD2010::AliRsnCutAOD2010(const char *name, Bool_t isMC) : |
47c1a0e0 | 35 | AliRsnCut(name, AliRsnCut::kDaughter, 0.0, 0.0), |
36 | ||
37 | fIsMC(kFALSE), | |
38 | fCheckITS(kTRUE), | |
39 | fCheckTPC(kTRUE), | |
40 | fCheckTOF(kTRUE), | |
41 | fUseGlobal(kTRUE), | |
42 | fUseITSSA(kTRUE), | |
89202f72 | 43 | |
44 | fMaxEta(1E6), | |
47c1a0e0 | 45 | |
46 | fPIDtype(AliPID::kKaon), | |
47 | ||
48 | fTPCminNclusters(70), | |
49 | fTPCmaxChi2(4.0), | |
50 | fTPCmaxNSigmaDCA(7.0), | |
51 | fTPClowBand(5.0), | |
52 | fTPChighBand(3.0), | |
53 | fTPClowLimit(0.35), | |
54 | ||
55 | fITSminNclusters(4), | |
56 | fITSmaxChi2(2.5), | |
57 | fITSmaxNSigmaDCA(7.0), | |
58 | fITSband(3.0), | |
59 | ||
60 | fTOFlowLimit(-2.5), | |
61 | fTOFhighLimit(3.5), | |
89202f72 | 62 | |
47c1a0e0 | 63 | fPID() |
64 | { | |
65 | // | |
89202f72 | 66 | // Default constructor. |
67 | // Sets all parameters to the currently used values, and requires | |
68 | // to know if we are running on data or MonteCarlo to set some others. | |
47c1a0e0 | 69 | // |
70 | ||
89202f72 | 71 | fTPCparamDCA[0] = 0.0050; |
72 | fTPCparamDCA[1] = 0.0070; | |
73 | fTPCparamDCA[2] = 1.0000; | |
74 | ||
75 | fITSparamDCA[0] = 0.0085; | |
76 | fITSparamDCA[1] = 0.0026; | |
77 | fITSparamDCA[2] = 1.5500; | |
78 | ||
79 | SetMC(isMC); | |
47c1a0e0 | 80 | } |
81 | ||
82 | //_________________________________________________________________________________________________ | |
83 | AliRsnCutAOD2010::AliRsnCutAOD2010 | |
84 | (const AliRsnCutAOD2010& copy) : | |
85 | AliRsnCut(copy), | |
86 | ||
87 | fIsMC(copy.fIsMC), | |
88 | fCheckITS(copy.fCheckITS), | |
89 | fCheckTPC(copy.fCheckTPC), | |
90 | fCheckTOF(copy.fCheckTOF), | |
91 | fUseGlobal(copy.fUseGlobal), | |
92 | fUseITSSA(copy.fUseITSSA), | |
93 | ||
89202f72 | 94 | fMaxEta(copy.fMaxEta), |
95 | ||
47c1a0e0 | 96 | fPIDtype(copy.fPIDtype), |
97 | ||
98 | fTPCminNclusters(copy.fTPCminNclusters), | |
99 | fTPCmaxChi2(copy.fTPCmaxChi2), | |
100 | fTPCmaxNSigmaDCA(copy.fTPCmaxNSigmaDCA), | |
101 | fTPClowBand(copy.fTPClowBand), | |
102 | fTPChighBand(copy.fTPChighBand), | |
103 | fTPClowLimit(copy.fTPClowLimit), | |
104 | ||
105 | fITSminNclusters(copy.fITSminNclusters), | |
106 | fITSmaxChi2(copy.fITSmaxChi2), | |
107 | fITSmaxNSigmaDCA(copy.fITSmaxNSigmaDCA), | |
108 | fITSband(copy.fITSband), | |
109 | ||
110 | fTOFlowLimit(copy.fTOFlowLimit), | |
111 | fTOFhighLimit(copy.fTOFhighLimit), | |
89202f72 | 112 | |
47c1a0e0 | 113 | fPID(copy.fPID) |
114 | { | |
115 | // | |
116 | // Copy constructor | |
117 | // | |
118 | ||
119 | Int_t i = 0; | |
120 | for (i = 0; i < 3; i++) | |
121 | { | |
122 | fTPCparamDCA[i] = copy.fTPCparamDCA[i]; | |
123 | fITSparamDCA[i] = copy.fITSparamDCA[i]; | |
124 | } | |
89202f72 | 125 | } |
126 | ||
127 | //_________________________________________________________________________________________________ | |
128 | void AliRsnCutAOD2010::SetMC(Bool_t yn) | |
129 | { | |
130 | // | |
131 | // Sets some parameters depending on MC or dataanalysis | |
132 | // | |
133 | ||
134 | fIsMC = yn; | |
135 | ||
136 | if (fIsMC) | |
137 | { | |
138 | AliDebug(AliLog::kDebug + 2, "Setting for MC"); | |
139 | fPID.GetTPCResponse().SetBetheBlochParameters(2.15898 / 50.0, 1.75295E1, 3.40030E-9, 1.96178, 3.91720); | |
140 | } | |
141 | else | |
142 | { | |
143 | AliDebug(AliLog::kDebug + 2, "Setting for DATA"); | |
144 | fPID.GetTPCResponse().SetBetheBlochParameters(1.41543 / 50.0, 2.63394E1, 5.0411E-11, 2.12543, 4.88663); | |
145 | } | |
146 | ||
147 | AliITSPIDResponse itsrsp(fIsMC); | |
148 | fPID.GetITSResponse() = itsrsp; | |
47c1a0e0 | 149 | } |
150 | ||
151 | //_________________________________________________________________________________________________ | |
152 | Bool_t AliRsnCutAOD2010::IsSelected(TObject *obj1, TObject* /*obj2*/) | |
153 | { | |
154 | // | |
155 | // Cut checker. | |
156 | // | |
157 | ||
158 | // coherence check: require an AOD track | |
159 | AliRsnDaughter *daughter = dynamic_cast<AliRsnDaughter*>(obj1); | |
160 | if (!daughter) return kFALSE; | |
161 | AliAODTrack *track = daughter->GetRefAODtrack(); | |
162 | if (!track) return kFALSE; | |
163 | ||
164 | // step #0: check presence of an SPD cluster | |
165 | Int_t nITS = 0, nSPD = 0; | |
166 | nSPD = TESTBIT(track->GetITSClusterMap(), 0); | |
167 | nSPD += TESTBIT(track->GetITSClusterMap(), 1); | |
168 | nITS = track->GetITSNcls() - nSPD; | |
169 | if (nSPD <= 0) | |
170 | { | |
171 | AliDebug(AliLog::kDebug + 2, "No SPD clusters in this track. Rejected"); | |
172 | return kFALSE; | |
173 | } | |
174 | ||
175 | // step #1: check status flags and reject track if it does not match any possibility | |
89202f72 | 176 | Bool_t isTPC, isTOF; |
177 | if (!track->IsOn(AliESDtrack::kTPCin) && track->IsOn(AliESDtrack::kITSrefit) && (!track->IsOn(AliESDtrack::kITSpureSA))) | |
47c1a0e0 | 178 | { |
89202f72 | 179 | isTPC = kFALSE; |
180 | isTOF = kFALSE; | |
181 | if (!fUseITSSA) | |
182 | { | |
183 | AliDebug(AliLog::kDebug + 2, "ITS standalone not used. Rejected"); | |
184 | return kFALSE; | |
185 | } | |
47c1a0e0 | 186 | } |
89202f72 | 187 | else if (track->IsOn(AliESDtrack::kTPCin) && track->IsOn(AliESDtrack::kTPCrefit) && track->IsOn(AliESDtrack::kITSrefit)) |
47c1a0e0 | 188 | { |
89202f72 | 189 | isTPC = kTRUE; |
190 | if (!fUseGlobal) | |
191 | { | |
192 | AliDebug(AliLog::kDebug + 2, "ITS standalone not used. Rejected"); | |
193 | return kFALSE; | |
194 | } | |
195 | if (track->IsOn(AliESDtrack::kTOFout) && track->IsOn(AliESDtrack::kTIME)) | |
196 | isTOF = kTRUE; | |
197 | else | |
198 | isTOF = kFALSE; | |
47c1a0e0 | 199 | } |
89202f72 | 200 | else |
47c1a0e0 | 201 | { |
89202f72 | 202 | AliDebug(AliLog::kDebug + 2, "Track is not either a TPC track or a ITS standalone. Rejected"); |
47c1a0e0 | 203 | return kFALSE; |
204 | } | |
205 | ||
206 | // step #2: check number of clusters | |
47c1a0e0 | 207 | if (isTPC) |
208 | { | |
89202f72 | 209 | if (track->GetTPCNcls() < fTPCminNclusters) |
47c1a0e0 | 210 | { |
211 | AliDebug(AliLog::kDebug + 2, "Too few clusters. Rejected"); | |
212 | return kFALSE; | |
213 | } | |
214 | } | |
89202f72 | 215 | else |
47c1a0e0 | 216 | { |
89202f72 | 217 | if (track->GetITSNcls() < fITSminNclusters) |
47c1a0e0 | 218 | { |
219 | AliDebug(AliLog::kDebug + 2, "Too few clusters. Rejected"); | |
220 | return kFALSE; | |
221 | } | |
222 | } | |
223 | ||
224 | // step #3: check chi square | |
225 | if (isTPC) | |
226 | { | |
227 | if (track->Chi2perNDF() > fTPCmaxChi2) | |
228 | { | |
229 | AliDebug(AliLog::kDebug + 2, "Bad chi2. Rejected"); | |
230 | return kFALSE; | |
231 | } | |
232 | } | |
233 | else | |
234 | { | |
235 | if (track->Chi2perNDF() > fITSmaxChi2) | |
236 | { | |
237 | AliDebug(AliLog::kDebug + 2, "Bad chi2. Rejected"); | |
238 | return kFALSE; | |
239 | } | |
240 | } | |
241 | ||
242 | // step #4: reject kink daughters | |
243 | AliAODVertex *vertex = track->GetProdVertex(); | |
244 | if (isTPC && vertex != 0x0) | |
245 | { | |
89202f72 | 246 | if (vertex->GetType() == AliAODVertex::kKink) |
47c1a0e0 | 247 | { |
248 | AliDebug(AliLog::kDebug + 2, "Kink daughter. Rejected"); | |
249 | return kFALSE; | |
250 | } | |
251 | } | |
252 | ||
253 | // step #5: DCA cut (transverse) | |
89202f72 | 254 | Double_t dz[2], cov[3], sigmaDCA = 0.0, nsigma = 0.0; |
255 | vertex = fEvent->GetRefAOD()->GetPrimaryVertex(); | |
256 | if (!vertex) | |
257 | { | |
258 | AliDebug(AliLog::kDebug + 2, "NULL vertex"); | |
259 | return kFALSE; | |
260 | } | |
261 | if (!track->PropagateToDCA(vertex, fEvent->GetRefAOD()->GetMagneticField(), kVeryBig, dz, cov)) | |
262 | { | |
263 | AliDebug(AliLog::kDebug + 2, "Failed propagation to vertex"); | |
264 | return kFALSE; | |
265 | } | |
266 | // compute the pt-dependent sigma | |
47c1a0e0 | 267 | if (isTPC) |
268 | { | |
269 | sigmaDCA = fTPCparamDCA[0] + fTPCparamDCA[1] / TMath::Power(track->Pt(), fTPCparamDCA[2]); | |
270 | nsigma = fTPCmaxNSigmaDCA; | |
271 | } | |
272 | else | |
273 | { | |
274 | sigmaDCA = fITSparamDCA[0] + fITSparamDCA[1] / TMath::Power(track->Pt(), fITSparamDCA[2]); | |
275 | nsigma = fITSmaxNSigmaDCA; | |
276 | } | |
89202f72 | 277 | // check the DCA |
278 | if (dz[0] > nsigma * sigmaDCA) | |
47c1a0e0 | 279 | { |
280 | AliDebug(AliLog::kDebug + 2, "Excceeded cut in DCA. Rejected"); | |
281 | return kFALSE; | |
282 | } | |
283 | ||
89202f72 | 284 | // step #6: check eta range |
285 | if (TMath::Abs(track->Eta()) >= fMaxEta) | |
47c1a0e0 | 286 | { |
89202f72 | 287 | AliDebug(AliLog::kDebug + 2, "Outside ETA acceptance"); |
288 | return kFALSE; | |
47c1a0e0 | 289 | } |
89202f72 | 290 | |
291 | // step #7: PID cuts | |
292 | if (isTPC) | |
47c1a0e0 | 293 | { |
294 | if (fCheckTPC) | |
295 | { | |
89202f72 | 296 | AliAODPid *pidObj = track->GetDetPid(); |
297 | Double_t mom = pidObj->GetTPCmomentum(); | |
298 | Double_t nsigmaTPC = fPID.NumberOfSigmasTPC(track, fPIDtype); | |
299 | Double_t bandTPC = fTPChighBand; | |
300 | if (mom <= fTPClowLimit) bandTPC = fTPClowBand; | |
47c1a0e0 | 301 | if (TMath::Abs(nsigmaTPC) > bandTPC) |
302 | { | |
303 | AliDebug(AliLog::kDebug + 2, "Bad TPC PID. Rejected"); | |
304 | return kFALSE; | |
305 | } | |
306 | else | |
307 | { | |
308 | AliDebug(AliLog::kDebug + 2, "Good TPC PID"); | |
309 | if (fCheckTOF && isTOF) | |
310 | { | |
89202f72 | 311 | Double_t nsigmaTOF = (Double_t)fPID.NumberOfSigmasTOF(track, fPIDtype); |
47c1a0e0 | 312 | if (nsigmaTOF < fTOFlowLimit || nsigmaTOF > fTOFhighLimit) |
313 | { | |
314 | AliDebug(AliLog::kDebug + 2, "Bad TOF PID. Rejected"); | |
315 | return kFALSE; | |
316 | } | |
317 | else | |
318 | { | |
319 | AliDebug(AliLog::kDebug + 2, "Good TOF PID. Accepted"); | |
320 | return kFALSE; | |
321 | } | |
322 | } | |
323 | else | |
324 | { | |
325 | AliDebug(AliLog::kDebug + 2, "TOF not checked. Accepted"); | |
326 | return kTRUE; | |
327 | } | |
328 | } | |
329 | } | |
330 | else | |
331 | { | |
332 | if (fCheckTOF && isTOF) | |
333 | { | |
89202f72 | 334 | Double_t nsigmaTOF = (Double_t)fPID.NumberOfSigmasTOF(track, fPIDtype); |
47c1a0e0 | 335 | if (nsigmaTOF < fTOFlowLimit || nsigmaTOF > fTOFhighLimit) |
336 | { | |
337 | AliDebug(AliLog::kDebug + 2, "Bad TOF PID. Rejected"); | |
338 | return kFALSE; | |
339 | } | |
340 | else | |
341 | { | |
342 | AliDebug(AliLog::kDebug + 2, "Good TOF PID. Accepted"); | |
343 | return kFALSE; | |
344 | } | |
345 | } | |
346 | else | |
347 | { | |
348 | AliDebug(AliLog::kDebug + 2, "No PID checked. Accepted"); | |
349 | return kTRUE; | |
350 | } | |
351 | } | |
352 | } | |
89202f72 | 353 | else |
354 | { | |
355 | if (fCheckITS) | |
356 | { | |
357 | if (nITS < 3 || !track->IsOn(AliESDtrack::kITSpid)) return kFALSE; | |
358 | Double_t nsigmaITS = (Double_t)fPID.NumberOfSigmasITS(track, fPIDtype); | |
359 | if (TMath::Abs(nsigmaITS) > fITSband) | |
360 | { | |
361 | AliDebug(AliLog::kDebug + 2, "Bad ITS PID. Rejected"); | |
362 | return kFALSE; | |
363 | } | |
364 | else | |
365 | { | |
366 | AliDebug(AliLog::kDebug + 2, "Good ITS PID. Accepted"); | |
367 | return kFALSE; | |
368 | } | |
369 | } | |
370 | else | |
371 | { | |
372 | AliDebug(AliLog::kDebug + 2, "No PID checked. Accepted"); | |
373 | return kTRUE; | |
374 | } | |
375 | } | |
47c1a0e0 | 376 | } |