/************************************************************************** * 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. * **************************************************************************/ ///////////////////////////////////////////////////////////// // // Class for cuts on AOD reconstructed D0->Kpi // // Author: A.Dainese, andrea.dainese@pd.infn.it ///////////////////////////////////////////////////////////// #include #include #include "AliRDHFCutsD0toKpi.h" #include "AliAODRecoDecayHF2Prong.h" #include "AliAODTrack.h" #include "AliESDtrack.h" ClassImp(AliRDHFCutsD0toKpi) //-------------------------------------------------------------------------- AliRDHFCutsD0toKpi::AliRDHFCutsD0toKpi(const char* name) : AliRDHFCuts(name) { // // Default Constructor // Int_t nvars=9; SetNVars(nvars); TString varNames[9]={"inv. mass [GeV]", "dca [cm]", "cosThetaStar", "pTK [GeV/c]", "pTPi [GeV/c]", "d0K [cm]", "d0Pi [cm]", "d0d0 [cm^2]", "cosThetaPoint"}; Bool_t isUpperCut[9]={kTRUE, kTRUE, kTRUE, kFALSE, kFALSE, kTRUE, kTRUE, kTRUE, kFALSE}; SetVarNames(nvars,varNames,isUpperCut); Bool_t forOpt[9]={kFALSE, kTRUE, kTRUE, kFALSE, kFALSE, kFALSE, kFALSE, kTRUE, kTRUE}; SetVarsForOpt(4,forOpt); Float_t limits[2]={0,999999999.}; SetPtBins(2,limits); } //-------------------------------------------------------------------------- AliRDHFCutsD0toKpi::AliRDHFCutsD0toKpi(const AliRDHFCutsD0toKpi &source) : AliRDHFCuts(source) { // // Copy constructor // } //-------------------------------------------------------------------------- AliRDHFCutsD0toKpi &AliRDHFCutsD0toKpi::operator=(const AliRDHFCutsD0toKpi &source) { // // assignment operator // if(&source == this) return *this; AliRDHFCuts::operator=(source); return *this; } //--------------------------------------------------------------------------- void AliRDHFCutsD0toKpi::GetCutVarsForOpt(AliAODRecoDecayHF *d,Float_t *vars,Int_t nvars,Int_t *pdgdaughters) { // // Fills in vars the values of the variables // if(nvars!=fnVarsForOpt) { printf("AliRDHFCutsD0toKpi::GetCutsVarsForOpt: wrong number of variables\n"); return; } AliAODRecoDecayHF2Prong *dd = (AliAODRecoDecayHF2Prong*)d; Int_t iter=-1; if(fVarsForOpt[0]){ iter++; if(TMath::Abs(pdgdaughters[0])==211) { vars[iter]=dd->InvMassD0(); } else { vars[iter]=dd->InvMassD0bar(); } } if(fVarsForOpt[1]){ iter++; vars[iter]=dd->GetDCA(); } if(fVarsForOpt[2]){ iter++; if(TMath::Abs(pdgdaughters[0])==211) { vars[iter] = dd->CosThetaStarD0(); } else { vars[iter] = dd->CosThetaStarD0bar(); } } if(fVarsForOpt[3]){ iter++; if(TMath::Abs(pdgdaughters[0])==321) { vars[iter]=dd->PtProng(0); } else{ vars[iter]=dd->PtProng(1); } } if(fVarsForOpt[4]){ iter++; if(TMath::Abs(pdgdaughters[0])==211) { vars[iter]=dd->PtProng(0); } else{ vars[iter]=dd->PtProng(1); } } if(fVarsForOpt[5]){ iter++; if(TMath::Abs(pdgdaughters[0])==321) { vars[iter]=dd->Getd0Prong(0); } else{ vars[iter]=dd->Getd0Prong(1); } } if(fVarsForOpt[6]){ iter++; if(TMath::Abs(pdgdaughters[0])==211) { vars[iter]=dd->Getd0Prong(0); } else{ vars[iter]=dd->Getd0Prong(1); } } if(fVarsForOpt[7]){ iter++; vars[iter]= dd->Prodd0d0(); } if(fVarsForOpt[8]){ iter++; vars[iter]=dd->CosPointingAngle(); } return; } //--------------------------------------------------------------------------- Int_t AliRDHFCutsD0toKpi::IsSelected(TObject* obj,Int_t selectionLevel) { // // Apply selection // if(!fCutsRD){ cout<<"Cut matrice not inizialized. Exit..."<Pt(); Int_t okD0=0,okD0bar=0; Int_t ptbin=PtBin(pt); Double_t mD0,mD0bar,ctsD0,ctsD0bar; okD0=1; okD0bar=1; Double_t mD0PDG = TDatabasePDG::Instance()->GetParticle(421)->Mass(); if(d->PtProng(1) < fCutsRD[GetGlobalIndex(3,ptbin)] || d->PtProng(0) < fCutsRD[GetGlobalIndex(4,ptbin)]) okD0 = 0; if(d->PtProng(0) < fCutsRD[GetGlobalIndex(3,ptbin)] || d->PtProng(1) < fCutsRD[GetGlobalIndex(4,ptbin)]) okD0bar = 0; if(!okD0 && !okD0bar) return 0; if(TMath::Abs(d->Getd0Prong(1)) > fCutsRD[GetGlobalIndex(5,ptbin)] || TMath::Abs(d->Getd0Prong(0)) > fCutsRD[GetGlobalIndex(6,ptbin)]) okD0 = 0; if(TMath::Abs(d->Getd0Prong(0)) > fCutsRD[GetGlobalIndex(6,ptbin)] || TMath::Abs(d->Getd0Prong(1)) > fCutsRD[GetGlobalIndex(5,ptbin)]) okD0bar = 0; if(!okD0 && !okD0bar) return 0; if(d->GetDCA() > fCutsRD[GetGlobalIndex(1,ptbin)]) return 0; d->InvMassD0(mD0,mD0bar); if(TMath::Abs(mD0-mD0PDG) > fCutsRD[GetGlobalIndex(0,ptbin)]) okD0 = 0; if(TMath::Abs(mD0bar-mD0PDG) > fCutsRD[GetGlobalIndex(0,ptbin)]) okD0bar = 0; if(!okD0 && !okD0bar) return 0; d->CosThetaStarD0(ctsD0,ctsD0bar); if(TMath::Abs(ctsD0) > fCutsRD[GetGlobalIndex(2,ptbin)]) okD0 = 0; if(TMath::Abs(ctsD0bar) > fCutsRD[GetGlobalIndex(2,ptbin)]) okD0bar = 0; if(!okD0 && !okD0bar) return 0; if(d->Prodd0d0() > fCutsRD[GetGlobalIndex(7,ptbin)]) return 0; if(d->CosPointingAngle() < fCutsRD[GetGlobalIndex(8,ptbin)]) return 0; if (okD0) returnvalueCuts=1; //cuts passed as D0 if (okD0bar) returnvalueCuts=2; //cuts passed as D0bar if (okD0 && okD0bar) returnvalueCuts=3; //cuts passed as D0 and D0bar } // combine PID and Cuts results switch(returnvaluePID) { case 0: returnvalue=0; break; case 1: returnvalue=((returnvalueCuts==1 || returnvalueCuts==3) ? 1 : 0); break; case 2: returnvalue=((returnvalueCuts==2 || returnvalueCuts==3) ? 2 : 0); break; case 3: returnvalue=returnvalueCuts; break; default: returnvalue=0; break; } return returnvalue; } //--------------------------------------------------------------------------- Bool_t AliRDHFCutsD0toKpi::IsInFiducialAcceptance(Double_t pt, Double_t y) const { // // Checking if D0 is in fiducial acceptance region // if(pt > 5.) { // applying cut for pt > 5 GeV AliDebug(4,Form("pt of D0 = %f (> 5), cutting at |y| < 0.8\n",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(4,Form("pt of D0 = %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 AliRDHFCutsD0toKpi::IsSelectedPID(AliAODRecoDecayHF* rd) const { // // Apply PID selection // (return: 0 not sel, 1 only D0, 2 only D0bar, 3 both) // if(!fUsePID || !rd) return 3; Int_t returnvalue=0; // HERE LOOP ON DAUGHTERS, USE AliAODpidHF CLASS, ETC... return returnvalue; }