/************************************************************************** * Copyright(c) 1998-2010, ALICE Experiment at CERN, All rights reserved. * * * * Author: The ALICE Off-line Project. * * Contributors are mentioned in the code where appropriate. * * * * Permission to use, copy, modify and distribute this software and its * * documentation strictly for non-commercial purposes is hereby granted * * without fee, provided that the above copyright notice appears in all * * copies and that both the copyright notice and this permission notice * * appear in the supporting documentation. The authors make no claims * * about the suitability of this software for any purpose. It is * * provided "as is" without express or implied warranty. * **************************************************************************/ /* $Id$ */ ///////////////////////////////////////////////////////////// // // Class for cuts on AOD reconstructed D+->Kpipi // // Author: R. Bala, bala@to.infn.it // G. Ortona, ortona@to.infn.it ///////////////////////////////////////////////////////////// #include #include #include "AliRDHFCutsDplustoKpipi.h" #include "AliAODRecoDecayHF3Prong.h" #include "AliAODTrack.h" #include "AliESDtrack.h" ClassImp(AliRDHFCutsDplustoKpipi) //-------------------------------------------------------------------------- AliRDHFCutsDplustoKpipi::AliRDHFCutsDplustoKpipi(const char* name) : AliRDHFCuts(name), fUseStrongPid(0), fMaxPtStrongPid(0.), fUseImpParProdCorrCut(kFALSE) { // // Default Constructor // Int_t nvars=14; SetNVars(nvars); TString varNames[14]={"inv. mass [GeV]", "pTK [GeV/c]", "pTPi [GeV/c]", "d0K [cm] lower limit!", "d0Pi [cm] lower limit!", "dist12 (cm)", "sigmavert (cm)", "dist prim-sec (cm)", "pM=Max{pT1,pT2,pT3} (GeV/c)", "cosThetaPoint", "Sum d0^2 (cm^2)", "dca cut (cm)", "dec len XY (cm)", "cosThetaPointXY"}; Bool_t isUpperCut[14]={kTRUE, kFALSE, kFALSE, kFALSE, kFALSE, kFALSE, kTRUE, kFALSE, kFALSE, kFALSE, kFALSE, kTRUE, kFALSE, kFALSE}; SetVarNames(nvars,varNames,isUpperCut); Bool_t forOpt[14]={kFALSE, kFALSE, kFALSE, kFALSE, kFALSE, kFALSE, kTRUE, kTRUE, kTRUE, kTRUE, kTRUE, kFALSE, kTRUE, kTRUE}; SetVarsForOpt(7,forOpt); Float_t limits[2]={0,999999999.}; SetPtBins(2,limits); if(fPidHF)delete fPidHF; fPidHF=new AliAODPidHF(); Double_t plim[2]={0.6,0.8}; Double_t nsigma[5]={2.,1.,2.,3.,0.}; fPidHF->SetPLimit(plim); fPidHF->SetAsym(kTRUE); fPidHF->SetSigma(nsigma); fPidHF->SetMatch(1); fPidHF->SetTPC(1); fPidHF->SetTOF(1); fPidHF->SetITS(0); fPidHF->SetTRD(0); fPidHF->SetCompat(kTRUE); } //-------------------------------------------------------------------------- AliRDHFCutsDplustoKpipi::AliRDHFCutsDplustoKpipi(const AliRDHFCutsDplustoKpipi &source) : AliRDHFCuts(source), fUseStrongPid(source.fUseStrongPid), fMaxPtStrongPid(source.fMaxPtStrongPid), fUseImpParProdCorrCut(source.fUseImpParProdCorrCut) { // // Copy constructor // } //-------------------------------------------------------------------------- AliRDHFCutsDplustoKpipi &AliRDHFCutsDplustoKpipi::operator=(const AliRDHFCutsDplustoKpipi &source) { // // assignment operator // if(&source == this) return *this; AliRDHFCuts::operator=(source); return *this; } // //--------------------------------------------------------------------------- void AliRDHFCutsDplustoKpipi::GetCutVarsForOpt(AliAODRecoDecayHF *d,Float_t *vars,Int_t nvars,Int_t *pdgdaughters,AliAODEvent *aod) { // // Fills in vars the values of the variables // if(nvars!=fnVarsForOpt) { printf("AliRDHFCutsDplustoKpipi::GetCutsVarsForOpt: wrong number of variables\n"); return; } AliAODRecoDecayHF3Prong *dd = (AliAODRecoDecayHF3Prong*)d; //recalculate vertex w/o daughters Bool_t cleanvtx=kFALSE; AliAODVertex *origownvtx=0x0; if(fRemoveDaughtersFromPrimary) { if(dd->GetOwnPrimaryVtx()) origownvtx=new AliAODVertex(*dd->GetOwnPrimaryVtx()); cleanvtx=kTRUE; if(!RecalcOwnPrimaryVtx(dd,aod)) { CleanOwnPrimaryVtx(dd,aod,origownvtx); cleanvtx=kFALSE; } } Int_t iter=-1; if(fVarsForOpt[0]){ iter++; vars[iter]=dd->InvMassDplus(); } if(fVarsForOpt[1]){ iter++; for(Int_t iprong=0;iprong<3;iprong++){ if(TMath::Abs(pdgdaughters[iprong])==321) { vars[iter]=dd->PtProng(iprong); } } } if(fVarsForOpt[2]){ iter++; Float_t minPtDau=1000000.0; for(Int_t iprong=0;iprong<3;iprong++){ if(TMath::Abs(pdgdaughters[iprong])==211) { if(dd->PtProng(iprong)PtProng(iprong); } } } vars[iter]=minPtDau; } if(fVarsForOpt[3]){ iter++; for(Int_t iprong=0;iprong<3;iprong++){ if(TMath::Abs(pdgdaughters[iprong])==321) { vars[iter]=dd->Getd0Prong(iprong); } } } if(fVarsForOpt[4]){ iter++; Float_t minImpParDau=1000000.0; for(Int_t iprong=0;iprong<3;iprong++){ if(TMath::Abs(pdgdaughters[iprong])==211) { if(dd->Getd0Prong(iprong)Getd0Prong(iprong); } } } vars[iter]=minImpParDau; } if(fVarsForOpt[5]){ iter++; Float_t dist12 = dd->GetDist12toPrim(); Float_t dist23 = dd->GetDist23toPrim(); if(dist12GetSigmaVert(); } if(fVarsForOpt[7]){ iter++; vars[iter] = dd->DecayLength(); } if(fVarsForOpt[8]){ iter++; Float_t ptmax=0; for(Int_t i=0;i<3;i++){ if(dd->PtProng(i)>ptmax)ptmax=dd->PtProng(i); } vars[iter]=ptmax; } if(fVarsForOpt[9]){ iter++; vars[iter]=dd->CosPointingAngle(); } if(fVarsForOpt[10]){ iter++; vars[iter]=dd->Getd0Prong(0)*dd->Getd0Prong(0)+dd->Getd0Prong(1)*dd->Getd0Prong(1)+dd->Getd0Prong(2)*dd->Getd0Prong(2); } if(fVarsForOpt[11]){ iter++; Float_t maxDCA=0; for(Int_t iprong=0;iprong<3;iprong++){ if(dd->GetDCA(iprong)GetDCA(iprong); } } vars[iter]=maxDCA; } if(fVarsForOpt[12]){ iter++; vars[iter]=dd->NormalizedDecayLengthXY()*dd->P()/dd->Pt(); } if(fVarsForOpt[13]){ iter++; vars[iter]=dd->CosPointingAngleXY(); } if(cleanvtx)CleanOwnPrimaryVtx(dd,aod,origownvtx); return; } //--------------------------------------------------------------------------- Bool_t AliRDHFCutsDplustoKpipi::IsInFiducialAcceptance(Double_t pt, Double_t y) const { // // Checking if Dplus is in fiducial acceptance region // if(pt > 5.) { // applying cut for pt > 5 GeV AliDebug(2,Form("pt of D+ = %f (> 5), cutting at |y| < 0.8",pt)); if (TMath::Abs(y) > 0.8) return kFALSE; } else { // appliying smooth cut for pt < 5 GeV Double_t maxFiducialY = -0.2/15*pt*pt+1.9/15*pt+0.5; Double_t minFiducialY = 0.2/15*pt*pt-1.9/15*pt-0.5; AliDebug(2,Form("pt of D+ = %f (< 5), cutting according to the fiducial zone [%f, %f]\n",pt,minFiducialY,maxFiducialY)); if (y < minFiducialY || y > maxFiducialY) return kFALSE; } return kTRUE; } //--------------------------------------------------------------------------- Int_t AliRDHFCutsDplustoKpipi::IsSelectedPID(AliAODRecoDecayHF *rd) { // // PID selection, returns 3 if accepted, 0 if not accepted // if(!fUsePID || !rd) return 3; //if(fUsePID)printf("i am inside the pid \n"); Int_t nkaons=0; Int_t nNotKaons=0; Int_t sign= rd->GetCharge(); for(Int_t daught=0;daught<3;daught++){ AliAODTrack *track=(AliAODTrack*)rd->GetDaughter(daught); Int_t isPion=fPidHF->MakeRawPid(track,AliPID::kPion); Int_t isKaon=fPidHF->MakeRawPid(track,AliPID::kKaon); Int_t isProton=fPidHF->MakeRawPid(track,AliPID::kProton); if(isProton>0 && isKaon<0 && isPion<0) return 0; if(isKaon>0 && isPion<0) nkaons++; if(isKaon<0) nNotKaons++; if(sign==track->Charge()){//pions if(isPion<0)return 0; if(rd->Pt()1)return 0; } else{//kaons if(isKaon<0)return 0; if(rd->Pt()0)return 0; } } if(nkaons>1)return 0; if(nNotKaons==3)return 0; return 3; } //--------------------------------------------------------------------------- Int_t AliRDHFCutsDplustoKpipi::IsSelected(TObject* obj,Int_t selectionLevel, AliAODEvent* aod) { // // Apply selection, returns 3 if accepted, 0 if not accepted // fIsSelectedCuts=0; fIsSelectedPID=0; if(!fCutsRD){ cout<<"Cut matrix not inizialized. Exit..."<Pt(); if(ptfMaxPtCand) return 0; // selection on candidate if(selectionLevel==AliRDHFCuts::kAll || selectionLevel==AliRDHFCuts::kCandidate) { //recalculate vertex w/o daughters AliAODVertex *origownvtx=0x0; if(fRemoveDaughtersFromPrimary) { if(d->GetOwnPrimaryVtx()) origownvtx=new AliAODVertex(*d->GetOwnPrimaryVtx()); if(!RecalcOwnPrimaryVtx(d,aod)) { CleanOwnPrimaryVtx(d,aod,origownvtx); return 0; } } Int_t ptbin=PtBin(pt); if (ptbin==-1) { CleanOwnPrimaryVtx(d,aod,origownvtx); return 0; } Double_t mDplusPDG = TDatabasePDG::Instance()->GetParticle(411)->Mass(); Double_t mDplus=d->InvMassDplus(); if(TMath::Abs(mDplus-mDplusPDG)>fCutsRD[GetGlobalIndex(0,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;} //2track cuts if(d->GetDist12toPrim()GetDist23toPrim()Getd0Prong(0)*d->Getd0Prong(0)+d->Getd0Prong(1)*d->Getd0Prong(1)+d->Getd0Prong(2)*d->Getd0Prong(2); if(sum2Getd0Prong(0)*d->Getd0Prong(1)<0. && d->Getd0Prong(2)*d->Getd0Prong(1)<0.) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;} } //sec vert if(d->GetSigmaVert()>fCutsRD[GetGlobalIndex(6,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;} //DCA for(Int_t i=0;i<3;i++) if(d->GetDCA(i)>fCutsRD[GetGlobalIndex(11,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;} if(d->Pt2Prong(1) < fCutsRD[GetGlobalIndex(1,ptbin)]*fCutsRD[GetGlobalIndex(1,ptbin)] || TMath::Abs(d->Getd0Prong(1))Pt2Prong(0) < fCutsRD[GetGlobalIndex(2,ptbin)]*fCutsRD[GetGlobalIndex(2,ptbin)] || TMath::Abs(d->Getd0Prong(0))Pt2Prong(2) < fCutsRD[GetGlobalIndex(2,ptbin)]*fCutsRD[GetGlobalIndex(2,ptbin)] || TMath::Abs(d->Getd0Prong(2))Pt2Prong(0)Pt2Prong(1)Pt2Prong(2)DecayLength2()CosPointingAngle()< fCutsRD[GetGlobalIndex(9,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;} if(d->NormalizedDecayLengthXY()*d->P()/ptCosPointingAngleXY()SetRequireSigmaToVertex(kFALSE); //default esdTrackCuts->SetRequireTPCRefit(kTRUE); esdTrackCuts->SetRequireITSRefit(kTRUE); //esdTrackCuts->SetMinNClustersITS(4); // default is 5 esdTrackCuts->SetMinNClustersTPC(70); esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny); // default is kBoth, otherwise kAny esdTrackCuts->SetMinDCAToVertexXY(0.); esdTrackCuts->SetPtRange(0.3,1.e10); AddTrackCuts(esdTrackCuts); const Int_t nptbins =13; const Int_t nvars=14; Float_t ptbins[nptbins+1]; ptbins[0]=0.; ptbins[1]=1; ptbins[2]=2.; ptbins[3]=3.; ptbins[4]=4.; ptbins[5]=5.; ptbins[6]=6.; ptbins[7]=8.; ptbins[8]=10.; ptbins[9]=12.; ptbins[10]=14.; ptbins[11]=16.; ptbins[12]=24.; ptbins[13]=99999.; Float_t** anacutsval; anacutsval=new Float_t*[nvars]; for(Int_t ic=0;icSetRequireSigmaToVertex(kFALSE); //default esdTrackCuts->SetRequireTPCRefit(kTRUE); esdTrackCuts->SetRequireITSRefit(kTRUE); //esdTrackCuts->SetMinNClustersITS(4); // default is 5 esdTrackCuts->SetMinNClustersTPC(70); esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny); // default is kBoth, otherwise kAny esdTrackCuts->SetMinDCAToVertexXY(0.); esdTrackCuts->SetPtRange(0.8,1.e10); AddTrackCuts(esdTrackCuts); const Int_t nptbins=10; Float_t* ptbins; ptbins=new Float_t[nptbins+1]; ptbins[0]=0.; ptbins[1]=1.; ptbins[2]=2.; ptbins[3]=3.; ptbins[4]=4.; ptbins[5]=5.; ptbins[6]=6.; ptbins[7]=8.; ptbins[8]=12.; ptbins[9]=16.; ptbins[10]=24.; const Int_t nvars=14; Float_t** anacutsval; anacutsval=new Float_t*[nvars]; for(Int_t ic=0;ic