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