X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=PWG3%2FvertexingHF%2FAliRDHFCutsDplustoKpipi.cxx;h=50687d49cfd6bb85d4f86448e811802f9eb26464;hb=3c86777898c62eb4710ab5bd8115fe10d7ed565f;hp=5f55cb6055e91e78b28e6f4e351f8e50199885f9;hpb=4755453e09dba443f93bcd62e613e584fc2b33c3;p=u%2Fmrichter%2FAliRoot.git diff --git a/PWG3/vertexingHF/AliRDHFCutsDplustoKpipi.cxx b/PWG3/vertexingHF/AliRDHFCutsDplustoKpipi.cxx index 5f55cb6055e..50687d49cfd 100644 --- a/PWG3/vertexingHF/AliRDHFCutsDplustoKpipi.cxx +++ b/PWG3/vertexingHF/AliRDHFCutsDplustoKpipi.cxx @@ -13,6 +13,8 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ +/* $Id$ */ + ///////////////////////////////////////////////////////////// // // Class for cuts on AOD reconstructed D+->Kpipi @@ -29,18 +31,22 @@ #include "AliAODTrack.h" #include "AliESDtrack.h" + ClassImp(AliRDHFCutsDplustoKpipi) //-------------------------------------------------------------------------- -AliRDHFCutsDplustoKpipi::AliRDHFCutsDplustoKpipi() : - AliRDHFCuts() +AliRDHFCutsDplustoKpipi::AliRDHFCutsDplustoKpipi(const char* name) : +AliRDHFCuts(name), + fUseStrongPid(0), + fMaxPtStrongPid(0.), + fUseImpParProdCorrCut(kFALSE) { // // Default Constructor // - Int_t nvars=12; + Int_t nvars=14; SetNVars(nvars); - TString varNames[12]={"inv. mass [GeV]", + TString varNames[14]={"inv. mass [GeV]", "pTK [GeV/c]", "pTPi [GeV/c]", "d0K [cm] lower limit!", @@ -51,8 +57,10 @@ AliRDHFCutsDplustoKpipi::AliRDHFCutsDplustoKpipi() : "pM=Max{pT1,pT2,pT3} (GeV/c)", "cosThetaPoint", "Sum d0^2 (cm^2)", - "dca cut (cm)"}; - Bool_t isUpperCut[12]={kTRUE, + "dca cut (cm)", + "dec len XY (cm)", + "cosThetaPointXY"}; + Bool_t isUpperCut[14]={kTRUE, kFALSE, kFALSE, kFALSE, @@ -63,9 +71,11 @@ AliRDHFCutsDplustoKpipi::AliRDHFCutsDplustoKpipi() : kFALSE, kFALSE, kFALSE, - kTRUE}; + kTRUE, + kFALSE, + kFALSE}; SetVarNames(nvars,varNames,isUpperCut); - Bool_t forOpt[12]={kFALSE, + Bool_t forOpt[14]={kFALSE, kFALSE, kFALSE, kFALSE, @@ -76,14 +86,43 @@ AliRDHFCutsDplustoKpipi::AliRDHFCutsDplustoKpipi() : kTRUE, kTRUE, kTRUE, - kFALSE}; - SetVarsForOpt(5,forOpt); + 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) + AliRDHFCuts(source), + fUseStrongPid(source.fUseStrongPid), + fMaxPtStrongPid(source.fMaxPtStrongPid), + fUseImpParProdCorrCut(source.fUseImpParProdCorrCut) { // // Copy constructor @@ -102,10 +141,11 @@ AliRDHFCutsDplustoKpipi &AliRDHFCutsDplustoKpipi::operator=(const AliRDHFCutsDpl return *this; } +// //--------------------------------------------------------------------------- -void AliRDHFCutsDplustoKpipi::GetCutVarsForOpt(AliAODRecoDecayHF *d,Float_t *vars,Int_t nvars,Int_t *pdgdaughters) { +void AliRDHFCutsDplustoKpipi::GetCutVarsForOpt(AliAODRecoDecayHF *d,Float_t *vars,Int_t nvars,Int_t *pdgdaughters,AliAODEvent *aod) { // // Fills in vars the values of the variables // @@ -117,6 +157,18 @@ void AliRDHFCutsDplustoKpipi::GetCutVarsForOpt(AliAODRecoDecayHF *d,Float_t *var } 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]){ @@ -172,7 +224,7 @@ void AliRDHFCutsDplustoKpipi::GetCutVarsForOpt(AliAODRecoDecayHF *d,Float_t *var } if(fVarsForOpt[6]){ iter++; - vars[iter]=dd->GetSigmaVert(); + vars[iter]=dd->GetSigmaVert(aod); } if(fVarsForOpt[7]){ iter++; @@ -204,14 +256,89 @@ void AliRDHFCutsDplustoKpipi::GetCutVarsForOpt(AliAODRecoDecayHF *d,Float_t *var } 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; } //--------------------------------------------------------------------------- -Int_t AliRDHFCutsDplustoKpipi::IsSelected(TObject* obj,Int_t selectionLevel) { +Bool_t AliRDHFCutsDplustoKpipi::IsInFiducialAcceptance(Double_t pt, Double_t y) const +{ // - // Apply selection + // 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; + + if(d->HasBadDaughters()) return 0; + // selection on candidate if(selectionLevel==AliRDHFCuts::kAll || selectionLevel==AliRDHFCuts::kCandidate) { - Double_t pt=d->Pt(); - - Int_t ptbin=PtBin(pt); + //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)])return 0; - // if(d->PtProng(1) < fCutsRD[GetGlobalIndex(3,ptbin)] || d->PtProng(0) < fCutsRD[GetGlobalIndex(4,ptbin)]) okD0 = 0; - if(TMath::Abs(d->PtProng(1)) < fCutsRD[GetGlobalIndex(1,ptbin)] || TMath::Abs(d->Getd0Prong(1))PtProng(0)) < fCutsRD[GetGlobalIndex(2,ptbin)] || TMath::Abs(d->Getd0Prong(0))PtProng(2)) < fCutsRD[GetGlobalIndex(2,ptbin)] || TMath::Abs(d->Getd0Prong(2))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;} + } + + + //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;} - //2track cuts - if(d->GetDist12toPrim()GetDist23toPrim()Getd0Prong(0)*d->Getd0Prong(1)<0. && d->Getd0Prong(2)*d->Getd0Prong(1)<0.)return 0; + if(d->NormalizedDecayLengthXY()*d->P()/ptGetSigmaVert()>fCutsRD[GetGlobalIndex(6,ptbin)])return 0; + if(d->CosPointingAngleXY()DecayLength()GetSigmaVert(aod); + if(sigmavert>fCutsRD[GetGlobalIndex(6,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;} - if(TMath::Abs(d->PtProng(0))PtProng(1))PtProng(2))CosPointingAngle()< fCutsRD[GetGlobalIndex(9,ptbin)])return 0; - Double_t sum2=d->Getd0Prong(0)*d->Getd0Prong(0)+d->Getd0Prong(1)*d->Getd0Prong(1)+d->Getd0Prong(2)*d->Getd0Prong(2); - if(sum2GetDCA(i)>fCutsRD[GetGlobalIndex(11,ptbin)]) return 0; + //if(!returnvalueCuts) return 0; // returnvalueCuts cannot be 0 here + } - return 1; + if(selectionLevel==AliRDHFCuts::kAll || + selectionLevel==AliRDHFCuts::kCandidate || + selectionLevel==AliRDHFCuts::kPID) { + returnvaluePID = IsSelectedPID(d); + fIsSelectedPID=returnvaluePID; + } + if(returnvaluePID==0)return 0; + + // selection on daughter tracks + if(selectionLevel==AliRDHFCuts::kAll || + selectionLevel==AliRDHFCuts::kTracks) { + if(!AreDaughtersSelected(d)) return 0; } - return 1; + + + + + return 3; } + + + + //--------------------------------------------------------------------------- + + +void AliRDHFCutsDplustoKpipi::SetStandardCutsPP2010() { + // + //STANDARD CUTS USED FOR 2010 pp analysis + // + + SetName("DplustoKpipiCutsStandard"); + SetTitle("Standard Cuts for D+ analysis"); + + // PILE UP REJECTION + SetOptPileup(AliRDHFCuts::kRejectPileupEvent); + + // EVENT CUTS + SetMinVtxContr(1); + + AliESDtrackCuts* esdTrackCuts=new AliESDtrackCuts(); + esdTrackCuts->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