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 Ds->KKpi
22 // Author: A.Dainese, andrea.dainese@pd.infn.it
23 /////////////////////////////////////////////////////////////
25 #include <TDatabasePDG.h>
26 #include <Riostream.h>
28 #include "AliRDHFCutsDstoKKpi.h"
29 #include "AliAODRecoDecayHF3Prong.h"
30 #include "AliAODTrack.h"
31 #include "AliESDtrack.h"
36 ClassImp(AliRDHFCutsDstoKKpi)
38 //--------------------------------------------------------------------------
39 AliRDHFCutsDstoKKpi::AliRDHFCutsDstoKKpi(const char* name) :
47 // Default Constructor
51 TString varNames[20]={"inv. mass [GeV]",
63 "inv. mass (Mphi-MKK) [GeV]",
64 "inv. mass (MKo*-MKpi) [GeV]",
65 "Abs(CosineKpiPhiRFrame)^3",
72 Bool_t isUpperCut[20]={kTRUE,
92 SetVarNames(20,varNames,isUpperCut);
93 Bool_t forOpt[20]={kFALSE,
114 SetVarsForOpt(11,forOpt);
115 Float_t limits[2]={0,999999999.};
117 if(fPidHF)delete fPidHF;
118 fPidHF=new AliAODPidHF();
119 Double_t plim[2]={0.6,0.8};
120 Double_t nsigma[5]={2.,1.,2.,3.,0.};
122 fPidHF->SetPLimit(plim);
123 fPidHF->SetAsym(kTRUE);
124 fPidHF->SetSigma(nsigma);
130 fPidHF->SetCompat(kTRUE);
133 //--------------------------------------------------------------------------
134 AliRDHFCutsDstoKKpi::AliRDHFCutsDstoKKpi(const AliRDHFCutsDstoKKpi &source) :
136 fPidOption(source.fPidOption),
137 fMaxPtStrongPid(source.fMaxPtStrongPid),
138 fMaxPStrongPidK(source.fMaxPStrongPidK),
139 fMaxPStrongPidpi(source.fMaxPStrongPidpi)
146 //--------------------------------------------------------------------------
147 AliRDHFCutsDstoKKpi &AliRDHFCutsDstoKKpi::operator=(const AliRDHFCutsDstoKKpi &source)
150 // assignment operator
152 if(&source == this) return *this;
154 AliRDHFCuts::operator=(source);
156 fPidOption=source.fPidOption;
157 fMaxPtStrongPid=source.fMaxPtStrongPid;
158 fMaxPStrongPidK=source.fMaxPStrongPidK;
159 fMaxPStrongPidpi=source.fMaxPStrongPidpi;
165 //---------------------------------------------------------------------------
166 void AliRDHFCutsDstoKKpi::GetCutVarsForOpt(AliAODRecoDecayHF *d,Float_t *vars,Int_t nvars,Int_t *pdgdaughters,AliAODEvent *aod) {
168 // Fills in vars the values of the variables
171 if(nvars!=fnVarsForOpt) {
172 printf("AliRDHFCutsDstoKKpi::GetCutsVarsForOpt: wrong number of variables\n");
176 AliAODRecoDecayHF3Prong *dd = (AliAODRecoDecayHF3Prong*)d;
178 //recalculate vertex w/o daughters
179 Bool_t cleanvtx=kFALSE;
180 AliAODVertex *origownvtx=0x0;
181 if(fRemoveDaughtersFromPrimary) {
182 if(dd->GetOwnPrimaryVtx()) origownvtx=new AliAODVertex(*dd->GetOwnPrimaryVtx());
184 if(!RecalcOwnPrimaryVtx(dd,aod)) {
185 CleanOwnPrimaryVtx(dd,aod,origownvtx);
193 if(TMath::Abs(pdgdaughters[0])==321){
194 vars[iter]=dd->InvMassDsKKpi();
196 vars[iter]=dd->InvMassDspiKK();
201 Float_t minPtDau=99999.;
202 for(Int_t iprong=0;iprong<3;iprong++){
203 if(TMath::Abs(pdgdaughters[iprong])==321 &&
204 dd->PtProng(iprong)<minPtDau) minPtDau=dd->PtProng(iprong);
210 for(Int_t iprong=0;iprong<3;iprong++){
211 if(TMath::Abs(pdgdaughters[iprong])==211) {
212 vars[iter]=dd->PtProng(iprong);
218 Float_t minImpParDau=99999.;
219 for(Int_t iprong=0;iprong<3;iprong++){
220 if(TMath::Abs(pdgdaughters[iprong])==321 &&
221 dd->Getd0Prong(iprong)<minImpParDau) minImpParDau=dd->Getd0Prong(iprong);
223 vars[iter]=minImpParDau;
227 for(Int_t iprong=0;iprong<3;iprong++){
228 if(TMath::Abs(pdgdaughters[iprong])==211) {
229 vars[iter]=dd->Getd0Prong(iprong);
235 Float_t minDistPair=TMath::Min(dd->GetDist12toPrim(),dd->GetDist23toPrim());
236 vars[iter]=minDistPair;
240 vars[iter]=dd->GetSigmaVert(aod);
244 vars[iter] = dd->DecayLength();
249 for(Int_t i=0;i<3;i++){
250 if(dd->PtProng(i)>ptmax)ptmax=dd->PtProng(i);
256 vars[iter]=dd->CosPointingAngle();
260 vars[iter]=dd->Getd0Prong(0)*dd->Getd0Prong(0)+dd->Getd0Prong(1)*dd->Getd0Prong(1)+dd->Getd0Prong(2)*dd->Getd0Prong(2);
265 for(Int_t i=0;i<3;i++){
266 if(d->GetDCA(i)>maxDCA) maxDCA=d->GetDCA(i);
272 Double_t mPDGPhi = TDatabasePDG::Instance()->GetParticle(333)->Mass();
273 if(TMath::Abs(pdgdaughters[0])==321){
275 Double_t phimass01=d->InvMass2Prongs(0,1,321,321);
276 vars[iter]=TMath::Abs(phimass01-mPDGPhi);
277 // vars[iter]=dd->InvMass2Prongs(0,1,321,321);
279 Double_t phimass12=d->InvMass2Prongs(1,2,321,321);
280 vars[iter]=TMath::Abs(phimass12-mPDGPhi);
281 // vars[iter]=dd->InvMass2Prongs(1,2,321,321);
286 Double_t mPDGK0star = TDatabasePDG::Instance()->GetParticle(313)->Mass();
287 if(TMath::Abs(pdgdaughters[0])==321){
289 Double_t mass12kpi=d->InvMass2Prongs(1,2,321,211);
290 vars[iter]=TMath::Abs(mass12kpi-mPDGK0star);
291 // vars[iter]=dd->InvMass2Prongs(1,2,321,211);
293 Double_t mass01pik=d->InvMass2Prongs(0,1,211,321);
294 vars[iter]=TMath::Abs(mass01pik-mPDGK0star);
295 // vars[iter]=dd->InvMass2Prongs(0,1,211,321);
300 if(TMath::Abs(pdgdaughters[0])==321){
301 vars[iter]=dd->CosPiKPhiRFrameKKpi();
303 vars[iter]=dd->CosPiKPhiRFramepiKK();
308 if(TMath::Abs(pdgdaughters[0])==321){
309 vars[iter]=dd->CosPiDsLabFrameKKpi();
311 vars[iter]=dd->CosPiDsLabFramepiKK();
317 vars[iter]=dd->DecayLengthXY();
322 vars[iter]=dd->NormalizedDecayLength();
327 vars[iter]=dd->NormalizedDecayLengthXY();
332 vars[iter]=dd->CosPointingAngleXY();
335 if(cleanvtx)CleanOwnPrimaryVtx(dd,aod,origownvtx);
338 //---------------------------------------------------------------------------
339 Bool_t AliRDHFCutsDstoKKpi::IsInFiducialAcceptance(Double_t pt, Double_t y) const
342 // Checking if Ds is in fiducial acceptance region
345 if(fMaxRapidityCand>-998.){
346 if(TMath::Abs(y) > fMaxRapidityCand) return kFALSE;
351 // applying cut for pt > 5 GeV
352 AliDebug(2,Form("pt of Ds = %f (> 5), cutting at |y| < 0.8",pt));
353 if (TMath::Abs(y) > 0.8) return kFALSE;
356 // appliying smooth cut for pt < 5 GeV
357 Double_t maxFiducialY = -0.2/15*pt*pt+1.9/15*pt+0.5;
358 Double_t minFiducialY = 0.2/15*pt*pt-1.9/15*pt-0.5;
359 AliDebug(2,Form("pt of Ds = %f (< 5), cutting according to the fiducial zone [%f, %f]\n",pt,minFiducialY,maxFiducialY));
360 if (y < minFiducialY || y > maxFiducialY) return kFALSE;
366 //---------------------------------------------------------------------------
367 Int_t AliRDHFCutsDstoKKpi::IsSelectedPID(AliAODRecoDecayHF *rd) {
369 // return values: 0->NOT OK, 1->OK as KKpi, 2->OK as piKK, 3->OK as both
373 if(!fUsePID || !rd) return retCode;
375 AliWarning("AliAODPidHF not created!");
379 Double_t origCompatTOF=fPidHF->GetPCompatTOF();
380 Double_t origThreshTPC=fPidHF->GetPtThresholdTPC();
381 if(fPidOption==kStrong){
382 fPidHF->SetPCompatTOF(999999.);
383 fPidHF->SetPtThresholdTPC(999999.);
388 Int_t sign= rd->GetCharge();
389 for(Int_t iDaught=0; iDaught<3; iDaught++){
390 AliAODTrack *track=(AliAODTrack*)rd->GetDaughter(iDaught);
392 Int_t isPion=fPidHF->MakeRawPid(track,AliPID::kPion);
393 Int_t isKaon=fPidHF->MakeRawPid(track,AliPID::kKaon);
394 Int_t isProton=fPidHF->MakeRawPid(track,AliPID::kProton);
396 if(isProton>0 && isKaon<0 && isPion<0){
397 fPidHF->SetPCompatTOF(origCompatTOF);
398 fPidHF->SetPtThresholdTPC(origThreshTPC);
401 if(sign!=track->Charge()){// must be kaon
403 fPidHF->SetPCompatTOF(origCompatTOF);
404 fPidHF->SetPtThresholdTPC(origThreshTPC);
407 if(fPidOption==kStrong && rd->Pt()<fMaxPtStrongPid && isKaon<=0){
408 fPidHF->SetPCompatTOF(origCompatTOF);
409 fPidHF->SetPtThresholdTPC(origThreshTPC);
412 if(fPidOption==kStrongPDep && rd->Pt()<fMaxPtStrongPid){
413 if(isKaon<=0 && track->P()<fMaxPStrongPidK) return 0;
417 if(isKaon>0 && isPion<0) nKaons++;
418 if(isKaon<0) nNotKaons++;
420 if(isKaon<0) okKKpi=kFALSE;
421 if(isPion<0) okpiKK=kFALSE;
422 if(fPidOption==kStrong && rd->Pt()<fMaxPtStrongPid){
423 if(isKaon<=0) okKKpi=kFALSE;
424 if(isPion<=0) okpiKK=kFALSE;
426 if(fPidOption==kStrongPDep && rd->Pt()<fMaxPtStrongPid){
427 if(isKaon<=0 && track->P()<fMaxPStrongPidK) okKKpi=kFALSE;
428 if(isPion<=0 && track->P()<fMaxPStrongPidpi) okpiKK=kFALSE;
432 if(isKaon<0) okpiKK=kFALSE;
433 if(isPion<0) okKKpi=kFALSE;
434 if(fPidOption==kStrong && rd->Pt()<fMaxPtStrongPid){
435 if(isKaon<=0) okpiKK=kFALSE;
436 if(isPion<=0) okKKpi=kFALSE;
438 if(fPidOption==kStrongPDep && rd->Pt()<fMaxPtStrongPid){
439 if(isKaon<=0 && track->P()<fMaxPStrongPidK) okpiKK=kFALSE;
440 if(isPion<=0 && track->P()<fMaxPStrongPidpi) okKKpi=kFALSE;
445 fPidHF->SetPCompatTOF(origCompatTOF);
446 fPidHF->SetPtThresholdTPC(origThreshTPC);
448 if(nKaons>2)return 0;
449 if(nNotKaons>1) return 0;
451 if(!okKKpi) retCode-=1;
452 if(!okpiKK) retCode-=2;
457 //---------------------------------------------------------------------------
458 Int_t AliRDHFCutsDstoKKpi::IsSelected(TObject* obj,Int_t selectionLevel, AliAODEvent* aod) {
464 cout<<"Cut matrix not inizialized. Exit..."<<endl;
468 AliAODRecoDecayHF3Prong* d=(AliAODRecoDecayHF3Prong*)obj;
471 cout<<"AliAODRecoDecayHF3Prong null"<<endl;
475 if(fKeepSignalMC) if(IsSignalMC(d,aod,431)) return 3;
477 Double_t ptD=d->Pt();
478 if(ptD<fMinPtCand) return 0;
479 if(ptD>fMaxPtCand) return 0;
481 if(fUseTrackSelectionWithFilterBits && d->HasBadDaughters()) return 0;
484 // selection on daughter tracks
485 if(selectionLevel==AliRDHFCuts::kAll ||
486 selectionLevel==AliRDHFCuts::kTracks) {
487 if(!AreDaughtersSelected(d)) return 0;
493 // selection on candidate
494 if(selectionLevel==AliRDHFCuts::kAll ||
495 selectionLevel==AliRDHFCuts::kCandidate) {
496 //recalculate vertex w/o daughters
497 AliAODVertex *origownvtx=0x0;
498 if(fRemoveDaughtersFromPrimary) {
499 if(d->GetOwnPrimaryVtx()) origownvtx=new AliAODVertex(*d->GetOwnPrimaryVtx());
500 if(!RecalcOwnPrimaryVtx(d,aod)) {
501 CleanOwnPrimaryVtx(d,aod,origownvtx);
508 Int_t okMassPhiKKpi=0;
509 Int_t okMassPhipiKK=0;
510 Int_t okMassK0starKKpi=0;
511 Int_t okMassK0starpiKK=0;
514 Int_t okDsK0starKKpi=0;
515 Int_t okDsK0starpiKK=0;
518 Int_t ptbin=PtBin(pt);
520 CleanOwnPrimaryVtx(d,aod,origownvtx);
524 Double_t mDsPDG = TDatabasePDG::Instance()->GetParticle(431)->Mass();
525 Double_t mDsKKpi=d->InvMassDsKKpi();
526 Double_t mDspiKK=d->InvMassDspiKK();
527 if(TMath::Abs(mDsKKpi-mDsPDG)>fCutsRD[GetGlobalIndex(0,ptbin)]) okDsKKpi = 0;
528 if(TMath::Abs(mDspiKK-mDsPDG)>fCutsRD[GetGlobalIndex(0,ptbin)]) okDspiKK = 0;
529 if(!okDsKKpi && !okDspiKK){
530 CleanOwnPrimaryVtx(d,aod,origownvtx);
536 // cuts on resonant decays (via Phi or K0*)
537 Double_t mPhiPDG = TDatabasePDG::Instance()->GetParticle(333)->Mass();
538 Double_t mK0starPDG = TDatabasePDG::Instance()->GetParticle(313)->Mass();
540 Double_t mass01phi=d->InvMass2Prongs(0,1,321,321);
541 Double_t mass12K0s=d->InvMass2Prongs(1,2,321,211);
542 if(TMath::Abs(mass01phi-mPhiPDG)<fCutsRD[GetGlobalIndex(12,ptbin)]) okMassPhiKKpi=1;
543 if(TMath::Abs(mass12K0s-mK0starPDG)<fCutsRD[GetGlobalIndex(13,ptbin)]) okMassK0starKKpi = 1;
544 if(!okMassPhiKKpi && !okMassK0starKKpi) okDsKKpi=0;
545 if(okMassPhiKKpi) okDsPhiKKpi=1;
546 if(okMassK0starKKpi) okDsK0starKKpi=1;
549 Double_t mass01K0s=d->InvMass2Prongs(0,1,211,321);
550 Double_t mass12phi=d->InvMass2Prongs(1,2,321,321);
551 if(TMath::Abs(mass01K0s-mK0starPDG)<fCutsRD[GetGlobalIndex(13,ptbin)]) okMassK0starpiKK = 1;
552 if(TMath::Abs(mass12phi-mPhiPDG)<fCutsRD[GetGlobalIndex(12,ptbin)]) okMassPhipiKK=1;
553 if(!okMassPhipiKK && !okMassK0starpiKK) okDspiKK=0;
554 if(okMassPhipiKK) okDsPhipiKK=1;
555 if(okMassK0starpiKK) okDsK0starpiKK=1;
557 if(!okDsKKpi && !okDspiKK){
558 CleanOwnPrimaryVtx(d,aod,origownvtx);
562 // Cuts on track pairs
563 for(Int_t i=0;i<3;i++){
564 if(d->GetDCA(i)>fCutsRD[GetGlobalIndex(11,ptbin)]){
565 CleanOwnPrimaryVtx(d,aod,origownvtx);
569 if(d->GetDist12toPrim()<fCutsRD[GetGlobalIndex(5,ptbin)] ||
570 d->GetDist23toPrim()<fCutsRD[GetGlobalIndex(5,ptbin)]){
571 CleanOwnPrimaryVtx(d,aod,origownvtx);
578 if(TMath::Abs(d->Pt2Prong(1)) < fCutsRD[GetGlobalIndex(1,ptbin)]*fCutsRD[GetGlobalIndex(1,ptbin)] ||
579 TMath::Abs(d->Getd0Prong(1))<fCutsRD[GetGlobalIndex(3,ptbin)]){
580 CleanOwnPrimaryVtx(d,aod,origownvtx);
585 if(TMath::Abs(d->Pt2Prong(0)) < fCutsRD[GetGlobalIndex(1,ptbin)]*fCutsRD[GetGlobalIndex(1,ptbin)] ||
586 TMath::Abs(d->Getd0Prong(0))<fCutsRD[GetGlobalIndex(3,ptbin)]) okDsKKpi=0;
587 if(TMath::Abs(d->Pt2Prong(2)) < fCutsRD[GetGlobalIndex(2,ptbin)]*fCutsRD[GetGlobalIndex(2,ptbin)] ||
588 TMath::Abs(d->Getd0Prong(2))<fCutsRD[GetGlobalIndex(4,ptbin)]) okDsKKpi=0;
591 if(TMath::Abs(d->Pt2Prong(0)) < fCutsRD[GetGlobalIndex(2,ptbin)]*fCutsRD[GetGlobalIndex(2,ptbin)] ||
592 TMath::Abs(d->Getd0Prong(0))<fCutsRD[GetGlobalIndex(4,ptbin)]) okDspiKK=0;
593 if(TMath::Abs(d->Pt2Prong(2)) < fCutsRD[GetGlobalIndex(1,ptbin)]*fCutsRD[GetGlobalIndex(1,ptbin)] ||
594 TMath::Abs(d->Getd0Prong(2))<fCutsRD[GetGlobalIndex(3,ptbin)]) okDspiKK=0;
596 if(!okDsKKpi && !okDspiKK){
597 CleanOwnPrimaryVtx(d,aod,origownvtx);
601 // Cuts on candidate triplet
604 if(d->CosPointingAngle()< fCutsRD[GetGlobalIndex(9,ptbin)]){
605 CleanOwnPrimaryVtx(d,aod,origownvtx);
609 if(d->Pt2Prong(0)<fCutsRD[GetGlobalIndex(8,ptbin)]*fCutsRD[GetGlobalIndex(8,ptbin)] &&
610 d->Pt2Prong(1)<fCutsRD[GetGlobalIndex(8,ptbin)]*fCutsRD[GetGlobalIndex(8,ptbin)] &&
611 d->Pt2Prong(2)<fCutsRD[GetGlobalIndex(8,ptbin)]*fCutsRD[GetGlobalIndex(8,ptbin)]) {
612 CleanOwnPrimaryVtx(d,aod,origownvtx);
616 if(d->DecayLength2()<fCutsRD[GetGlobalIndex(7,ptbin)]*fCutsRD[GetGlobalIndex(7,ptbin)]){
617 CleanOwnPrimaryVtx(d,aod,origownvtx);
622 Double_t sum2=d->Getd0Prong(0)*d->Getd0Prong(0)+d->Getd0Prong(1)*d->Getd0Prong(1)+d->Getd0Prong(2)*d->Getd0Prong(2);
623 if(sum2<fCutsRD[GetGlobalIndex(10,ptbin)]){
624 CleanOwnPrimaryVtx(d,aod,origownvtx);
630 Double_t sigmavert=d->GetSigmaVert(aod);
631 if(sigmavert>fCutsRD[GetGlobalIndex(6,ptbin)]){
632 CleanOwnPrimaryVtx(d,aod,origownvtx);
637 if(d->DecayLengthXY()<fCutsRD[GetGlobalIndex(16,ptbin)]){
638 CleanOwnPrimaryVtx(d,aod,origownvtx);
643 if(d->NormalizedDecayLength()<fCutsRD[GetGlobalIndex(17,ptbin)]){
644 CleanOwnPrimaryVtx(d,aod,origownvtx);
648 //norm decay length XY
649 if(d->NormalizedDecayLengthXY()<fCutsRD[GetGlobalIndex(18,ptbin)]){
650 CleanOwnPrimaryVtx(d,aod,origownvtx);
655 if(d->CosPointingAngleXY()<fCutsRD[GetGlobalIndex(19,ptbin)]){
656 CleanOwnPrimaryVtx(d,aod,origownvtx);
662 Double_t cosPiKPhiRFKKpi=d->CosPiKPhiRFrameKKpi();
663 Double_t kincutPiKPhiKKpi=TMath::Abs(cosPiKPhiRFKKpi*cosPiKPhiRFKKpi*cosPiKPhiRFKKpi);
664 if(kincutPiKPhiKKpi<fCutsRD[GetGlobalIndex(14,ptbin)]) okDsKKpi=0;
667 Double_t cosPiKPhiRFpiKK=d->CosPiKPhiRFramepiKK();
668 Double_t kincutPiKPhipiKK=TMath::Abs(cosPiKPhiRFpiKK*cosPiKPhiRFpiKK*cosPiKPhiRFpiKK);
669 if(kincutPiKPhipiKK<fCutsRD[GetGlobalIndex(14,ptbin)]) okDspiKK=0;
671 if(!okDsKKpi && !okDspiKK){
672 CleanOwnPrimaryVtx(d,aod,origownvtx);
679 Double_t cosPiDsLabFrameKKpi=d->CosPiDsLabFrameKKpi();
680 if(cosPiDsLabFrameKKpi>fCutsRD[GetGlobalIndex(15,ptbin)]) okDsKKpi=0;
683 Double_t cosPiDsLabFramepiKK=d->CosPiDsLabFramepiKK();
684 if(cosPiDsLabFramepiKK>fCutsRD[GetGlobalIndex(15,ptbin)]) okDspiKK=0;
686 if(!okDsKKpi && !okDspiKK){
687 CleanOwnPrimaryVtx(d,aod,origownvtx);
691 // unset recalculated primary vertex when not needed any more
692 CleanOwnPrimaryVtx(d,aod,origownvtx);
706 Int_t returnvaluePID=3;
707 if(selectionLevel==AliRDHFCuts::kAll ||
708 selectionLevel==AliRDHFCuts::kCandidate ||
709 selectionLevel==AliRDHFCuts::kPID) {
710 returnvaluePID = IsSelectedPID(d);
711 fIsSelectedPID=returnvaluePID;
713 if(returnvaluePID==0)return 0;
715 Bool_t okPidDsKKpi=returnvaluePID&1;
716 Bool_t okPidDspiKK=returnvaluePID&2;
726 if((okPidDsKKpi && okDsKKpi)||(okPidDspiKK && okDspiKK)){
728 if(okDsKKpi) returnvalue+=1;
729 if(okDspiKK) returnvalue+=2;
730 if(okDsPhiKKpi) returnvalue+=4;
731 if(okDsPhipiKK) returnvalue+=8;
732 if(okDsK0starKKpi) returnvalue+=16;
733 if(okDsK0starpiKK) returnvalue+=32;
743 //--------------------------------------------------------------------------
745 UInt_t AliRDHFCutsDstoKKpi::GetPIDTrackTPCTOFBitMap(AliAODTrack *track) const{
749 Double_t sigmaTPCPionHyp=-999.;
750 Double_t sigmaTPCKaonHyp=-999.;
751 Double_t sigmaTPCProtonHyp=-999.;
752 Double_t sigmaTOFPionHyp=-999.;
753 Double_t sigmaTOFKaonHyp=-999.;
754 Double_t sigmaTOFProtonHyp=-999.;
756 Int_t oksigmaTPCPionHyp=fPidHF->GetnSigmaTPC(track,2,sigmaTPCPionHyp);
757 Int_t oksigmaTPCKaonHyp=fPidHF->GetnSigmaTPC(track,3,sigmaTPCKaonHyp);
758 Int_t oksigmaTPCProtonHyp=fPidHF->GetnSigmaTPC(track,4,sigmaTPCProtonHyp);
759 Int_t oksigmaTOFPionHyp=fPidHF->GetnSigmaTOF(track,2,sigmaTOFPionHyp);
760 Int_t oksigmaTOFKaonHyp=fPidHF->GetnSigmaTOF(track,3,sigmaTOFKaonHyp);
761 Int_t oksigmaTOFProtonHyp=fPidHF->GetnSigmaTOF(track,4,sigmaTOFProtonHyp);
763 sigmaTPCPionHyp=TMath::Abs(sigmaTPCPionHyp);
764 sigmaTPCKaonHyp=TMath::Abs(sigmaTPCKaonHyp);
765 sigmaTPCProtonHyp=TMath::Abs(sigmaTPCProtonHyp);
766 sigmaTOFPionHyp=TMath::Abs(sigmaTOFPionHyp);
767 sigmaTOFKaonHyp=TMath::Abs(sigmaTOFKaonHyp);
768 sigmaTOFProtonHyp=TMath::Abs(sigmaTOFProtonHyp);
770 if (oksigmaTPCPionHyp && sigmaTPCPionHyp>0.){
771 if (sigmaTPCPionHyp<1.) bitmap+=1<<kTPCPionLess1;
773 if (sigmaTPCPionHyp<2.) bitmap+=1<<kTPCPionMore1Less2;
775 if (sigmaTPCPionHyp<3.) bitmap+=1<<kTPCPionMore2Less3;
776 else bitmap+=1<<kTPCPionMore3;
781 if (oksigmaTPCKaonHyp && sigmaTPCKaonHyp>0.){
782 if (sigmaTPCKaonHyp<1.) bitmap+=1<<kTPCKaonLess1;
784 if (sigmaTPCKaonHyp<2.) bitmap+=1<<kTPCKaonMore1Less2;
786 if (sigmaTPCKaonHyp<3.) bitmap+=1<<kTPCKaonMore2Less3;
787 else bitmap+=1<<kTPCKaonMore3;
792 if (oksigmaTPCProtonHyp && sigmaTPCProtonHyp>0.){
793 if (sigmaTPCProtonHyp<1.) bitmap+=1<<kTPCProtonLess1;
795 if (sigmaTPCProtonHyp<2.) bitmap+=1<<kTPCProtonMore1Less2;
797 if (sigmaTPCProtonHyp<3.) bitmap+=1<<kTPCProtonMore2Less3;
798 else bitmap+=1<<kTPCProtonMore3;
803 if (oksigmaTOFPionHyp && sigmaTOFPionHyp>0.){
804 if (sigmaTOFPionHyp<1.) bitmap+=1<<kTOFPionLess1;
806 if (sigmaTOFPionHyp<2.) bitmap+=1<<kTOFPionMore1Less2;
808 if (sigmaTOFPionHyp<3.) bitmap+=1<<kTOFPionMore2Less3;
809 else bitmap+=1<<kTOFPionMore3;
814 if (oksigmaTOFKaonHyp && sigmaTOFKaonHyp>0.){
815 if (sigmaTOFKaonHyp<1.) bitmap+=1<<kTOFKaonLess1;
817 if (sigmaTOFKaonHyp<2.) bitmap+=1<<kTOFKaonMore1Less2;
819 if (sigmaTOFKaonHyp<3.) bitmap+=1<<kTOFKaonMore2Less3;
820 else bitmap+=1<<kTOFKaonMore3;
825 if (oksigmaTOFProtonHyp && sigmaTOFProtonHyp>0.){
826 if (sigmaTOFProtonHyp<1.) bitmap+=1<<kTOFProtonLess1;
828 if (sigmaTOFProtonHyp<2.) bitmap+=1<<kTOFProtonMore1Less2;
830 if (sigmaTOFProtonHyp<3.) bitmap+=1<<kTOFProtonMore2Less3;
831 else bitmap+=1<<kTOFProtonMore3;
843 //---------------------------------------------------------------------------
845 void AliRDHFCutsDstoKKpi::SetStandardCutsPP2010() {
847 //STANDARD CUTS USED FOR 2010 pp analysis
850 SetName("DstoKKpiCutsStandard");
851 SetTitle("Standard Cuts for D+s analysis");
854 SetOptPileup(AliRDHFCuts::kRejectPileupEvent);
859 AliESDtrackCuts* esdTrackCuts=new AliESDtrackCuts();
860 esdTrackCuts->SetRequireSigmaToVertex(kFALSE);
862 esdTrackCuts->SetRequireTPCRefit(kTRUE);
863 esdTrackCuts->SetRequireITSRefit(kTRUE);
864 //esdTrackCuts->SetMinNClustersITS(4); // default is 5
865 esdTrackCuts->SetMinNClustersTPC(70);
866 esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,
867 AliESDtrackCuts::kAny);
868 // default is kBoth, otherwise kAny
869 esdTrackCuts->SetMinDCAToVertexXY(0.);
870 esdTrackCuts->SetPtRange(0.3,1.e10);
872 AddTrackCuts(esdTrackCuts);
877 const Int_t nptbins=4;
878 Float_t ptbins[nptbins+1];
885 const Int_t nvars=20;
887 Float_t** anacutsval;
888 anacutsval=new Float_t*[nvars];
890 for(Int_t ic=0;ic<nvars;ic++){anacutsval[ic]=new Float_t[nptbins];}
891 for(Int_t ipt=0;ipt<nptbins;ipt++){
893 anacutsval[0][ipt]=0.35;
894 anacutsval[1][ipt]=0.3;
895 anacutsval[2][ipt]=0.3;
896 anacutsval[3][ipt]=0.;
897 anacutsval[4][ipt]=0.;
898 anacutsval[5][ipt]=0.005;
899 anacutsval[8][ipt]=0.;
900 anacutsval[10][ipt]=0.;
901 anacutsval[11][ipt]=1000.0;
902 anacutsval[13][ipt]=0.1;
903 anacutsval[16][ipt]=0.;
904 anacutsval[17][ipt]=0.;
905 anacutsval[18][ipt]=0.;
906 anacutsval[19][ipt]=-1.;
913 anacutsval[6][0]=0.020;
914 anacutsval[6][1]=0.030;
915 anacutsval[6][2]=0.030;
916 anacutsval[6][3]=0.060;
920 anacutsval[7][0]=0.035;
921 anacutsval[7][1]=0.035;
922 anacutsval[7][2]=0.040;
923 anacutsval[7][3]=0.040;
927 anacutsval[9][0]=0.94;
928 anacutsval[9][1]=0.94;
929 anacutsval[9][2]=0.94;
930 anacutsval[9][3]=0.94;
934 anacutsval[12][0]=0.0080;
935 anacutsval[12][1]=0.0050;
936 anacutsval[12][2]=0.0045;
937 anacutsval[12][3]=0.0090;
941 anacutsval[14][0]=0.10;
942 anacutsval[14][1]=0.05;
943 anacutsval[14][2]=0.0;
944 anacutsval[14][3]=0.05;
948 anacutsval[15][0]=0.95;
949 anacutsval[15][1]=0.95;
950 anacutsval[15][2]=1.;
951 anacutsval[15][3]=0.95;
953 fPidHF->SetOldPid(kTRUE);
956 SetMaxPtStrongPid(9999.);
957 SetGlobalIndex(nvars,nptbins);
958 SetPtBins(nptbins+1,ptbins);
959 SetCuts(nvars,nptbins,anacutsval);
960 SetRemoveDaughtersFromPrim(kTRUE);
964 for(Int_t iic=0;iic<nvars;iic++){delete [] anacutsval[iic];}
965 delete [] anacutsval;