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 **************************************************************************/
18 /////////////////////////////////////////////////////////////
20 // Class for cuts on AOD reconstructed D0->Kpi
22 // Author: A.Dainese, andrea.dainese@pd.infn.it
23 /////////////////////////////////////////////////////////////
25 #include <TDatabasePDG.h>
26 #include <Riostream.h>
28 #include "AliRDHFCutsD0toKpi.h"
29 #include "AliAODRecoDecayHF2Prong.h"
30 #include "AliAODTrack.h"
31 #include "AliESDtrack.h"
32 #include "AliAODPid.h"
33 #include "AliTPCPIDResponse.h"
34 #include "AliAODVertex.h"
35 #include "AliKFVertex.h"
36 #include "AliKFParticle.h"
38 ClassImp(AliRDHFCutsD0toKpi)
40 //--------------------------------------------------------------------------
41 AliRDHFCutsD0toKpi::AliRDHFCutsD0toKpi(const char* name) :
43 fUseSpecialCuts(kFALSE),
50 // Default Constructor
54 TString varNames[11]={"inv. mass [GeV]",
65 Bool_t isUpperCut[11]={kTRUE,
76 SetVarNames(nvars,varNames,isUpperCut);
77 Bool_t forOpt[11]={kFALSE,
88 SetVarsForOpt(4,forOpt);
89 Float_t limits[2]={0,999999999.};
93 //--------------------------------------------------------------------------
94 AliRDHFCutsD0toKpi::AliRDHFCutsD0toKpi(const AliRDHFCutsD0toKpi &source) :
96 fUseSpecialCuts(source.fUseSpecialCuts),
97 fLowPt(source.fLowPt),
98 fDefaultPID(source.fDefaultPID),
99 fUseKF(source.fUseKF),
100 fPtLowPID(source.fPtLowPID)
107 //--------------------------------------------------------------------------
108 AliRDHFCutsD0toKpi &AliRDHFCutsD0toKpi::operator=(const AliRDHFCutsD0toKpi &source)
111 // assignment operator
113 if(&source == this) return *this;
115 AliRDHFCuts::operator=(source);
116 fUseSpecialCuts=source.fUseSpecialCuts;
117 fLowPt=source.fLowPt;
118 fDefaultPID=source.fDefaultPID;
119 fPtLowPID=source.fPtLowPID;
125 //---------------------------------------------------------------------------
126 void AliRDHFCutsD0toKpi::GetCutVarsForOpt(AliAODRecoDecayHF *d,Float_t *vars,Int_t nvars,Int_t *pdgdaughters,AliAODEvent *aod) {
128 // Fills in vars the values of the variables
131 if(nvars!=fnVarsForOpt) {
132 printf("AliRDHFCutsD0toKpi::GetCutsVarsForOpt: wrong number of variables\n");
136 AliAODRecoDecayHF2Prong *dd = (AliAODRecoDecayHF2Prong*)d;
138 //recalculate vertex w/o daughters
139 Bool_t cleanvtx=kFALSE;
140 AliAODVertex *origownvtx=0x0;
141 if(fRemoveDaughtersFromPrimary) {
142 if(dd->GetOwnPrimaryVtx()) origownvtx=new AliAODVertex(*dd->GetOwnPrimaryVtx());
144 if(!RecalcOwnPrimaryVtx(dd,aod)) {
145 CleanOwnPrimaryVtx(dd,aod,origownvtx);
153 if(TMath::Abs(pdgdaughters[0])==211) {
154 vars[iter]=dd->InvMassD0();
156 vars[iter]=dd->InvMassD0bar();
161 vars[iter]=dd->GetDCA();
165 if(TMath::Abs(pdgdaughters[0])==211) {
166 vars[iter] = dd->CosThetaStarD0();
168 vars[iter] = dd->CosThetaStarD0bar();
173 if(TMath::Abs(pdgdaughters[0])==321) {
174 vars[iter]=dd->PtProng(0);
177 vars[iter]=dd->PtProng(1);
182 if(TMath::Abs(pdgdaughters[0])==211) {
183 vars[iter]=dd->PtProng(0);
186 vars[iter]=dd->PtProng(1);
191 if(TMath::Abs(pdgdaughters[0])==321) {
192 vars[iter]=dd->Getd0Prong(0);
195 vars[iter]=dd->Getd0Prong(1);
200 if(TMath::Abs(pdgdaughters[0])==211) {
201 vars[iter]=dd->Getd0Prong(0);
204 vars[iter]=dd->Getd0Prong(1);
209 vars[iter]= dd->Prodd0d0();
213 vars[iter]=dd->CosPointingAngle();
218 vars[iter]=TMath::Abs(dd->CosPointingAngleXY());
223 vars[iter]=dd->NormalizedDecayLengthXY();
226 if(cleanvtx)CleanOwnPrimaryVtx(dd,aod,origownvtx);
230 //---------------------------------------------------------------------------
231 Int_t AliRDHFCutsD0toKpi::IsSelected(TObject* obj,Int_t selectionLevel,AliAODEvent* aod) {
241 cout<<"Cut matrice not inizialized. Exit..."<<endl;
245 AliAODRecoDecayHF2Prong* d=(AliAODRecoDecayHF2Prong*)obj;
248 cout<<"AliAODRecoDecayHF2Prong null"<<endl;
252 if(fKeepSignalMC) if(IsSignalMC(d,aod,421)) return 3;
254 Double_t ptD=d->Pt();
255 if(ptD<fMinPtCand) return 0;
256 if(ptD>fMaxPtCand) return 0;
258 if(d->HasBadDaughters()) return 0;
260 // returnvalue: 0 not sel, 1 only D0, 2 only D0bar, 3 both
261 Int_t returnvaluePID=3;
262 Int_t returnvalueCuts=3;
264 // selection on candidate
265 if(selectionLevel==AliRDHFCuts::kAll ||
266 selectionLevel==AliRDHFCuts::kCandidate) {
270 //recalculate vertex w/o daughters
271 AliAODVertex *origownvtx=0x0;
272 if(fRemoveDaughtersFromPrimary && !fUseMCVertex) {
273 if(d->GetOwnPrimaryVtx()) origownvtx=new AliAODVertex(*d->GetOwnPrimaryVtx());
274 if(!RecalcOwnPrimaryVtx(d,aod)) {
275 CleanOwnPrimaryVtx(d,aod,origownvtx);
281 if(d->GetOwnPrimaryVtx()) origownvtx=new AliAODVertex(*d->GetOwnPrimaryVtx());
282 if(!SetMCPrimaryVtx(d,aod)) {
283 CleanOwnPrimaryVtx(d,aod,origownvtx);
290 Int_t okD0=0,okD0bar=0;
292 Int_t ptbin=PtBin(pt);
294 CleanOwnPrimaryVtx(d,aod,origownvtx);
298 Double_t mD0,mD0bar,ctsD0,ctsD0bar;
301 Double_t mD0PDG = TDatabasePDG::Instance()->GetParticle(421)->Mass();
303 d->InvMassD0(mD0,mD0bar);
304 if(TMath::Abs(mD0-mD0PDG) > fCutsRD[GetGlobalIndex(0,ptbin)]) okD0 = 0;
305 if(TMath::Abs(mD0bar-mD0PDG) > fCutsRD[GetGlobalIndex(0,ptbin)]) okD0bar = 0;
306 if(!okD0 && !okD0bar) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
308 if(d->Prodd0d0() > fCutsRD[GetGlobalIndex(7,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
311 if(d->Pt2Prong(1) < fCutsRD[GetGlobalIndex(3,ptbin)]*fCutsRD[GetGlobalIndex(3,ptbin)] || d->Pt2Prong(0) < fCutsRD[GetGlobalIndex(4,ptbin)]*fCutsRD[GetGlobalIndex(4,ptbin)]) okD0 = 0;
312 if(d->Pt2Prong(0) < fCutsRD[GetGlobalIndex(3,ptbin)]*fCutsRD[GetGlobalIndex(3,ptbin)] || d->Pt2Prong(1) < fCutsRD[GetGlobalIndex(4,ptbin)]*fCutsRD[GetGlobalIndex(4,ptbin)]) okD0bar = 0;
313 if(!okD0 && !okD0bar) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
316 if(TMath::Abs(d->Getd0Prong(1)) > fCutsRD[GetGlobalIndex(5,ptbin)] ||
317 TMath::Abs(d->Getd0Prong(0)) > fCutsRD[GetGlobalIndex(6,ptbin)]) okD0 = 0;
318 if(TMath::Abs(d->Getd0Prong(0)) > fCutsRD[GetGlobalIndex(6,ptbin)] ||
319 TMath::Abs(d->Getd0Prong(1)) > fCutsRD[GetGlobalIndex(5,ptbin)]) okD0bar = 0;
320 if(!okD0 && !okD0bar) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
322 if(d->GetDCA() > fCutsRD[GetGlobalIndex(1,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
325 d->CosThetaStarD0(ctsD0,ctsD0bar);
326 if(TMath::Abs(ctsD0) > fCutsRD[GetGlobalIndex(2,ptbin)]) okD0 = 0;
327 if(TMath::Abs(ctsD0bar) > fCutsRD[GetGlobalIndex(2,ptbin)]) okD0bar = 0;
328 if(!okD0 && !okD0bar) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
330 if(d->CosPointingAngle() < fCutsRD[GetGlobalIndex(8,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
333 if(TMath::Abs(d->CosPointingAngleXY()) < fCutsRD[GetGlobalIndex(9,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
335 Double_t normalDecayLengXY=d->NormalizedDecayLengthXY();
336 if (normalDecayLengXY < fCutsRD[GetGlobalIndex(10, ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
338 if (returnvalueCuts!=0) {
339 if (okD0) returnvalueCuts=1; //cuts passed as D0
340 if (okD0bar) returnvalueCuts=2; //cuts passed as D0bar
341 if (okD0 && okD0bar) returnvalueCuts=3; //cuts passed as D0 and D0bar
346 if(fUseSpecialCuts) special=IsSelectedSpecialCuts(d);
347 if(!special) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
349 // unset recalculated primary vertex when not needed any more
350 CleanOwnPrimaryVtx(d,aod,origownvtx);
353 // go to selection with Kalman vertexing, if requested
354 returnvalueCuts = IsSelectedKF(d,aod);
357 fIsSelectedCuts=returnvalueCuts;
358 if(!returnvalueCuts) return 0;
363 if(selectionLevel==AliRDHFCuts::kAll ||
364 selectionLevel==AliRDHFCuts::kCandidate ||
365 selectionLevel==AliRDHFCuts::kPID) {
366 returnvaluePID = IsSelectedPID(d);
367 fIsSelectedPID=returnvaluePID;
368 if(!returnvaluePID) return 0;
371 Int_t returnvalueComb=CombineSelectionLevels(3,returnvalueCuts,returnvaluePID);
373 if(!returnvalueComb) return 0;
375 // selection on daughter tracks
376 if(selectionLevel==AliRDHFCuts::kAll ||
377 selectionLevel==AliRDHFCuts::kTracks) {
378 if(!AreDaughtersSelected(d)) return 0;
381 // cout<<"Pid = "<<returnvaluePID<<endl;
382 return returnvalueComb;
385 //------------------------------------------------------------------------------------------
386 Int_t AliRDHFCutsD0toKpi::IsSelectedKF(AliAODRecoDecayHF2Prong *d,
387 AliAODEvent* aod) const {
389 // Apply selection using KF-vertexing
392 AliAODTrack *track0 = (AliAODTrack*)d->GetDaughter(0);
393 AliAODTrack *track1 = (AliAODTrack*)d->GetDaughter(1);
395 if(!track0 || !track1) {
396 cout<<"one or two D0 daughters missing!"<<endl;
400 // returnvalue: 0 not sel, 1 only D0, 2 only D0bar, 3 both
401 Int_t returnvalueCuts=3;
403 // candidate selection with AliKF
404 AliKFParticle::SetField(aod->GetMagneticField()); // set the magnetic field
406 Int_t okD0=0,okD0bar=0;
409 // convert tracks into AliKFParticles
411 AliKFParticle negPiKF(*track1,-211); // neg pion kandidate
412 AliKFParticle negKKF(*track1,-321); // neg kaon kandidate
413 AliKFParticle posPiKF(*track0,211); // pos pion kandidate
414 AliKFParticle posKKF(*track0,321); // pos kaon kandidate
416 // build D0 candidates
418 AliKFParticle d0c(negKKF,posPiKF); // D0 candidate
419 AliKFParticle ad0c(posKKF,negPiKF); // D0bar candidate
421 // create kf primary vertices
423 AliAODVertex *vtx1 = aod->GetPrimaryVertex();
424 AliKFVertex primVtx(*vtx1);
425 AliKFVertex aprimVtx(*vtx1);
427 if(primVtx.GetNContributors()<=0) okD0 = 0;
428 if(aprimVtx.GetNContributors()<=0) okD0bar = 0;
429 if(!okD0 && !okD0bar) returnvalueCuts=0;
433 Double_t d0mass = d0c.GetMass();
434 Double_t ad0mass = ad0c.GetMass();
436 // calculate P of D0 and D0bar
437 Double_t d0P = d0c.GetP();
438 Double_t d0Px = d0c.GetPx();
439 Double_t d0Py = d0c.GetPy();
440 Double_t d0Pz = d0c.GetPz();
441 Double_t ad0P = ad0c.GetP();
442 Double_t ad0Px = ad0c.GetPx();
443 Double_t ad0Py = ad0c.GetPy();
444 Double_t ad0Pz = ad0c.GetPz();
446 //calculate Pt of D0 and D0bar
448 Double_t pt=d0c.GetPt();
449 Double_t apt=ad0c.GetPt();
451 // remove D0 daughters from primary vertices (if used in vertex fit) and add D0-candidates
453 if(track0->GetUsedForPrimVtxFit()) {
458 if(track1->GetUsedForPrimVtxFit()) {
466 if(primVtx.GetNContributors()<=0) okD0 = 0;
467 if(aprimVtx.GetNContributors()<=0) okD0bar = 0;
468 if(!okD0 && !okD0bar) returnvalueCuts=0;
470 //calculate cut variables
472 // calculate impact params of daughters w.r.t recalculated vertices
474 Double_t impactPi = posPiKF.GetDistanceFromVertexXY(primVtx);
475 Double_t aimpactPi = negPiKF.GetDistanceFromVertexXY(aprimVtx);
476 Double_t impactKa = negKKF.GetDistanceFromVertexXY(primVtx);
477 Double_t aimpactKa = posKKF.GetDistanceFromVertexXY(aprimVtx);
479 // calculate Product of Impact Params
481 Double_t prodParam = impactPi*impactKa;
482 Double_t aprodParam = aimpactPi*aimpactKa;
484 // calculate cosine of pointing angles
486 TVector3 mom(d0c.GetPx(),d0c.GetPy(),d0c.GetPz());
487 TVector3 fline(d0c.GetX()-primVtx.GetX(),
488 d0c.GetY()-primVtx.GetY(),
489 d0c.GetZ()-primVtx.GetZ());
490 Double_t pta = mom.Angle(fline);
491 Double_t cosP = TMath::Cos(pta); // cosine of pta for D0 candidate
493 TVector3 amom(ad0c.GetPx(),ad0c.GetPy(),ad0c.GetPz());
494 TVector3 afline(ad0c.GetX()-aprimVtx.GetX(),
495 ad0c.GetY()-aprimVtx.GetY(),
496 ad0c.GetZ()-aprimVtx.GetZ());
497 Double_t apta = amom.Angle(afline);
498 Double_t acosP = TMath::Cos(apta); // cosine of pta for D0bar candidate
500 // calculate P of Pions at Decay Position of D0 and D0bar candidates
501 negKKF.TransportToParticle(d0c);
502 posPiKF.TransportToParticle(d0c);
503 posKKF.TransportToParticle(ad0c);
504 negPiKF.TransportToParticle(ad0c);
506 Double_t pxPi = posPiKF.GetPx();
507 Double_t pyPi = posPiKF.GetPy();
508 Double_t pzPi = posPiKF.GetPz();
509 Double_t ptPi = posPiKF.GetPt();
511 Double_t apxPi = negPiKF.GetPx();
512 Double_t apyPi = negPiKF.GetPy();
513 Double_t apzPi = negPiKF.GetPz();
514 Double_t aptPi = negPiKF.GetPt();
516 // calculate Pt of Kaons at Decay Position of D0 and D0bar candidates
518 Double_t ptK = negKKF.GetPt();
519 Double_t aptK = posKKF.GetPt();
521 //calculate cos(thetastar)
522 Double_t massvtx = TDatabasePDG::Instance()->GetParticle(421)->Mass();
524 massp[0] = TDatabasePDG::Instance()->GetParticle(321)->Mass();
525 massp[1] = TDatabasePDG::Instance()->GetParticle(211)->Mass();
526 Double_t pStar = TMath::Sqrt(TMath::Power(massvtx*massvtx-massp[0]*massp[0]-massp[1]*massp[1],2.)
527 -4.*massp[0]*massp[0]*massp[1]*massp[1])/(2.*massvtx);
529 // cos(thetastar) for D0 and Pion
531 Double_t d0E = TMath::Sqrt(massvtx*massvtx + d0P*d0P);
532 Double_t beta = d0P/d0E;
533 Double_t gamma = d0E/massvtx;
534 TVector3 momPi(pxPi,pyPi,pzPi);
535 TVector3 momTot(d0Px,d0Py,d0Pz);
536 Double_t q1 = momPi.Dot(momTot)/momTot.Mag();
537 Double_t cts = (q1/gamma-beta*TMath::Sqrt(pStar*pStar+massp[1]*massp[1]))/pStar;
539 // cos(thetastar) for D0bar and Pion
541 Double_t ad0E = TMath::Sqrt(massvtx*massvtx + ad0P*ad0P);
542 Double_t abeta = ad0P/ad0E;
543 Double_t agamma = ad0E/massvtx;
544 TVector3 amomPi(apxPi,apyPi,apzPi);
545 TVector3 amomTot(ad0Px,ad0Py,ad0Pz);
546 Double_t aq1 = amomPi.Dot(amomTot)/amomTot.Mag();
547 Double_t acts = (aq1/agamma-abeta*TMath::Sqrt(pStar*pStar+massp[1]*massp[1]))/pStar;
549 // calculate reduced Chi2 for the full D0 fit
550 d0c.SetProductionVertex(primVtx);
551 ad0c.SetProductionVertex(aprimVtx);
552 negKKF.SetProductionVertex(d0c);
553 posPiKF.SetProductionVertex(d0c);
554 posKKF.SetProductionVertex(ad0c);
555 negPiKF.SetProductionVertex(ad0c);
556 d0c.TransportToProductionVertex();
557 ad0c.TransportToProductionVertex();
559 // calculate the decay length
560 Double_t decayLengthD0 = d0c.GetDecayLength();
561 Double_t adecayLengthD0 = ad0c.GetDecayLength();
563 Double_t chi2D0 = 50.;
564 if(d0c.GetNDF() > 0 && d0c.GetChi2() >= 0) {
565 chi2D0 = d0c.GetChi2()/d0c.GetNDF();
568 Double_t achi2D0 = 50.;
569 if(ad0c.GetNDF() > 0 && ad0c.GetChi2() >= 0) {
570 achi2D0 = ad0c.GetChi2()/ad0c.GetNDF();
574 Int_t ptbin=PtBin(pt);
575 Int_t aptbin=PtBin(apt);
577 if(ptbin < 0) okD0 = 0;
578 if(aptbin < 0) okD0bar = 0;
579 if(!okD0 && !okD0bar) returnvalueCuts=0;
581 if(ptK < fCutsRD[GetGlobalIndex(3,ptbin)] || ptPi < fCutsRD[GetGlobalIndex(4,ptbin)]) okD0 = 0;
582 if(aptK < fCutsRD[GetGlobalIndex(3,aptbin)] || aptPi < fCutsRD[GetGlobalIndex(4,aptbin)]) okD0bar = 0;
583 if(!okD0 && !okD0bar) returnvalueCuts=0;
586 if(TMath::Abs(impactKa) > fCutsRD[GetGlobalIndex(5,ptbin)] ||
587 TMath::Abs(impactPi) > fCutsRD[GetGlobalIndex(6,ptbin)]) okD0 = 0;
589 if(TMath::Abs(aimpactKa) > fCutsRD[GetGlobalIndex(5,aptbin)] ||
590 TMath::Abs(aimpactPi) > fCutsRD[GetGlobalIndex(6,aptbin)]) okD0bar = 0;
592 if(!okD0 && !okD0bar) returnvalueCuts=0;
594 // for the moment via the standard method due to bug in AliKF
595 if(d->GetDCA() > fCutsRD[GetGlobalIndex(1,ptbin)]) okD0 = 0;
596 if(d->GetDCA() > fCutsRD[GetGlobalIndex(1,aptbin)]) okD0bar = 0;
597 if(!okD0 && !okD0bar) returnvalueCuts=0;
600 if(TMath::Abs(d0mass-massvtx) > fCutsRD[GetGlobalIndex(0,ptbin)]) okD0 = 0;
601 if(TMath::Abs(ad0mass-massvtx) > fCutsRD[GetGlobalIndex(0,aptbin)]) okD0bar = 0;
602 if(!okD0 && !okD0bar) returnvalueCuts=0;
605 if(TMath::Abs(cts) > fCutsRD[GetGlobalIndex(2,ptbin)]) okD0 = 0;
606 if(TMath::Abs(acts) > fCutsRD[GetGlobalIndex(2,aptbin)]) okD0bar = 0;
607 if(!okD0 && !okD0bar) returnvalueCuts=0;
609 if(prodParam > fCutsRD[GetGlobalIndex(7,ptbin)]) okD0 = 0;
610 if(aprodParam > fCutsRD[GetGlobalIndex(7,aptbin)]) okD0bar = 0;
611 if(!okD0 && !okD0bar) returnvalueCuts=0;
613 if(cosP < fCutsRD[GetGlobalIndex(8,ptbin)]) okD0 = 0;
614 if(acosP < fCutsRD[GetGlobalIndex(8,aptbin)]) okD0bar = 0;
615 if(!okD0 && !okD0bar) returnvalueCuts=0;
617 if(chi2D0 > fCutsRD[GetGlobalIndex(10,ptbin)]) okD0 = 0;
618 if(achi2D0 > fCutsRD[GetGlobalIndex(10,aptbin)]) okD0bar = 0;
619 if(!okD0 && !okD0bar) returnvalueCuts=0;
621 if(decayLengthD0 < fCutsRD[GetGlobalIndex(9,ptbin)]) okD0 = 0;
622 if(adecayLengthD0 < fCutsRD[GetGlobalIndex(9,aptbin)]) okD0bar = 0;
623 if(!okD0 && !okD0bar) returnvalueCuts=0;
625 if(returnvalueCuts!=0) {
626 if(okD0) returnvalueCuts=1; //cuts passed as D0
627 if(okD0bar) returnvalueCuts=2; //cuts passed as D0bar
628 if(okD0 && okD0bar) returnvalueCuts=3; //cuts passed as D0 and D0bar
631 return returnvalueCuts;
634 //---------------------------------------------------------------------------
636 Bool_t AliRDHFCutsD0toKpi::IsInFiducialAcceptance(Double_t pt, Double_t y) const
639 // Checking if D0 is in fiducial acceptance region
643 // applying cut for pt > 5 GeV
644 AliDebug(2,Form("pt of D0 = %f (> 5), cutting at |y| < 0.8\n",pt));
645 if (TMath::Abs(y) > 0.8){
649 // appliying smooth cut for pt < 5 GeV
650 Double_t maxFiducialY = -0.2/15*pt*pt+1.9/15*pt+0.5;
651 Double_t minFiducialY = 0.2/15*pt*pt-1.9/15*pt-0.5;
652 AliDebug(2,Form("pt of D0 = %f (< 5), cutting according to the fiducial zone [%f, %f]\n",pt,minFiducialY,maxFiducialY));
653 if (y < minFiducialY || y > maxFiducialY){
660 //---------------------------------------------------------------------------
661 Int_t AliRDHFCutsD0toKpi::IsSelectedPID(AliAODRecoDecayHF* d)
663 // ############################################################
665 // Apply PID selection
668 // ############################################################
670 if(!fUsePID) return 3;
671 if(fDefaultPID) return IsSelectedPIDdefault(d);
673 Int_t isD0D0barPID[2]={1,2};
674 Int_t combinedPID[2][2];// CONVENTION: [daught][isK,IsPi]; [0][0]=(prong 1, isK)=value [0][1]=(prong 1, isPi)=value;
676 // values convention -1 = discarded
677 // 0 = not identified (but compatible) || No PID (->hasPID flag)
679 // PID search: pion (TPC) or not K (TOF), Kaon hypothesis for both
680 // Initial hypothesis: unknwon (but compatible)
681 combinedPID[0][0]=0; // prima figlia, Kaon
682 combinedPID[0][1]=0; // prima figlia, pione
683 combinedPID[1][0]=0; // seconda figlia, Kaon
684 combinedPID[1][1]=0; // seconda figlia, pion
686 Bool_t checkPIDInfo[2]={kTRUE,kTRUE};
687 Double_t sigma_tmp[3]={fPidHF->GetSigma(0),fPidHF->GetSigma(1),fPidHF->GetSigma(2)};
688 for(Int_t daught=0;daught<2;daught++){
690 AliAODTrack *aodtrack=(AliAODTrack*)d->GetDaughter(daught);
691 if(fPidHF->IsTOFPiKexcluded(aodtrack,5.)) return 0;
693 if(!(fPidHF->CheckStatus(aodtrack,"TPC")) && !(fPidHF->CheckStatus(aodtrack,"TOF"))) {
694 checkPIDInfo[daught]=kFALSE;
699 combinedPID[daught][0]=fPidHF->MakeRawPid(aodtrack,3);
703 if(!(fPidHF->CheckStatus(aodtrack,"TPC"))) {
704 combinedPID[daught][1]=0;
706 fPidHF->SetTOF(kFALSE);
707 combinedPID[daught][1]=fPidHF->MakeRawPid(aodtrack,2);
708 fPidHF->SetTOF(kTRUE);
709 fPidHF->SetCompat(kTRUE);
713 if(combinedPID[daught][0]<=-1&&combinedPID[daught][1]<=-1){ // if not a K- and not a pi- both D0 and D0bar excluded
717 else if(combinedPID[daught][0]==2&&combinedPID[daught][1]>=1){
718 if(aodtrack->Charge()==-1)isD0D0barPID[1]=0;//if K- D0bar excluded
719 else isD0D0barPID[0]=0;// if K+ D0 excluded
721 /* else if(combinedPID[daught][0]==1&&combinedPID[daught][1]>=1){
726 else if(combinedPID[daught][0]>=1||combinedPID[daught][1]<=-1){
727 if(aodtrack->Charge()==-1)isD0D0barPID[1]=0;// not a D0bar if K- or if pi- excluded
728 else isD0D0barPID[0]=0;// not a D0 if K+ or if pi+ excluded
730 else if(combinedPID[daught][0]<=-1||combinedPID[daught][1]>=1){
731 if(aodtrack->Charge()==-1)isD0D0barPID[0]=0;// not a D0 if pi- or if K- excluded
732 else isD0D0barPID[1]=0;// not a D0bar if pi+ or if K+ excluded
735 if(fLowPt && d->Pt()<fPtLowPID){
736 Double_t sigmaTPC[3]={3.,2.,0.};
737 fPidHF->SetSigmaForTPC(sigmaTPC);
739 combinedPID[daught][0]=fPidHF->MakeRawPid(aodtrack,3);
741 Double_t ptProng=aodtrack->P();
744 fPidHF->SetCompat(kFALSE);
745 combinedPID[daught][0]=fPidHF->MakeRawPid(aodtrack,3);
746 fPidHF->SetCompat(kTRUE);
749 if(!(fPidHF->CheckStatus(aodtrack,"TPC"))) {
750 combinedPID[daught][1]=0;
752 fPidHF->SetTOF(kFALSE);
753 Double_t sigmaTPCpi[3]={3.,3.,0.};
754 fPidHF->SetSigmaForTPC(sigmaTPCpi);
755 combinedPID[daught][1]=fPidHF->MakeRawPid(aodtrack,2);
756 fPidHF->SetTOF(kTRUE);
758 Bool_t isTPCpion=fPidHF->IsPionRaw(aodtrack,"TPC");
760 combinedPID[daught][1]=1;
762 combinedPID[daught][1]=-1;
768 fPidHF->SetSigmaForTPC(sigma_tmp);
769 }// END OF LOOP ON DAUGHTERS
771 if(!checkPIDInfo[0] && !checkPIDInfo[1]) {
772 if(fLowPt) fPidHF->SetSigmaForTPC(sigma_tmp);
777 // FURTHER PID REQUEST (both daughter info is needed)
778 if(combinedPID[0][0]<=-1&&combinedPID[1][0]<=-1){
779 fWhyRejection=31;// reject cases in which no kaon-compatible tracks are found
780 if(fLowPt) fPidHF->SetSigmaForTPC(sigma_tmp);
784 if(fLowPt && d->Pt()<fPtLowPID){
785 if(combinedPID[0][0]<=0&&combinedPID[1][0]<=0){
786 fWhyRejection=32;// reject cases where the Kaon is not identified
787 fPidHF->SetSigmaForTPC(sigma_tmp);
791 if(fLowPt) fPidHF->SetSigmaForTPC(sigma_tmp);
793 // cout<<"Why? "<<fWhyRejection<<endl;
794 return isD0D0barPID[0]+isD0D0barPID[1];
796 //---------------------------------------------------------------------------
797 Int_t AliRDHFCutsD0toKpi::IsSelectedPIDdefault(AliAODRecoDecayHF* d)
799 // ############################################################
801 // Apply PID selection
804 // temporary selection: PID AS USED FOR D0 by Andrea Rossi (up to 28/06/2010)
806 // d must be a AliAODRecoDecayHF2Prong object
807 // returns 0 if both D0 and D0bar are rejectecd
808 // 1 if D0 is accepted while D0bar is rejected
809 // 2 if D0bar is accepted while D0 is rejected
810 // 3 if both are accepted
811 // fWhyRejection variable (not returned for the moment, print it if needed)
812 // keeps some information on why a candidate has been
813 // rejected according to the following (unfriendly?) scheme
814 // if more rejection cases are considered interesting, just add numbers
816 // TO BE CONSIDERED WITH A GRAIN OF SALT (the order in which cut are applied is relevant)
817 // from 20 to 30: "detector" selection (PID acceptance)
820 // 28: no (TOF||TPC) pid information (no kTOFpid,kTOFout,kTIME,kTPCpid,...)
822 // from 30 to 40: PID selection
823 // 31: no Kaon compatible tracks found between daughters
824 // 32: no Kaon identified tracks found (strong sel. at low momenta)
825 // 33: both mass hypotheses are rejected
827 // ############################################################
829 if(!fUsePID) return 3;
831 Int_t isD0D0barPID[2]={1,2};
832 Double_t nsigmaTPCpi=-1., nsigmaTPCK=-1.; //used for TPC pid
833 Double_t tofSig,times[5];// used fot TOF pid
834 Int_t hasPID[2]={2,2};// flag to count how many detectors give PID info for the daughters
835 Int_t isKaonPionTOF[2][2],isKaonPionTPC[2][2];
836 Int_t combinedPID[2][2];// CONVENTION: [daught][isK,IsPi]; [0][0]=(prong 1, isK)=value [0][1]=(prong 1, isPi)=value;
838 // values convention -1 = discarded
839 // 0 = not identified (but compatible) || No PID (->hasPID flag)
841 // PID search: pion (TPC) or not K (TOF), Kaon hypothesis for both
842 // Initial hypothesis: unknwon (but compatible)
843 isKaonPionTOF[0][0]=0;
844 isKaonPionTOF[0][1]=0;
845 isKaonPionTOF[1][0]=0;
846 isKaonPionTOF[1][1]=0;
848 isKaonPionTPC[0][0]=0;
849 isKaonPionTPC[0][1]=0;
850 isKaonPionTPC[1][0]=0;
851 isKaonPionTPC[1][1]=0;
860 for(Int_t daught=0;daught<2;daught++){
863 // ########### Step 0- CHECKING minimal PID "ACCEPTANCE" ####################
865 AliAODTrack *aodtrack=(AliAODTrack*)d->GetDaughter(daught);
867 if(!(aodtrack->GetStatus()&AliESDtrack::kTPCrefit)){
871 if(!(aodtrack->GetStatus()&AliESDtrack::kITSrefit)){
876 AliAODPid *pid=aodtrack->GetDetPid();
883 // ########### Step 1- Check of TPC and TOF response ####################
885 Double_t ptrack=aodtrack->P();
886 //#################### TPC PID #######################
887 if (!(aodtrack->GetStatus()&AliESDtrack::kTPCpid )){
888 // NO TPC PID INFO FOR THIS TRACK
892 static AliTPCPIDResponse theTPCpid;
893 AliAODPid *pidObj = aodtrack->GetDetPid();
894 Double_t ptProng=pidObj->GetTPCmomentum();
895 nsigmaTPCpi = theTPCpid.GetNumberOfSigmas(ptProng,(Float_t)pid->GetTPCsignal(),(Int_t)aodtrack->GetTPCClusterMap().CountBits(),AliPID::kPion);
896 nsigmaTPCK = theTPCpid.GetNumberOfSigmas(ptProng,(Float_t)pid->GetTPCsignal(),(Int_t)aodtrack->GetTPCClusterMap().CountBits(),AliPID::kKaon);
899 if(TMath::Abs(nsigmaTPCK)<2.)isKaonPionTPC[daught][0]=1;
900 else if(TMath::Abs(nsigmaTPCK)>3.)isKaonPionTPC[daught][0]=-1;
901 if(TMath::Abs(nsigmaTPCpi)<2.)isKaonPionTPC[daught][1]=1;
902 else if(TMath::Abs(nsigmaTPCpi)>3.)isKaonPionTPC[daught][1]=-1;
904 //else if(ptrack<.8){
906 if(TMath::Abs(nsigmaTPCK)<1.)isKaonPionTPC[daught][0]=1;
907 else if(TMath::Abs(nsigmaTPCK)>3.)isKaonPionTPC[daught][0]=-1;
908 if(TMath::Abs(nsigmaTPCpi)<1.)isKaonPionTPC[daught][1]=1;
909 else if(TMath::Abs(nsigmaTPCpi)>3.)isKaonPionTPC[daught][1]=-1;
912 // if(nsigmaTPCK>-2.&&nsigmaTPCK<1.)isKaonPionTPC[daught][0]=1;
913 if(TMath::Abs(nsigmaTPCK)>3.)isKaonPionTPC[daught][0]=-1;
914 //if(nsigmaTPCpi>-1.&&nsigmaTPCpi<2.)isKaonPionTPC[daught][1]=1;
915 if(TMath::Abs(nsigmaTPCpi)>3.)isKaonPionTPC[daught][1]=-1;
920 // ##### TOF PID: do not ask nothing for pion/protons ############
921 if(!((aodtrack->GetStatus()&AliESDtrack::kTOFpid)&&(aodtrack->GetStatus()&AliESDtrack::kTOFout)&&(aodtrack->GetStatus()&AliESDtrack::kTIME))){
922 // NO TOF PID INFO FOR THIS TRACK
926 tofSig=pid->GetTOFsignal();
927 pid->GetIntegratedTimes(times);
928 if((tofSig-times[3])>5.*160.)return 0;// PROTON REJECTION
929 if(TMath::Abs(tofSig-times[3])>3.*160.){
930 isKaonPionTOF[daught][0]=-1;
934 isKaonPionTOF[daught][0]=1;
939 //######### Step 2: COMBINE TOF and TPC PID ###############
940 // we apply the following convention: if TPC and TOF disagree (discarded Vs identified) -> unknown
941 combinedPID[daught][0]=isKaonPionTOF[daught][0]+isKaonPionTPC[daught][0];
942 combinedPID[daught][1]=isKaonPionTOF[daught][1]+isKaonPionTPC[daught][1];
945 //######### Step 3: USE PID INFO
947 if(combinedPID[daught][0]<=-1&&combinedPID[daught][1]<=-1){// if not a K- and not a pi- both D0 and D0bar excluded
951 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
952 if(aodtrack->Charge()==-1)isD0D0barPID[1]=0;//if K- D0bar excluded
953 else isD0D0barPID[0]=0;// if K+ D0 excluded
955 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
959 else if(combinedPID[daught][0]>=1||combinedPID[daught][1]<=-1){
960 if(aodtrack->Charge()==-1)isD0D0barPID[1]=0;// not a D0bar if K- or if pi- excluded
961 else isD0D0barPID[0]=0;// not a D0 if K+ or if pi+ excluded
963 else if(combinedPID[daught][0]<=-1||combinedPID[daught][1]>=1){
964 if(aodtrack->Charge()==-1)isD0D0barPID[0]=0;// not a D0 if pi- or if K- excluded
965 else isD0D0barPID[1]=0;// not a D0bar if pi+ or if K+ excluded
968 // ########## ALSO DIFFERENT TPC PID REQUEST FOR LOW pt D0: request of K identification ###############################
969 // ########## more tolerant criteria for single particle ID-> more selective criteria for D0 ##############################
970 // ############### NOT OPTIMIZED YET ###################################
972 isKaonPionTPC[daught][0]=0;
973 isKaonPionTPC[daught][1]=0;
974 AliAODPid *pidObj = aodtrack->GetDetPid();
975 Double_t ptProng=pidObj->GetTPCmomentum();
978 if(TMath::Abs(nsigmaTPCK)<3.)isKaonPionTPC[daught][0]=1;
979 else if(TMath::Abs(nsigmaTPCK)>3.)isKaonPionTPC[daught][0]=-1;
980 if(TMath::Abs(nsigmaTPCpi)<3.)isKaonPionTPC[daught][1]=1;
981 else if(TMath::Abs(nsigmaTPCpi)>3.)isKaonPionTPC[daught][1]=-1;
983 //else if(ptrack<.8){
985 if(TMath::Abs(nsigmaTPCK)<2.)isKaonPionTPC[daught][0]=1;
986 else if(TMath::Abs(nsigmaTPCK)>3.)isKaonPionTPC[daught][0]=-1;
987 if(TMath::Abs(nsigmaTPCpi)<3.)isKaonPionTPC[daught][1]=1;
988 else if(TMath::Abs(nsigmaTPCpi)>3.)isKaonPionTPC[daught][1]=-1;
991 if(TMath::Abs(nsigmaTPCK)>3.)isKaonPionTPC[daught][0]=-1;
992 if(TMath::Abs(nsigmaTPCpi)>3.)isKaonPionTPC[daught][1]=-1;
996 }// END OF LOOP ON DAUGHTERS
998 // FURTHER PID REQUEST (both daughter info is needed)
999 if(combinedPID[0][0]<=-1&&combinedPID[1][0]<=-1){
1000 fWhyRejection=31;// reject cases in which no kaon-compatible tracks are found
1003 else if(hasPID[0]==0&&hasPID[1]==0){
1004 fWhyRejection=28;// reject cases in which no PID info is available
1008 // request of K identification at low D0 pt
1009 combinedPID[0][0]=0;
1010 combinedPID[0][1]=0;
1011 combinedPID[1][0]=0;
1012 combinedPID[1][1]=0;
1014 combinedPID[0][0]=isKaonPionTOF[0][0]+isKaonPionTPC[0][0];
1015 combinedPID[0][1]=isKaonPionTOF[0][1]+isKaonPionTPC[0][1];
1016 combinedPID[1][0]=isKaonPionTOF[1][0]+isKaonPionTPC[1][0];
1017 combinedPID[1][1]=isKaonPionTOF[1][1]+isKaonPionTPC[1][1];
1019 if(combinedPID[0][0]<=0&&combinedPID[1][0]<=0){
1020 fWhyRejection=32;// reject cases where the Kaon is not identified
1025 // cout<<"Why? "<<fWhyRejection<<endl;
1026 return isD0D0barPID[0]+isD0D0barPID[1];
1031 //---------------------------------------------------------------------------
1032 Int_t AliRDHFCutsD0toKpi::CombineSelectionLevels(Int_t selectionvalTrack,
1033 Int_t selectionvalCand,
1034 Int_t selectionvalPID) const
1037 // This method combines the tracks, PID and cuts selection results
1039 if(selectionvalTrack==0) return 0;
1043 switch(selectionvalPID) {
1048 returnvalue=((selectionvalCand==1 || selectionvalCand==3) ? 1 : 0);
1051 returnvalue=((selectionvalCand==2 || selectionvalCand==3) ? 2 : 0);
1054 returnvalue=selectionvalCand;
1063 //----------------------------------------------------------------------------
1064 Int_t AliRDHFCutsD0toKpi::IsSelectedSpecialCuts(AliAODRecoDecayHF *d) const
1067 // Note: this method is temporary
1068 // Additional cuts on decay lenght and lower cut for d0 norm are applied using vertex without candidate's daughters
1073 Float_t normDecLengthCut=1.,decLengthCut=TMath::Min(d->P()*0.0066+0.01,0.06/*cm*/), normd0Cut=0.5;
1074 // "decay length" expo law with tau' = beta*gamma*ctau= p/m*ctau =p*0.0123/1.864~p*0.0066
1075 // decay lenght > ctau' implies to retain (1-1/e) (for signal without considering detector resolution),
1077 Int_t returnvalue=3; //cut passed
1078 for(Int_t i=0;i<2/*prongs*/;i++){
1079 if(TMath::Abs(d->Normalizedd0Prong(i))<normd0Cut) return 0; //normd0Cut not passed
1081 if(d->DecayLength2()<decLengthCut*decLengthCut) return 0; //decLengthCut not passed
1082 if(d->NormalizedDecayLength2()<normDecLengthCut*normDecLengthCut) return 0; //decLengthCut not passed
1087 //----------------------------------------------
1088 void AliRDHFCutsD0toKpi::SetUseKF(Bool_t useKF)
1090 //switch on candidate selection via AliKFparticle
1096 TString varNamesKF[11]={"inv. mass [GeV]",
1107 Bool_t isUpperCutKF[11]={kTRUE,
1118 SetVarNames(nvarsKF,varNamesKF,isUpperCutKF);
1120 Bool_t forOpt[11]={kFALSE,
1131 SetVarsForOpt(4,forOpt);
1137 void AliRDHFCutsD0toKpi::SetStandardCutsPP2010() {
1139 //STANDARD CUTS USED FOR 2010 pp analysis
1140 //dca cut will be enlarged soon to 400 micron
1143 SetName("D0toKpiCutsStandard");
1144 SetTitle("Standard Cuts for D0 analysis");
1146 // PILE UP REJECTION
1147 SetOptPileup(AliRDHFCuts::kRejectPileupEvent);
1153 // TRACKS ON SINGLE TRACKS
1154 AliESDtrackCuts *esdTrackCuts = new AliESDtrackCuts("AliESDtrackCuts","default");
1155 esdTrackCuts->SetRequireSigmaToVertex(kFALSE);
1156 esdTrackCuts->SetRequireTPCRefit(kTRUE);
1157 esdTrackCuts->SetRequireITSRefit(kTRUE);
1158 // esdTrackCuts->SetMinNClustersITS(4);
1159 esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,AliESDtrackCuts::kAny);
1160 esdTrackCuts->SetMinDCAToVertexXY(0.);
1161 esdTrackCuts->SetEtaRange(-0.8,0.8);
1162 esdTrackCuts->SetPtRange(0.3,1.e10);
1164 AddTrackCuts(esdTrackCuts);
1166 const Int_t nptbins =14;
1167 const Double_t ptmax = 9999.;
1168 const Int_t nvars=11;
1169 Float_t ptbins[nptbins+1];
1186 SetGlobalIndex(nvars,nptbins);
1187 SetPtBins(nptbins+1,ptbins);
1189 Float_t cutsMatrixD0toKpiStand[nptbins][nvars]={{0.400,350.*1E-4,0.8,0.5,0.5,1000.*1E-4,1000.*1E-4,-5000.*1E-8,0.80,0.,0.},/* pt<0.5*/
1190 {0.400,350.*1E-4,0.8,0.5,0.5,1000.*1E-4,1000.*1E-4,-5000.*1E-8,0.80,0.,0.},/* 0.5<pt<1*/
1191 {0.400,300.*1E-4,0.8,0.4,0.4,1000.*1E-4,1000.*1E-4,-25000.*1E-8,0.80,0.,0.},/* 1<pt<2 */
1192 {0.400,300.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,-15000.*1E-8,0.85,0.,0.},/* 2<pt<3 */
1193 {0.400,300.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,-8000.*1E-8,0.85,0.,0.},/* 3<pt<4 */
1194 {0.400,300.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,-8000.*1E-8,0.85,0.,0.},/* 4<pt<5 */
1195 {0.400,300.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,-8000.*1E-8,0.85,0.,0.},/* 5<pt<6 */
1196 {0.400,300.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,-8000.*1E-8,0.85,0.,0.},/* 6<pt<7 */
1197 {0.400,300.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,-7000.*1E-8,0.85,0.,0.},/* 7<pt<8 */
1198 {0.400,300.*1E-4,0.9,0.7,0.7,1000.*1E-4,1000.*1E-4,-5000.*1E-8,0.85,0.,0.},/* 8<pt<12 */
1199 {0.400,300.*1E-4,1.0,0.7,0.7,1000.*1E-4,1000.*1E-4,10000.*1E-8,0.85,0.,0.},/* 12<pt<16 */
1200 {0.400,300.*1E-4,1.0,0.7,0.7,1000.*1E-4,1000.*1E-4,999999.*1E-8,0.85,0.,0.},/* 16<pt<20 */
1201 {0.400,300.*1E-4,1.0,0.7,0.7,1000.*1E-4,1000.*1E-4,999999.*1E-8,0.85,0.,0.},/* 20<pt<24 */
1202 {0.400,300.*1E-4,1.0,0.7,0.7,1000.*1E-4,1000.*1E-4,999999.*1E-8,0.85,0.,0.}};/* pt>24 */
1205 //CREATE TRANSPOSE MATRIX...REVERSE INDICES as required by AliRDHFCuts
1206 Float_t **cutsMatrixTransposeStand=new Float_t*[nvars];
1207 for(Int_t iv=0;iv<nvars;iv++)cutsMatrixTransposeStand[iv]=new Float_t[nptbins];
1209 for (Int_t ibin=0;ibin<nptbins;ibin++){
1210 for (Int_t ivar = 0; ivar<nvars; ivar++){
1211 cutsMatrixTransposeStand[ivar][ibin]=cutsMatrixD0toKpiStand[ibin][ivar];
1215 SetCuts(nvars,nptbins,cutsMatrixTransposeStand);
1216 SetUseSpecialCuts(kTRUE);
1217 SetRemoveDaughtersFromPrim(kTRUE);
1219 for(Int_t iv=0;iv<nvars;iv++) delete [] cutsMatrixTransposeStand[iv];
1220 delete [] cutsMatrixTransposeStand;
1221 cutsMatrixTransposeStand=NULL;
1224 AliAODPidHF* pidObj=new AliAODPidHF();
1225 //pidObj->SetName("pid4D0");
1227 const Int_t nlims=2;
1228 Double_t plims[nlims]={0.6,0.8}; //TPC limits in momentum [GeV/c]
1229 Bool_t compat=kTRUE; //effective only for this mode
1231 Double_t sigmas[5]={2.,1.,0.,3.,0.}; //to be checked and to be modified with new implementation of setters by Rossella
1232 pidObj->SetAsym(asym);// if you want to use the asymmetric bands in TPC
1233 pidObj->SetMatch(mode);
1234 pidObj->SetPLimit(plims,nlims);
1235 pidObj->SetSigma(sigmas);
1236 pidObj->SetCompat(compat);
1237 pidObj->SetTPC(kTRUE);
1238 pidObj->SetTOF(kTRUE);
1239 pidObj->SetPCompatTOF(1.5);
1240 pidObj->SetSigmaForTPCCompat(3.);
1241 pidObj->SetSigmaForTOFCompat(3.);
1245 SetUseDefaultPID(kFALSE);
1258 void AliRDHFCutsD0toKpi::SetStandardCutsPbPb2010() {
1260 //PRELIMINARY CUTS USED FOR 2010 PbPb analysis
1264 SetName("D0toKpiCutsStandard");
1265 SetTitle("Standard Cuts for D0 analysis in PbPb2010 run");
1267 // PILE UP REJECTION
1268 //SetOptPileup(AliRDHFCuts::kRejectPileupEvent);
1269 // CENTRALITY SELECTION
1270 SetMinCentrality(0.);
1271 SetMaxCentrality(80.);
1272 SetUseCentrality(AliRDHFCuts::kCentV0M);
1280 // TRACKS ON SINGLE TRACKS
1281 AliESDtrackCuts *esdTrackCuts = new AliESDtrackCuts("AliESDtrackCuts","default");
1282 esdTrackCuts->SetRequireSigmaToVertex(kFALSE);
1283 esdTrackCuts->SetRequireTPCRefit(kTRUE);
1284 esdTrackCuts->SetRequireITSRefit(kTRUE);
1285 // esdTrackCuts->SetMinNClustersITS(4);
1286 esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,AliESDtrackCuts::kAny);
1287 esdTrackCuts->SetMinDCAToVertexXY(0.);
1288 esdTrackCuts->SetEtaRange(-0.8,0.8);
1289 esdTrackCuts->SetPtRange(0.7,1.e10);
1291 esdTrackCuts->SetMaxDCAToVertexXY(1.);
1292 esdTrackCuts->SetMaxDCAToVertexZ(1.);
1293 esdTrackCuts->SetMinDCAToVertexXYPtDep("0.0075*TMath::Max(0.,(1-TMath::Floor(TMath::Abs(pt)/2.)))");
1296 AddTrackCuts(esdTrackCuts);
1299 const Int_t nptbins =13;
1300 const Double_t ptmax = 9999.;
1301 const Int_t nvars=11;
1302 Float_t ptbins[nptbins+1];
1318 SetGlobalIndex(nvars,nptbins);
1319 SetPtBins(nptbins+1,ptbins);
1320 SetMinPtCandidate(2.);
1322 Float_t cutsMatrixD0toKpiStand[nptbins][nvars]={{0.400,400.*1E-4,0.8,0.3,0.3,1000.*1E-4,1000.*1E-4,-10000.*1E-8,0.85,0.,5.},/* pt<0.5*/
1323 {0.400,400.*1E-4,0.8,0.3,0.3,1000.*1E-4,1000.*1E-4,-35000.*1E-8,0.9,0.,5.},/* 0.5<pt<1*/
1324 {0.400,400.*1E-4,0.8,0.4,0.4,1000.*1E-4,1000.*1E-4,-43000.*1E-8,0.85,0.,5.},/* 1<pt<2 */
1325 {0.400,250.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,-40000.*1E-8,0.95,0.998,5.},/* 2<pt<3 */
1326 {0.400,250.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,-36000.*1E-8,0.95,0.998,5.},/* 3<pt<4 */
1327 {0.400,250.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,-27000.*1E-8,0.95,0.998,5.},/* 4<pt<5 */
1328 {0.400,250.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,-21000.*1E-8,0.92,0.998,5.},/* 5<pt<6 */
1329 {0.400,270.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,-14000.*1E-8,0.88,0.998,5.},/* 6<pt<8 */
1330 {0.400,300.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,-5000.*1E-8,0.85,0.998,5.},/* 8<pt<12 */
1331 {0.400,350.*1E-4,1.0,0.7,0.7,1000.*1E-4,1000.*1E-4,-1000.*1E-8,0.83,0.998,5.},/* 12<pt<16 */
1332 {0.400,400.*1E-4,1.0,0.7,0.7,1000.*1E-4,1000.*1E-4,-1000.*1E-8,0.82,0.998,5.},/* 16<pt<20 */
1333 {0.400,400.*1E-4,1.0,0.7,0.7,1000.*1E-4,1000.*1E-4,-1000.*1E-8,0.81,0.998,5.},/* 20<pt<24 */
1334 {0.400,400.*1E-4,1.0,0.7,0.7,1000.*1E-4,1000.*1E-4,-1000.*1E-8,0.8,0.998,5.}};/* pt>24 */
1337 //CREATE TRANSPOSE MATRIX...REVERSE INDICES as required by AliRDHFCuts
1338 Float_t **cutsMatrixTransposeStand=new Float_t*[nvars];
1339 for(Int_t iv=0;iv<nvars;iv++)cutsMatrixTransposeStand[iv]=new Float_t[nptbins];
1341 for (Int_t ibin=0;ibin<nptbins;ibin++){
1342 for (Int_t ivar = 0; ivar<nvars; ivar++){
1343 cutsMatrixTransposeStand[ivar][ibin]=cutsMatrixD0toKpiStand[ibin][ivar];
1347 SetCuts(nvars,nptbins,cutsMatrixTransposeStand);
1348 SetUseSpecialCuts(kTRUE);
1349 SetRemoveDaughtersFromPrim(kFALSE);// THIS IS VERY IMPORTANT! TOO SLOW IN PbPb
1350 for(Int_t iv=0;iv<nvars;iv++) delete [] cutsMatrixTransposeStand[iv];
1351 delete [] cutsMatrixTransposeStand;
1352 cutsMatrixTransposeStand=NULL;
1355 AliAODPidHF* pidObj=new AliAODPidHF();
1356 //pidObj->SetName("pid4D0");
1358 const Int_t nlims=2;
1359 Double_t plims[nlims]={0.6,0.8}; //TPC limits in momentum [GeV/c]
1360 Bool_t compat=kTRUE; //effective only for this mode
1362 Double_t sigmas[5]={2.,1.,0.,3.,0.}; //to be checked and to be modified with new implementation of setters by Rossella
1363 pidObj->SetAsym(asym);// if you want to use the asymmetric bands in TPC
1364 pidObj->SetMatch(mode);
1365 pidObj->SetPLimit(plims,nlims);
1366 pidObj->SetSigma(sigmas);
1367 pidObj->SetCompat(compat);
1368 pidObj->SetTPC(kTRUE);
1369 pidObj->SetTOF(kTRUE);
1370 pidObj->SetPCompatTOF(2.);
1371 pidObj->SetSigmaForTPCCompat(3.);
1372 pidObj->SetSigmaForTOFCompat(3.);
1377 SetUseDefaultPID(kFALSE);