]>
Commit | Line | Data |
---|---|---|
74722676 | 1 | // |
2 | // All cuts for single pions | |
3 | // based on track quality and particle identification | |
4 | // with TPC and TOF. | |
5 | // Author: fbellini@cern.ch | |
6 | // | |
7 | // | |
8 | ||
9 | #include <Riostream.h> | |
10 | ||
11 | #include "AliPID.h" | |
12 | #include "AliPIDResponse.h" | |
13 | #include "AliRsnCutKaon.h" | |
14 | ||
15 | ClassImp(AliRsnCutKaon) | |
16 | ||
61f275d1 | 17 | const char *AliRsnCutKaon::fgkCutName[AliRsnCutKaon::kNkaonCuts]= { |
18 | "kQuality_Std2010", | |
19 | "kTOFMatch_Std2010", | |
20 | "kFastTPCpid_Nsigma", | |
21 | "kFastTPCpid_1point5sigma", | |
22 | "kFastTPCpid_2sigma", | |
23 | "kFastTPCpid_3sigma", | |
24 | "kFastTOFpid_Nsigma", | |
25 | "kFastTOFpid_1point5sigma", | |
26 | "kFastTOFpid_2sigma", | |
27 | "kFastTOFpid_3sigma", | |
28 | "kTPCTOFpid_DefaultKstarPP2010" | |
74722676 | 29 | }; |
30 | ||
31 | //__________________________________________________________________________________________________ | |
32 | AliRsnCutKaon::AliRsnCutKaon(const char *name, AliRsnCutKaon::ERsnKaonCut cutID, AliPID::EParticleType pid) : | |
61f275d1 | 33 | AliRsnCut(name, AliRsnTarget::kDaughter), |
34 | fNoPID(kFALSE), | |
35 | fPID(pid), | |
36 | fCutQuality(Form("%sQuality", name)), | |
37 | fAppliedCutID(cutID), | |
38 | fNsigmaCutTPC(1E6), | |
39 | fNsigmaCutTOF(1E6) | |
74722676 | 40 | { |
61f275d1 | 41 | // |
42 | // Constructor | |
43 | // Initialize track quality cuts to 2010 defaults | |
44 | // | |
45 | fCutQuality.SetPtRange(0.15, 1E+20); | |
46 | fCutQuality.SetEtaRange(-0.8, 0.8); | |
47 | fCutQuality.SetDCARPtFormula("0.0182+0.0350/pt^1.01"); | |
48 | fCutQuality.SetDCAZmax(2.0); | |
49 | fCutQuality.SetSPDminNClusters(1); | |
50 | fCutQuality.SetITSminNClusters(0); | |
51 | fCutQuality.SetITSmaxChi2(1E+20); | |
52 | fCutQuality.SetTPCminNClusters(70); | |
53 | fCutQuality.SetTPCmaxChi2(4.0); | |
54 | fCutQuality.SetRejectKinkDaughters(); | |
55 | fCutQuality.SetAODTestFilterBit(5); | |
56 | AliInfo(Form("Applied cut on kaon candidate: %s", AliRsnCutKaon::fgkCutName[fAppliedCutID])); | |
74722676 | 57 | } |
58 | ||
59 | //__________________________________________________________________________________________________ | |
60 | Bool_t AliRsnCutKaon::MatchTOF(const AliVTrack *vtrack) | |
61 | { | |
62 | // | |
63 | // Checks if the track has matched the TOF detector | |
64 | // | |
65 | if (!vtrack) { | |
66 | AliWarning("NULL argument: impossible to check status"); | |
67 | return kFALSE; | |
68 | } | |
69 | if (!(vtrack->GetStatus() & AliESDtrack::kTOFout)) return kFALSE; | |
70 | if (!(vtrack->GetStatus() & AliESDtrack::kTIME)) return kFALSE; | |
71 | ||
72 | return kTRUE; | |
73 | } | |
74 | ||
75 | //__________________________________________________________________________________________________ | |
76 | Bool_t AliRsnCutKaon::IsSelected(TObject *obj) | |
77 | { | |
78 | // | |
79 | // Global check | |
80 | // | |
81 | // coherence check | |
82 | if (!TargetOK(obj)) return kFALSE; | |
61f275d1 | 83 | |
74722676 | 84 | // check track |
61f275d1 | 85 | AliVTrack *track = dynamic_cast<AliVTrack *>(fDaughter->GetRef()); |
74722676 | 86 | if (!track) return kFALSE; |
61f275d1 | 87 | |
74722676 | 88 | Bool_t isSelected=kFALSE; |
89 | switch (fAppliedCutID) | |
61f275d1 | 90 | { |
91 | case AliRsnCutKaon::kQualityStd2010: | |
92 | isSelected=IsSelectedByQualityStd2010(obj, 1, 1, 1); | |
93 | break; | |
94 | ||
95 | case AliRsnCutKaon::kTOFMatchStd2010: | |
96 | isSelected=IsSelectedByTOFMatchStd2010(obj); | |
97 | break; | |
98 | ||
99 | case AliRsnCutKaon::kFastTPCpidNsigma: | |
100 | isSelected=IsSelectedByFastTPCpidNsigma(obj,fNsigmaCutTPC); | |
101 | break; | |
102 | ||
103 | case AliRsnCutKaon::kFastTPCpid1point5sigma: | |
104 | isSelected=IsSelectedByFastTPCpid1point5sigma(obj); | |
105 | break; | |
106 | ||
107 | case AliRsnCutKaon::kFastTPCpid2sigma: | |
108 | isSelected=IsSelectedByFastTPCpid2sigma(obj); | |
109 | break; | |
110 | ||
111 | case AliRsnCutKaon::kFastTPCpid3sigma: | |
112 | isSelected=IsSelectedByFastTPCpid3sigma(obj); | |
113 | break; | |
114 | ||
115 | case AliRsnCutKaon::kFastTOFpidNsigma: | |
116 | isSelected=IsSelectedByFastTOFpidNsigma(obj,fNsigmaCutTOF); | |
117 | break; | |
118 | ||
119 | case AliRsnCutKaon::kFastTOFpid1point5sigma: | |
120 | isSelected=IsSelectedByFastTOFpid1point5sigma(obj); | |
121 | break; | |
122 | ||
123 | case AliRsnCutKaon::kFastTOFpid2sigma: | |
124 | isSelected=IsSelectedByFastTOFpid2sigma(obj); | |
125 | break; | |
126 | ||
127 | case AliRsnCutKaon::kFastTOFpid3sigma: | |
128 | isSelected=IsSelectedByFastTOFpid3sigma(obj); | |
129 | break; | |
130 | ||
131 | case AliRsnCutKaon::kTPCTOFpidDefaultKstarPP2010: | |
132 | isSelected=IsSelectedByTPCTOFpidDefaultKstarPP2010(obj); | |
133 | break; | |
134 | ||
135 | default : | |
136 | break; | |
137 | } | |
138 | ||
74722676 | 139 | return isSelected; |
140 | } | |
141 | ||
142 | //----------------------------------------------------------- | |
143 | Bool_t AliRsnCutKaon::IsSelectedByQualityStd2010(TObject *obj, Bool_t requireTPCin=kTRUE, Bool_t requireTPCrefit=kTRUE, Bool_t requireITSrefit=kTRUE) | |
144 | { | |
61f275d1 | 145 | //Checks if track passes the standard quality cuts |
146 | //defined for analysis in 2010 pp and PbPb data | |
147 | ||
148 | if (!obj) { | |
149 | AliError("Invalid track object passed to function. Please check!"); | |
150 | return kFALSE; | |
151 | } | |
152 | ||
153 | fAppliedCutID= AliRsnCutKaon::kQualityStd2010; | |
154 | AliVTrack *track = dynamic_cast<AliVTrack *>(fDaughter->GetRef()); | |
74722676 | 155 | if (!track) return kFALSE; |
61f275d1 | 156 | |
157 | //optionally check refit flags (to be used for Phi and kStar analysis) | |
158 | if (requireTPCin && ((track->GetStatus() & AliESDtrack::kTPCin) == 0) ) return kFALSE; | |
159 | if (requireTPCrefit && ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) ) return kFALSE; | |
160 | if (requireITSrefit && ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) ) return kFALSE; | |
161 | ||
162 | // quality | |
163 | if (!fCutQuality.IsSelected(obj)) return kFALSE; | |
164 | return kTRUE; | |
74722676 | 165 | } |
166 | ||
167 | //----------------------------------------------------------- | |
168 | Bool_t AliRsnCutKaon::IsSelectedByTOFMatchStd2010(TObject *obj) | |
169 | { | |
61f275d1 | 170 | /* |
171 | fbellini@cern.ch, 05.dec.2011 | |
172 | definition of TOF match: quality cuts 2010 + kTOFout + kTIME | |
173 | (optionally) L > 350. cm cut can be added | |
174 | */ | |
74722676 | 175 | if (!obj) { |
61f275d1 | 176 | AliError("Invalid track object passed to function. Please check!"); |
177 | return kFALSE; | |
74722676 | 178 | } |
179 | ||
180 | fAppliedCutID=AliRsnCutKaon::kTOFMatchStd2010; | |
61f275d1 | 181 | |
74722676 | 182 | if (!IsSelectedByQualityStd2010(obj, kTRUE, kTRUE, kTRUE)) |
61f275d1 | 183 | return kFALSE; |
184 | ||
185 | AliVTrack *track = dynamic_cast<AliVTrack *>(fDaughter->GetRef()); | |
74722676 | 186 | if (!track) return kFALSE; |
187 | return MatchTOF(track); | |
188 | } | |
189 | ||
190 | //----------------------------------------------------------- | |
191 | Bool_t AliRsnCutKaon::IsSelectedByFastTPCpidNsigma(TObject *obj,Float_t nSigmaCut=10.) | |
192 | { | |
61f275d1 | 193 | /* |
194 | fbellini@cern.ch, 05.dec.2011 Double_t pTPC = track->GetTPCmomentum(); | |
195 | definition of fast TPC pid N-sigma: quality cuts 2010 + sigma cut on dE/dx without p dependence | |
196 | */ | |
197 | if (!obj) { | |
198 | AliError("Invalid track object passed to function. Please check!"); | |
199 | return kFALSE; | |
200 | } | |
201 | fAppliedCutID=AliRsnCutKaon::kFastTPCpidNsigma; | |
202 | ||
203 | // check initialization of PID object | |
204 | AliPIDResponse *pid = fEvent->GetPIDResponse(); | |
205 | if (!pid) { | |
206 | AliFatal("NULL PID response"); | |
207 | return kFALSE; | |
208 | } | |
209 | ||
210 | if (!IsSelectedByQualityStd2010(obj, kTRUE, kTRUE, kTRUE)) | |
211 | return kFALSE; | |
212 | ||
213 | AliVTrack *track = dynamic_cast<AliVTrack *>(fDaughter->GetRef()); | |
214 | if (!track) return kFALSE; | |
215 | ||
216 | Double_t nsTPC = TMath::Abs(pid->NumberOfSigmasTPC(track,fPID)); | |
217 | return (nsTPC <= nSigmaCut); | |
74722676 | 218 | } |
219 | //----------------------------------------------------------- | |
220 | Bool_t AliRsnCutKaon::IsSelectedByFastTOFpidNsigma(TObject *obj,Float_t nSigmaCut=10.) | |
221 | { | |
61f275d1 | 222 | /* |
223 | fbellini@cern.ch, 05.dec.2011 | |
224 | definition of fast TOF pid N-sigma: quality cuts 2010 + sigma cut on t-t_0-t_exp without p dependence | |
225 | */ | |
226 | if (!obj) { | |
227 | AliError("Invalid track object passed to function. Please check!"); | |
228 | return kFALSE; | |
229 | } | |
230 | ||
231 | fAppliedCutID=AliRsnCutKaon::kFastTOFpidNsigma; | |
232 | ||
233 | // check initialization of PID object | |
234 | AliPIDResponse *pid = fEvent->GetPIDResponse(); | |
235 | if (!pid) { | |
236 | AliFatal("NULL PID response"); | |
237 | return kFALSE; | |
238 | } | |
239 | ||
240 | if (!IsSelectedByQualityStd2010(obj, kTRUE, kTRUE, kTRUE)) | |
241 | return kFALSE; | |
242 | ||
243 | AliVTrack *track = dynamic_cast<AliVTrack *>(fDaughter->GetRef()); | |
244 | if (!track) return kFALSE; | |
245 | Bool_t isTOF = MatchTOF(track); | |
246 | Double_t nsTOF = isTOF ? TMath::Abs(pid->NumberOfSigmasTOF(track, fPID)) : 1E20; | |
247 | ||
248 | return (nsTOF <= nSigmaCut); | |
74722676 | 249 | } |
250 | ||
251 | //----------------------------------------------------------- | |
252 | Bool_t AliRsnCutKaon::IsSelectedByTPCTOFpidDefaultKstarPP2010(TObject *obj) | |
253 | { | |
61f275d1 | 254 | /* |
255 | fbellini@cern.ch, 05.dec.2011 | |
256 | definition of TPC-TOF pid for pp phi and Kstar analysis on 2010 data: | |
257 | quality cuts 2010 + sigma cut on dE/dx with pTPC dependence + sigma cut on t-t_0-t_exp with p dependence | |
258 | */ | |
259 | ||
260 | if (!obj) { | |
261 | AliError("Invalid track object passed to function. Please check!"); | |
262 | return kFALSE; | |
263 | } | |
264 | fAppliedCutID=AliRsnCutKaon::kTPCTOFpidDefaultKstarPP2010; | |
265 | ||
266 | // check initialization of PID object | |
267 | AliPIDResponse *pid = fEvent->GetPIDResponse(); | |
268 | if (!pid) { | |
269 | AliFatal("NULL PID response"); | |
270 | return kFALSE; | |
271 | } | |
272 | ||
273 | if (!IsSelectedByQualityStd2010(obj, kTRUE, kTRUE, kTRUE)) //require ITS+TPCrefit and TPCin | |
274 | return kFALSE; | |
275 | ||
276 | AliVTrack *track = dynamic_cast<AliVTrack *>(fDaughter->GetRef()); | |
277 | if (!track) return kFALSE; | |
278 | ||
279 | Bool_t isTOF = MatchTOF(track); | |
280 | Double_t pTPC = track->GetTPCmomentum(); | |
281 | Double_t p = track->P(); | |
282 | Double_t nsTPC = TMath::Abs(pid->NumberOfSigmasTPC(track, fPID)); | |
283 | Double_t nsTOF = isTOF ? TMath::Abs(pid->NumberOfSigmasTOF(track, fPID)) : 1E20; | |
284 | Double_t maxTPC = 1E20; | |
285 | Double_t maxTOF = 1E20; | |
286 | ||
287 | if (isTOF) { | |
288 | // TPC: 5sigma cut for all | |
289 | if (nsTPC > 5.0) return kFALSE; | |
290 | // TOF: 3sigma below 1.5 GeV, 2sigma above | |
291 | if (p < 1.5) maxTOF = 3.0; else maxTOF = 2.0; | |
292 | return (nsTOF <= maxTOF); | |
293 | } else { | |
294 | // TPC: | |
295 | // all below 350 MeV: 5sigma | |
296 | // all between 350 and 500 MeV: 3sigma | |
297 | // pios above 500 MeV: 2sigma | |
298 | // kaons between 500 and 700 MeV: 2sigma | |
299 | // kaons above 700 MeV: rejected | |
300 | if (pTPC <= 0.35) | |
301 | maxTPC = 5.0; | |
302 | else if (pTPC > 0.35 && pTPC <= 0.5) | |
303 | maxTPC = 3.0; | |
304 | else { | |
305 | if (pTPC <= 0.7) maxTPC = 2.0; | |
306 | else | |
307 | return kFALSE; | |
308 | } | |
309 | return (nsTPC <= maxTPC); | |
310 | } | |
74722676 | 311 | } |