1 /**************************************************************************
2 * Copyright(c) 1998-2010, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 /////////////////////////////////////////////////////////////
18 // Class for cuts on AOD reconstructed D0->Kpi
20 // Author: A.Dainese, andrea.dainese@pd.infn.it
21 /////////////////////////////////////////////////////////////
23 #include <TDatabasePDG.h>
24 #include <Riostream.h>
26 #include "AliRDHFCutsD0toKpi.h"
27 #include "AliAODRecoDecayHF2Prong.h"
28 #include "AliAODTrack.h"
29 #include "AliESDtrack.h"
30 #include "AliAODPid.h"
31 #include "AliTPCPIDResponse.h"
32 #include "AliAODVertex.h"
33 #include "AliKFVertex.h"
34 #include "AliKFParticle.h"
36 ClassImp(AliRDHFCutsD0toKpi)
38 //--------------------------------------------------------------------------
39 AliRDHFCutsD0toKpi::AliRDHFCutsD0toKpi(const char* name) :
41 fUseSpecialCuts(kFALSE),
47 // Default Constructor
51 TString varNames[9]={"inv. mass [GeV]",
60 Bool_t isUpperCut[9]={kTRUE,
69 SetVarNames(nvars,varNames,isUpperCut);
70 Bool_t forOpt[9]={kFALSE,
79 SetVarsForOpt(4,forOpt);
80 Float_t limits[2]={0,999999999.};
84 //--------------------------------------------------------------------------
85 AliRDHFCutsD0toKpi::AliRDHFCutsD0toKpi(const AliRDHFCutsD0toKpi &source) :
87 fUseSpecialCuts(source.fUseSpecialCuts),
88 fLowPt(source.fLowPt),
89 fDefaultPID(source.fDefaultPID),
97 //--------------------------------------------------------------------------
98 AliRDHFCutsD0toKpi &AliRDHFCutsD0toKpi::operator=(const AliRDHFCutsD0toKpi &source)
101 // assignment operator
103 if(&source == this) return *this;
105 AliRDHFCuts::operator=(source);
106 fUseSpecialCuts=source.fUseSpecialCuts;
107 fLowPt=source.fLowPt;
108 fDefaultPID=source.fDefaultPID;
114 //---------------------------------------------------------------------------
115 void AliRDHFCutsD0toKpi::GetCutVarsForOpt(AliAODRecoDecayHF *d,Float_t *vars,Int_t nvars,Int_t *pdgdaughters) {
117 // Fills in vars the values of the variables
120 if(nvars!=fnVarsForOpt) {
121 printf("AliRDHFCutsD0toKpi::GetCutsVarsForOpt: wrong number of variables\n");
125 AliAODRecoDecayHF2Prong *dd = (AliAODRecoDecayHF2Prong*)d;
130 if(TMath::Abs(pdgdaughters[0])==211) {
131 vars[iter]=dd->InvMassD0();
133 vars[iter]=dd->InvMassD0bar();
138 vars[iter]=dd->GetDCA();
142 if(TMath::Abs(pdgdaughters[0])==211) {
143 vars[iter] = dd->CosThetaStarD0();
145 vars[iter] = dd->CosThetaStarD0bar();
150 if(TMath::Abs(pdgdaughters[0])==321) {
151 vars[iter]=dd->PtProng(0);
154 vars[iter]=dd->PtProng(1);
159 if(TMath::Abs(pdgdaughters[0])==211) {
160 vars[iter]=dd->PtProng(0);
163 vars[iter]=dd->PtProng(1);
168 if(TMath::Abs(pdgdaughters[0])==321) {
169 vars[iter]=dd->Getd0Prong(0);
172 vars[iter]=dd->Getd0Prong(1);
177 if(TMath::Abs(pdgdaughters[0])==211) {
178 vars[iter]=dd->Getd0Prong(0);
181 vars[iter]=dd->Getd0Prong(1);
186 vars[iter]= dd->Prodd0d0();
190 vars[iter]=dd->CosPointingAngle();
195 //---------------------------------------------------------------------------
196 Int_t AliRDHFCutsD0toKpi::IsSelected(TObject* obj,Int_t selectionLevel,AliAODEvent* aod) {
202 cout<<"Cut matrice not inizialized. Exit..."<<endl;
206 AliAODRecoDecayHF2Prong* d=(AliAODRecoDecayHF2Prong*)obj;
209 cout<<"AliAODRecoDecayHF2Prong null"<<endl;
213 // selection on daughter tracks
214 if(selectionLevel==AliRDHFCuts::kAll ||
215 selectionLevel==AliRDHFCuts::kTracks) {
216 if(!AreDaughtersSelected(d)) return 0;
221 // returnvalue: 0 not sel, 1 only D0, 2 only D0bar, 3 both
222 Int_t returnvaluePID=3;
223 Int_t returnvalueCuts=3;
226 if(selectionLevel==AliRDHFCuts::kAll ||
227 selectionLevel==AliRDHFCuts::kCandidate ||
228 selectionLevel==AliRDHFCuts::kPID) {
229 returnvaluePID = IsSelectedPID(d);
235 // selection on candidate
236 if(selectionLevel==AliRDHFCuts::kAll ||
237 selectionLevel==AliRDHFCuts::kCandidate) {
239 // go to selection with Kalman vertexing, if requested
241 returnvalueCuts = IsSelectedKF(d,aod);
244 //recalculate vertex w/o daughters
245 AliAODVertex *origownvtx=0x0;
246 AliAODVertex *recvtx=0x0;
248 if(fRemoveDaughtersFromPrimary) {
250 AliError("Can not remove daughters from vertex without AOD event");
253 if(d->GetOwnPrimaryVtx()) origownvtx=new AliAODVertex(*d->GetOwnPrimaryVtx());
254 recvtx=d->RemoveDaughtersFromPrimaryVtx(aod);
256 AliDebug(2,"Removal of daughter tracks failed");
257 //recvtx=d->GetPrimaryVtx();
264 //set recalculed primary vertex
265 d->SetOwnPrimaryVtx(recvtx);
266 delete recvtx; recvtx=NULL;
272 Int_t okD0=0,okD0bar=0;
274 Int_t ptbin=PtBin(pt);
277 d->SetOwnPrimaryVtx(origownvtx);
281 else d->UnsetOwnPrimaryVtx();
284 Double_t mD0,mD0bar,ctsD0,ctsD0bar;
287 Double_t mD0PDG = TDatabasePDG::Instance()->GetParticle(421)->Mass();
289 if(d->PtProng(1) < fCutsRD[GetGlobalIndex(3,ptbin)] || d->PtProng(0) < fCutsRD[GetGlobalIndex(4,ptbin)]) okD0 = 0;
290 if(d->PtProng(0) < fCutsRD[GetGlobalIndex(3,ptbin)] || d->PtProng(1) < fCutsRD[GetGlobalIndex(4,ptbin)]) okD0bar = 0;
291 if(!okD0 && !okD0bar) returnvalueCuts=0;
294 if(TMath::Abs(d->Getd0Prong(1)) > fCutsRD[GetGlobalIndex(5,ptbin)] ||
295 TMath::Abs(d->Getd0Prong(0)) > fCutsRD[GetGlobalIndex(6,ptbin)]) okD0 = 0;
296 if(TMath::Abs(d->Getd0Prong(0)) > fCutsRD[GetGlobalIndex(6,ptbin)] ||
297 TMath::Abs(d->Getd0Prong(1)) > fCutsRD[GetGlobalIndex(5,ptbin)]) okD0bar = 0;
298 if(!okD0 && !okD0bar) returnvalueCuts=0;
300 if(d->GetDCA() > fCutsRD[GetGlobalIndex(1,ptbin)]) returnvalueCuts=0;
302 d->InvMassD0(mD0,mD0bar);
303 if(TMath::Abs(mD0-mD0PDG) > fCutsRD[GetGlobalIndex(0,ptbin)]) okD0 = 0;
304 if(TMath::Abs(mD0bar-mD0PDG) > fCutsRD[GetGlobalIndex(0,ptbin)]) okD0bar = 0;
305 if(!okD0 && !okD0bar) returnvalueCuts=0;
307 d->CosThetaStarD0(ctsD0,ctsD0bar);
308 if(TMath::Abs(ctsD0) > fCutsRD[GetGlobalIndex(2,ptbin)]) okD0 = 0;
309 if(TMath::Abs(ctsD0bar) > fCutsRD[GetGlobalIndex(2,ptbin)]) okD0bar = 0;
310 if(!okD0 && !okD0bar) returnvalueCuts=0;
312 if(d->Prodd0d0() > fCutsRD[GetGlobalIndex(7,ptbin)]) returnvalueCuts=0;
314 if(d->CosPointingAngle() < fCutsRD[GetGlobalIndex(8,ptbin)]) returnvalueCuts=0;
316 if (returnvalueCuts!=0) {
317 if (okD0) returnvalueCuts=1; //cuts passed as D0
318 if (okD0bar) returnvalueCuts=2; //cuts passed as D0bar
319 if (okD0 && okD0bar) returnvalueCuts=3; //cuts passed as D0 and D0bar
324 if(fUseSpecialCuts) special=IsSelectedSpecialCuts(d);
325 if(!special) returnvalueCuts=0;
327 // unset recalculated primary vertex when not needed any more
329 d->SetOwnPrimaryVtx(origownvtx);
332 } else if(fRemoveDaughtersFromPrimary) {
333 d->UnsetOwnPrimaryVtx();
334 AliDebug(3,"delete new vertex\n");
342 // cout<<"Pid = "<<returnvaluePID<<endl;
343 return CombineSelectionLevels(3,returnvalueCuts,returnvaluePID);
346 //------------------------------------------------------------------------------------------
347 Int_t AliRDHFCutsD0toKpi::IsSelectedKF(AliAODRecoDecayHF2Prong *d,
348 AliAODEvent* aod) const {
350 // Apply selection using KF-vertexing
353 AliAODTrack *track0 = (AliAODTrack*)d->GetDaughter(0);
354 AliAODTrack *track1 = (AliAODTrack*)d->GetDaughter(1);
356 if(!track0 || !track1) {
357 cout<<"one or two D0 daughters missing!"<<endl;
361 // returnvalue: 0 not sel, 1 only D0, 2 only D0bar, 3 both
362 Int_t returnvalueCuts=3;
364 // candidate selection with AliKF
365 AliKFParticle::SetField(aod->GetMagneticField()); // set the magnetic field
367 Int_t okD0=0,okD0bar=0;
370 // convert tracks into AliKFParticles
372 AliKFParticle negPiKF(*track1,-211); // neg pion kandidate
373 AliKFParticle negKKF(*track1,-321); // neg kaon kandidate
374 AliKFParticle posPiKF(*track0,211); // pos pion kandidate
375 AliKFParticle posKKF(*track0,321); // pos kaon kandidate
377 // build D0 candidates
379 AliKFParticle d0c(negKKF,posPiKF); // D0 candidate
380 AliKFParticle ad0c(posKKF,negPiKF); // D0bar candidate
382 // create kf primary vertices
384 AliAODVertex *vtx1 = aod->GetPrimaryVertex();
385 AliKFVertex primVtx(*vtx1);
386 AliKFVertex aprimVtx(*vtx1);
388 if(primVtx.GetNContributors()<=0) okD0 = 0;
389 if(aprimVtx.GetNContributors()<=0) okD0bar = 0;
390 if(!okD0 && !okD0bar) returnvalueCuts=0;
394 Double_t d0mass = d0c.GetMass();
395 Double_t ad0mass = ad0c.GetMass();
397 // calculate P of D0 and D0bar
398 Double_t d0P = d0c.GetP();
399 Double_t d0Px = d0c.GetPx();
400 Double_t d0Py = d0c.GetPy();
401 Double_t d0Pz = d0c.GetPz();
402 Double_t ad0P = ad0c.GetP();
403 Double_t ad0Px = ad0c.GetPx();
404 Double_t ad0Py = ad0c.GetPy();
405 Double_t ad0Pz = ad0c.GetPz();
407 //calculate Pt of D0 and D0bar
409 Double_t pt=d0c.GetPt();
410 Double_t apt=ad0c.GetPt();
412 // remove D0 daughters from primary vertices (if used in vertex fit) and add D0-candidates
414 if(track0->GetUsedForPrimVtxFit()) {
419 if(track1->GetUsedForPrimVtxFit()) {
427 if(primVtx.GetNContributors()<=0) okD0 = 0;
428 if(aprimVtx.GetNContributors()<=0) okD0bar = 0;
429 if(!okD0 && !okD0bar) returnvalueCuts=0;
431 //calculate cut variables
433 // calculate impact params of daughters w.r.t recalculated vertices
435 Double_t impactPi = posPiKF.GetDistanceFromVertexXY(primVtx);
436 Double_t aimpactPi = negPiKF.GetDistanceFromVertexXY(aprimVtx);
437 Double_t impactKa = negKKF.GetDistanceFromVertexXY(primVtx);
438 Double_t aimpactKa = posKKF.GetDistanceFromVertexXY(aprimVtx);
440 // calculate Product of Impact Params
442 Double_t prodParam = impactPi*impactKa;
443 Double_t aprodParam = aimpactPi*aimpactKa;
445 // calculate cosine of pointing angles
447 TVector3 mom(d0c.GetPx(),d0c.GetPy(),d0c.GetPz());
448 TVector3 fline(d0c.GetX()-primVtx.GetX(),
449 d0c.GetY()-primVtx.GetY(),
450 d0c.GetZ()-primVtx.GetZ());
451 Double_t pta = mom.Angle(fline);
452 Double_t cosP = TMath::Cos(pta); // cosine of pta for D0 candidate
454 TVector3 amom(ad0c.GetPx(),ad0c.GetPy(),ad0c.GetPz());
455 TVector3 afline(ad0c.GetX()-aprimVtx.GetX(),
456 ad0c.GetY()-aprimVtx.GetY(),
457 ad0c.GetZ()-aprimVtx.GetZ());
458 Double_t apta = amom.Angle(afline);
459 Double_t acosP = TMath::Cos(apta); // cosine of pta for D0bar candidate
461 // calculate P of Pions at Decay Position of D0 and D0bar candidates
462 negKKF.TransportToParticle(d0c);
463 posPiKF.TransportToParticle(d0c);
464 posKKF.TransportToParticle(ad0c);
465 negPiKF.TransportToParticle(ad0c);
467 Double_t pxPi = posPiKF.GetPx();
468 Double_t pyPi = posPiKF.GetPy();
469 Double_t pzPi = posPiKF.GetPz();
470 Double_t ptPi = posPiKF.GetPt();
472 Double_t apxPi = negPiKF.GetPx();
473 Double_t apyPi = negPiKF.GetPy();
474 Double_t apzPi = negPiKF.GetPz();
475 Double_t aptPi = negPiKF.GetPt();
477 // calculate Pt of Kaons at Decay Position of D0 and D0bar candidates
479 Double_t ptK = negKKF.GetPt();
480 Double_t aptK = posKKF.GetPt();
482 //calculate cos(thetastar)
483 Double_t massvtx = TDatabasePDG::Instance()->GetParticle(421)->Mass();
485 massp[0] = TDatabasePDG::Instance()->GetParticle(321)->Mass();
486 massp[1] = TDatabasePDG::Instance()->GetParticle(211)->Mass();
487 Double_t pStar = TMath::Sqrt(TMath::Power(massvtx*massvtx-massp[0]*massp[0]-massp[1]*massp[1],2.)
488 -4.*massp[0]*massp[0]*massp[1]*massp[1])/(2.*massvtx);
490 // cos(thetastar) for D0 and Pion
492 Double_t d0E = TMath::Sqrt(massvtx*massvtx + d0P*d0P);
493 Double_t beta = d0P/d0E;
494 Double_t gamma = d0E/massvtx;
495 TVector3 momPi(pxPi,pyPi,pzPi);
496 TVector3 momTot(d0Px,d0Py,d0Pz);
497 Double_t q1 = momPi.Dot(momTot)/momTot.Mag();
498 Double_t cts = (q1/gamma-beta*TMath::Sqrt(pStar*pStar+massp[1]*massp[1]))/pStar;
500 // cos(thetastar) for D0bar and Pion
502 Double_t ad0E = TMath::Sqrt(massvtx*massvtx + ad0P*ad0P);
503 Double_t abeta = ad0P/ad0E;
504 Double_t agamma = ad0E/massvtx;
505 TVector3 amomPi(apxPi,apyPi,apzPi);
506 TVector3 amomTot(ad0Px,ad0Py,ad0Pz);
507 Double_t aq1 = amomPi.Dot(amomTot)/amomTot.Mag();
508 Double_t acts = (aq1/agamma-abeta*TMath::Sqrt(pStar*pStar+massp[1]*massp[1]))/pStar;
510 // calculate reduced Chi2 for the full D0 fit
511 d0c.SetProductionVertex(primVtx);
512 ad0c.SetProductionVertex(aprimVtx);
513 negKKF.SetProductionVertex(d0c);
514 posPiKF.SetProductionVertex(d0c);
515 posKKF.SetProductionVertex(ad0c);
516 negPiKF.SetProductionVertex(ad0c);
517 d0c.TransportToProductionVertex();
518 ad0c.TransportToProductionVertex();
520 // calculate the decay length
521 Double_t decayLengthD0 = d0c.GetDecayLength();
522 Double_t adecayLengthD0 = ad0c.GetDecayLength();
524 Double_t chi2D0 = 50.;
525 if(d0c.GetNDF() > 0 && d0c.GetChi2() >= 0) {
526 chi2D0 = d0c.GetChi2()/d0c.GetNDF();
529 Double_t achi2D0 = 50.;
530 if(ad0c.GetNDF() > 0 && ad0c.GetChi2() >= 0) {
531 achi2D0 = ad0c.GetChi2()/ad0c.GetNDF();
535 Int_t ptbin=PtBin(pt);
536 Int_t aptbin=PtBin(apt);
538 if(ptbin < 0) okD0 = 0;
539 if(aptbin < 0) okD0bar = 0;
540 if(!okD0 && !okD0bar) returnvalueCuts=0;
542 if(ptK < fCutsRD[GetGlobalIndex(3,ptbin)] || ptPi < fCutsRD[GetGlobalIndex(4,ptbin)]) okD0 = 0;
543 if(aptK < fCutsRD[GetGlobalIndex(3,aptbin)] || aptPi < fCutsRD[GetGlobalIndex(4,aptbin)]) okD0bar = 0;
544 if(!okD0 && !okD0bar) returnvalueCuts=0;
547 if(TMath::Abs(impactKa) > fCutsRD[GetGlobalIndex(5,ptbin)] ||
548 TMath::Abs(impactPi) > fCutsRD[GetGlobalIndex(6,ptbin)]) okD0 = 0;
550 if(TMath::Abs(aimpactKa) > fCutsRD[GetGlobalIndex(5,aptbin)] ||
551 TMath::Abs(aimpactPi) > fCutsRD[GetGlobalIndex(6,aptbin)]) okD0bar = 0;
553 if(!okD0 && !okD0bar) returnvalueCuts=0;
555 // for the moment via the standard method due to bug in AliKF
556 if(d->GetDCA() > fCutsRD[GetGlobalIndex(1,ptbin)]) okD0 = 0;
557 if(d->GetDCA() > fCutsRD[GetGlobalIndex(1,aptbin)]) okD0bar = 0;
558 if(!okD0 && !okD0bar) returnvalueCuts=0;
561 if(TMath::Abs(d0mass-massvtx) > fCutsRD[GetGlobalIndex(0,ptbin)]) okD0 = 0;
562 if(TMath::Abs(ad0mass-massvtx) > fCutsRD[GetGlobalIndex(0,aptbin)]) okD0bar = 0;
563 if(!okD0 && !okD0bar) returnvalueCuts=0;
566 if(TMath::Abs(cts) > fCutsRD[GetGlobalIndex(2,ptbin)]) okD0 = 0;
567 if(TMath::Abs(acts) > fCutsRD[GetGlobalIndex(2,aptbin)]) okD0bar = 0;
568 if(!okD0 && !okD0bar) returnvalueCuts=0;
570 if(prodParam > fCutsRD[GetGlobalIndex(7,ptbin)]) okD0 = 0;
571 if(aprodParam > fCutsRD[GetGlobalIndex(7,aptbin)]) okD0bar = 0;
572 if(!okD0 && !okD0bar) returnvalueCuts=0;
574 if(cosP < fCutsRD[GetGlobalIndex(8,ptbin)]) okD0 = 0;
575 if(acosP < fCutsRD[GetGlobalIndex(8,aptbin)]) okD0bar = 0;
576 if(!okD0 && !okD0bar) returnvalueCuts=0;
578 if(chi2D0 > fCutsRD[GetGlobalIndex(10,ptbin)]) okD0 = 0;
579 if(achi2D0 > fCutsRD[GetGlobalIndex(10,aptbin)]) okD0bar = 0;
580 if(!okD0 && !okD0bar) returnvalueCuts=0;
582 if(decayLengthD0 < fCutsRD[GetGlobalIndex(9,ptbin)]) okD0 = 0;
583 if(adecayLengthD0 < fCutsRD[GetGlobalIndex(9,aptbin)]) okD0bar = 0;
584 if(!okD0 && !okD0bar) returnvalueCuts=0;
586 if(returnvalueCuts!=0) {
587 if(okD0) returnvalueCuts=1; //cuts passed as D0
588 if(okD0bar) returnvalueCuts=2; //cuts passed as D0bar
589 if(okD0 && okD0bar) returnvalueCuts=3; //cuts passed as D0 and D0bar
592 return returnvalueCuts;
595 //---------------------------------------------------------------------------
597 Bool_t AliRDHFCutsD0toKpi::IsInFiducialAcceptance(Double_t pt, Double_t y) const
600 // Checking if D0 is in fiducial acceptance region
604 // applying cut for pt > 5 GeV
605 AliDebug(2,Form("pt of D0 = %f (> 5), cutting at |y| < 0.8\n",pt));
606 if (TMath::Abs(y) > 0.8){
610 // appliying smooth cut for pt < 5 GeV
611 Double_t maxFiducialY = -0.2/15*pt*pt+1.9/15*pt+0.5;
612 Double_t minFiducialY = 0.2/15*pt*pt-1.9/15*pt-0.5;
613 AliDebug(2,Form("pt of D0 = %f (< 5), cutting according to the fiducial zone [%f, %f]\n",pt,minFiducialY,maxFiducialY));
614 if (y < minFiducialY || y > maxFiducialY){
621 //---------------------------------------------------------------------------
622 Int_t AliRDHFCutsD0toKpi::IsSelectedPID(AliAODRecoDecayHF* d)
624 // ############################################################
626 // Apply PID selection
629 // ############################################################
631 if(!fUsePID) return 3;
632 if(fDefaultPID) return IsSelectedPIDdefault(d);
634 Int_t isD0D0barPID[2]={1,2};
635 Int_t combinedPID[2][2];// CONVENTION: [daught][isK,IsPi]; [0][0]=(prong 1, isK)=value [0][1]=(prong 1, isPi)=value;
637 // values convention -1 = discarded
638 // 0 = not identified (but compatible) || No PID (->hasPID flag)
640 // PID search: pion (TPC) or not K (TOF), Kaon hypothesis for both
641 // Initial hypothesis: unknwon (but compatible)
642 combinedPID[0][0]=0; // prima figlia, Kaon
643 combinedPID[0][1]=0; // prima figlia, pione
644 combinedPID[1][0]=0; // seconda figlia, Kaon
645 combinedPID[1][1]=0; // seconda figlia, pion
647 Bool_t checkPIDInfo[2]={kTRUE,kTRUE};
648 Double_t sigma_tmp[3]={fPidHF->GetSigma(0),fPidHF->GetSigma(1),fPidHF->GetSigma(2)};
649 for(Int_t daught=0;daught<2;daught++){
651 AliAODTrack *aodtrack=(AliAODTrack*)d->GetDaughter(daught);
653 if(!(fPidHF->CheckStatus(aodtrack,"TPC")) && !(fPidHF->CheckStatus(aodtrack,"TOF"))) {
654 checkPIDInfo[daught]=kFALSE;
659 combinedPID[daught][0]=fPidHF->MakeRawPid(aodtrack,3);
663 if(!(fPidHF->CheckStatus(aodtrack,"TPC"))) {
664 combinedPID[daught][1]=0;
666 fPidHF->SetTOF(kFALSE);
667 combinedPID[daught][1]=fPidHF->MakeRawPid(aodtrack,2);
668 fPidHF->SetTOF(kTRUE);
669 fPidHF->SetCompat(kTRUE);
673 if(combinedPID[daught][0]<=-1&&combinedPID[daught][1]<=-1){ // if not a K- and not a pi- both D0 and D0bar excluded
677 else if(combinedPID[daught][0]==2&&combinedPID[daught][1]>=1){
678 if(aodtrack->Charge()==-1)isD0D0barPID[1]=0;//if K- D0bar excluded
679 else isD0D0barPID[0]=0;// if K+ D0 excluded
681 else if(combinedPID[daught][0]==1&&combinedPID[daught][1]>=1){
685 else if(combinedPID[daught][0]>=1||combinedPID[daught][1]<=-1){
686 if(aodtrack->Charge()==-1)isD0D0barPID[1]=0;// not a D0bar if K- or if pi- excluded
687 else isD0D0barPID[0]=0;// not a D0 if K+ or if pi+ excluded
689 else if(combinedPID[daught][0]<=-1||combinedPID[daught][1]>=1){
690 if(aodtrack->Charge()==-1)isD0D0barPID[0]=0;// not a D0 if pi- or if K- excluded
691 else isD0D0barPID[1]=0;// not a D0bar if pi+ or if K+ excluded
694 if(fLowPt && d->Pt()<2.){
695 Double_t sigmaTPC[3]={3.,2.,0.};
696 fPidHF->SetSigmaForTPC(sigmaTPC);
698 combinedPID[daught][0]=fPidHF->MakeRawPid(aodtrack,3);
700 Double_t ptProng=aodtrack->P();
703 fPidHF->SetCompat(kFALSE);
704 combinedPID[daught][0]=fPidHF->MakeRawPid(aodtrack,3);
705 fPidHF->SetCompat(kTRUE);
708 if(!(fPidHF->CheckStatus(aodtrack,"TPC"))) {
709 combinedPID[daught][1]=0;
711 fPidHF->SetTOF(kFALSE);
712 Double_t sigmaTPCpi[3]={3.,3.,0.};
713 fPidHF->SetSigmaForTPC(sigmaTPCpi);
714 combinedPID[daught][1]=fPidHF->MakeRawPid(aodtrack,2);
715 fPidHF->SetTOF(kTRUE);
717 Bool_t isTPCpion=fPidHF->IsPionRaw(aodtrack,"TPC");
719 combinedPID[daught][1]=1;
721 combinedPID[daught][1]=-1;
727 fPidHF->SetSigmaForTPC(sigma_tmp);
728 }// END OF LOOP ON DAUGHTERS
730 if(!checkPIDInfo[0] && !checkPIDInfo[1]) {
731 if(fLowPt) fPidHF->SetSigmaForTPC(sigma_tmp);
736 // FURTHER PID REQUEST (both daughter info is needed)
737 if(combinedPID[0][0]<=-1&&combinedPID[1][0]<=-1){
738 fWhyRejection=31;// reject cases in which no kaon-compatible tracks are found
739 if(fLowPt) fPidHF->SetSigmaForTPC(sigma_tmp);
744 if(fLowPt) fPidHF->SetSigmaForTPC(sigma_tmp);
745 if(combinedPID[0][0]<=0&&combinedPID[1][0]<=0){
746 fWhyRejection=32;// reject cases where the Kaon is not identified
750 if(fLowPt) fPidHF->SetSigmaForTPC(sigma_tmp);
752 // cout<<"Why? "<<fWhyRejection<<endl;
753 return isD0D0barPID[0]+isD0D0barPID[1];
755 //---------------------------------------------------------------------------
756 Int_t AliRDHFCutsD0toKpi::IsSelectedPIDdefault(AliAODRecoDecayHF* d)
758 // ############################################################
760 // Apply PID selection
763 // temporary selection: PID AS USED FOR D0 by Andrea Rossi (up to 28/06/2010)
765 // d must be a AliAODRecoDecayHF2Prong object
766 // returns 0 if both D0 and D0bar are rejectecd
767 // 1 if D0 is accepted while D0bar is rejected
768 // 2 if D0bar is accepted while D0 is rejected
769 // 3 if both are accepted
770 // fWhyRejection variable (not returned for the moment, print it if needed)
771 // keeps some information on why a candidate has been
772 // rejected according to the following (unfriendly?) scheme
773 // if more rejection cases are considered interesting, just add numbers
775 // TO BE CONSIDERED WITH A GRAIN OF SALT (the order in which cut are applied is relevant)
776 // from 20 to 30: "detector" selection (PID acceptance)
779 // 28: no (TOF||TPC) pid information (no kTOFpid,kTOFout,kTIME,kTPCpid,...)
781 // from 30 to 40: PID selection
782 // 31: no Kaon compatible tracks found between daughters
783 // 32: no Kaon identified tracks found (strong sel. at low momenta)
784 // 33: both mass hypotheses are rejected
786 // ############################################################
788 if(!fUsePID) return 3;
790 Int_t isD0D0barPID[2]={1,2};
791 Double_t nsigmaTPCpi=-1., nsigmaTPCK=-1.; //used for TPC pid
792 Double_t tofSig,times[5];// used fot TOF pid
793 Int_t hasPID[2]={2,2};// flag to count how many detectors give PID info for the daughters
794 Int_t isKaonPionTOF[2][2],isKaonPionTPC[2][2];
795 Int_t combinedPID[2][2];// CONVENTION: [daught][isK,IsPi]; [0][0]=(prong 1, isK)=value [0][1]=(prong 1, isPi)=value;
797 // values convention -1 = discarded
798 // 0 = not identified (but compatible) || No PID (->hasPID flag)
800 // PID search: pion (TPC) or not K (TOF), Kaon hypothesis for both
801 // Initial hypothesis: unknwon (but compatible)
802 isKaonPionTOF[0][0]=0;
803 isKaonPionTOF[0][1]=0;
804 isKaonPionTOF[1][0]=0;
805 isKaonPionTOF[1][1]=0;
807 isKaonPionTPC[0][0]=0;
808 isKaonPionTPC[0][1]=0;
809 isKaonPionTPC[1][0]=0;
810 isKaonPionTPC[1][1]=0;
819 for(Int_t daught=0;daught<2;daught++){
822 // ########### Step 0- CHECKING minimal PID "ACCEPTANCE" ####################
824 AliAODTrack *aodtrack=(AliAODTrack*)d->GetDaughter(daught);
826 if(!(aodtrack->GetStatus()&AliESDtrack::kTPCrefit)){
830 if(!(aodtrack->GetStatus()&AliESDtrack::kITSrefit)){
835 AliAODPid *pid=aodtrack->GetDetPid();
842 // ########### Step 1- Check of TPC and TOF response ####################
844 Double_t ptrack=aodtrack->P();
845 //#################### TPC PID #######################
846 if (!(aodtrack->GetStatus()&AliESDtrack::kTPCpid )){
847 // NO TPC PID INFO FOR THIS TRACK
851 static AliTPCPIDResponse theTPCpid;
852 AliAODPid *pidObj = aodtrack->GetDetPid();
853 Double_t ptProng=pidObj->GetTPCmomentum();
854 nsigmaTPCpi = theTPCpid.GetNumberOfSigmas(ptProng,(Float_t)pid->GetTPCsignal(),(Int_t)aodtrack->GetTPCClusterMap().CountBits(),AliPID::kPion);
855 nsigmaTPCK = theTPCpid.GetNumberOfSigmas(ptProng,(Float_t)pid->GetTPCsignal(),(Int_t)aodtrack->GetTPCClusterMap().CountBits(),AliPID::kKaon);
858 if(TMath::Abs(nsigmaTPCK)<2.)isKaonPionTPC[daught][0]=1;
859 else if(TMath::Abs(nsigmaTPCK)>3.)isKaonPionTPC[daught][0]=-1;
860 if(TMath::Abs(nsigmaTPCpi)<2.)isKaonPionTPC[daught][1]=1;
861 else if(TMath::Abs(nsigmaTPCpi)>3.)isKaonPionTPC[daught][1]=-1;
863 //else if(ptrack<.8){
865 if(TMath::Abs(nsigmaTPCK)<1.)isKaonPionTPC[daught][0]=1;
866 else if(TMath::Abs(nsigmaTPCK)>3.)isKaonPionTPC[daught][0]=-1;
867 if(TMath::Abs(nsigmaTPCpi)<1.)isKaonPionTPC[daught][1]=1;
868 else if(TMath::Abs(nsigmaTPCpi)>3.)isKaonPionTPC[daught][1]=-1;
871 // if(nsigmaTPCK>-2.&&nsigmaTPCK<1.)isKaonPionTPC[daught][0]=1;
872 if(TMath::Abs(nsigmaTPCK)>3.)isKaonPionTPC[daught][0]=-1;
873 //if(nsigmaTPCpi>-1.&&nsigmaTPCpi<2.)isKaonPionTPC[daught][1]=1;
874 if(TMath::Abs(nsigmaTPCpi)>3.)isKaonPionTPC[daught][1]=-1;
879 // ##### TOF PID: do not ask nothing for pion/protons ############
880 if(!((aodtrack->GetStatus()&AliESDtrack::kTOFpid)&&(aodtrack->GetStatus()&AliESDtrack::kTOFout)&&(aodtrack->GetStatus()&AliESDtrack::kTIME))){
881 // NO TOF PID INFO FOR THIS TRACK
885 tofSig=pid->GetTOFsignal();
886 pid->GetIntegratedTimes(times);
887 if((tofSig-times[3])>5.*160.)return 0;// PROTON REJECTION
888 if(TMath::Abs(tofSig-times[3])>3.*160.){
889 isKaonPionTOF[daught][0]=-1;
893 isKaonPionTOF[daught][0]=1;
898 //######### Step 2: COMBINE TOF and TPC PID ###############
899 // we apply the following convention: if TPC and TOF disagree (discarded Vs identified) -> unknown
900 combinedPID[daught][0]=isKaonPionTOF[daught][0]+isKaonPionTPC[daught][0];
901 combinedPID[daught][1]=isKaonPionTOF[daught][1]+isKaonPionTPC[daught][1];
904 //######### Step 3: USE PID INFO
906 if(combinedPID[daught][0]<=-1&&combinedPID[daught][1]<=-1){// if not a K- and not a pi- both D0 and D0bar excluded
910 else if(combinedPID[daught][0]==2&&combinedPID[daught][1]>=1){// if in conflict (both pi- and K-), if k for both TPC and TOF -> is K
911 if(aodtrack->Charge()==-1)isD0D0barPID[1]=0;//if K- D0bar excluded
912 else isD0D0barPID[0]=0;// if K+ D0 excluded
914 else if(combinedPID[daught][0]==1&&combinedPID[daught][1]>=1){// if in conflict (both pi- and K-) and k- only for TPC or TOF -> reject
918 else if(combinedPID[daught][0]>=1||combinedPID[daught][1]<=-1){
919 if(aodtrack->Charge()==-1)isD0D0barPID[1]=0;// not a D0bar if K- or if pi- excluded
920 else isD0D0barPID[0]=0;// not a D0 if K+ or if pi+ excluded
922 else if(combinedPID[daught][0]<=-1||combinedPID[daught][1]>=1){
923 if(aodtrack->Charge()==-1)isD0D0barPID[0]=0;// not a D0 if pi- or if K- excluded
924 else isD0D0barPID[1]=0;// not a D0bar if pi+ or if K+ excluded
927 // ########## ALSO DIFFERENT TPC PID REQUEST FOR LOW pt D0: request of K identification ###############################
928 // ########## more tolerant criteria for single particle ID-> more selective criteria for D0 ##############################
929 // ############### NOT OPTIMIZED YET ###################################
931 isKaonPionTPC[daught][0]=0;
932 isKaonPionTPC[daught][1]=0;
933 AliAODPid *pidObj = aodtrack->GetDetPid();
934 Double_t ptProng=pidObj->GetTPCmomentum();
937 if(TMath::Abs(nsigmaTPCK)<3.)isKaonPionTPC[daught][0]=1;
938 else if(TMath::Abs(nsigmaTPCK)>3.)isKaonPionTPC[daught][0]=-1;
939 if(TMath::Abs(nsigmaTPCpi)<3.)isKaonPionTPC[daught][1]=1;
940 else if(TMath::Abs(nsigmaTPCpi)>3.)isKaonPionTPC[daught][1]=-1;
942 //else if(ptrack<.8){
944 if(TMath::Abs(nsigmaTPCK)<2.)isKaonPionTPC[daught][0]=1;
945 else if(TMath::Abs(nsigmaTPCK)>3.)isKaonPionTPC[daught][0]=-1;
946 if(TMath::Abs(nsigmaTPCpi)<3.)isKaonPionTPC[daught][1]=1;
947 else if(TMath::Abs(nsigmaTPCpi)>3.)isKaonPionTPC[daught][1]=-1;
950 if(TMath::Abs(nsigmaTPCK)>3.)isKaonPionTPC[daught][0]=-1;
951 if(TMath::Abs(nsigmaTPCpi)>3.)isKaonPionTPC[daught][1]=-1;
955 }// END OF LOOP ON DAUGHTERS
957 // FURTHER PID REQUEST (both daughter info is needed)
958 if(combinedPID[0][0]<=-1&&combinedPID[1][0]<=-1){
959 fWhyRejection=31;// reject cases in which no kaon-compatible tracks are found
962 else if(hasPID[0]==0&&hasPID[1]==0){
963 fWhyRejection=28;// reject cases in which no PID info is available
967 // request of K identification at low D0 pt
973 combinedPID[0][0]=isKaonPionTOF[0][0]+isKaonPionTPC[0][0];
974 combinedPID[0][1]=isKaonPionTOF[0][1]+isKaonPionTPC[0][1];
975 combinedPID[1][0]=isKaonPionTOF[1][0]+isKaonPionTPC[1][0];
976 combinedPID[1][1]=isKaonPionTOF[1][1]+isKaonPionTPC[1][1];
978 if(combinedPID[0][0]<=0&&combinedPID[1][0]<=0){
979 fWhyRejection=32;// reject cases where the Kaon is not identified
984 // cout<<"Why? "<<fWhyRejection<<endl;
985 return isD0D0barPID[0]+isD0D0barPID[1];
990 //---------------------------------------------------------------------------
991 Int_t AliRDHFCutsD0toKpi::CombineSelectionLevels(Int_t selectionvalTrack,
992 Int_t selectionvalCand,
993 Int_t selectionvalPID) const
996 // This method combines the tracks, PID and cuts selection results
998 if(selectionvalTrack==0) return 0;
1002 switch(selectionvalPID) {
1007 returnvalue=((selectionvalCand==1 || selectionvalCand==3) ? 1 : 0);
1010 returnvalue=((selectionvalCand==2 || selectionvalCand==3) ? 2 : 0);
1013 returnvalue=selectionvalCand;
1022 //----------------------------------------------------------------------------
1023 Int_t AliRDHFCutsD0toKpi::IsSelectedSpecialCuts(AliAODRecoDecayHF *d) const
1026 // Note: this method is temporary
1027 // Additional cuts on decay lenght and lower cut for d0 norm are applied using vertex without candidate's daughters
1032 Float_t normDecLengthCut=1.,decLengthCut=TMath::Min(d->P()*0.0066+0.01,0.06/*cm*/), normd0Cut=0.5;
1033 // "decay length" expo law with tau' = beta*gamma*ctau= p/m*ctau =p*0.0123/1.864~p*0.0066
1034 // decay lenght > ctau' implies to retain (1-1/e) (for signal without considering detector resolution),
1036 Int_t returnvalue=3; //cut passed
1037 for(Int_t i=0;i<2/*prongs*/;i++){
1038 if(TMath::Abs(d->Normalizedd0Prong(i))<normd0Cut) return 0; //normd0Cut not passed
1040 if(d->DecayLength()<decLengthCut) return 0; //decLengthCut not passed
1041 if(d->NormalizedDecayLength()<normDecLengthCut) return 0; //decLengthCut not passed
1047 //----------------------------------------------
1048 void AliRDHFCutsD0toKpi::SetUseKF(Bool_t useKF)
1050 //switch on candidate selection via AliKFparticle
1056 TString varNamesKF[11]={"inv. mass [GeV]",
1067 Bool_t isUpperCutKF[11]={kTRUE,
1078 SetVarNames(nvarsKF,varNamesKF,isUpperCutKF);
1080 Bool_t forOpt[11]={kFALSE,
1091 SetVarsForOpt(4,forOpt);
1097 void AliRDHFCutsD0toKpi::SetStandardCutsPP2010() {
1099 //STANDARD CUTS USED FOR 2010 pp analysis
1100 //dca cut will be enlarged soon to 400 micron
1103 SetName("D0toKpiCutsStandard");
1104 SetTitle("Standard Cuts for D0 analysis");
1106 // PILE UP REJECTION
1107 SetOptPileup(AliRDHFCuts::kRejectPileupEvent);
1113 // TRACKS ON SINGLE TRACKS
1114 AliESDtrackCuts *esdTrackCuts = new AliESDtrackCuts("AliESDtrackCuts","default");
1115 esdTrackCuts->SetRequireSigmaToVertex(kFALSE);
1116 esdTrackCuts->SetRequireTPCRefit(kTRUE);
1117 esdTrackCuts->SetRequireITSRefit(kTRUE);
1118 // esdTrackCuts->SetMinNClustersITS(4);
1119 esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,AliESDtrackCuts::kAny);
1120 esdTrackCuts->SetMinDCAToVertexXY(0.);
1121 esdTrackCuts->SetEtaRange(-0.8,0.8);
1122 esdTrackCuts->SetPtRange(0.3,1.e10);
1124 AddTrackCuts(esdTrackCuts);
1126 const Int_t nptbins =13;
1127 const Double_t ptmax = 9999.;
1128 const Int_t nvars=9;
1129 Float_t ptbins[nptbins+1];
1145 SetGlobalIndex(nvars,nptbins);
1146 SetPtBins(nptbins+1,ptbins);
1148 Float_t cutsMatrixD0toKpiStand[nptbins][nvars]={{0.400,300.*1E-4,0.8,0.3,0.3,1000.*1E-4,1000.*1E-4,-35000.*1E-8,0.73},/* pt<0.5*/
1149 {0.400,300.*1E-4,0.8,0.3,0.3,1000.*1E-4,1000.*1E-4,-35000.*1E-8,0.73},/* 0.5<pt<1*/
1150 {0.400,200.*1E-4,0.8,0.4,0.4,1000.*1E-4,1000.*1E-4,-25000.*1E-8,0.75},/* 1<pt<2 */
1151 {0.400,200.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,-15000.*1E-8,0.8},/* 2<pt<3 */
1152 {0.400,200.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,-8000.*1E-8,0.85},/* 3<pt<4 */
1153 {0.400,200.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,-8000.*1E-8,0.85},/* 4<pt<5 */
1154 {0.400,150.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,-8000.*1E-8,0.85},/* 5<pt<6 */
1155 {0.400,150.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,-8000.*1E-8,0.85},/* 6<pt<8 */
1156 {0.400,150.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,-5000.*1E-8,0.85},/* 8<pt<12 */
1157 {0.400,150.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,-0.*1E-8,0.85},/* 12<pt<16 */
1158 {0.400,150.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,0.*1E-8,0.85},/* 16<pt<20 */
1159 {0.400,150.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,0.*1E-8,0.85},/* 20<pt<24 */
1160 {0.400,150.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,0.*1E-8,0.85}};/* pt>24 */
1163 //CREATE TRANSPOSE MATRIX...REVERSE INDICES as required by AliRDHFCuts
1164 Float_t **cutsMatrixTransposeStand=new Float_t*[nvars];
1165 for(Int_t iv=0;iv<nvars;iv++)cutsMatrixTransposeStand[iv]=new Float_t[nptbins];
1167 for (Int_t ibin=0;ibin<nptbins;ibin++){
1168 for (Int_t ivar = 0; ivar<nvars; ivar++){
1169 cutsMatrixTransposeStand[ivar][ibin]=cutsMatrixD0toKpiStand[ibin][ivar];
1173 SetCuts(nvars,nptbins,cutsMatrixTransposeStand);
1174 SetUseSpecialCuts(kTRUE);
1175 SetRemoveDaughtersFromPrim(kTRUE);
1178 AliAODPidHF* pidObj=new AliAODPidHF();
1179 //pidObj->SetName("pid4D0");
1181 const Int_t nlims=2;
1182 Double_t plims[nlims]={0.6,0.8}; //TPC limits in momentum [GeV/c]
1183 Bool_t compat=kTRUE; //effective only for this mode
1185 Double_t sigmas[5]={2.,1.,0.,3.,0.}; //to be checked and to be modified with new implementation of setters by Rossella
1186 pidObj->SetAsym(asym);// if you want to use the asymmetric bands in TPC
1187 pidObj->SetMatch(mode);
1188 pidObj->SetPLimit(plims,nlims);
1189 pidObj->SetSigma(sigmas);
1190 pidObj->SetCompat(compat);
1191 pidObj->SetTPC(kTRUE);
1192 pidObj->SetTOF(kTRUE);
1196 SetUseDefaultPID(kFALSE);
1206 void AliRDHFCutsD0toKpi::SetStandardCutsPbPb2010() {
1208 //PRELIMINARY CUTS USED FOR 2010 PbPb analysis
1212 SetName("D0toKpiCutsStandard");
1213 SetTitle("Standard Cuts for D0 analysis in PbPb2010 run");
1215 // PILE UP REJECTION
1216 //SetOptPileup(AliRDHFCuts::kRejectPileupEvent);
1222 // TRACKS ON SINGLE TRACKS
1223 AliESDtrackCuts *esdTrackCuts = new AliESDtrackCuts("AliESDtrackCuts","default");
1224 esdTrackCuts->SetRequireSigmaToVertex(kFALSE);
1225 esdTrackCuts->SetRequireTPCRefit(kTRUE);
1226 esdTrackCuts->SetRequireITSRefit(kTRUE);
1227 // esdTrackCuts->SetMinNClustersITS(4);
1228 esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,AliESDtrackCuts::kAny);
1229 esdTrackCuts->SetMinDCAToVertexXY(0.);
1230 esdTrackCuts->SetEtaRange(-0.8,0.8);
1231 esdTrackCuts->SetPtRange(0.3,1.e10);
1233 AddTrackCuts(esdTrackCuts);
1235 const Int_t nptbins =13;
1236 const Double_t ptmax = 9999.;
1237 const Int_t nvars=9;
1238 Float_t ptbins[nptbins+1];
1254 SetGlobalIndex(nvars,nptbins);
1255 SetPtBins(nptbins+1,ptbins);
1257 Float_t cutsMatrixD0toKpiStand[nptbins][nvars]={{0.400,300.*1E-4,0.8,0.3,0.3,1000.*1E-4,1000.*1E-4,-40000.*1E-8,0.8},/* pt<0.5*/
1258 {0.400,300.*1E-4,0.8,0.3,0.3,1000.*1E-4,1000.*1E-4,-40000.*1E-8,0.8},/* 0.5<pt<1*/
1259 {0.400,250.*1E-4,0.8,0.4,0.4,1000.*1E-4,1000.*1E-4,-32000.*1E-8,0.8},/* 1<pt<2 */
1260 {0.400,250.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,-26000.*1E-8,0.94},/* 2<pt<3 */
1261 {0.400,250.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,-1500.*1E-8,0.88},/* 3<pt<4 */
1262 {0.400,250.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,-1500.*1E-8,0.88},/* 4<pt<5 */
1263 {0.400,250.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,-10000.*1E-8,0.90},/* 5<pt<6 */
1264 {0.400,250.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,-10000.*1E-8,0.90},/* 6<pt<8 */
1265 {0.400,250.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,-10000.*1E-8,0.90},/* 8<pt<12 */
1266 {0.400,300.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,-5000.*1E-8,0.90},/* 12<pt<16 */
1267 {0.400,350.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,-5000.*1E-8,0.85},/* 16<pt<20 */
1268 {0.400,350.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,-0.*1E-8,0.85},/* 20<pt<24 */
1269 {0.400,350.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,-0.*1E-8,0.82}};/* pt>24 */
1272 //CREATE TRANSPOSE MATRIX...REVERSE INDICES as required by AliRDHFCuts
1273 Float_t **cutsMatrixTransposeStand=new Float_t*[nvars];
1274 for(Int_t iv=0;iv<nvars;iv++)cutsMatrixTransposeStand[iv]=new Float_t[nptbins];
1276 for (Int_t ibin=0;ibin<nptbins;ibin++){
1277 for (Int_t ivar = 0; ivar<nvars; ivar++){
1278 cutsMatrixTransposeStand[ivar][ibin]=cutsMatrixD0toKpiStand[ibin][ivar];
1282 SetCuts(nvars,nptbins,cutsMatrixTransposeStand);
1283 SetUseSpecialCuts(kTRUE);
1284 SetRemoveDaughtersFromPrim(kFALSE);// THIS IS VERY IMPORTANT! TOO SLOW IN PbPb
1287 AliAODPidHF* pidObj=new AliAODPidHF();
1288 //pidObj->SetName("pid4D0");
1290 const Int_t nlims=2;
1291 Double_t plims[nlims]={0.6,0.8}; //TPC limits in momentum [GeV/c]
1292 Bool_t compat=kTRUE; //effective only for this mode
1294 Double_t sigmas[5]={2.,1.,0.,3.,0.}; //to be checked and to be modified with new implementation of setters by Rossella
1295 pidObj->SetAsym(asym);// if you want to use the asymmetric bands in TPC
1296 pidObj->SetMatch(mode);
1297 pidObj->SetPLimit(plims,nlims);
1298 pidObj->SetSigma(sigmas);
1299 pidObj->SetCompat(compat);
1300 pidObj->SetTPC(kTRUE);
1301 pidObj->SetTOF(kTRUE);
1305 SetUseDefaultPID(kTRUE);// TEMPORARY: PROTON EXCLUSION SET ONLY IN DEFAULT PID