]>
Commit | Line | Data |
---|---|---|
1 | /************************************************************************** | |
2 | * Copyright(c) 1998-2010, 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 * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
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$ */ | |
17 | ||
18 | ///////////////////////////////////////////////////////////// | |
19 | // | |
20 | // Class for cuts on AOD reconstructed D+->Kpipi | |
21 | // | |
22 | // Author: R. Bala, bala@to.infn.it | |
23 | // G. Ortona, ortona@to.infn.it | |
24 | ///////////////////////////////////////////////////////////// | |
25 | ||
26 | #include <TDatabasePDG.h> | |
27 | #include <Riostream.h> | |
28 | ||
29 | #include "AliAODPidHF.h" | |
30 | #include "AliRDHFCutsDplustoKpipi.h" | |
31 | #include "AliAODRecoDecayHF3Prong.h" | |
32 | #include "AliAODTrack.h" | |
33 | #include "AliESDtrack.h" | |
34 | ||
35 | ||
36 | using std::cout; | |
37 | using std::endl; | |
38 | ||
39 | ClassImp(AliRDHFCutsDplustoKpipi) | |
40 | ||
41 | //-------------------------------------------------------------------------- | |
42 | AliRDHFCutsDplustoKpipi::AliRDHFCutsDplustoKpipi(const char* name) : | |
43 | AliRDHFCuts(name), | |
44 | fUseStrongPid(0), | |
45 | fMaxPtStrongPid(0.), | |
46 | fMaxPStrongPidK(0.), | |
47 | fMaxPStrongPidpi(0.), | |
48 | fUseImpParProdCorrCut(kFALSE) | |
49 | { | |
50 | // | |
51 | // Default Constructor | |
52 | // | |
53 | Int_t nvars=14; | |
54 | SetNVars(nvars); | |
55 | TString varNames[14]={"inv. mass [GeV]", | |
56 | "pTK [GeV/c]", | |
57 | "pTPi [GeV/c]", | |
58 | "d0K [cm] lower limit!", | |
59 | "d0Pi [cm] lower limit!", | |
60 | "dist12 (cm)", | |
61 | "sigmavert (cm)", | |
62 | "dist prim-sec (cm)", | |
63 | "pM=Max{pT1,pT2,pT3} (GeV/c)", | |
64 | "cosThetaPoint", | |
65 | "Sum d0^2 (cm^2)", | |
66 | "dca cut (cm)", | |
67 | "dec len XY (cm)", | |
68 | "cosThetaPointXY"}; | |
69 | Bool_t isUpperCut[14]={kTRUE, | |
70 | kFALSE, | |
71 | kFALSE, | |
72 | kFALSE, | |
73 | kFALSE, | |
74 | kFALSE, | |
75 | kTRUE, | |
76 | kFALSE, | |
77 | kFALSE, | |
78 | kFALSE, | |
79 | kFALSE, | |
80 | kTRUE, | |
81 | kFALSE, | |
82 | kFALSE}; | |
83 | SetVarNames(nvars,varNames,isUpperCut); | |
84 | Bool_t forOpt[14]={kFALSE, | |
85 | kFALSE, | |
86 | kFALSE, | |
87 | kFALSE, | |
88 | kFALSE, | |
89 | kFALSE, | |
90 | kTRUE, | |
91 | kTRUE, | |
92 | kTRUE, | |
93 | kTRUE, | |
94 | kTRUE, | |
95 | kFALSE, | |
96 | kTRUE, | |
97 | kTRUE}; | |
98 | SetVarsForOpt(7,forOpt); | |
99 | Float_t limits[2]={0,999999999.}; | |
100 | SetPtBins(2,limits); | |
101 | if(fPidHF)delete fPidHF; | |
102 | fPidHF=new AliAODPidHF(); | |
103 | Double_t plim[2]={0.6,0.8}; | |
104 | Double_t nsigma[5]={2.,1.,2.,3.,0.}; | |
105 | ||
106 | fPidHF->SetPLimit(plim); | |
107 | fPidHF->SetAsym(kTRUE); | |
108 | fPidHF->SetSigma(nsigma); | |
109 | fPidHF->SetMatch(1); | |
110 | fPidHF->SetTPC(1); | |
111 | fPidHF->SetTOF(1); | |
112 | fPidHF->SetITS(0); | |
113 | fPidHF->SetTRD(0); | |
114 | fPidHF->SetCompat(kTRUE); | |
115 | ||
116 | ||
117 | } | |
118 | ||
119 | ||
120 | ||
121 | ||
122 | ||
123 | ||
124 | ||
125 | ||
126 | //-------------------------------------------------------------------------- | |
127 | AliRDHFCutsDplustoKpipi::AliRDHFCutsDplustoKpipi(const AliRDHFCutsDplustoKpipi &source) : | |
128 | AliRDHFCuts(source), | |
129 | fUseStrongPid(source.fUseStrongPid), | |
130 | fMaxPtStrongPid(source.fMaxPtStrongPid), | |
131 | fMaxPStrongPidK(source.fMaxPStrongPidK), | |
132 | fMaxPStrongPidpi(source.fMaxPStrongPidpi), | |
133 | fUseImpParProdCorrCut(source.fUseImpParProdCorrCut) | |
134 | { | |
135 | // | |
136 | // Copy constructor | |
137 | // | |
138 | ||
139 | } | |
140 | //-------------------------------------------------------------------------- | |
141 | AliRDHFCutsDplustoKpipi &AliRDHFCutsDplustoKpipi::operator=(const AliRDHFCutsDplustoKpipi &source) | |
142 | { | |
143 | // | |
144 | // assignment operator | |
145 | // | |
146 | if(&source == this) return *this; | |
147 | ||
148 | AliRDHFCuts::operator=(source); | |
149 | ||
150 | fUseStrongPid=source.fUseStrongPid; | |
151 | fMaxPtStrongPid=source.fMaxPtStrongPid; | |
152 | fMaxPStrongPidK=source.fMaxPStrongPidK; | |
153 | fMaxPStrongPidpi=source.fMaxPStrongPidpi; | |
154 | fUseImpParProdCorrCut=source.fUseImpParProdCorrCut; | |
155 | ||
156 | return *this; | |
157 | } | |
158 | // | |
159 | ||
160 | ||
161 | //--------------------------------------------------------------------------- | |
162 | void AliRDHFCutsDplustoKpipi::GetCutVarsForOpt(AliAODRecoDecayHF *d,Float_t *vars,Int_t nvars,Int_t *pdgdaughters,AliAODEvent *aod) { | |
163 | // | |
164 | // Fills in vars the values of the variables | |
165 | // | |
166 | ||
167 | ||
168 | if(nvars!=fnVarsForOpt) { | |
169 | printf("AliRDHFCutsDplustoKpipi::GetCutsVarsForOpt: wrong number of variables\n"); | |
170 | return; | |
171 | } | |
172 | ||
173 | AliAODRecoDecayHF3Prong *dd = (AliAODRecoDecayHF3Prong*)d; | |
174 | ||
175 | //recalculate vertex w/o daughters | |
176 | Bool_t cleanvtx=kFALSE; | |
177 | AliAODVertex *origownvtx=0x0; | |
178 | if(fRemoveDaughtersFromPrimary) { | |
179 | if(dd->GetOwnPrimaryVtx()) origownvtx=new AliAODVertex(*dd->GetOwnPrimaryVtx()); | |
180 | cleanvtx=kTRUE; | |
181 | if(!RecalcOwnPrimaryVtx(dd,aod)) { | |
182 | CleanOwnPrimaryVtx(dd,aod,origownvtx); | |
183 | cleanvtx=kFALSE; | |
184 | } | |
185 | } | |
186 | ||
187 | Int_t iter=-1; | |
188 | if(fVarsForOpt[0]){ | |
189 | iter++; | |
190 | vars[iter]=dd->InvMassDplus(); | |
191 | } | |
192 | if(fVarsForOpt[1]){ | |
193 | iter++; | |
194 | for(Int_t iprong=0;iprong<3;iprong++){ | |
195 | if(TMath::Abs(pdgdaughters[iprong])==321) { | |
196 | vars[iter]=dd->PtProng(iprong); | |
197 | } | |
198 | } | |
199 | } | |
200 | if(fVarsForOpt[2]){ | |
201 | iter++; | |
202 | Float_t minPtDau=1000000.0; | |
203 | for(Int_t iprong=0;iprong<3;iprong++){ | |
204 | if(TMath::Abs(pdgdaughters[iprong])==211) { | |
205 | if(dd->PtProng(iprong)<minPtDau){ | |
206 | minPtDau=dd->PtProng(iprong); | |
207 | } | |
208 | } | |
209 | } | |
210 | vars[iter]=minPtDau; | |
211 | } | |
212 | if(fVarsForOpt[3]){ | |
213 | iter++; | |
214 | for(Int_t iprong=0;iprong<3;iprong++){ | |
215 | if(TMath::Abs(pdgdaughters[iprong])==321) { | |
216 | vars[iter]=dd->Getd0Prong(iprong); | |
217 | } | |
218 | } | |
219 | } | |
220 | if(fVarsForOpt[4]){ | |
221 | iter++; | |
222 | Float_t minImpParDau=1000000.0; | |
223 | for(Int_t iprong=0;iprong<3;iprong++){ | |
224 | if(TMath::Abs(pdgdaughters[iprong])==211) { | |
225 | if(dd->Getd0Prong(iprong)<minImpParDau){ | |
226 | minImpParDau=dd->Getd0Prong(iprong); | |
227 | } | |
228 | } | |
229 | } | |
230 | vars[iter]=minImpParDau; | |
231 | } | |
232 | if(fVarsForOpt[5]){ | |
233 | iter++; | |
234 | Float_t dist12 = dd->GetDist12toPrim(); | |
235 | Float_t dist23 = dd->GetDist23toPrim(); | |
236 | if(dist12<dist23)vars[iter]=dist12; | |
237 | else vars[iter]=dist23; | |
238 | } | |
239 | if(fVarsForOpt[6]){ | |
240 | iter++; | |
241 | vars[iter]=dd->GetSigmaVert(aod); | |
242 | } | |
243 | if(fVarsForOpt[7]){ | |
244 | iter++; | |
245 | vars[iter] = dd->DecayLength(); | |
246 | } | |
247 | if(fVarsForOpt[8]){ | |
248 | iter++; | |
249 | Float_t ptmax=0; | |
250 | for(Int_t i=0;i<3;i++){ | |
251 | if(dd->PtProng(i)>ptmax)ptmax=dd->PtProng(i); | |
252 | } | |
253 | vars[iter]=ptmax; | |
254 | } | |
255 | if(fVarsForOpt[9]){ | |
256 | iter++; | |
257 | vars[iter]=dd->CosPointingAngle(); | |
258 | } | |
259 | if(fVarsForOpt[10]){ | |
260 | iter++; | |
261 | vars[iter]=dd->Getd0Prong(0)*dd->Getd0Prong(0)+dd->Getd0Prong(1)*dd->Getd0Prong(1)+dd->Getd0Prong(2)*dd->Getd0Prong(2); | |
262 | } | |
263 | if(fVarsForOpt[11]){ | |
264 | iter++; | |
265 | Float_t maxDCA=0; | |
266 | for(Int_t iprong=0;iprong<3;iprong++){ | |
267 | if(dd->GetDCA(iprong)<maxDCA){ | |
268 | maxDCA=dd->GetDCA(iprong); | |
269 | } | |
270 | } | |
271 | vars[iter]=maxDCA; | |
272 | } | |
273 | if(fVarsForOpt[12]){ | |
274 | iter++; | |
275 | vars[iter]=dd->NormalizedDecayLengthXY()*dd->P()/dd->Pt(); | |
276 | } | |
277 | if(fVarsForOpt[13]){ | |
278 | iter++; | |
279 | vars[iter]=dd->CosPointingAngleXY(); | |
280 | } | |
281 | ||
282 | if(cleanvtx)CleanOwnPrimaryVtx(dd,aod,origownvtx); | |
283 | ||
284 | return; | |
285 | } | |
286 | //--------------------------------------------------------------------------- | |
287 | Bool_t AliRDHFCutsDplustoKpipi::IsInFiducialAcceptance(Double_t pt, Double_t y) const | |
288 | { | |
289 | // | |
290 | // Checking if Dplus is in fiducial acceptance region | |
291 | // | |
292 | ||
293 | if(pt > 5.) { | |
294 | // applying cut for pt > 5 GeV | |
295 | AliDebug(2,Form("pt of D+ = %f (> 5), cutting at |y| < 0.8",pt)); | |
296 | if (TMath::Abs(y) > 0.8) return kFALSE; | |
297 | ||
298 | } else { | |
299 | // appliying smooth cut for pt < 5 GeV | |
300 | Double_t maxFiducialY = -0.2/15*pt*pt+1.9/15*pt+0.5; | |
301 | Double_t minFiducialY = 0.2/15*pt*pt-1.9/15*pt-0.5; | |
302 | AliDebug(2,Form("pt of D+ = %f (< 5), cutting according to the fiducial zone [%f, %f]\n",pt,minFiducialY,maxFiducialY)); | |
303 | if (y < minFiducialY || y > maxFiducialY) return kFALSE; | |
304 | } | |
305 | ||
306 | return kTRUE; | |
307 | } | |
308 | ||
309 | //--------------------------------------------------------------------------- | |
310 | Int_t AliRDHFCutsDplustoKpipi::GetPIDBitMask(AliAODRecoDecayHF *rd) | |
311 | { | |
312 | if(!fUsePID || !rd) return -1; | |
313 | //if(fUsePID)printf("i am inside the pid \n"); | |
314 | Int_t mask=0; | |
315 | Int_t sign=rd->GetCharge(); | |
316 | for(Int_t daught=0;daught<3;daught++){ | |
317 | AliAODTrack *track=(AliAODTrack*)rd->GetDaughter(daught); | |
318 | ||
319 | if(sign==track->Charge()){//pions | |
320 | Int_t isPion=fPidHF->MakeRawPid(track,AliPID::kPion); | |
321 | if(isPion==0)mask+=1; | |
322 | else if(isPion>0)mask+=3; | |
323 | mask=mask<<2; | |
324 | } | |
325 | else{//kaons | |
326 | Int_t isKaon=fPidHF->MakeRawPid(track,AliPID::kKaon); | |
327 | if(isKaon==0)mask+=1; | |
328 | else if(isKaon>0)mask+=3; | |
329 | mask=mask<<2; | |
330 | } | |
331 | } | |
332 | mask=mask>>2; | |
333 | return mask; | |
334 | } | |
335 | //--------------------------------------------------------------------------- | |
336 | Int_t AliRDHFCutsDplustoKpipi::IsSelectedPID(AliAODRecoDecayHF *rd) | |
337 | { | |
338 | // | |
339 | // PID selection, returns 3 if accepted, 0 if not accepted | |
340 | // | |
341 | if(!fUsePID || !rd) return 3; | |
342 | //if(fUsePID)printf("i am inside the pid \n"); | |
343 | Int_t nkaons=0; | |
344 | Int_t nNotKaons=0; | |
345 | Int_t sign= rd->GetCharge(); | |
346 | for(Int_t daught=0;daught<3;daught++){ | |
347 | AliAODTrack *track=(AliAODTrack*)rd->GetDaughter(daught); | |
348 | Int_t isPion=fPidHF->MakeRawPid(track,AliPID::kPion); | |
349 | Int_t isKaon=fPidHF->MakeRawPid(track,AliPID::kKaon); | |
350 | Int_t isProton=fPidHF->MakeRawPid(track,AliPID::kProton); | |
351 | ||
352 | if(isProton>0 && isKaon<0 && isPion<0) return 0; | |
353 | if(isKaon>0 && isPion<0) nkaons++; | |
354 | if(isKaon<0) nNotKaons++; | |
355 | if(sign==track->Charge()){//pions | |
356 | if(isPion<0)return 0; | |
357 | if(rd->Pt()<fMaxPtStrongPid && isPion<=0 && fUseStrongPid&2 && track->P()<fMaxPStrongPidpi)return 0; | |
358 | } | |
359 | else{//kaons | |
360 | if(isKaon<0)return 0; | |
361 | if(rd->Pt()<fMaxPtStrongPid && isKaon<=0 && fUseStrongPid&1&& track->P()<fMaxPStrongPidK)return 0; | |
362 | } | |
363 | } | |
364 | ||
365 | if(nkaons>1)return 0; | |
366 | if(nNotKaons==3)return 0; | |
367 | ||
368 | return 3; | |
369 | } | |
370 | ||
371 | ||
372 | //--------------------------------------------------------------------------- | |
373 | Int_t AliRDHFCutsDplustoKpipi::IsSelected(TObject* obj,Int_t selectionLevel, AliAODEvent* aod) { | |
374 | // | |
375 | // Apply selection, returns 3 if accepted, 0 if not accepted | |
376 | // | |
377 | ||
378 | ||
379 | fIsSelectedCuts=0; | |
380 | fIsSelectedPID=0; | |
381 | ||
382 | if(!fCutsRD){ | |
383 | cout<<"Cut matrix not inizialized. Exit..."<<endl; | |
384 | return 0; | |
385 | } | |
386 | //PrintAll(); | |
387 | AliAODRecoDecayHF3Prong* d=(AliAODRecoDecayHF3Prong*)obj; | |
388 | ||
389 | ||
390 | if(!d){ | |
391 | cout<<"AliAODRecoDecayHF3Prong null"<<endl; | |
392 | return 0; | |
393 | } | |
394 | ||
395 | if(fKeepSignalMC) if(IsSignalMC(d,aod,411)) return 3; | |
396 | ||
397 | // PID selection | |
398 | Int_t returnvaluePID=3; | |
399 | Int_t returnvalueCuts=3; | |
400 | ||
401 | Double_t pt=d->Pt(); | |
402 | if(pt<fMinPtCand) return 0; | |
403 | if(pt>fMaxPtCand) return 0; | |
404 | ||
405 | if(d->HasBadDaughters()) return 0; | |
406 | ||
407 | // selection on candidate | |
408 | if(selectionLevel==AliRDHFCuts::kAll || | |
409 | selectionLevel==AliRDHFCuts::kCandidate) { | |
410 | ||
411 | //recalculate vertex w/o daughters | |
412 | AliAODVertex *origownvtx=0x0; | |
413 | if(fRemoveDaughtersFromPrimary) { | |
414 | if(d->GetOwnPrimaryVtx()) origownvtx=new AliAODVertex(*d->GetOwnPrimaryVtx()); | |
415 | if(!RecalcOwnPrimaryVtx(d,aod)) { | |
416 | CleanOwnPrimaryVtx(d,aod,origownvtx); | |
417 | return 0; | |
418 | } | |
419 | } | |
420 | ||
421 | Int_t ptbin=PtBin(pt); | |
422 | if (ptbin==-1) { | |
423 | CleanOwnPrimaryVtx(d,aod,origownvtx); | |
424 | return 0; | |
425 | } | |
426 | ||
427 | Double_t mDplusPDG = TDatabasePDG::Instance()->GetParticle(411)->Mass(); | |
428 | Double_t mDplus=d->InvMassDplus(); | |
429 | if(TMath::Abs(mDplus-mDplusPDG)>fCutsRD[GetGlobalIndex(0,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;} | |
430 | ||
431 | //2track cuts | |
432 | if(d->GetDist12toPrim()<fCutsRD[GetGlobalIndex(5,ptbin)]|| d->GetDist23toPrim()<fCutsRD[GetGlobalIndex(5,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;} | |
433 | ||
434 | Double_t sum2=d->Getd0Prong(0)*d->Getd0Prong(0)+d->Getd0Prong(1)*d->Getd0Prong(1)+d->Getd0Prong(2)*d->Getd0Prong(2); | |
435 | if(sum2<fCutsRD[GetGlobalIndex(10,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;} | |
436 | ||
437 | if(fUseImpParProdCorrCut){ | |
438 | if(d->Getd0Prong(0)*d->Getd0Prong(1)<0. && d->Getd0Prong(2)*d->Getd0Prong(1)<0.) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;} | |
439 | } | |
440 | ||
441 | ||
442 | //DCA | |
443 | for(Int_t i=0;i<3;i++) if(d->GetDCA(i)>fCutsRD[GetGlobalIndex(11,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;} | |
444 | ||
445 | if(d->Pt2Prong(1) < fCutsRD[GetGlobalIndex(1,ptbin)]*fCutsRD[GetGlobalIndex(1,ptbin)] || TMath::Abs(d->Getd0Prong(1))<fCutsRD[GetGlobalIndex(3,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}//Kaon | |
446 | ||
447 | if(d->Pt2Prong(0) < fCutsRD[GetGlobalIndex(2,ptbin)]*fCutsRD[GetGlobalIndex(2,ptbin)] || TMath::Abs(d->Getd0Prong(0))<fCutsRD[GetGlobalIndex(4,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}//Pion1 | |
448 | ||
449 | if(d->Pt2Prong(2) < fCutsRD[GetGlobalIndex(2,ptbin)]*fCutsRD[GetGlobalIndex(2,ptbin)] || TMath::Abs(d->Getd0Prong(2))<fCutsRD[GetGlobalIndex(4,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}//Pion2 | |
450 | ||
451 | if(d->Pt2Prong(0)<fCutsRD[GetGlobalIndex(8,ptbin)]*fCutsRD[GetGlobalIndex(8,ptbin)] && d->Pt2Prong(1)<fCutsRD[GetGlobalIndex(8,ptbin)]*fCutsRD[GetGlobalIndex(8,ptbin)] && d->Pt2Prong(2)<fCutsRD[GetGlobalIndex(8,ptbin)]*fCutsRD[GetGlobalIndex(8,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;} | |
452 | ||
453 | if(d->DecayLength2()<fCutsRD[GetGlobalIndex(7,ptbin)]*fCutsRD[GetGlobalIndex(7,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;} | |
454 | ||
455 | if(d->CosPointingAngle()< fCutsRD[GetGlobalIndex(9,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;} | |
456 | ||
457 | if(d->NormalizedDecayLengthXY()*d->P()/pt<fCutsRD[GetGlobalIndex(12,ptbin)]){CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;} | |
458 | ||
459 | if(d->CosPointingAngleXY()<fCutsRD[GetGlobalIndex(13,ptbin)]){CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;} | |
460 | ||
461 | //sec vert | |
462 | Double_t sigmavert=d->GetSigmaVert(aod); | |
463 | if(sigmavert>fCutsRD[GetGlobalIndex(6,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;} | |
464 | ||
465 | // unset recalculated primary vertex when not needed any more | |
466 | CleanOwnPrimaryVtx(d,aod,origownvtx); | |
467 | ||
468 | fIsSelectedCuts=returnvalueCuts; | |
469 | ||
470 | //if(!returnvalueCuts) return 0; // returnvalueCuts cannot be 0 here | |
471 | } | |
472 | ||
473 | if(selectionLevel==AliRDHFCuts::kAll || | |
474 | selectionLevel==AliRDHFCuts::kCandidate || | |
475 | selectionLevel==AliRDHFCuts::kPID) { | |
476 | returnvaluePID = IsSelectedPID(d); | |
477 | fIsSelectedPID=returnvaluePID; | |
478 | } | |
479 | if(returnvaluePID==0)return 0; | |
480 | ||
481 | // selection on daughter tracks | |
482 | if(selectionLevel==AliRDHFCuts::kAll || | |
483 | selectionLevel==AliRDHFCuts::kTracks) { | |
484 | if(!AreDaughtersSelected(d)) return 0; | |
485 | } | |
486 | ||
487 | ||
488 | ||
489 | ||
490 | return 3; | |
491 | } | |
492 | ||
493 | ||
494 | ||
495 | ||
496 | //--------------------------------------------------------------------------- | |
497 | ||
498 | ||
499 | void AliRDHFCutsDplustoKpipi::SetStandardCutsPP2010() { | |
500 | // | |
501 | //STANDARD CUTS USED FOR 2010 pp analysis | |
502 | // | |
503 | ||
504 | SetName("DplustoKpipiCutsStandard"); | |
505 | SetTitle("Standard Cuts for D+ analysis"); | |
506 | ||
507 | // PILE UP REJECTION | |
508 | SetOptPileup(AliRDHFCuts::kRejectPileupEvent); | |
509 | ||
510 | // EVENT CUTS | |
511 | SetMinVtxContr(1); | |
512 | ||
513 | AliESDtrackCuts* esdTrackCuts=new AliESDtrackCuts(); | |
514 | esdTrackCuts->SetRequireSigmaToVertex(kFALSE); | |
515 | //default | |
516 | esdTrackCuts->SetRequireTPCRefit(kTRUE); | |
517 | esdTrackCuts->SetRequireITSRefit(kTRUE); | |
518 | //esdTrackCuts->SetMinNClustersITS(4); // default is 5 | |
519 | esdTrackCuts->SetMinNClustersTPC(70); | |
520 | esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, | |
521 | AliESDtrackCuts::kAny); | |
522 | // default is kBoth, otherwise kAny | |
523 | esdTrackCuts->SetMinDCAToVertexXY(0.); | |
524 | esdTrackCuts->SetPtRange(0.3,1.e10); | |
525 | ||
526 | AddTrackCuts(esdTrackCuts); | |
527 | ||
528 | ||
529 | const Int_t nptbins =15; | |
530 | const Int_t nvars=14; | |
531 | Float_t ptbins[nptbins+1]; | |
532 | ptbins[0]=0.; | |
533 | ptbins[1]=1; | |
534 | ptbins[2]=2.; | |
535 | ptbins[3]=3.; | |
536 | ptbins[4]=4.; | |
537 | ptbins[5]=5.; | |
538 | ptbins[6]=6.; | |
539 | ptbins[7]=7.; | |
540 | ptbins[8]=8.; | |
541 | ptbins[9]=9.; | |
542 | ptbins[10]=10.; | |
543 | ptbins[11]=12.; | |
544 | ptbins[12]=14.; | |
545 | ptbins[13]=16.; | |
546 | ptbins[14]=24.; | |
547 | ptbins[15]=99999.; | |
548 | ||
549 | ||
550 | Float_t** anacutsval; | |
551 | anacutsval=new Float_t*[nvars]; | |
552 | ||
553 | for(Int_t ic=0;ic<nvars;ic++){anacutsval[ic]=new Float_t[nptbins];} | |
554 | ||
555 | //Double_t cutsDplus[12]={0.2,0.4,0.4,0.,0.,0.01,0.06,0.02,0.,0.85,0.,10000000000.}; | |
556 | for(Int_t ipt=0;ipt<nptbins;ipt++){ | |
557 | anacutsval[0][ipt]=0.2; | |
558 | anacutsval[3][ipt]=0.; | |
559 | anacutsval[4][ipt]=0.; | |
560 | anacutsval[5][ipt]=0.01; | |
561 | anacutsval[11][ipt]=10000000000.; | |
562 | } | |
563 | ||
564 | anacutsval[1][0]=0.3; | |
565 | anacutsval[1][1]=0.4; | |
566 | anacutsval[1][2]=0.4; | |
567 | anacutsval[2][0]=0.3; | |
568 | anacutsval[2][1]=0.3; | |
569 | anacutsval[2][2]=0.4; | |
570 | for(Int_t ipt=3;ipt<nptbins;ipt++){ | |
571 | anacutsval[1][ipt]=0.4; | |
572 | anacutsval[2][ipt]=0.4; | |
573 | } | |
574 | ||
575 | anacutsval[6][0]=0.022100; | |
576 | anacutsval[6][1]=0.022100; | |
577 | anacutsval[6][2]=0.034; | |
578 | anacutsval[6][3]=0.020667; | |
579 | anacutsval[6][4]=0.020667; | |
580 | anacutsval[6][5]=0.023333; | |
581 | ||
582 | ||
583 | anacutsval[7][0]=0.08; | |
584 | anacutsval[7][1]=0.08; | |
585 | anacutsval[7][2]=0.09; | |
586 | anacutsval[7][3]=0.095; | |
587 | anacutsval[7][4]=0.095; | |
588 | ||
589 | anacutsval[8][0]=0.5; | |
590 | anacutsval[8][1]=0.5; | |
591 | anacutsval[8][2]=1.0; | |
592 | anacutsval[8][3]=0.5; | |
593 | anacutsval[8][4]=0.5; | |
594 | ||
595 | ||
596 | anacutsval[9][0]=0.97; | |
597 | anacutsval[9][1]=0.936; | |
598 | anacutsval[9][2]=0.95; | |
599 | anacutsval[9][3]=0.95; | |
600 | anacutsval[9][4]= 0.95; | |
601 | anacutsval[9][5]=0.92; | |
602 | anacutsval[9][6]=0.92; | |
603 | anacutsval[9][7]=0.92; | |
604 | anacutsval[9][8]=0.92; | |
605 | anacutsval[9][9]=0.90; | |
606 | for(Int_t ipt=10;ipt<nptbins;ipt++){ | |
607 | anacutsval[9][ipt]=0.90; | |
608 | } | |
609 | ||
610 | ||
611 | anacutsval[10][0]=0.0055; | |
612 | anacutsval[10][1]=0.0055; | |
613 | anacutsval[10][2]= 0.0028; | |
614 | anacutsval[10][3]=0.000883; | |
615 | anacutsval[10][4]=0.000883; | |
616 | ||
617 | ||
618 | for(Int_t ipt=5;ipt<nptbins;ipt++){ | |
619 | anacutsval[6][ipt]=0.02333; | |
620 | anacutsval[7][ipt]=0.115; | |
621 | anacutsval[8][ipt]=0.5; | |
622 | anacutsval[10][ipt]=0.000883; | |
623 | } | |
624 | ||
625 | anacutsval[12][0]=8; | |
626 | anacutsval[12][1]=8; | |
627 | ||
628 | anacutsval[13][0]=0.98; | |
629 | anacutsval[13][1]=0.98; | |
630 | for(Int_t ipt=2;ipt<nptbins;ipt++){ | |
631 | anacutsval[12][ipt]=0.; | |
632 | anacutsval[13][ipt]=0.; | |
633 | } | |
634 | ||
635 | ||
636 | ||
637 | SetGlobalIndex(nvars,nptbins); | |
638 | SetPtBins(nptbins+1,ptbins); | |
639 | SetCuts(nvars,nptbins,anacutsval); | |
640 | SetUsePID(kTRUE); | |
641 | SetRemoveDaughtersFromPrim(kTRUE); | |
642 | ||
643 | PrintAll(); | |
644 | ||
645 | for(Int_t iic=0;iic<nvars;iic++){delete [] anacutsval[iic];} | |
646 | delete [] anacutsval; | |
647 | anacutsval=NULL; | |
648 | ||
649 | return; | |
650 | } | |
651 | ||
652 | ||
653 | void AliRDHFCutsDplustoKpipi::SetStandardCutsPbPb2010() { | |
654 | // | |
655 | //STANDARD CUTS USED FOR 2010 Pb Pb analysis.... not optimized yet | |
656 | // | |
657 | ||
658 | SetName("DplustoKpipiCutsStandard"); | |
659 | SetTitle("Standard Cuts for D+ analysis in PbPb2010 run"); | |
660 | ||
661 | // PILE UP REJECTION | |
662 | //SetOptPileup(AliRDHFCuts::kRejectPileupEvent); | |
663 | ||
664 | // EVENT CUTS | |
665 | SetMinVtxContr(1); | |
666 | ||
667 | ||
668 | AliESDtrackCuts* esdTrackCuts=new AliESDtrackCuts(); | |
669 | esdTrackCuts->SetRequireSigmaToVertex(kFALSE); | |
670 | //default | |
671 | esdTrackCuts->SetRequireTPCRefit(kTRUE); | |
672 | esdTrackCuts->SetRequireITSRefit(kTRUE); | |
673 | //esdTrackCuts->SetMinNClustersITS(4); // default is 5 | |
674 | esdTrackCuts->SetMinNClustersTPC(70); | |
675 | esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, | |
676 | AliESDtrackCuts::kAny); | |
677 | // default is kBoth, otherwise kAny | |
678 | esdTrackCuts->SetMinDCAToVertexXY(0.); | |
679 | esdTrackCuts->SetPtRange(0.8,1.e10); | |
680 | ||
681 | AddTrackCuts(esdTrackCuts); | |
682 | ||
683 | const Int_t nptbins=10; | |
684 | Float_t* ptbins; | |
685 | ptbins=new Float_t[nptbins+1]; | |
686 | ||
687 | ptbins[0]=0.; | |
688 | ptbins[1]=1.; | |
689 | ptbins[2]=2.; | |
690 | ptbins[3]=3.; | |
691 | ptbins[4]=4.; | |
692 | ptbins[5]=5.; | |
693 | ptbins[6]=6.; | |
694 | ptbins[7]=8.; | |
695 | ptbins[8]=12.; | |
696 | ptbins[9]=16.; | |
697 | ptbins[10]=24.; | |
698 | const Int_t nvars=14; | |
699 | ||
700 | Float_t** anacutsval; | |
701 | anacutsval=new Float_t*[nvars]; | |
702 | ||
703 | for(Int_t ic=0;ic<nvars;ic++){anacutsval[ic]=new Float_t[nptbins];} | |
704 | //Double_t cutsDplus[12]={0.2,0.4,0.4,0.,0.,0.01,0.06,0.02,0.,0.85,0.,10000000000.}; | |
705 | ||
706 | for(Int_t ipt=0;ipt<nptbins;ipt++){ | |
707 | anacutsval[0][ipt]=0.2; | |
708 | anacutsval[1][ipt]=0.8; | |
709 | anacutsval[2][ipt]=0.8; | |
710 | anacutsval[3][ipt]=0.; | |
711 | anacutsval[4][ipt]=0.; | |
712 | anacutsval[5][ipt]=0.01; | |
713 | anacutsval[11][ipt]=10000000000.; | |
714 | anacutsval[12][ipt]=0.; | |
715 | anacutsval[13][ipt]=0.; | |
716 | } | |
717 | anacutsval[1][5]=0.9; | |
718 | ||
719 | anacutsval[6][0]=0.022100; | |
720 | anacutsval[6][1]=0.022100; | |
721 | anacutsval[6][2]=0.034; | |
722 | anacutsval[6][3]=0.020667; | |
723 | anacutsval[6][4]=0.020667; | |
724 | anacutsval[6][5]=0.023333; | |
725 | ||
726 | anacutsval[7][0]=0.08; | |
727 | anacutsval[7][1]=0.08; | |
728 | anacutsval[7][2]=0.17; | |
729 | anacutsval[7][3]=0.14; | |
730 | anacutsval[7][4]=0.14; | |
731 | anacutsval[7][5]=0.19; | |
732 | ||
733 | anacutsval[8][0]=0.8; | |
734 | anacutsval[8][1]=0.8; | |
735 | anacutsval[8][2]=1.1; | |
736 | anacutsval[8][3]=0.5; | |
737 | anacutsval[8][4]=0.5; | |
738 | anacutsval[8][5]=0.5; | |
739 | ||
740 | anacutsval[9][0]=0.995; | |
741 | anacutsval[9][1]=0.995; | |
742 | anacutsval[9][2]=0.997; | |
743 | anacutsval[9][3]=0.998; | |
744 | anacutsval[9][4]=0.998; | |
745 | anacutsval[9][5]=0.995; | |
746 | ||
747 | anacutsval[10][0]=0.0055; | |
748 | anacutsval[10][1]=0.0055; | |
749 | anacutsval[10][2]= 0.0028; | |
750 | anacutsval[10][3]=0.000883; | |
751 | anacutsval[10][4]=0.000883; | |
752 | anacutsval[10][5]=0.000883; | |
753 | ||
754 | anacutsval[12][5]=12.; | |
755 | anacutsval[13][5]=0.998571; | |
756 | anacutsval[12][6]=10.; | |
757 | anacutsval[13][6]=0.997143; | |
758 | ||
759 | for(Int_t ipt=6;ipt<nptbins;ipt++){ | |
760 | anacutsval[6][ipt]=0.02333; | |
761 | anacutsval[7][ipt]=0.19; | |
762 | anacutsval[8][ipt]=2.0; | |
763 | anacutsval[9][ipt]=0.997; | |
764 | anacutsval[10][ipt]=0.000883; | |
765 | } | |
766 | anacutsval[7][6]=0.14; | |
767 | anacutsval[9][6]=0.995; | |
768 | ||
769 | SetPtBins(nptbins+1,ptbins); | |
770 | SetCuts(nvars,nptbins,anacutsval); | |
771 | SetUsePID(kTRUE); | |
772 | SetMinCentrality(1E-10); | |
773 | SetMaxCentrality(20.); | |
774 | SetUseCentrality(AliRDHFCuts::kCentV0M); | |
775 | SetRemoveDaughtersFromPrim(kFALSE); | |
776 | ||
777 | PrintAll(); | |
778 | ||
779 | for(Int_t iic=0;iic<nvars;iic++){delete [] anacutsval[iic];} | |
780 | delete [] anacutsval; | |
781 | anacutsval=NULL; | |
782 | ||
783 | delete [] ptbins; | |
784 | ptbins=NULL; | |
785 | ||
786 | return; | |
787 | } | |
788 | ||
789 | ||
790 | void AliRDHFCutsDplustoKpipi::SetStandardCutsPbPb2011() { | |
791 | ||
792 | // Default 2010 PbPb cut object | |
793 | SetStandardCutsPbPb2010(); | |
794 | ||
795 | // Enable all 2011 PbPb run triggers | |
796 | // | |
797 | SetTriggerClass(""); | |
798 | ResetMaskAndEnableMBTrigger(); | |
799 | EnableCentralTrigger(); | |
800 | EnableSemiCentralTrigger(); | |
801 | ||
802 | } | |
803 | //-------------------------------------------------------------------------- | |
804 | ||
805 | UInt_t AliRDHFCutsDplustoKpipi::GetPIDTrackTPCTOFBitMap(AliAODTrack *track) const{ | |
806 | ||
807 | UInt_t bitmap=0; | |
808 | ||
809 | Double_t sigmaTPCPionHyp=-999.; | |
810 | Double_t sigmaTPCKaonHyp=-999.; | |
811 | Double_t sigmaTPCProtonHyp=-999.; | |
812 | Double_t sigmaTOFPionHyp=-999.; | |
813 | Double_t sigmaTOFKaonHyp=-999.; | |
814 | Double_t sigmaTOFProtonHyp=-999.; | |
815 | ||
816 | Int_t oksigmaTPCPionHyp=fPidHF->GetnSigmaTPC(track,2,sigmaTPCPionHyp); | |
817 | Int_t oksigmaTPCKaonHyp=fPidHF->GetnSigmaTPC(track,3,sigmaTPCKaonHyp); | |
818 | Int_t oksigmaTPCProtonHyp=fPidHF->GetnSigmaTPC(track,4,sigmaTPCProtonHyp); | |
819 | Int_t oksigmaTOFPionHyp=fPidHF->GetnSigmaTOF(track,2,sigmaTOFPionHyp); | |
820 | Int_t oksigmaTOFKaonHyp=fPidHF->GetnSigmaTOF(track,3,sigmaTOFKaonHyp); | |
821 | Int_t oksigmaTOFProtonHyp=fPidHF->GetnSigmaTOF(track,4,sigmaTOFProtonHyp); | |
822 | ||
823 | sigmaTPCPionHyp=TMath::Abs(sigmaTPCPionHyp); | |
824 | sigmaTPCKaonHyp=TMath::Abs(sigmaTPCKaonHyp); | |
825 | sigmaTPCProtonHyp=TMath::Abs(sigmaTPCProtonHyp); | |
826 | sigmaTOFPionHyp=TMath::Abs(sigmaTOFPionHyp); | |
827 | sigmaTOFKaonHyp=TMath::Abs(sigmaTOFKaonHyp); | |
828 | sigmaTOFProtonHyp=TMath::Abs(sigmaTOFProtonHyp); | |
829 | ||
830 | if (oksigmaTPCPionHyp && sigmaTPCPionHyp>0.){ | |
831 | if (sigmaTPCPionHyp<1.) bitmap+=1<<kTPCPionLess1; | |
832 | else{ | |
833 | if (sigmaTPCPionHyp<2.) bitmap+=1<<kTPCPionMore1Less2; | |
834 | else { | |
835 | if (sigmaTPCPionHyp<3.) bitmap+=1<<kTPCPionMore2Less3; | |
836 | else bitmap+=1<<kTPCPionMore3; | |
837 | } | |
838 | } | |
839 | } | |
840 | ||
841 | if (oksigmaTPCKaonHyp && sigmaTPCKaonHyp>0.){ | |
842 | if (sigmaTPCKaonHyp<1.) bitmap+=1<<kTPCKaonLess1; | |
843 | else{ | |
844 | if (sigmaTPCKaonHyp<2.) bitmap+=1<<kTPCKaonMore1Less2; | |
845 | else { | |
846 | if (sigmaTPCKaonHyp<3.) bitmap+=1<<kTPCKaonMore2Less3; | |
847 | else bitmap+=1<<kTPCKaonMore3; | |
848 | } | |
849 | } | |
850 | } | |
851 | ||
852 | if (oksigmaTPCProtonHyp && sigmaTPCProtonHyp>0.){ | |
853 | if (sigmaTPCProtonHyp<1.) bitmap+=1<<kTPCProtonLess1; | |
854 | else{ | |
855 | if (sigmaTPCProtonHyp<2.) bitmap+=1<<kTPCProtonMore1Less2; | |
856 | else { | |
857 | if (sigmaTPCProtonHyp<3.) bitmap+=1<<kTPCProtonMore2Less3; | |
858 | else bitmap+=1<<kTPCProtonMore3; | |
859 | } | |
860 | } | |
861 | } | |
862 | ||
863 | if (oksigmaTOFPionHyp && sigmaTOFPionHyp>0.){ | |
864 | if (sigmaTOFPionHyp<1.) bitmap+=1<<kTOFPionLess1; | |
865 | else{ | |
866 | if (sigmaTOFPionHyp<2.) bitmap+=1<<kTOFPionMore1Less2; | |
867 | else { | |
868 | if (sigmaTOFPionHyp<3.) bitmap+=1<<kTOFPionMore2Less3; | |
869 | else bitmap+=1<<kTOFPionMore3; | |
870 | } | |
871 | } | |
872 | } | |
873 | ||
874 | if (oksigmaTOFKaonHyp && sigmaTOFKaonHyp>0.){ | |
875 | if (sigmaTOFKaonHyp<1.) bitmap+=1<<kTOFKaonLess1; | |
876 | else{ | |
877 | if (sigmaTOFKaonHyp<2.) bitmap+=1<<kTOFKaonMore1Less2; | |
878 | else { | |
879 | if (sigmaTOFKaonHyp<3.) bitmap+=1<<kTOFKaonMore2Less3; | |
880 | else bitmap+=1<<kTOFKaonMore3; | |
881 | } | |
882 | } | |
883 | } | |
884 | ||
885 | if (oksigmaTOFProtonHyp && sigmaTOFProtonHyp>0.){ | |
886 | if (sigmaTOFProtonHyp<1.) bitmap+=1<<kTOFProtonLess1; | |
887 | else{ | |
888 | if (sigmaTOFProtonHyp<2.) bitmap+=1<<kTOFProtonMore1Less2; | |
889 | else { | |
890 | if (sigmaTOFProtonHyp<3.) bitmap+=1<<kTOFProtonMore2Less3; | |
891 | else bitmap+=1<<kTOFProtonMore3; | |
892 | } | |
893 | } | |
894 | } | |
895 | ||
896 | ||
897 | ||
898 | return bitmap; | |
899 | ||
900 | } |