Added selection bits
authordainese <dainese@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 15 Feb 2011 18:36:50 +0000 (18:36 +0000)
committerdainese <dainese@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 15 Feb 2011 18:36:50 +0000 (18:36 +0000)
PWG3/vertexingHF/AliAODRecoDecayHF.cxx
PWG3/vertexingHF/AliAODRecoDecayHF.h
PWG3/vertexingHF/AliAnalysisVertexingHF.cxx
PWG3/vertexingHF/AliAnalysisVertexingHF.h
PWG3/vertexingHF/AliRDHFCuts.h
PWG3/vertexingHF/AliRDHFCutsDStartoKpipi.cxx
PWG3/vertexingHF/ConfigVertexingHF_highmult.C

index 0b67ecd..981949e 100644 (file)
@@ -41,7 +41,8 @@ AliAODRecoDecayHF::AliAODRecoDecayHF() :
   fEventPrimaryVtx(),
   fListOfCuts(),
   fd0err(0x0), 
-  fProngID(0x0) 
+  fProngID(0x0),
+  fSelectionMap(0)
 {
   //
   // Default Constructor
@@ -56,7 +57,8 @@ AliAODRecoDecayHF::AliAODRecoDecayHF(AliAODVertex *vtx2,Int_t nprongs,Short_t ch
   fEventPrimaryVtx(),
   fListOfCuts(),
   fd0err(0x0),
-  fProngID(0x0) 
+  fProngID(0x0),
+  fSelectionMap(0)
 {
   //
   // Constructor with AliAODVertex for decay vertex
@@ -72,7 +74,8 @@ AliAODRecoDecayHF::AliAODRecoDecayHF(AliAODVertex *vtx2,Int_t nprongs,Short_t ch
   fEventPrimaryVtx(),
   fListOfCuts(),
   fd0err(0x0),
-  fProngID(0x0) 
+  fProngID(0x0),
+  fSelectionMap(0)
 {
   //
   // Constructor with AliAODVertex for decay vertex and without prongs momenta
@@ -90,7 +93,8 @@ AliAODRecoDecayHF::AliAODRecoDecayHF(Double_t vtx1[3],Double_t vtx2[3],
   fEventPrimaryVtx(),
   fListOfCuts(),
   fd0err(0x0),
-  fProngID(0x0) 
+  fProngID(0x0), 
+  fSelectionMap(0)
 {
   //
   // Constructor that can used for a "MC" object
@@ -109,7 +113,8 @@ AliAODRecoDecayHF::AliAODRecoDecayHF(const AliAODRecoDecayHF &source) :
   fEventPrimaryVtx(source.fEventPrimaryVtx),
   fListOfCuts(source.fListOfCuts),
   fd0err(0x0),
-  fProngID(0x0)
+  fProngID(0x0),
+  fSelectionMap(source.fSelectionMap)
 {
   //
   // Copy constructor
@@ -137,6 +142,7 @@ AliAODRecoDecayHF &AliAODRecoDecayHF::operator=(const AliAODRecoDecayHF &source)
 
   fEventPrimaryVtx = source.fEventPrimaryVtx;
   fListOfCuts = source.fListOfCuts;
+  fSelectionMap = source.fSelectionMap;
 
   if(source.GetOwnPrimaryVtx()) fOwnPrimaryVtx = new AliAODVertex(*(source.GetOwnPrimaryVtx()));
 
index d223865..5afe5d9 100644 (file)
@@ -109,6 +109,11 @@ class AliAODRecoDecayHF : public AliAODRecoDecay {
   // misalign
   void Misalign(TString misal="null");
 
+  // selection map
+  void    SetSelectionBit(Int_t i) {SETBIT(fSelectionMap,i); return;}
+  Bool_t  HasSelectionBit(Int_t i) const {return TESTBIT(fSelectionMap,i);}
+  ULong_t GetSelectionMap() const {return fSelectionMap;}
+
  protected:
 
   AliAODVertex *fOwnPrimaryVtx; // primary vertex for this candidate
@@ -116,8 +121,9 @@ class AliAODRecoDecayHF : public AliAODRecoDecay {
   TRef          fListOfCuts;  // ref to the list of analysis cuts
   Double_t     *fd0err;  //[fNProngs] error on prongs rphi impact param [cm]
   UShort_t     *fProngID;  //[fNProngs] track ID of daughters
+  ULong_t       fSelectionMap; // used to store outcome of selection in AliAnalysisVertexingHF
 
-  ClassDef(AliAODRecoDecayHF,4)  // base class for AOD reconstructed heavy-flavour decays
+  ClassDef(AliAODRecoDecayHF,5)  // base class for AOD reconstructed heavy-flavour decays
 };
 
 inline void AliAODRecoDecayHF::SetProngIDs(Int_t nIDs,UShort_t *id) 
index 2bf5ae3..387579f 100644 (file)
@@ -690,6 +690,8 @@ void AliAnalysisVertexingHF::FindCandidates(AliVEvent *event,
            v2Prong->SetParent(rd);
            AddRefs(v2Prong,rd,event,twoTrackArray1);
          }
+         // Set selection bit for PID
+         if(okD0) SetSelectionBitForPID(fCutsD0toKpi,rd);
        }
        // D* candidates
        if(fDstar && okD0fromDstar && !isLikeSign2Prong) {
@@ -762,6 +764,8 @@ void AliAnalysisVertexingHF::FindCandidates(AliVEvent *event,
                v2Prong->SetParent(rd);
                AddRefs(v2Prong,rd,event,twoTrackArray1);
                okD0=kTRUE; // this is done to add it only once
+               // Set selection bit for PID
+               SetSelectionBitForPID(fCutsD0toKpi,rd);
              }
              // add the vertex and the cascade to the AOD
              AliAODVertex *vCasc = new(verticesHFRef[iVerticesHF++])AliAODVertex(*vertexCasc); 
@@ -771,6 +775,8 @@ void AliAnalysisVertexingHF::FindCandidates(AliVEvent *event,
              if(!fInputAOD) vCasc->AddDaughter(rd); // just to fill ref #0 
              AddRefs(vCasc,rc,event,twoTrackArrayCasc);
              vCasc->AddDaughter(rd); // add the D0 (in ref #1)
+             // Set selection bit for PID
+             SetSelectionBitForPID(fCutsDStartoKpipi,rc);
            }
            twoTrackArrayCasc->Clear();
            trackPi=0; 
@@ -891,6 +897,10 @@ void AliAnalysisVertexingHF::FindCandidates(AliVEvent *event,
              v3Prong->SetParent(rd);
              AddRefs(v3Prong,rd,event,threeTrackArray);
            }
+           // Set selection bit for PID
+           SetSelectionBitForPID(fCutsDplustoKpipi,rd);
+           SetSelectionBitForPID(fCutsDstoKKpi,rd);
+           SetSelectionBitForPID(fCutsLctopKpi,rd);
          }
          if(io3Prong) {delete io3Prong; io3Prong=NULL;} 
          if(secVert3PrAOD) {delete secVert3PrAOD; secVert3PrAOD=NULL;} 
@@ -1076,6 +1086,10 @@ void AliAnalysisVertexingHF::FindCandidates(AliVEvent *event,
              v3Prong->SetParent(rd);
              AddRefs(v3Prong,rd,event,threeTrackArray);
            }
+           // Set selection bit for PID
+           SetSelectionBitForPID(fCutsDplustoKpipi,rd);
+           SetSelectionBitForPID(fCutsDstoKKpi,rd);
+           SetSelectionBitForPID(fCutsLctopKpi,rd);
          }
          if(io3Prong) {delete io3Prong; io3Prong=NULL;} 
          if(secVert3PrAOD) {delete secVert3PrAOD; secVert3PrAOD=NULL;}
@@ -1316,6 +1330,7 @@ AliAODRecoCascadeHF* AliAnalysisVertexingHF::MakeCascade(
   // select D*->D0pi
   if(fDstar) {
     okDstar = (Bool_t)fCutsDStartoKpipi->IsSelected(tmpCascade,AliRDHFCuts::kCandidate);
+    if(okDstar) theCascade->SetSelectionBit(AliRDHFCuts::kDstarCuts);
   }
   tmpCascade->GetSecondaryVtx()->RemoveDaughters();
   tmpCascade->UnsetOwnPrimaryVtx(); 
@@ -1325,6 +1340,7 @@ AliAODRecoCascadeHF* AliAnalysisVertexingHF::MakeCascade(
   }
   if(primVertexAOD) {delete primVertexAOD; primVertexAOD=NULL;}
   //---
+
   
   return theCascade;
 }
@@ -1444,13 +1460,21 @@ AliAODRecoDecayHF2Prong *AliAnalysisVertexingHF::Make2Prong(
  
   if(postrack->Charge()!=0 && negtrack->Charge()!=0) { // don't apply these cuts if it's a Dstar 
     // select D0->Kpi
-    if(fD0toKpi)   okD0 = (Bool_t)fCutsD0toKpi->IsSelected(the2Prong,AliRDHFCuts::kCandidate);
+    if(fD0toKpi)   {
+      okD0 = (Bool_t)fCutsD0toKpi->IsSelected(the2Prong,AliRDHFCuts::kCandidate);
+      if(okD0) the2Prong->SetSelectionBit(AliRDHFCuts::kD0toKpiCuts);
+    }
     //if(fDebug && fD0toKpi) printf("   %d\n",(Int_t)okD0);
     // select J/psi from B
-    if(fJPSItoEle)   okJPSI = (Bool_t)fCutsJpsitoee->IsSelected(the2Prong,AliRDHFCuts::kCandidate);
+    if(fJPSItoEle)   {
+      okJPSI = (Bool_t)fCutsJpsitoee->IsSelected(the2Prong,AliRDHFCuts::kCandidate);
+    }
     //if(fDebug && fJPSItoEle) printf("   %d\n",(Int_t)okJPSI);
     // select D0->Kpi from Dstar
-    if(fDstar)   okD0fromDstar = (Bool_t)fCutsDStartoKpipi->IsD0FromDStarSelected(the2Prong->Pt(),the2Prong,AliRDHFCuts::kCandidate);
+    if(fDstar)   {
+      okD0fromDstar = (Bool_t)fCutsDStartoKpipi->IsD0FromDStarSelected(the2Prong->Pt(),the2Prong,AliRDHFCuts::kCandidate);
+      if(okD0fromDstar) the2Prong->SetSelectionBit(AliRDHFCuts::kD0fromDstarCuts);
+    }
     //if(fDebug && fDstar) printf("   %d\n",(Int_t)okD0fromDstar);
   }
 
@@ -1550,10 +1574,18 @@ AliAODRecoDecayHF3Prong* AliAnalysisVertexingHF::Make3Prong(
   if(f3Prong) {
     ok3Prong = kFALSE;
     
-    if(fCutsDplustoKpipi->IsSelected(the3Prong,AliRDHFCuts::kCandidate)) ok3Prong = kTRUE;
-    if(fCutsDstoKKpi->IsSelected(the3Prong,AliRDHFCuts::kCandidate)) ok3Prong = kTRUE;
-    if(fCutsLctopKpi->IsSelected(the3Prong,AliRDHFCuts::kCandidate)) ok3Prong = kTRUE;
-    
+    if(fCutsDplustoKpipi->IsSelected(the3Prong,AliRDHFCuts::kCandidate)) {
+      ok3Prong = kTRUE;
+      the3Prong->SetSelectionBit(AliRDHFCuts::kDplusCuts);
+    }
+    if(fCutsDstoKKpi->IsSelected(the3Prong,AliRDHFCuts::kCandidate)) {
+      ok3Prong = kTRUE;
+      the3Prong->SetSelectionBit(AliRDHFCuts::kDsCuts);
+    }
+    if(fCutsLctopKpi->IsSelected(the3Prong,AliRDHFCuts::kCandidate)) {
+      ok3Prong = kTRUE;
+      the3Prong->SetSelectionBit(AliRDHFCuts::kLcCuts);
+    } 
   }
   //if(fDebug) printf("ok3Prong: %d\n",(Int_t)ok3Prong);
 
@@ -2169,6 +2201,20 @@ void AliAnalysisVertexingHF::SelectTracksAndCopyVertex(const AliVEvent *event,
   return;
 }
 //-----------------------------------------------------------------------------
+void AliAnalysisVertexingHF::SetSelectionBitForPID(AliRDHFCuts *cuts,AliAODRecoDecayHF *rd) {
+  //
+  // Set the selection bit for PID
+  //
+  if(cuts->GetPidHF()) {
+    Bool_t usepid=cuts->GetIsUsePID();
+    cuts->SetUsePID(kTRUE);
+    if(cuts->IsSelectedPID(rd))
+      rd->SetSelectionBit(AliRDHFCuts::kDstarPID);
+    cuts->SetUsePID(usepid);
+  }
+  return;
+}
+//-----------------------------------------------------------------------------
 Bool_t AliAnalysisVertexingHF::SingleTrkCuts(AliESDtrack *trk,
                                             Bool_t &okDisplaced,Bool_t &okSoftPi) const 
 {
index 2d44e61..24baec0 100644 (file)
@@ -22,6 +22,7 @@ class AliAODRecoDecayHF3Prong;
 class AliAODRecoDecayHF4Prong;
 class AliAODRecoCascadeHF;
 class AliAnalysisFilter;
+class AliRDHFCuts;
 class AliRDHFCutsD0toKpi;
 class AliRDHFCutsJpsitoee;
 class AliRDHFCutsDplustoKpipi;
@@ -212,6 +213,8 @@ class AliAnalysisVertexingHF : public TNamed {
                                   UChar_t *seleFlags,Int_t *evtNumber);
   Bool_t SingleTrkCuts(AliESDtrack *trk,Bool_t &okDisplaced,Bool_t &okSoftPi) const;
 
+  void   SetSelectionBitForPID(AliRDHFCuts *cuts,AliAODRecoDecayHF *rd);
+
   AliAODv0* TransformESDv0toAODv0(AliESDv0 *esdv0, 
                                  TObjArray *twoTrackArrayV0);
 
index 037093d..fb5eeea 100644 (file)
@@ -26,6 +26,7 @@ class AliRDHFCuts : public AliAnalysisCuts
   enum ECentrality {kCentOff,kCentV0M,kCentTRK,kCentTKL,kCentCL1,kCentInvalid};
   enum ESelLevel {kAll,kTracks,kPID,kCandidate};
   enum EPileup {kNoPileupSelection,kRejectPileupEvent,kRejectTracksFromPileupVertex};
+  enum ESele {kD0toKpiCuts,kD0toKpiPID,kD0fromDstarCuts,kD0fromDstarPID,kDplusCuts,kDplusPID,kDsCuts,kDsPID,kLcCuts,kLcPID,kDstarCuts,kDstarPID};
 
   AliRDHFCuts(const Char_t* name="RDHFCuts", const Char_t* title="");
   
@@ -54,7 +55,7 @@ class AliRDHFCuts : public AliAnalysisCuts
   void SetCuts(Int_t nVars,Int_t nPtBins,Float_t** cutsRD);
   void SetCuts(Int_t glIndex, Float_t* cutsRDGlob);
   void AddTrackCuts(const AliESDtrackCuts *cuts) 
-         {fTrackCuts=new AliESDtrackCuts(*cuts); return;}
+          {delete fTrackCuts; fTrackCuts=new AliESDtrackCuts(*cuts); return;}
   void SetUsePID(Bool_t flag=kTRUE) {fUsePID=flag; return;}
   void SetUseCentrality(Int_t flag=1);    // see enum below
   void SetPidHF(AliAODPidHF* pidObj) {
index 38fae18..c20b148 100644 (file)
@@ -248,6 +248,10 @@ Int_t AliRDHFCutsDStartoKpipi::IsSelected(TObject* obj,Int_t selectionLevel) {
     return 0;
   }
   
+  Double_t ptD=d->Pt();
+  if(ptD<fMinPtCand) return 0;
+  if(ptD>fMaxPtCand) return 0;
+
   AliAODRecoDecayHF2Prong* dd = (AliAODRecoDecayHF2Prong*)d->Get2Prong();  
   if(!dd){
     cout<<"AliAODRecoDecayHF2Prong null"<<endl;
index 70f39ad..582ce8c 100644 (file)
@@ -47,6 +47,8 @@ AliAnalysisVertexingHF* ConfigVertexingHF() {
   vHF->SetTrackFilterSoftPi(trkFilterSoftPi);
   //--- set cuts for candidates selection
   AliRDHFCutsD0toKpi *cutsD0toKpi = new AliRDHFCutsD0toKpi("CutsD0toKpi");
+  cutsD0toKpi->SetStandardCutsPbPb2010();
+  cutsD0toKpi->SetUsePID(kFALSE);
   Float_t cutsArrayD0toKpi[9]={0.2,999999.,1.1,0.,0.,999999.,999999.,0.,0.5};
   cutsD0toKpi->SetCuts(9,cutsArrayD0toKpi);
   cutsD0toKpi->AddTrackCuts(esdTrackCuts);
@@ -57,16 +59,22 @@ AliAnalysisVertexingHF* ConfigVertexingHF() {
   cutsJpsitoee->AddTrackCuts(esdTrackCuts);
   vHF->SetCutsJpsitoee(cutsJpsitoee);
   AliRDHFCutsDplustoKpipi *cutsDplustoKpipi = new AliRDHFCutsDplustoKpipi("CutsDplustoKpipi");
+  cutsDplustoKpipi->SetStandardCutsPbPb2010();
+  cutsDplustoKpipi->SetUsePID(kFALSE);
   Float_t cutsArrayDplustoKpipi[12]={0.2,0.8,0.8,0.,0.,0.01,0.06,0.03,0.,0.85,0.,10000000000.};
   cutsDplustoKpipi->SetCuts(12,cutsArrayDplustoKpipi);
   cutsDplustoKpipi->AddTrackCuts(esdTrackCuts);
   vHF->SetCutsDplustoKpipi(cutsDplustoKpipi);
   AliRDHFCutsDstoKKpi *cutsDstoKKpi = new AliRDHFCutsDstoKKpi("CutsDstoKKpi");
+  cutsDstoKKpi->SetStandardCutsPbPb2010();
+  cutsDstoKKpi->SetUsePID(kFALSE);
   Float_t cutsArrayDstoKKpi[14]={0.,999.,999.,0.,0.,0.005,0.06,0.,0.,0.7,0.,1000.,0.1,0.1};
   cutsDstoKKpi->SetCuts(14,cutsArrayDstoKKpi);
   cutsDstoKKpi->AddTrackCuts(esdTrackCuts);
   vHF->SetCutsDstoKKpi(cutsDstoKKpi);
   AliRDHFCutsLctopKpi *cutsLctopKpi = new AliRDHFCutsLctopKpi("CutsLctopKpi");
+  cutsLctopKpi->SetStandardCutsPbPb2010();
+  cutsLctopKpi->SetUsePID(kFALSE);
   Float_t cutsArrayLctopKpi[12]={0.13,0.5,0.6,0.,0.,0.01,0.04,0.006,0.8,0.3,0.,0.05};
   cutsLctopKpi->SetCuts(12,cutsArrayLctopKpi);
   cutsLctopKpi->AddTrackCuts(esdTrackCuts);
@@ -77,7 +85,9 @@ AliAnalysisVertexingHF* ConfigVertexingHF() {
   cutsD0toKpipipi->AddTrackCuts(esdTrackCuts);
   vHF->SetCutsD0toKpipipi(cutsD0toKpipipi);
   AliRDHFCutsDStartoKpipi *cutsDStartoKpipi = new AliRDHFCutsDStartoKpipi("CutsDStartoKpipi");
-  Float_t cutsArrayDStartoKpipi[14]={0.15,0.07.,0.85,0.8,0.8,0.06.,0.06.,0.001,0.6,0.15, 0.03, 0.2, 5, 0.5}; // first 9 for D0 from D*, last 5 for D*
+  cutsDStartoKpipi->SetStandardCutsPbPb2010();
+  cutsDStartoKpipi->SetUsePID(kFALSE);
+  Float_t cutsArrayDStartoKpipi[14]={0.15,0.07,0.85,0.8,0.8,0.06.,0.06.,0.001,0.6, 0.15, 0.03, 0.2, 5, 0.5}; // first 9 for D0 from D*, last 5 for D*
   cutsDStartoKpipi->SetCuts(14,cutsArrayDStartoKpipi);
   cutsDStartoKpipi->AddTrackCuts(esdTrackCuts);
   cutsDStartoKpipi->AddTrackCutsSoftPi(esdTrackCutsSoftPi);