]>
Commit | Line | Data |
---|---|---|
e3d40058 | 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 | ||
27de2dfb | 16 | /* $Id$ */ |
17 | ||
e3d40058 | 18 | ///////////////////////////////////////////////////////////// |
19 | // | |
20 | // Class for cuts on AOD reconstructed Lc->pKpi | |
21 | // | |
22 | // Author: A.Dainese, andrea.dainese@pd.infn.it | |
23 | ///////////////////////////////////////////////////////////// | |
24 | ||
25 | #include <TDatabasePDG.h> | |
26 | #include <Riostream.h> | |
27 | ||
28 | #include "AliRDHFCutsLctopKpi.h" | |
29 | #include "AliAODRecoDecayHF3Prong.h" | |
7ad4b782 | 30 | #include "AliRDHFCuts.h" |
e3d40058 | 31 | #include "AliAODTrack.h" |
32 | #include "AliESDtrack.h" | |
7ad4b782 | 33 | #include "AliKFParticle.h" |
34 | #include "AliESDVertex.h" | |
e3d40058 | 35 | |
c64cb1f6 | 36 | using std::cout; |
37 | using std::endl; | |
38 | ||
e3d40058 | 39 | ClassImp(AliRDHFCutsLctopKpi) |
40 | ||
41 | //-------------------------------------------------------------------------- | |
a9b75906 | 42 | AliRDHFCutsLctopKpi::AliRDHFCutsLctopKpi(const char* name) : |
7ad4b782 | 43 | AliRDHFCuts(name), |
44 | fPidObjprot(0), | |
45 | fPidObjpion(0), | |
c1234468 | 46 | fUseImpParProdCorrCut(kFALSE), |
47 | fPIDStrategy(kNSigma), | |
48 | fCutsStrategy(kStandard) | |
e3d40058 | 49 | { |
50 | // | |
51 | // Default Constructor | |
52 | // | |
a7b533b7 | 53 | Int_t nvars=13; |
e3d40058 | 54 | SetNVars(nvars); |
a7b533b7 | 55 | TString varNames[13]={"inv. mass [GeV]", |
a8b8e864 | 56 | "pTK [GeV/c]", |
a7b533b7 | 57 | "pTP [GeV/c]", |
a8b8e864 | 58 | "d0K [cm] lower limit!", |
e3d40058 | 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)", | |
a7b533b7 | 66 | "dca cut (cm)", |
67 | "cut on pTpion [GeV/c]"}; | |
68 | Bool_t isUpperCut[13]={kTRUE, | |
e3d40058 | 69 | kFALSE, |
70 | kFALSE, | |
71 | kFALSE, | |
72 | kFALSE, | |
73 | kFALSE, | |
74 | kTRUE, | |
75 | kFALSE, | |
76 | kFALSE, | |
77 | kFALSE, | |
78 | kFALSE, | |
a7b533b7 | 79 | kTRUE, |
80 | kFALSE | |
81 | }; | |
e3d40058 | 82 | SetVarNames(nvars,varNames,isUpperCut); |
a7b533b7 | 83 | Bool_t forOpt[13]={kFALSE, |
84 | kTRUE, | |
85 | kTRUE, | |
e3d40058 | 86 | kFALSE, |
87 | kFALSE, | |
88 | kFALSE, | |
89 | kFALSE, | |
90 | kTRUE, | |
a7b533b7 | 91 | kFALSE, |
92 | kFALSE, | |
93 | kFALSE, | |
94 | kFALSE, | |
95 | kTRUE}; | |
96 | SetVarsForOpt(4,forOpt); | |
e3d40058 | 97 | Float_t limits[2]={0,999999999.}; |
98 | SetPtBins(2,limits); | |
c1234468 | 99 | for (Int_t ispecies=0;ispecies<AliPID::kSPECIES;++ispecies) |
100 | fPIDThreshold[ispecies]=0.; | |
e3d40058 | 101 | } |
102 | //-------------------------------------------------------------------------- | |
103 | AliRDHFCutsLctopKpi::AliRDHFCutsLctopKpi(const AliRDHFCutsLctopKpi &source) : | |
7ad4b782 | 104 | AliRDHFCuts(source), |
6572e7ce | 105 | fPidObjprot(0x0), |
106 | fPidObjpion(0x0), | |
c1234468 | 107 | fUseImpParProdCorrCut(source.fUseImpParProdCorrCut), |
108 | fPIDStrategy(source.fPIDStrategy), | |
109 | fCutsStrategy(source.fCutsStrategy) | |
e3d40058 | 110 | { |
111 | // | |
112 | // Copy constructor | |
113 | // | |
6572e7ce | 114 | if (source.fPidObjprot) fPidObjprot = new AliAODPidHF(*(source.fPidObjprot)); |
115 | else fPidObjprot = new AliAODPidHF(); | |
116 | if (source.fPidObjpion) fPidObjpion = new AliAODPidHF(*(source.fPidObjpion)); | |
117 | else fPidObjpion = new AliAODPidHF(); | |
f5e92b8a | 118 | memcpy(fPIDThreshold,source.fPIDThreshold,AliPID::kSPECIES*sizeof(Double_t)); |
e3d40058 | 119 | } |
120 | //-------------------------------------------------------------------------- | |
121 | AliRDHFCutsLctopKpi &AliRDHFCutsLctopKpi::operator=(const AliRDHFCutsLctopKpi &source) | |
122 | { | |
123 | // | |
124 | // assignment operator | |
125 | // | |
f5e92b8a | 126 | if(this != &source) { |
127 | ||
128 | AliRDHFCuts::operator=(source); | |
129 | delete fPidObjprot; | |
130 | fPidObjprot = new AliAODPidHF(*(source.fPidObjprot)); | |
131 | delete fPidObjpion; | |
132 | fPidObjpion = new AliAODPidHF(*(source.fPidObjpion)); | |
133 | fPIDStrategy=source.fPIDStrategy; | |
134 | fCutsStrategy=source.fCutsStrategy; | |
135 | memcpy(fPIDThreshold,source.fPIDThreshold,AliPID::kSPECIES*sizeof(Double_t)); | |
136 | } | |
137 | ||
e3d40058 | 138 | return *this; |
139 | } | |
7ad4b782 | 140 | //--------------------------------------------------------------------------- |
141 | AliRDHFCutsLctopKpi::~AliRDHFCutsLctopKpi() { | |
142 | // | |
143 | // // Default Destructor | |
144 | // | |
145 | if(fPidObjpion){ | |
146 | delete fPidObjpion; | |
147 | fPidObjpion=0; | |
148 | } | |
149 | if(fPidObjprot){ | |
150 | delete fPidObjprot; | |
151 | fPidObjprot=0; | |
152 | } | |
e3d40058 | 153 | |
7ad4b782 | 154 | } |
e3d40058 | 155 | |
156 | //--------------------------------------------------------------------------- | |
e0fb900a | 157 | void AliRDHFCutsLctopKpi::GetCutVarsForOpt(AliAODRecoDecayHF *d,Float_t *vars,Int_t nvars,Int_t *pdgdaughters, AliAODEvent *aod) { |
e3d40058 | 158 | // |
159 | // Fills in vars the values of the variables | |
160 | // | |
161 | ||
162 | if(nvars!=fnVarsForOpt) { | |
163 | printf("AliRDHFCutsLctopKpi::GetCutsVarsForOpt: wrong number of variables\n"); | |
164 | return; | |
165 | } | |
166 | ||
167 | AliAODRecoDecayHF3Prong *dd = (AliAODRecoDecayHF3Prong*)d; | |
168 | ||
169 | Int_t iter=-1; | |
170 | if(fVarsForOpt[0]){ | |
171 | iter++; | |
172 | vars[iter]=dd->InvMassLcpKpi(); | |
173 | } | |
174 | if(fVarsForOpt[1]){ | |
175 | iter++; | |
176 | for(Int_t iprong=0;iprong<3;iprong++){ | |
a7b533b7 | 177 | if(TMath::Abs(pdgdaughters[iprong])==321) { |
e3d40058 | 178 | vars[iter]=dd->PtProng(iprong); |
179 | } | |
180 | } | |
181 | } | |
182 | if(fVarsForOpt[2]){ | |
183 | iter++; | |
184 | for(Int_t iprong=0;iprong<3;iprong++){ | |
a7b533b7 | 185 | if(TMath::Abs(pdgdaughters[iprong])==2212) { |
e3d40058 | 186 | vars[iter]=dd->PtProng(iprong); |
187 | } | |
188 | } | |
189 | } | |
190 | if(fVarsForOpt[3]){ | |
191 | iter++; | |
192 | for(Int_t iprong=0;iprong<3;iprong++){ | |
193 | if(TMath::Abs(pdgdaughters[iprong])==2212) { | |
194 | vars[iter]=dd->Getd0Prong(iprong); | |
195 | } | |
196 | } | |
197 | } | |
198 | if(fVarsForOpt[4]){ | |
199 | iter++; | |
200 | for(Int_t iprong=0;iprong<3;iprong++){ | |
201 | if(TMath::Abs(pdgdaughters[iprong])==211) { | |
202 | vars[iter]=dd->Getd0Prong(iprong); | |
203 | } | |
204 | } | |
205 | } | |
206 | if(fVarsForOpt[5]){ | |
207 | iter++; | |
208 | vars[iter]=dd->GetDist12toPrim(); | |
209 | } | |
210 | if(fVarsForOpt[6]){ | |
211 | iter++; | |
e0fb900a | 212 | vars[iter]=dd->GetSigmaVert(aod); |
e3d40058 | 213 | } |
214 | if(fVarsForOpt[7]){ | |
215 | iter++; | |
216 | vars[iter] = dd->DecayLength(); | |
217 | } | |
218 | if(fVarsForOpt[8]){ | |
219 | iter++; | |
220 | Float_t ptmax=0; | |
221 | for(Int_t i=0;i<3;i++){ | |
222 | if(dd->PtProng(i)>ptmax)ptmax=dd->PtProng(i); | |
223 | } | |
224 | vars[iter]=ptmax; | |
225 | } | |
226 | if(fVarsForOpt[9]){ | |
227 | iter++; | |
228 | vars[iter]=dd->CosPointingAngle(); | |
229 | } | |
230 | if(fVarsForOpt[10]){ | |
231 | iter++; | |
232 | vars[iter]=dd->Getd0Prong(0)*dd->Getd0Prong(0)+dd->Getd0Prong(1)*dd->Getd0Prong(1)+dd->Getd0Prong(2)*dd->Getd0Prong(2); | |
233 | } | |
234 | if(fVarsForOpt[11]){ | |
235 | iter++; | |
236 | vars[iter]=dd->GetDCA(); | |
237 | } | |
a7b533b7 | 238 | if(fVarsForOpt[12]){ |
239 | iter++; | |
240 | for(Int_t iprong=0;iprong<3;iprong++){ | |
241 | if(TMath::Abs(pdgdaughters[iprong])==211) { | |
242 | vars[iter]=dd->PtProng(iprong); | |
243 | } | |
244 | } | |
245 | } | |
e3d40058 | 246 | |
247 | return; | |
248 | } | |
249 | //--------------------------------------------------------------------------- | |
7ad4b782 | 250 | Int_t AliRDHFCutsLctopKpi::IsSelected(TObject* obj,Int_t selectionLevel,AliAODEvent *aod) { |
e3d40058 | 251 | // |
252 | // Apply selection | |
253 | // | |
254 | ||
255 | if(!fCutsRD){ | |
256 | cout<<"Cut matrice not inizialized. Exit..."<<endl; | |
257 | return 0; | |
258 | } | |
259 | //PrintAll(); | |
260 | AliAODRecoDecayHF3Prong* d=(AliAODRecoDecayHF3Prong*)obj; | |
261 | ||
262 | if(!d){ | |
263 | cout<<"AliAODRecoDecayHF3Prong null"<<endl; | |
264 | return 0; | |
265 | } | |
266 | ||
267 | ||
5e938293 | 268 | if(fKeepSignalMC) if(IsSignalMC(d,aod,4122)) return 3; |
e3d40058 | 269 | |
228974b3 | 270 | Int_t returnvalue=3; |
7ad4b782 | 271 | Int_t returnvaluePID=3; |
272 | ||
47aa3d55 | 273 | if(d->Pt()<fMinPtCand) return 0; |
274 | if(d->Pt()>fMaxPtCand) return 0; | |
e3d40058 | 275 | |
3e075b37 | 276 | if(fUseTrackSelectionWithFilterBits && d->HasBadDaughters()) return 0; |
ba27eecd | 277 | |
c1234468 | 278 | if(selectionLevel==AliRDHFCuts::kAll || |
279 | selectionLevel==AliRDHFCuts::kCandidate|| | |
280 | selectionLevel==AliRDHFCuts::kPID) { | |
281 | switch (fPIDStrategy) { | |
282 | case kNSigma: | |
283 | returnvaluePID = IsSelectedPID(d); | |
284 | ||
285 | break; | |
286 | case kCombined: | |
287 | returnvaluePID = IsSelectedCombinedPID(d); | |
288 | break; | |
289 | } | |
290 | fIsSelectedPID=returnvaluePID; | |
291 | } | |
292 | // if(fUsePID || selectionLevel==AliRDHFCuts::kPID) returnvaluePID = IsSelectedCombinedPID(d); // to test!! | |
293 | if(returnvaluePID==0) return 0; | |
ba27eecd | 294 | |
e3d40058 | 295 | // selection on candidate |
296 | if(selectionLevel==AliRDHFCuts::kAll || | |
297 | selectionLevel==AliRDHFCuts::kCandidate) { | |
298 | ||
299 | Double_t pt=d->Pt(); | |
300 | ||
301 | Int_t ptbin=PtBin(pt); | |
302 | ||
303 | Double_t mLcpKpi,mLcpiKp; | |
304 | Int_t okLcpKpi=1,okLcpiKp=1; | |
305 | ||
306 | Double_t mLcPDG = TDatabasePDG::Instance()->GetParticle(4122)->Mass(); | |
307 | ||
308 | mLcpKpi=d->InvMassLcpKpi(); | |
309 | mLcpiKp=d->InvMassLcpiKp(); | |
310 | ||
311 | if(TMath::Abs(mLcpKpi-mLcPDG)>fCutsRD[GetGlobalIndex(0,ptbin)]) okLcpKpi = 0; | |
312 | if(TMath::Abs(mLcpiKp-mLcPDG)>fCutsRD[GetGlobalIndex(0,ptbin)]) okLcpiKp = 0; | |
313 | if(!okLcpKpi && !okLcpiKp) return 0; | |
314 | ||
c1234468 | 315 | switch (fCutsStrategy) { |
316 | ||
317 | case kStandard: | |
e3d40058 | 318 | if(TMath::Abs(d->PtProng(1)) < fCutsRD[GetGlobalIndex(1,ptbin)] || TMath::Abs(d->Getd0Prong(1))<fCutsRD[GetGlobalIndex(3,ptbin)]) return 0;//Kaon |
3875c875 | 319 | if(d->Pt()>=3. && d->PProng(1)<0.55) return 0; |
a7b533b7 | 320 | if((TMath::Abs(d->PtProng(0)) < fCutsRD[GetGlobalIndex(2,ptbin)]) || (TMath::Abs(d->PtProng(2)) < fCutsRD[GetGlobalIndex(12,ptbin)])) okLcpKpi=0; |
321 | if((TMath::Abs(d->PtProng(2)) < fCutsRD[GetGlobalIndex(2,ptbin)]) || (TMath::Abs(d->PtProng(0)) < fCutsRD[GetGlobalIndex(12,ptbin)]))okLcpiKp=0; | |
7ad4b782 | 322 | if(!okLcpKpi && !okLcpiKp) return 0; |
e3d40058 | 323 | //2track cuts |
324 | if(d->GetDist12toPrim()<fCutsRD[GetGlobalIndex(5,ptbin)]|| d->GetDist23toPrim()<fCutsRD[GetGlobalIndex(5,ptbin)]) return 0; | |
3875c875 | 325 | if(d->GetDist12toPrim()>0.5) return 0; |
326 | if(d->GetDist23toPrim()>0.5) return 0; | |
43d2fecc | 327 | if(fUseImpParProdCorrCut){ |
328 | if(d->Getd0Prong(0)*d->Getd0Prong(1)<0. && d->Getd0Prong(2)*d->Getd0Prong(1)<0.) return 0; | |
329 | } | |
e0fb900a | 330 | //sec vert |
e3d40058 | 331 | if(d->DecayLength()<fCutsRD[GetGlobalIndex(7,ptbin)]) return 0; |
228974b3 | 332 | if(d->DecayLength()>0.5) return 0; |
c1234468 | 333 | |
334 | // Double_t sumd0s=d->Getd0Prong(0)*d->Getd0Prong(0)+d->Getd0Prong(1)*d->Getd0Prong(1)+d->Getd0Prong(2)*d->Getd0Prong(2); | |
335 | // if(sumd0s<fCutsRD[GetGlobalIndex(10,ptbin)]) return 0; | |
336 | if((d->Getd0Prong(0)*d->Getd0Prong(0)+d->Getd0Prong(1)*d->Getd0Prong(1)+d->Getd0Prong(2)*d->Getd0Prong(2))<fCutsRD[GetGlobalIndex(10,ptbin)]) return 0; | |
e3d40058 | 337 | |
338 | if(TMath::Abs(d->PtProng(0))<fCutsRD[GetGlobalIndex(8,ptbin)] && TMath::Abs(d->PtProng(1))<fCutsRD[GetGlobalIndex(8,ptbin)] && TMath::Abs(d->PtProng(2))<fCutsRD[GetGlobalIndex(8,ptbin)]) return 0; | |
339 | if(d->CosPointingAngle()< fCutsRD[GetGlobalIndex(9,ptbin)]) return 0; | |
e0fb900a | 340 | if(d->GetSigmaVert(aod)>fCutsRD[GetGlobalIndex(6,ptbin)]) return 0; |
e3d40058 | 341 | |
342 | //DCA | |
343 | for(Int_t i=0;i<3;i++) if(d->GetDCA(i)>fCutsRD[GetGlobalIndex(11,ptbin)]) return 0; | |
344 | ||
c1234468 | 345 | break; |
346 | ||
347 | case kKF: | |
348 | Int_t pdgs[3]={0,321,0}; | |
349 | Bool_t constraint=kFALSE; | |
350 | if(fCutsRD[GetGlobalIndex(1,ptbin)]>0.) constraint=kTRUE; | |
351 | Double_t field=aod->GetMagneticField(); | |
352 | if (returnvaluePID==1 || returnvaluePID==3){ | |
353 | ||
82ccd919 | 354 | pdgs[0]=2122;pdgs[2]=211; |
355 | AliKFParticle *lc1=ReconstructKF(d,pdgs,field,constraint); | |
356 | if(!lc1){ | |
357 | okLcpKpi=0; | |
358 | }else{ | |
359 | if(lc1->GetChi2()/lc1->GetNDF()>fCutsRD[GetGlobalIndex(2,ptbin)]) okLcpKpi=0; | |
360 | } | |
c1234468 | 361 | } else if(returnvaluePID>=2){ |
362 | ||
82ccd919 | 363 | pdgs[0]=211;pdgs[2]=2212; |
364 | AliKFParticle *lc2=ReconstructKF(d,pdgs,field,constraint); | |
365 | if(!lc2){ | |
366 | okLcpiKp=0; | |
367 | }else{ | |
368 | if(lc2->GetChi2()/lc2->GetNDF()>fCutsRD[GetGlobalIndex(2,ptbin)])okLcpiKp=0; | |
369 | } | |
c1234468 | 370 | } |
371 | break; | |
372 | ||
373 | } | |
e3d40058 | 374 | |
375 | if(okLcpKpi) returnvalue=1; //cuts passed as Lc->pKpi | |
376 | if(okLcpiKp) returnvalue=2; //cuts passed as Lc->piKp | |
377 | if(okLcpKpi && okLcpiKp) returnvalue=3; //cuts passed as both pKpi and piKp | |
dcc2ade0 | 378 | |
dcc2ade0 | 379 | } |
380 | ||
dcc2ade0 | 381 | // selection on daughter tracks |
382 | if(selectionLevel==AliRDHFCuts::kAll || | |
383 | selectionLevel==AliRDHFCuts::kTracks) { | |
384 | if(!AreDaughtersSelected(d)) return 0; | |
e3d40058 | 385 | } |
dcc2ade0 | 386 | |
387 | ||
7ad4b782 | 388 | Int_t returnvalueTot=CombinePIDCuts(returnvalue,returnvaluePID); |
389 | return returnvalueTot; | |
e3d40058 | 390 | } |
391 | //--------------------------------------------------------------------------- | |
7ad4b782 | 392 | Int_t AliRDHFCutsLctopKpi::IsSelectedPID(AliAODRecoDecayHF* obj) { |
393 | ||
394 | ||
1a141544 | 395 | if(!fUsePID || !obj) return 3; |
7ad4b782 | 396 | Int_t okLcpKpi=0,okLcpiKp=0; |
397 | Int_t returnvalue=0; | |
398 | Bool_t isPeriodd=fPidHF->GetOnePad(); | |
a7b533b7 | 399 | Bool_t isMC=fPidHF->GetMC(); |
7ad4b782 | 400 | Bool_t ispion0=kTRUE,ispion2=kTRUE; |
401 | Bool_t isproton0=kFALSE,isproton2=kFALSE; | |
402 | Bool_t iskaon1=kFALSE; | |
a7b533b7 | 403 | if(isPeriodd) { |
404 | fPidObjprot->SetOnePad(kTRUE); | |
405 | fPidObjpion->SetOnePad(kTRUE); | |
406 | } | |
407 | if(isMC) { | |
408 | fPidObjprot->SetMC(kTRUE); | |
409 | fPidObjpion->SetMC(kTRUE); | |
410 | } | |
7ad4b782 | 411 | |
412 | for(Int_t i=0;i<3;i++){ | |
413 | AliAODTrack *track=(AliAODTrack*)obj->GetDaughter(i); | |
414 | if(!track) return 0; | |
415 | // identify kaon | |
3875c875 | 416 | if(track->P()<0.55){ |
417 | fPidHF->SetTOF(kFALSE); | |
418 | fPidHF->SetTOFdecide(kFALSE); | |
419 | } | |
7ad4b782 | 420 | if(i==1) { |
421 | Int_t isKaon=fPidHF->MakeRawPid(track,3); | |
422 | if(isKaon>=1) { | |
423 | iskaon1=kTRUE; | |
424 | if(fPidHF->MakeRawPid(track,2)>=1) iskaon1=kFALSE; | |
425 | } | |
47aa3d55 | 426 | if(!iskaon1) return 0; |
7ad4b782 | 427 | |
428 | }else{ | |
429 | //pion or proton | |
3875c875 | 430 | if(track->P()<1.){ |
431 | fPidObjprot->SetTOF(kFALSE); | |
432 | fPidObjprot->SetTOFdecide(kFALSE); | |
433 | } | |
7ad4b782 | 434 | |
435 | Int_t isProton=fPidObjprot->MakeRawPid(track,4); | |
436 | if(isProton>=1){ | |
437 | if(fPidHF->MakeRawPid(track,2)>=1) isProton=-1; | |
438 | if(fPidHF->MakeRawPid(track,3)>=1) isProton=-1; | |
439 | } | |
440 | ||
441 | Int_t isPion=fPidObjpion->MakeRawPid(track,2); | |
442 | if(fPidHF->MakeRawPid(track,3)>=1) isPion=-1; | |
443 | if(fPidObjprot->MakeRawPid(track,4)>=1) isPion=-1; | |
3875c875 | 444 | if(track->P()<1.){ |
445 | fPidObjprot->SetTOF(kTRUE); | |
446 | fPidObjprot->SetTOFdecide(kTRUE); | |
447 | } | |
448 | if(track->P()<0.55){ | |
449 | fPidHF->SetTOF(kTRUE); | |
450 | fPidHF->SetTOFdecide(kTRUE); | |
451 | } | |
7ad4b782 | 452 | |
453 | if(i==0) { | |
454 | if(isPion<0) ispion0=kFALSE; | |
455 | if(isProton>=1) isproton0=kTRUE; | |
456 | ||
457 | } | |
47aa3d55 | 458 | if(!ispion0 && !isproton0) return 0; |
7ad4b782 | 459 | if(i==2) { |
460 | if(isPion<0) ispion2=kFALSE; | |
461 | if(isProton>=1) isproton2=kTRUE; | |
462 | } | |
463 | ||
464 | } | |
465 | } | |
466 | ||
467 | if(ispion2 && isproton0 && iskaon1) okLcpKpi=1; | |
468 | if(ispion0 && isproton2 && iskaon1) okLcpiKp=1; | |
469 | if(okLcpKpi) returnvalue=1; //cuts passed as Lc->pKpi | |
470 | if(okLcpiKp) returnvalue=2; //cuts passed as Lc->piKp | |
471 | if(okLcpKpi && okLcpiKp) returnvalue=3; //cuts passed as both pKpi and piKp | |
472 | ||
473 | return returnvalue; | |
474 | } | |
11690a06 | 475 | //--------------------------------------------------------------------------- |
476 | Int_t AliRDHFCutsLctopKpi::IsSelectedCombinedPID(AliAODRecoDecayHF* obj) { | |
477 | ||
478 | // Printf(" -------- IsSelectedCombinedPID --------------"); | |
479 | ||
c1234468 | 480 | |
481 | if(!fUsePID || !obj) {return 3;} | |
11690a06 | 482 | Int_t okLcpKpi=0,okLcpiKp=0; |
483 | Int_t returnvalue=0; | |
484 | Bool_t isPeriodd=fPidHF->GetOnePad(); | |
485 | Bool_t isMC=fPidHF->GetMC(); | |
11690a06 | 486 | |
487 | if(isPeriodd) { | |
488 | fPidObjprot->SetOnePad(kTRUE); | |
489 | fPidObjpion->SetOnePad(kTRUE); | |
490 | } | |
491 | if(isMC) { | |
492 | fPidObjprot->SetMC(kTRUE); | |
493 | fPidObjpion->SetMC(kTRUE); | |
494 | } | |
495 | ||
c1234468 | 496 | AliVTrack *track0=dynamic_cast<AliVTrack*>(obj->GetDaughter(0)); |
497 | AliVTrack *track1=dynamic_cast<AliVTrack*>(obj->GetDaughter(1)); | |
498 | AliVTrack *track2=dynamic_cast<AliVTrack*>(obj->GetDaughter(2)); | |
499 | if (!track0 || !track1 || !track2) return 0; | |
500 | Double_t prob0[AliPID::kSPECIES]; | |
501 | Double_t prob1[AliPID::kSPECIES]; | |
502 | Double_t prob2[AliPID::kSPECIES]; | |
3875c875 | 503 | if(obj->Pt()<3. && track0->P()<1.) fPidHF->GetPidCombined()->SetDetectorMask(AliPIDResponse::kDetTPC); |
c1234468 | 504 | fPidHF->GetPidCombined()->ComputeProbabilities(track0,fPidHF->GetPidResponse(),prob0); |
3875c875 | 505 | if(obj->Pt()<3. && track0->P()<1.) fPidHF->GetPidCombined()->SetDetectorMask(AliPIDResponse::kDetTPC|AliPIDResponse::kDetTOF); |
506 | ||
507 | if(obj->Pt()<3. && track1->P()<0.55) fPidHF->GetPidCombined()->SetDetectorMask(AliPIDResponse::kDetTPC); | |
c1234468 | 508 | fPidHF->GetPidCombined()->ComputeProbabilities(track1,fPidHF->GetPidResponse(),prob1); |
3875c875 | 509 | if(obj->Pt()<3. && track1->P()<0.55) fPidHF->GetPidCombined()->SetDetectorMask(AliPIDResponse::kDetTPC|AliPIDResponse::kDetTOF); |
510 | ||
511 | if(obj->Pt()<3. && track2->P()<1.) fPidHF->GetPidCombined()->SetDetectorMask(AliPIDResponse::kDetTPC); | |
c1234468 | 512 | fPidHF->GetPidCombined()->ComputeProbabilities(track2,fPidHF->GetPidResponse(),prob2); |
3875c875 | 513 | if(obj->Pt()<3. && track2->P()<1.) fPidHF->GetPidCombined()->SetDetectorMask(AliPIDResponse::kDetTPC|AliPIDResponse::kDetTOF); |
514 | ||
c1234468 | 515 | if(fPIDThreshold[AliPID::kPion]>0. && fPIDThreshold[AliPID::kKaon]>0. && fPIDThreshold[AliPID::kProton]>0.){ |
516 | okLcpiKp= (prob0[AliPID::kPion ]>fPIDThreshold[AliPID::kPion ]) | |
517 | &&(prob1[AliPID::kKaon ]>fPIDThreshold[AliPID::kKaon ]) | |
518 | &&(prob2[AliPID::kProton]>fPIDThreshold[AliPID::kProton]); | |
519 | okLcpKpi= (prob0[AliPID::kProton]>fPIDThreshold[AliPID::kProton]) | |
520 | &&(prob1[AliPID::kKaon ]>fPIDThreshold[AliPID::kKaon ]) | |
521 | &&(prob2[AliPID::kPion ]>fPIDThreshold[AliPID::kPion ]); | |
522 | }else{ | |
11690a06 | 523 | //pion or proton |
524 | ||
11690a06 | 525 | |
c1234468 | 526 | if(TMath::MaxElement(AliPID::kSPECIES,prob1) == prob1[AliPID::kKaon]){ |
527 | if(TMath::MaxElement(AliPID::kSPECIES,prob0) == prob0[AliPID::kProton] && TMath::MaxElement(AliPID::kSPECIES,prob2) == prob2[AliPID::kPion]) okLcpKpi = 1; | |
528 | if(TMath::MaxElement(AliPID::kSPECIES,prob2) == prob2[AliPID::kProton] && TMath::MaxElement(AliPID::kSPECIES,prob0) == prob0[AliPID::kPion]) okLcpiKp = 1; | |
11690a06 | 529 | } |
c1234468 | 530 | } |
11690a06 | 531 | |
532 | if(okLcpKpi) returnvalue=1; //cuts passed as Lc->pKpi | |
533 | if(okLcpiKp) returnvalue=2; //cuts passed as Lc->piKp | |
534 | if(okLcpKpi && okLcpiKp) returnvalue=3; //cuts passed as both pKpi and piKp | |
535 | ||
536 | return returnvalue; | |
537 | } | |
7ad4b782 | 538 | //----------------------- |
539 | Int_t AliRDHFCutsLctopKpi::CombinePIDCuts(Int_t returnvalue, Int_t returnvaluePID) const { | |
540 | ||
541 | Int_t returnvalueTot=0; | |
542 | Int_t okLcpKpi=0,okLcpiKp=0; | |
543 | if(returnvaluePID==1){ | |
544 | if(returnvalue==1 || returnvalue==3) okLcpKpi=1; | |
545 | } | |
546 | if(returnvaluePID==2){ | |
547 | if(returnvalue>=2) okLcpiKp=1; | |
548 | } | |
549 | if(returnvaluePID==3 && returnvalue>0){ | |
550 | if(returnvalue==1 || returnvalue==3) okLcpKpi=1; | |
551 | if(returnvalue>=2) okLcpiKp=1; | |
552 | } | |
553 | ||
554 | if(okLcpKpi) returnvalueTot=1; //cuts passed as Lc->pKpi | |
555 | if(okLcpiKp) returnvalueTot=2; //cuts passed as Lc->piKp | |
556 | if(okLcpKpi && okLcpiKp) returnvalueTot=3; //cuts passed as both pKpi and piKp | |
557 | return returnvalueTot; | |
558 | } | |
559 | //---------------------------------- | |
560 | void AliRDHFCutsLctopKpi::SetStandardCutsPP2010() { | |
561 | ||
562 | SetName("LctopKpiProdCuts"); | |
563 | SetTitle("Production cuts for Lc analysis"); | |
564 | ||
565 | AliESDtrackCuts *esdTrackCuts = new AliESDtrackCuts("AliESDtrackCuts","default"); | |
566 | esdTrackCuts->SetRequireSigmaToVertex(kFALSE); | |
567 | esdTrackCuts->SetRequireTPCRefit(kTRUE); | |
568 | esdTrackCuts->SetMinNClustersTPC(70); | |
569 | esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, | |
570 | AliESDtrackCuts::kAny); | |
571 | esdTrackCuts->SetRequireITSRefit(kTRUE); | |
572 | esdTrackCuts->SetMinNClustersITS(4); | |
573 | esdTrackCuts->SetMinDCAToVertexXY(0.); | |
574 | esdTrackCuts->SetEtaRange(-0.8,0.8); | |
575 | esdTrackCuts->SetPtRange(0.3,1.e10); | |
576 | AddTrackCuts(esdTrackCuts); | |
577 | ||
578 | const Int_t nptbins=4; | |
a7b533b7 | 579 | const Int_t nvars=13; |
7ad4b782 | 580 | Float_t* ptbins; |
581 | ptbins=new Float_t[nptbins+1]; | |
582 | ||
583 | ptbins[0]=0.; | |
584 | ptbins[1]=2.; | |
585 | ptbins[2]=3.; | |
586 | ptbins[3]=4.; | |
587 | ptbins[4]=9999.; | |
588 | ||
589 | SetGlobalIndex(nvars,nptbins); | |
590 | SetPtBins(nptbins+1,ptbins); | |
591 | ||
592 | Float_t** prodcutsval; | |
593 | prodcutsval=new Float_t*[nvars]; | |
594 | for(Int_t iv=0;iv<nvars;iv++){ | |
595 | prodcutsval[iv]=new Float_t[nptbins]; | |
596 | } | |
e11ae259 | 597 | |
7ad4b782 | 598 | for(Int_t ipt=0;ipt<nptbins;ipt++){ |
599 | prodcutsval[0][ipt]=0.18; | |
600 | prodcutsval[1][ipt]=0.4; | |
601 | prodcutsval[2][ipt]=0.5; | |
602 | prodcutsval[3][ipt]=0.; | |
603 | prodcutsval[4][ipt]=0.; | |
604 | prodcutsval[5][ipt]=0.01; | |
605 | prodcutsval[6][ipt]=0.06; | |
606 | prodcutsval[7][ipt]=0.005; | |
607 | prodcutsval[8][ipt]=0.; | |
608 | prodcutsval[9][ipt]=0.; | |
609 | prodcutsval[10][ipt]=0.; | |
610 | prodcutsval[11][ipt]=0.05; | |
a7b533b7 | 611 | prodcutsval[12][ipt]=0.4; |
7ad4b782 | 612 | } |
613 | SetCuts(nvars,nptbins,prodcutsval); | |
614 | ||
615 | AliAODPidHF* pidObjK=new AliAODPidHF(); | |
616 | Double_t sigmasK[5]={3.,1.,1.,3.,2.}; | |
617 | pidObjK->SetSigma(sigmasK); | |
618 | pidObjK->SetAsym(kTRUE); | |
619 | pidObjK->SetMatch(1); | |
620 | pidObjK->SetTPC(kTRUE); | |
621 | pidObjK->SetTOF(kTRUE); | |
622 | pidObjK->SetITS(kTRUE); | |
623 | Double_t plimK[2]={0.5,0.8}; | |
624 | pidObjK->SetPLimit(plimK,2); | |
a7b533b7 | 625 | pidObjK->SetTOFdecide(kTRUE); |
7ad4b782 | 626 | |
627 | SetPidHF(pidObjK); | |
628 | ||
629 | AliAODPidHF* pidObjpi=new AliAODPidHF(); | |
630 | pidObjpi->SetTPC(kTRUE); | |
631 | Double_t sigmaspi[5]={3.,0.,0.,0.,0.}; | |
632 | pidObjpi->SetSigma(sigmaspi); | |
a7b533b7 | 633 | pidObjpi->SetTOFdecide(kTRUE); |
7ad4b782 | 634 | SetPidpion(pidObjpi); |
635 | ||
636 | AliAODPidHF* pidObjp=new AliAODPidHF(); | |
637 | Double_t sigmasp[5]={3.,1.,1.,3.,2.}; | |
638 | pidObjp->SetSigma(sigmasp); | |
639 | pidObjp->SetAsym(kTRUE); | |
640 | pidObjp->SetMatch(1); | |
641 | pidObjp->SetTPC(kTRUE); | |
642 | pidObjp->SetTOF(kTRUE); | |
643 | pidObjp->SetITS(kTRUE); | |
644 | Double_t plimp[2]={1.,2.}; | |
645 | pidObjp->SetPLimit(plimp,2); | |
a7b533b7 | 646 | pidObjp->SetTOFdecide(kTRUE); |
7ad4b782 | 647 | |
648 | SetPidprot(pidObjp); | |
649 | ||
650 | SetUsePID(kTRUE); | |
651 | ||
652 | PrintAll(); | |
653 | ||
e11ae259 | 654 | for(Int_t iiv=0;iiv<nvars;iiv++){ |
655 | delete [] prodcutsval[iiv]; | |
656 | } | |
657 | delete [] prodcutsval; | |
658 | prodcutsval=NULL; | |
659 | delete [] ptbins; | |
660 | ptbins=NULL; | |
661 | ||
662 | delete pidObjp; | |
663 | pidObjp=NULL; | |
664 | ||
7ad4b782 | 665 | return; |
666 | } | |
a8b8e864 | 667 | //------------------ |
668 | void AliRDHFCutsLctopKpi::SetStandardCutsPbPb2010() { | |
669 | ||
670 | SetName("LctopKpiProdCuts"); | |
671 | SetTitle("Production cuts for Lc analysis"); | |
672 | ||
673 | AliESDtrackCuts *esdTrackCuts = new AliESDtrackCuts("AliESDtrackCuts","default"); | |
674 | ||
675 | esdTrackCuts->SetRequireTPCRefit(kTRUE); | |
676 | esdTrackCuts->SetMinNClustersTPC(70); | |
677 | esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, | |
678 | AliESDtrackCuts::kAny); | |
679 | esdTrackCuts->SetRequireITSRefit(kTRUE); | |
680 | esdTrackCuts->SetMinNClustersITS(4); | |
681 | esdTrackCuts->SetMinDCAToVertexXYPtDep("0.0100*TMath::Max(0.,(1-TMath::Floor(TMath::Abs(pt)/2.)))"); | |
682 | esdTrackCuts->SetEtaRange(-0.8,0.8); | |
683 | esdTrackCuts->SetMaxDCAToVertexXY(1.); | |
684 | esdTrackCuts->SetMaxDCAToVertexZ(1.); | |
685 | esdTrackCuts->SetPtRange(0.8,1.e10); | |
686 | AddTrackCuts(esdTrackCuts); | |
687 | ||
688 | const Int_t nptbins=4; | |
a7b533b7 | 689 | const Int_t nvars=13; |
a8b8e864 | 690 | Float_t* ptbins; |
691 | ptbins=new Float_t[nptbins+1]; | |
692 | ||
693 | ptbins[0]=0.; | |
694 | ptbins[1]=2.; | |
695 | ptbins[2]=3.; | |
696 | ptbins[3]=4.; | |
697 | ptbins[4]=9999.; | |
698 | ||
699 | SetGlobalIndex(nvars,nptbins); | |
700 | SetPtBins(nptbins+1,ptbins); | |
701 | ||
702 | Float_t** prodcutsval; | |
703 | prodcutsval=new Float_t*[nvars]; | |
704 | for(Int_t iv=0;iv<nvars;iv++){ | |
705 | prodcutsval[iv]=new Float_t[nptbins]; | |
706 | } | |
707 | ||
708 | for(Int_t ipt=0;ipt<nptbins;ipt++){ | |
709 | prodcutsval[0][ipt]=0.13; | |
710 | prodcutsval[1][ipt]=0.5; | |
711 | prodcutsval[2][ipt]=0.6; | |
712 | prodcutsval[3][ipt]=0.; | |
713 | prodcutsval[4][ipt]=0.; | |
714 | prodcutsval[5][ipt]=0.01; | |
715 | prodcutsval[6][ipt]=0.04; | |
716 | prodcutsval[7][ipt]=0.006; | |
717 | prodcutsval[8][ipt]=0.8; | |
718 | prodcutsval[9][ipt]=0.3; | |
719 | prodcutsval[10][ipt]=0.; | |
720 | prodcutsval[11][ipt]=0.05; | |
a7b533b7 | 721 | prodcutsval[12][ipt]=0.4; |
a8b8e864 | 722 | } |
723 | SetCuts(nvars,nptbins,prodcutsval); | |
724 | ||
725 | AliAODPidHF* pidObjK=new AliAODPidHF(); | |
726 | Double_t sigmasK[5]={3.,1.,1.,3.,2.}; | |
727 | pidObjK->SetSigma(sigmasK); | |
728 | pidObjK->SetAsym(kTRUE); | |
729 | pidObjK->SetMatch(1); | |
730 | pidObjK->SetTPC(kTRUE); | |
731 | pidObjK->SetTOF(kTRUE); | |
732 | pidObjK->SetITS(kTRUE); | |
733 | Double_t plimK[2]={0.5,0.8}; | |
734 | pidObjK->SetPLimit(plimK,2); | |
735 | ||
736 | SetPidHF(pidObjK); | |
737 | ||
738 | AliAODPidHF* pidObjpi=new AliAODPidHF(); | |
739 | pidObjpi->SetTPC(kTRUE); | |
740 | Double_t sigmaspi[5]={3.,0.,0.,0.,0.}; | |
741 | pidObjpi->SetSigma(sigmaspi); | |
742 | SetPidpion(pidObjpi); | |
7ad4b782 | 743 | |
a8b8e864 | 744 | AliAODPidHF* pidObjp=new AliAODPidHF(); |
745 | Double_t sigmasp[5]={3.,1.,1.,3.,2.}; | |
746 | pidObjp->SetSigma(sigmasp); | |
747 | pidObjp->SetAsym(kTRUE); | |
748 | pidObjp->SetMatch(1); | |
749 | pidObjp->SetTPC(kTRUE); | |
750 | pidObjp->SetTOF(kTRUE); | |
751 | pidObjp->SetITS(kTRUE); | |
752 | Double_t plimp[2]={1.,2.}; | |
753 | pidObjp->SetPLimit(plimp,2); | |
754 | ||
755 | SetPidprot(pidObjp); | |
756 | ||
757 | SetUsePID(kTRUE); | |
758 | ||
759 | PrintAll(); | |
760 | ||
761 | for(Int_t iiv=0;iiv<nvars;iiv++){ | |
762 | delete [] prodcutsval[iiv]; | |
763 | } | |
764 | delete [] prodcutsval; | |
765 | prodcutsval=NULL; | |
766 | delete [] ptbins; | |
767 | ptbins=NULL; | |
768 | ||
769 | delete pidObjp; | |
770 | pidObjp=NULL; | |
771 | ||
772 | return; | |
773 | } | |
7ad4b782 | 774 | //------------------ |
c1234468 | 775 | AliKFParticle* AliRDHFCutsLctopKpi::ReconstructKF(AliAODRecoDecayHF3Prong *d,Int_t *pdgs,Double_t field,Bool_t constraint) const{ |
cc4bd7b4 | 776 | // Method to construct the KF particle from the candidate |
16d0e822 | 777 | |
c1234468 | 778 | const Int_t nprongs=d->GetNProngs(); |
5da7eaa9 | 779 | if(nprongs<=0) return 0x0; |
82ccd919 | 780 | |
7ad4b782 | 781 | Int_t iprongs[nprongs]; |
782 | for(Int_t i=0;i<nprongs;i++) iprongs[i]=i; | |
783 | ||
784 | Double_t mass[2]={0.,0.}; | |
785 | ||
c1234468 | 786 | AliKFParticle *decay=d->ApplyVertexingKF(iprongs,nprongs,pdgs,constraint,field,mass); |
787 | if(!decay) return 0x0; | |
7ad4b782 | 788 | AliESDVertex *vertexESD = new AliESDVertex(decay->Parameters(), |
789 | decay->CovarianceMatrix(), | |
790 | decay->GetChi2(), | |
791 | nprongs); | |
792 | Double_t pos[3],cov[6],chi2perNDF; | |
793 | vertexESD->GetXYZ(pos); | |
794 | vertexESD->GetCovMatrix(cov); | |
795 | chi2perNDF = vertexESD->GetChi2toNDF(); | |
796 | delete vertexESD; vertexESD=NULL; | |
797 | AliAODVertex *vertexAOD = new AliAODVertex(pos,cov,chi2perNDF,0x0,-1,AliAODVertex::kUndef,nprongs); | |
798 | d->SetSecondaryVtx(vertexAOD); | |
c1234468 | 799 | return decay; |
800 | } | |
801 | ||
0c22e2ac | 802 | //------------------ |
803 | void AliRDHFCutsLctopKpi::SetStandardCutsPbPb2011() { | |
804 | ||
805 | // Default 2010 PbPb cut object | |
806 | SetStandardCutsPbPb2010(); | |
807 | ||
808 | // | |
809 | // Enable all 2011 PbPb run triggers | |
810 | // | |
811 | SetTriggerClass(""); | |
812 | ResetMaskAndEnableMBTrigger(); | |
813 | EnableCentralTrigger(); | |
814 | EnableSemiCentralTrigger(); | |
815 | } | |
c1234468 | 816 | //----------------- |
817 | ||
818 | Bool_t AliRDHFCutsLctopKpi::IsInFiducialAcceptance(Double_t pt, Double_t y) const | |
819 | { | |
820 | // | |
821 | // // Checking if Dplus is in fiducial acceptance region | |
822 | // // | |
823 | // | |
824 | if(pt > 5.) { | |
825 | // applying cut for pt > 5 GeV | |
826 | AliDebug(2,Form("pt of D+ = %f (> 5), cutting at |y| < 0.8",pt)); | |
827 | if (TMath::Abs(y) > 0.8) return kFALSE; | |
828 | ||
829 | } else { | |
830 | // appliying smooth cut for pt < 5 GeV | |
831 | Double_t maxFiducialY = -0.2/15*pt*pt+1.9/15*pt+0.5; | |
832 | Double_t minFiducialY = 0.2/15*pt*pt-1.9/15*pt-0.5; | |
833 | AliDebug(2,Form("pt of D+ = %f (< 5), cutting according to the fiducial zone [%f, %f]\n",pt,minFiducialY,maxFiducialY)); | |
834 | if (y < minFiducialY || y > maxFiducialY) return kFALSE; | |
835 | } | |
836 | // | |
837 | return kTRUE; | |
7ad4b782 | 838 | } |
a8b8e864 | 839 |