]>
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 | |
36 | ClassImp(AliRDHFCutsLctopKpi) | |
37 | ||
38 | //-------------------------------------------------------------------------- | |
a9b75906 | 39 | AliRDHFCutsLctopKpi::AliRDHFCutsLctopKpi(const char* name) : |
7ad4b782 | 40 | AliRDHFCuts(name), |
41 | fPidObjprot(0), | |
42 | fPidObjpion(0), | |
43d2fecc | 43 | fRecoKF(kFALSE), |
44 | fUseImpParProdCorrCut(kFALSE) | |
e3d40058 | 45 | { |
46 | // | |
47 | // Default Constructor | |
48 | // | |
a7b533b7 | 49 | Int_t nvars=13; |
e3d40058 | 50 | SetNVars(nvars); |
a7b533b7 | 51 | TString varNames[13]={"inv. mass [GeV]", |
a8b8e864 | 52 | "pTK [GeV/c]", |
a7b533b7 | 53 | "pTP [GeV/c]", |
a8b8e864 | 54 | "d0K [cm] lower limit!", |
e3d40058 | 55 | "d0Pi [cm] lower limit!", |
56 | "dist12 (cm)", | |
57 | "sigmavert (cm)", | |
58 | "dist prim-sec (cm)", | |
59 | "pM=Max{pT1,pT2,pT3} (GeV/c)", | |
60 | "cosThetaPoint", | |
61 | "Sum d0^2 (cm^2)", | |
a7b533b7 | 62 | "dca cut (cm)", |
63 | "cut on pTpion [GeV/c]"}; | |
64 | Bool_t isUpperCut[13]={kTRUE, | |
e3d40058 | 65 | kFALSE, |
66 | kFALSE, | |
67 | kFALSE, | |
68 | kFALSE, | |
69 | kFALSE, | |
70 | kTRUE, | |
71 | kFALSE, | |
72 | kFALSE, | |
73 | kFALSE, | |
74 | kFALSE, | |
a7b533b7 | 75 | kTRUE, |
76 | kFALSE | |
77 | }; | |
e3d40058 | 78 | SetVarNames(nvars,varNames,isUpperCut); |
a7b533b7 | 79 | Bool_t forOpt[13]={kFALSE, |
80 | kTRUE, | |
81 | kTRUE, | |
e3d40058 | 82 | kFALSE, |
83 | kFALSE, | |
84 | kFALSE, | |
85 | kFALSE, | |
86 | kTRUE, | |
a7b533b7 | 87 | kFALSE, |
88 | kFALSE, | |
89 | kFALSE, | |
90 | kFALSE, | |
91 | kTRUE}; | |
92 | SetVarsForOpt(4,forOpt); | |
e3d40058 | 93 | Float_t limits[2]={0,999999999.}; |
94 | SetPtBins(2,limits); | |
95 | } | |
96 | //-------------------------------------------------------------------------- | |
97 | AliRDHFCutsLctopKpi::AliRDHFCutsLctopKpi(const AliRDHFCutsLctopKpi &source) : | |
7ad4b782 | 98 | AliRDHFCuts(source), |
99 | fPidObjprot(0), | |
100 | fPidObjpion(0), | |
c0d01d9d | 101 | fRecoKF(source.fRecoKF), |
43d2fecc | 102 | fUseImpParProdCorrCut(source.fUseImpParProdCorrCut) |
e3d40058 | 103 | { |
104 | // | |
105 | // Copy constructor | |
106 | // | |
7ad4b782 | 107 | if(source.fPidObjprot) SetPidprot(source.fPidObjprot); |
108 | if(source.fPidObjpion) SetPidpion(source.fPidObjpion); | |
e3d40058 | 109 | } |
110 | //-------------------------------------------------------------------------- | |
111 | AliRDHFCutsLctopKpi &AliRDHFCutsLctopKpi::operator=(const AliRDHFCutsLctopKpi &source) | |
112 | { | |
113 | // | |
114 | // assignment operator | |
115 | // | |
116 | if(&source == this) return *this; | |
117 | ||
118 | AliRDHFCuts::operator=(source); | |
7ad4b782 | 119 | SetPidprot(source.GetPidprot()); |
120 | SetPidpion(source.GetPidpion()); | |
360841eb | 121 | fRecoKF=source.fRecoKF; |
122 | fUseImpParProdCorrCut=source.fUseImpParProdCorrCut; | |
e3d40058 | 123 | |
124 | return *this; | |
125 | } | |
7ad4b782 | 126 | //--------------------------------------------------------------------------- |
127 | AliRDHFCutsLctopKpi::~AliRDHFCutsLctopKpi() { | |
128 | // | |
129 | // // Default Destructor | |
130 | // | |
131 | if(fPidObjpion){ | |
132 | delete fPidObjpion; | |
133 | fPidObjpion=0; | |
134 | } | |
135 | if(fPidObjprot){ | |
136 | delete fPidObjprot; | |
137 | fPidObjprot=0; | |
138 | } | |
e3d40058 | 139 | |
7ad4b782 | 140 | } |
e3d40058 | 141 | |
142 | //--------------------------------------------------------------------------- | |
e0fb900a | 143 | void AliRDHFCutsLctopKpi::GetCutVarsForOpt(AliAODRecoDecayHF *d,Float_t *vars,Int_t nvars,Int_t *pdgdaughters, AliAODEvent *aod) { |
e3d40058 | 144 | // |
145 | // Fills in vars the values of the variables | |
146 | // | |
147 | ||
148 | if(nvars!=fnVarsForOpt) { | |
149 | printf("AliRDHFCutsLctopKpi::GetCutsVarsForOpt: wrong number of variables\n"); | |
150 | return; | |
151 | } | |
152 | ||
153 | AliAODRecoDecayHF3Prong *dd = (AliAODRecoDecayHF3Prong*)d; | |
154 | ||
155 | Int_t iter=-1; | |
156 | if(fVarsForOpt[0]){ | |
157 | iter++; | |
158 | vars[iter]=dd->InvMassLcpKpi(); | |
159 | } | |
160 | if(fVarsForOpt[1]){ | |
161 | iter++; | |
162 | for(Int_t iprong=0;iprong<3;iprong++){ | |
a7b533b7 | 163 | if(TMath::Abs(pdgdaughters[iprong])==321) { |
e3d40058 | 164 | vars[iter]=dd->PtProng(iprong); |
165 | } | |
166 | } | |
167 | } | |
168 | if(fVarsForOpt[2]){ | |
169 | iter++; | |
170 | for(Int_t iprong=0;iprong<3;iprong++){ | |
a7b533b7 | 171 | if(TMath::Abs(pdgdaughters[iprong])==2212) { |
e3d40058 | 172 | vars[iter]=dd->PtProng(iprong); |
173 | } | |
174 | } | |
175 | } | |
176 | if(fVarsForOpt[3]){ | |
177 | iter++; | |
178 | for(Int_t iprong=0;iprong<3;iprong++){ | |
179 | if(TMath::Abs(pdgdaughters[iprong])==2212) { | |
180 | vars[iter]=dd->Getd0Prong(iprong); | |
181 | } | |
182 | } | |
183 | } | |
184 | if(fVarsForOpt[4]){ | |
185 | iter++; | |
186 | for(Int_t iprong=0;iprong<3;iprong++){ | |
187 | if(TMath::Abs(pdgdaughters[iprong])==211) { | |
188 | vars[iter]=dd->Getd0Prong(iprong); | |
189 | } | |
190 | } | |
191 | } | |
192 | if(fVarsForOpt[5]){ | |
193 | iter++; | |
194 | vars[iter]=dd->GetDist12toPrim(); | |
195 | } | |
196 | if(fVarsForOpt[6]){ | |
197 | iter++; | |
e0fb900a | 198 | vars[iter]=dd->GetSigmaVert(aod); |
e3d40058 | 199 | } |
200 | if(fVarsForOpt[7]){ | |
201 | iter++; | |
202 | vars[iter] = dd->DecayLength(); | |
203 | } | |
204 | if(fVarsForOpt[8]){ | |
205 | iter++; | |
206 | Float_t ptmax=0; | |
207 | for(Int_t i=0;i<3;i++){ | |
208 | if(dd->PtProng(i)>ptmax)ptmax=dd->PtProng(i); | |
209 | } | |
210 | vars[iter]=ptmax; | |
211 | } | |
212 | if(fVarsForOpt[9]){ | |
213 | iter++; | |
214 | vars[iter]=dd->CosPointingAngle(); | |
215 | } | |
216 | if(fVarsForOpt[10]){ | |
217 | iter++; | |
218 | vars[iter]=dd->Getd0Prong(0)*dd->Getd0Prong(0)+dd->Getd0Prong(1)*dd->Getd0Prong(1)+dd->Getd0Prong(2)*dd->Getd0Prong(2); | |
219 | } | |
220 | if(fVarsForOpt[11]){ | |
221 | iter++; | |
222 | vars[iter]=dd->GetDCA(); | |
223 | } | |
a7b533b7 | 224 | if(fVarsForOpt[12]){ |
225 | iter++; | |
226 | for(Int_t iprong=0;iprong<3;iprong++){ | |
227 | if(TMath::Abs(pdgdaughters[iprong])==211) { | |
228 | vars[iter]=dd->PtProng(iprong); | |
229 | } | |
230 | } | |
231 | } | |
e3d40058 | 232 | |
233 | return; | |
234 | } | |
235 | //--------------------------------------------------------------------------- | |
7ad4b782 | 236 | Int_t AliRDHFCutsLctopKpi::IsSelected(TObject* obj,Int_t selectionLevel,AliAODEvent *aod) { |
e3d40058 | 237 | // |
238 | // Apply selection | |
239 | // | |
240 | ||
241 | if(!fCutsRD){ | |
242 | cout<<"Cut matrice not inizialized. Exit..."<<endl; | |
243 | return 0; | |
244 | } | |
245 | //PrintAll(); | |
246 | AliAODRecoDecayHF3Prong* d=(AliAODRecoDecayHF3Prong*)obj; | |
247 | ||
248 | if(!d){ | |
249 | cout<<"AliAODRecoDecayHF3Prong null"<<endl; | |
250 | return 0; | |
251 | } | |
252 | ||
253 | ||
5e938293 | 254 | if(fKeepSignalMC) if(IsSignalMC(d,aod,4122)) return 3; |
e3d40058 | 255 | |
228974b3 | 256 | Int_t returnvalue=3; |
7ad4b782 | 257 | Int_t returnvaluePID=3; |
258 | ||
47aa3d55 | 259 | if(d->Pt()<fMinPtCand) return 0; |
260 | if(d->Pt()>fMaxPtCand) return 0; | |
e3d40058 | 261 | |
ba27eecd | 262 | if(d->HasBadDaughters()) return 0; |
263 | ||
264 | ||
e3d40058 | 265 | // selection on candidate |
266 | if(selectionLevel==AliRDHFCuts::kAll || | |
267 | selectionLevel==AliRDHFCuts::kCandidate) { | |
268 | ||
269 | Double_t pt=d->Pt(); | |
270 | ||
271 | Int_t ptbin=PtBin(pt); | |
272 | ||
273 | Double_t mLcpKpi,mLcpiKp; | |
274 | Int_t okLcpKpi=1,okLcpiKp=1; | |
275 | ||
276 | Double_t mLcPDG = TDatabasePDG::Instance()->GetParticle(4122)->Mass(); | |
277 | ||
278 | mLcpKpi=d->InvMassLcpKpi(); | |
279 | mLcpiKp=d->InvMassLcpiKp(); | |
280 | ||
281 | if(TMath::Abs(mLcpKpi-mLcPDG)>fCutsRD[GetGlobalIndex(0,ptbin)]) okLcpKpi = 0; | |
282 | if(TMath::Abs(mLcpiKp-mLcPDG)>fCutsRD[GetGlobalIndex(0,ptbin)]) okLcpiKp = 0; | |
283 | if(!okLcpKpi && !okLcpiKp) return 0; | |
284 | ||
285 | if(TMath::Abs(d->PtProng(1)) < fCutsRD[GetGlobalIndex(1,ptbin)] || TMath::Abs(d->Getd0Prong(1))<fCutsRD[GetGlobalIndex(3,ptbin)]) return 0;//Kaon | |
a7b533b7 | 286 | if((TMath::Abs(d->PtProng(0)) < fCutsRD[GetGlobalIndex(2,ptbin)]) || (TMath::Abs(d->PtProng(2)) < fCutsRD[GetGlobalIndex(12,ptbin)])) okLcpKpi=0; |
287 | if((TMath::Abs(d->PtProng(2)) < fCutsRD[GetGlobalIndex(2,ptbin)]) || (TMath::Abs(d->PtProng(0)) < fCutsRD[GetGlobalIndex(12,ptbin)]))okLcpiKp=0; | |
7ad4b782 | 288 | if(!okLcpKpi && !okLcpiKp) return 0; |
e3d40058 | 289 | |
290 | ||
7ad4b782 | 291 | if(fRecoKF){ |
292 | Int_t valueTmp=3; | |
293 | if(okLcpKpi) returnvalue=1; //cuts passed as Lc->pKpi | |
294 | if(okLcpiKp) returnvalue=2; //cuts passed as Lc->piKp | |
295 | if(okLcpKpi && okLcpiKp) returnvalue=3; //cuts passed as both pKpi and piKp | |
296 | ||
297 | Int_t valueTotTmp=CombinePIDCuts(valueTmp,returnvaluePID); | |
298 | Int_t pdgs[3]={2212,321,211}; | |
299 | if(valueTotTmp>=2) { | |
300 | pdgs[0]=211; | |
301 | pdgs[2]=2212; | |
302 | } | |
303 | if(!d->GetOwnPrimaryVtx()){ | |
304 | AliAODVertex *vtx1 = (AliAODVertex*)aod->GetPrimaryVertex(); | |
305 | d->SetOwnPrimaryVtx(vtx1); | |
306 | } | |
307 | Double_t field=aod->GetMagneticField(); | |
16d0e822 | 308 | Bool_t outKF=ReconstructKF(d,pdgs,field); |
309 | if(!outKF) return 0; | |
7ad4b782 | 310 | } |
e3d40058 | 311 | //2track cuts |
312 | if(d->GetDist12toPrim()<fCutsRD[GetGlobalIndex(5,ptbin)]|| d->GetDist23toPrim()<fCutsRD[GetGlobalIndex(5,ptbin)]) return 0; | |
228974b3 | 313 | if(d->GetDist12toPrim()>1.) return 0; |
314 | if(d->GetDist23toPrim()>1.) return 0; | |
43d2fecc | 315 | if(fUseImpParProdCorrCut){ |
316 | if(d->Getd0Prong(0)*d->Getd0Prong(1)<0. && d->Getd0Prong(2)*d->Getd0Prong(1)<0.) return 0; | |
317 | } | |
318 | ||
e3d40058 | 319 | |
e0fb900a | 320 | //sec vert |
e3d40058 | 321 | if(d->DecayLength()<fCutsRD[GetGlobalIndex(7,ptbin)]) return 0; |
228974b3 | 322 | if(d->DecayLength()>0.5) return 0; |
e3d40058 | 323 | |
324 | 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; | |
325 | if(d->CosPointingAngle()< fCutsRD[GetGlobalIndex(9,ptbin)]) return 0; | |
326 | Double_t sum2=d->Getd0Prong(0)*d->Getd0Prong(0)+d->Getd0Prong(1)*d->Getd0Prong(1)+d->Getd0Prong(2)*d->Getd0Prong(2); | |
327 | if(sum2<fCutsRD[GetGlobalIndex(10,ptbin)]) return 0; | |
e0fb900a | 328 | if(d->GetSigmaVert(aod)>fCutsRD[GetGlobalIndex(6,ptbin)]) return 0; |
e3d40058 | 329 | |
330 | //DCA | |
331 | for(Int_t i=0;i<3;i++) if(d->GetDCA(i)>fCutsRD[GetGlobalIndex(11,ptbin)]) return 0; | |
332 | ||
333 | ||
334 | if(okLcpKpi) returnvalue=1; //cuts passed as Lc->pKpi | |
335 | if(okLcpiKp) returnvalue=2; //cuts passed as Lc->piKp | |
336 | if(okLcpKpi && okLcpiKp) returnvalue=3; //cuts passed as both pKpi and piKp | |
dcc2ade0 | 337 | |
dcc2ade0 | 338 | } |
339 | ||
1a141544 | 340 | if(selectionLevel==AliRDHFCuts::kAll || |
341 | selectionLevel==AliRDHFCuts::kCandidate|| | |
342 | selectionLevel==AliRDHFCuts::kPID) { | |
343 | returnvaluePID = IsSelectedPID(d); | |
344 | fIsSelectedPID=returnvaluePID; | |
345 | } | |
11690a06 | 346 | // if(fUsePID || selectionLevel==AliRDHFCuts::kPID) returnvaluePID = IsSelectedCombinedPID(d); // to test!! |
dcc2ade0 | 347 | if(returnvaluePID==0) return 0; |
348 | ||
349 | // selection on daughter tracks | |
350 | if(selectionLevel==AliRDHFCuts::kAll || | |
351 | selectionLevel==AliRDHFCuts::kTracks) { | |
352 | if(!AreDaughtersSelected(d)) return 0; | |
e3d40058 | 353 | } |
dcc2ade0 | 354 | |
355 | ||
7ad4b782 | 356 | Int_t returnvalueTot=CombinePIDCuts(returnvalue,returnvaluePID); |
357 | return returnvalueTot; | |
e3d40058 | 358 | } |
359 | //--------------------------------------------------------------------------- | |
7ad4b782 | 360 | Int_t AliRDHFCutsLctopKpi::IsSelectedPID(AliAODRecoDecayHF* obj) { |
361 | ||
362 | ||
1a141544 | 363 | if(!fUsePID || !obj) return 3; |
7ad4b782 | 364 | Int_t okLcpKpi=0,okLcpiKp=0; |
365 | Int_t returnvalue=0; | |
366 | Bool_t isPeriodd=fPidHF->GetOnePad(); | |
a7b533b7 | 367 | Bool_t isMC=fPidHF->GetMC(); |
7ad4b782 | 368 | Bool_t ispion0=kTRUE,ispion2=kTRUE; |
369 | Bool_t isproton0=kFALSE,isproton2=kFALSE; | |
370 | Bool_t iskaon1=kFALSE; | |
a7b533b7 | 371 | if(isPeriodd) { |
372 | fPidObjprot->SetOnePad(kTRUE); | |
373 | fPidObjpion->SetOnePad(kTRUE); | |
374 | } | |
375 | if(isMC) { | |
376 | fPidObjprot->SetMC(kTRUE); | |
377 | fPidObjpion->SetMC(kTRUE); | |
378 | } | |
7ad4b782 | 379 | |
380 | for(Int_t i=0;i<3;i++){ | |
381 | AliAODTrack *track=(AliAODTrack*)obj->GetDaughter(i); | |
382 | if(!track) return 0; | |
383 | // identify kaon | |
384 | if(i==1) { | |
385 | Int_t isKaon=fPidHF->MakeRawPid(track,3); | |
386 | if(isKaon>=1) { | |
387 | iskaon1=kTRUE; | |
388 | if(fPidHF->MakeRawPid(track,2)>=1) iskaon1=kFALSE; | |
389 | } | |
47aa3d55 | 390 | if(!iskaon1) return 0; |
7ad4b782 | 391 | |
392 | }else{ | |
393 | //pion or proton | |
394 | ||
395 | Int_t isProton=fPidObjprot->MakeRawPid(track,4); | |
396 | if(isProton>=1){ | |
397 | if(fPidHF->MakeRawPid(track,2)>=1) isProton=-1; | |
398 | if(fPidHF->MakeRawPid(track,3)>=1) isProton=-1; | |
399 | } | |
400 | ||
401 | Int_t isPion=fPidObjpion->MakeRawPid(track,2); | |
402 | if(fPidHF->MakeRawPid(track,3)>=1) isPion=-1; | |
403 | if(fPidObjprot->MakeRawPid(track,4)>=1) isPion=-1; | |
404 | ||
405 | ||
406 | if(i==0) { | |
407 | if(isPion<0) ispion0=kFALSE; | |
408 | if(isProton>=1) isproton0=kTRUE; | |
409 | ||
410 | } | |
47aa3d55 | 411 | if(!ispion0 && !isproton0) return 0; |
7ad4b782 | 412 | if(i==2) { |
413 | if(isPion<0) ispion2=kFALSE; | |
414 | if(isProton>=1) isproton2=kTRUE; | |
415 | } | |
416 | ||
417 | } | |
418 | } | |
419 | ||
420 | if(ispion2 && isproton0 && iskaon1) okLcpKpi=1; | |
421 | if(ispion0 && isproton2 && iskaon1) okLcpiKp=1; | |
422 | if(okLcpKpi) returnvalue=1; //cuts passed as Lc->pKpi | |
423 | if(okLcpiKp) returnvalue=2; //cuts passed as Lc->piKp | |
424 | if(okLcpKpi && okLcpiKp) returnvalue=3; //cuts passed as both pKpi and piKp | |
425 | ||
426 | return returnvalue; | |
427 | } | |
11690a06 | 428 | //--------------------------------------------------------------------------- |
429 | Int_t AliRDHFCutsLctopKpi::IsSelectedCombinedPID(AliAODRecoDecayHF* obj) { | |
430 | ||
431 | // Printf(" -------- IsSelectedCombinedPID --------------"); | |
432 | ||
433 | if(!obj) {return 3;} | |
434 | Int_t okLcpKpi=0,okLcpiKp=0; | |
435 | Int_t returnvalue=0; | |
436 | Bool_t isPeriodd=fPidHF->GetOnePad(); | |
437 | Bool_t isMC=fPidHF->GetMC(); | |
438 | Bool_t isKaon = kFALSE; | |
439 | Bool_t isPion = kFALSE; | |
440 | Bool_t isProton = kFALSE; | |
441 | ||
442 | if(isPeriodd) { | |
443 | fPidObjprot->SetOnePad(kTRUE); | |
444 | fPidObjpion->SetOnePad(kTRUE); | |
445 | } | |
446 | if(isMC) { | |
447 | fPidObjprot->SetMC(kTRUE); | |
448 | fPidObjpion->SetMC(kTRUE); | |
449 | } | |
450 | ||
451 | Double_t probComb[AliPID::kSPECIES]={0.}; // array to store the info for the combined ITS|TPC|TOF probabilities | |
452 | fPidHF->GetPidCombined()->SetDetectorMask(AliPIDResponse::kDetITS|AliPIDResponse::kDetTOF|AliPIDResponse::kDetTPC); // the mask could become a member of the cut object | |
453 | ||
454 | for(Int_t i=0;i<3;i++){ | |
455 | AliAODTrack *track=(AliAODTrack*)obj->GetDaughter(i); | |
456 | if(!track) return 0; | |
457 | // identify kaon | |
2fd6ad5e | 458 | /*UInt_t detUsed =*/ fPidHF->GetPidCombined()->ComputeProbabilities(track, fPidHF->GetPidResponse(), probComb); // for the moment we don't check detUsed... |
11690a06 | 459 | // Printf("[%d] %x %f %f %f %f %f",i,detUsed,probComb[0],probComb[1],probComb[2],probComb[3],probComb[4]); |
460 | if(i==1) { | |
461 | if(TMath::MaxElement(AliPID::kSPECIES,probComb) == probComb[3]) { // the probability to be a Kaon is the highest | |
462 | isKaon=kTRUE; | |
463 | // if ( probComb[3] > 0.8 ) isKaon=kTRUE; | |
464 | // else return 0; | |
465 | } | |
466 | else return 0; // prong at position 1 is not a Kaon, returning 0 | |
467 | } | |
468 | else { | |
469 | //pion or proton | |
470 | ||
471 | if(TMath::MaxElement(AliPID::kSPECIES,probComb) == probComb[4]) { // the probability to be a proton is the highest | |
472 | isProton=kTRUE; | |
473 | if (isPion) okLcpiKp = 1; // the pion was already identified, so here we must be at i == 2 --> Lc --> pi K p (K already found) | |
474 | } | |
475 | if(TMath::MaxElement(AliPID::kSPECIES,probComb) == probComb[2]) { // the probability to be a pion is the highest | |
476 | isPion=kTRUE; | |
477 | if (isProton) okLcpKpi = 1; // the proton was already identified, so here we must be at i == 2 --> Lc --> p K pi (K already found) | |
478 | } | |
479 | ||
480 | } | |
481 | } | |
482 | ||
483 | if(okLcpKpi) returnvalue=1; //cuts passed as Lc->pKpi | |
484 | if(okLcpiKp) returnvalue=2; //cuts passed as Lc->piKp | |
485 | if(okLcpKpi && okLcpiKp) returnvalue=3; //cuts passed as both pKpi and piKp | |
486 | ||
487 | return returnvalue; | |
488 | } | |
7ad4b782 | 489 | //----------------------- |
490 | Int_t AliRDHFCutsLctopKpi::CombinePIDCuts(Int_t returnvalue, Int_t returnvaluePID) const { | |
491 | ||
492 | Int_t returnvalueTot=0; | |
493 | Int_t okLcpKpi=0,okLcpiKp=0; | |
494 | if(returnvaluePID==1){ | |
495 | if(returnvalue==1 || returnvalue==3) okLcpKpi=1; | |
496 | } | |
497 | if(returnvaluePID==2){ | |
498 | if(returnvalue>=2) okLcpiKp=1; | |
499 | } | |
500 | if(returnvaluePID==3 && returnvalue>0){ | |
501 | if(returnvalue==1 || returnvalue==3) okLcpKpi=1; | |
502 | if(returnvalue>=2) okLcpiKp=1; | |
503 | } | |
504 | ||
505 | if(okLcpKpi) returnvalueTot=1; //cuts passed as Lc->pKpi | |
506 | if(okLcpiKp) returnvalueTot=2; //cuts passed as Lc->piKp | |
507 | if(okLcpKpi && okLcpiKp) returnvalueTot=3; //cuts passed as both pKpi and piKp | |
508 | return returnvalueTot; | |
509 | } | |
510 | //---------------------------------- | |
511 | void AliRDHFCutsLctopKpi::SetStandardCutsPP2010() { | |
512 | ||
513 | SetName("LctopKpiProdCuts"); | |
514 | SetTitle("Production cuts for Lc analysis"); | |
515 | ||
516 | AliESDtrackCuts *esdTrackCuts = new AliESDtrackCuts("AliESDtrackCuts","default"); | |
517 | esdTrackCuts->SetRequireSigmaToVertex(kFALSE); | |
518 | esdTrackCuts->SetRequireTPCRefit(kTRUE); | |
519 | esdTrackCuts->SetMinNClustersTPC(70); | |
520 | esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, | |
521 | AliESDtrackCuts::kAny); | |
522 | esdTrackCuts->SetRequireITSRefit(kTRUE); | |
523 | esdTrackCuts->SetMinNClustersITS(4); | |
524 | esdTrackCuts->SetMinDCAToVertexXY(0.); | |
525 | esdTrackCuts->SetEtaRange(-0.8,0.8); | |
526 | esdTrackCuts->SetPtRange(0.3,1.e10); | |
527 | AddTrackCuts(esdTrackCuts); | |
528 | ||
529 | const Int_t nptbins=4; | |
a7b533b7 | 530 | const Int_t nvars=13; |
7ad4b782 | 531 | Float_t* ptbins; |
532 | ptbins=new Float_t[nptbins+1]; | |
533 | ||
534 | ptbins[0]=0.; | |
535 | ptbins[1]=2.; | |
536 | ptbins[2]=3.; | |
537 | ptbins[3]=4.; | |
538 | ptbins[4]=9999.; | |
539 | ||
540 | SetGlobalIndex(nvars,nptbins); | |
541 | SetPtBins(nptbins+1,ptbins); | |
542 | ||
543 | Float_t** prodcutsval; | |
544 | prodcutsval=new Float_t*[nvars]; | |
545 | for(Int_t iv=0;iv<nvars;iv++){ | |
546 | prodcutsval[iv]=new Float_t[nptbins]; | |
547 | } | |
e11ae259 | 548 | |
7ad4b782 | 549 | for(Int_t ipt=0;ipt<nptbins;ipt++){ |
550 | prodcutsval[0][ipt]=0.18; | |
551 | prodcutsval[1][ipt]=0.4; | |
552 | prodcutsval[2][ipt]=0.5; | |
553 | prodcutsval[3][ipt]=0.; | |
554 | prodcutsval[4][ipt]=0.; | |
555 | prodcutsval[5][ipt]=0.01; | |
556 | prodcutsval[6][ipt]=0.06; | |
557 | prodcutsval[7][ipt]=0.005; | |
558 | prodcutsval[8][ipt]=0.; | |
559 | prodcutsval[9][ipt]=0.; | |
560 | prodcutsval[10][ipt]=0.; | |
561 | prodcutsval[11][ipt]=0.05; | |
a7b533b7 | 562 | prodcutsval[12][ipt]=0.4; |
7ad4b782 | 563 | } |
564 | SetCuts(nvars,nptbins,prodcutsval); | |
565 | ||
566 | AliAODPidHF* pidObjK=new AliAODPidHF(); | |
567 | Double_t sigmasK[5]={3.,1.,1.,3.,2.}; | |
568 | pidObjK->SetSigma(sigmasK); | |
569 | pidObjK->SetAsym(kTRUE); | |
570 | pidObjK->SetMatch(1); | |
571 | pidObjK->SetTPC(kTRUE); | |
572 | pidObjK->SetTOF(kTRUE); | |
573 | pidObjK->SetITS(kTRUE); | |
574 | Double_t plimK[2]={0.5,0.8}; | |
575 | pidObjK->SetPLimit(plimK,2); | |
a7b533b7 | 576 | pidObjK->SetTOFdecide(kTRUE); |
7ad4b782 | 577 | |
578 | SetPidHF(pidObjK); | |
579 | ||
580 | AliAODPidHF* pidObjpi=new AliAODPidHF(); | |
581 | pidObjpi->SetTPC(kTRUE); | |
582 | Double_t sigmaspi[5]={3.,0.,0.,0.,0.}; | |
583 | pidObjpi->SetSigma(sigmaspi); | |
a7b533b7 | 584 | pidObjpi->SetTOFdecide(kTRUE); |
7ad4b782 | 585 | SetPidpion(pidObjpi); |
586 | ||
587 | AliAODPidHF* pidObjp=new AliAODPidHF(); | |
588 | Double_t sigmasp[5]={3.,1.,1.,3.,2.}; | |
589 | pidObjp->SetSigma(sigmasp); | |
590 | pidObjp->SetAsym(kTRUE); | |
591 | pidObjp->SetMatch(1); | |
592 | pidObjp->SetTPC(kTRUE); | |
593 | pidObjp->SetTOF(kTRUE); | |
594 | pidObjp->SetITS(kTRUE); | |
595 | Double_t plimp[2]={1.,2.}; | |
596 | pidObjp->SetPLimit(plimp,2); | |
a7b533b7 | 597 | pidObjp->SetTOFdecide(kTRUE); |
7ad4b782 | 598 | |
599 | SetPidprot(pidObjp); | |
600 | ||
601 | SetUsePID(kTRUE); | |
602 | ||
603 | PrintAll(); | |
604 | ||
e11ae259 | 605 | for(Int_t iiv=0;iiv<nvars;iiv++){ |
606 | delete [] prodcutsval[iiv]; | |
607 | } | |
608 | delete [] prodcutsval; | |
609 | prodcutsval=NULL; | |
610 | delete [] ptbins; | |
611 | ptbins=NULL; | |
612 | ||
613 | delete pidObjp; | |
614 | pidObjp=NULL; | |
615 | ||
7ad4b782 | 616 | return; |
617 | } | |
a8b8e864 | 618 | //------------------ |
619 | void AliRDHFCutsLctopKpi::SetStandardCutsPbPb2010() { | |
620 | ||
621 | SetName("LctopKpiProdCuts"); | |
622 | SetTitle("Production cuts for Lc analysis"); | |
623 | ||
624 | AliESDtrackCuts *esdTrackCuts = new AliESDtrackCuts("AliESDtrackCuts","default"); | |
625 | ||
626 | esdTrackCuts->SetRequireTPCRefit(kTRUE); | |
627 | esdTrackCuts->SetMinNClustersTPC(70); | |
628 | esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, | |
629 | AliESDtrackCuts::kAny); | |
630 | esdTrackCuts->SetRequireITSRefit(kTRUE); | |
631 | esdTrackCuts->SetMinNClustersITS(4); | |
632 | esdTrackCuts->SetMinDCAToVertexXYPtDep("0.0100*TMath::Max(0.,(1-TMath::Floor(TMath::Abs(pt)/2.)))"); | |
633 | esdTrackCuts->SetEtaRange(-0.8,0.8); | |
634 | esdTrackCuts->SetMaxDCAToVertexXY(1.); | |
635 | esdTrackCuts->SetMaxDCAToVertexZ(1.); | |
636 | esdTrackCuts->SetPtRange(0.8,1.e10); | |
637 | AddTrackCuts(esdTrackCuts); | |
638 | ||
639 | const Int_t nptbins=4; | |
a7b533b7 | 640 | const Int_t nvars=13; |
a8b8e864 | 641 | Float_t* ptbins; |
642 | ptbins=new Float_t[nptbins+1]; | |
643 | ||
644 | ptbins[0]=0.; | |
645 | ptbins[1]=2.; | |
646 | ptbins[2]=3.; | |
647 | ptbins[3]=4.; | |
648 | ptbins[4]=9999.; | |
649 | ||
650 | SetGlobalIndex(nvars,nptbins); | |
651 | SetPtBins(nptbins+1,ptbins); | |
652 | ||
653 | Float_t** prodcutsval; | |
654 | prodcutsval=new Float_t*[nvars]; | |
655 | for(Int_t iv=0;iv<nvars;iv++){ | |
656 | prodcutsval[iv]=new Float_t[nptbins]; | |
657 | } | |
658 | ||
659 | for(Int_t ipt=0;ipt<nptbins;ipt++){ | |
660 | prodcutsval[0][ipt]=0.13; | |
661 | prodcutsval[1][ipt]=0.5; | |
662 | prodcutsval[2][ipt]=0.6; | |
663 | prodcutsval[3][ipt]=0.; | |
664 | prodcutsval[4][ipt]=0.; | |
665 | prodcutsval[5][ipt]=0.01; | |
666 | prodcutsval[6][ipt]=0.04; | |
667 | prodcutsval[7][ipt]=0.006; | |
668 | prodcutsval[8][ipt]=0.8; | |
669 | prodcutsval[9][ipt]=0.3; | |
670 | prodcutsval[10][ipt]=0.; | |
671 | prodcutsval[11][ipt]=0.05; | |
a7b533b7 | 672 | prodcutsval[12][ipt]=0.4; |
a8b8e864 | 673 | } |
674 | SetCuts(nvars,nptbins,prodcutsval); | |
675 | ||
676 | AliAODPidHF* pidObjK=new AliAODPidHF(); | |
677 | Double_t sigmasK[5]={3.,1.,1.,3.,2.}; | |
678 | pidObjK->SetSigma(sigmasK); | |
679 | pidObjK->SetAsym(kTRUE); | |
680 | pidObjK->SetMatch(1); | |
681 | pidObjK->SetTPC(kTRUE); | |
682 | pidObjK->SetTOF(kTRUE); | |
683 | pidObjK->SetITS(kTRUE); | |
684 | Double_t plimK[2]={0.5,0.8}; | |
685 | pidObjK->SetPLimit(plimK,2); | |
686 | ||
687 | SetPidHF(pidObjK); | |
688 | ||
689 | AliAODPidHF* pidObjpi=new AliAODPidHF(); | |
690 | pidObjpi->SetTPC(kTRUE); | |
691 | Double_t sigmaspi[5]={3.,0.,0.,0.,0.}; | |
692 | pidObjpi->SetSigma(sigmaspi); | |
693 | SetPidpion(pidObjpi); | |
7ad4b782 | 694 | |
a8b8e864 | 695 | AliAODPidHF* pidObjp=new AliAODPidHF(); |
696 | Double_t sigmasp[5]={3.,1.,1.,3.,2.}; | |
697 | pidObjp->SetSigma(sigmasp); | |
698 | pidObjp->SetAsym(kTRUE); | |
699 | pidObjp->SetMatch(1); | |
700 | pidObjp->SetTPC(kTRUE); | |
701 | pidObjp->SetTOF(kTRUE); | |
702 | pidObjp->SetITS(kTRUE); | |
703 | Double_t plimp[2]={1.,2.}; | |
704 | pidObjp->SetPLimit(plimp,2); | |
705 | ||
706 | SetPidprot(pidObjp); | |
707 | ||
708 | SetUsePID(kTRUE); | |
709 | ||
710 | PrintAll(); | |
711 | ||
712 | for(Int_t iiv=0;iiv<nvars;iiv++){ | |
713 | delete [] prodcutsval[iiv]; | |
714 | } | |
715 | delete [] prodcutsval; | |
716 | prodcutsval=NULL; | |
717 | delete [] ptbins; | |
718 | ptbins=NULL; | |
719 | ||
720 | delete pidObjp; | |
721 | pidObjp=NULL; | |
722 | ||
723 | return; | |
724 | } | |
7ad4b782 | 725 | //------------------ |
726 | Bool_t AliRDHFCutsLctopKpi::ReconstructKF(AliAODRecoDecayHF3Prong *d,Int_t *pdgs,Double_t field) const{ | |
727 | ||
16d0e822 | 728 | const Int_t nprongs=d->GetNProngs(); |
cfcc5da0 | 729 | if(nprongs<=0) return kFALSE; |
16d0e822 | 730 | |
7ad4b782 | 731 | Int_t iprongs[nprongs]; |
732 | for(Int_t i=0;i<nprongs;i++) iprongs[i]=i; | |
733 | ||
734 | Double_t mass[2]={0.,0.}; | |
735 | ||
736 | AliKFParticle *decay=d->ApplyVertexingKF(iprongs,nprongs,pdgs,kTRUE,field,mass); | |
737 | if(!decay) return kTRUE; | |
738 | AliESDVertex *vertexESD = new AliESDVertex(decay->Parameters(), | |
739 | decay->CovarianceMatrix(), | |
740 | decay->GetChi2(), | |
741 | nprongs); | |
742 | Double_t pos[3],cov[6],chi2perNDF; | |
743 | vertexESD->GetXYZ(pos); | |
744 | vertexESD->GetCovMatrix(cov); | |
745 | chi2perNDF = vertexESD->GetChi2toNDF(); | |
746 | delete vertexESD; vertexESD=NULL; | |
747 | AliAODVertex *vertexAOD = new AliAODVertex(pos,cov,chi2perNDF,0x0,-1,AliAODVertex::kUndef,nprongs); | |
748 | d->SetSecondaryVtx(vertexAOD); | |
749 | return kTRUE; | |
750 | } | |
a8b8e864 | 751 |