Fix for setting of PID selection bits (thanks Francesco)
authordainese <dainese@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 23 Feb 2011 00:59:56 +0000 (00:59 +0000)
committerdainese <dainese@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 23 Feb 2011 00:59:56 +0000 (00:59 +0000)
PWG3/vertexingHF/AliAnalysisVertexingHF.cxx
PWG3/vertexingHF/AliAnalysisVertexingHF.h

index 352d689..061e105 100644 (file)
@@ -690,7 +690,7 @@ void AliAnalysisVertexingHF::FindCandidates(AliVEvent *event,
            AddRefs(v2Prong,rd,event,twoTrackArray1);
          }
          // Set selection bit for PID
-         if(okD0) SetSelectionBitForPID(fCutsD0toKpi,rd);
+         if(okD0) SetSelectionBitForPID(fCutsD0toKpi,rd,AliRDHFCuts::kD0toKpiPID);
        }
        // D* candidates
        if(fDstar && okD0fromDstar && !isLikeSign2Prong) {
@@ -763,8 +763,6 @@ 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); 
@@ -775,7 +773,7 @@ void AliAnalysisVertexingHF::FindCandidates(AliVEvent *event,
              AddRefs(vCasc,rc,event,twoTrackArrayCasc);
              vCasc->AddDaughter(rd); // add the D0 (in ref #1)
              // Set selection bit for PID
-             SetSelectionBitForPID(fCutsDStartoKpipi,rc);
+             SetSelectionBitForPID(fCutsDStartoKpipi,rc,AliRDHFCuts::kDstarPID);
            }
            twoTrackArrayCasc->Clear();
            trackPi=0; 
@@ -897,9 +895,9 @@ void AliAnalysisVertexingHF::FindCandidates(AliVEvent *event,
              AddRefs(v3Prong,rd,event,threeTrackArray);
            }
            // Set selection bit for PID
-           SetSelectionBitForPID(fCutsDplustoKpipi,rd);
-           SetSelectionBitForPID(fCutsDstoKKpi,rd);
-           SetSelectionBitForPID(fCutsLctopKpi,rd);
+           SetSelectionBitForPID(fCutsDplustoKpipi,rd,AliRDHFCuts::kDplusPID);
+           SetSelectionBitForPID(fCutsDstoKKpi,rd,AliRDHFCuts::kDsPID);
+           SetSelectionBitForPID(fCutsLctopKpi,rd,AliRDHFCuts::kLcPID);
          }
          if(io3Prong) {delete io3Prong; io3Prong=NULL;} 
          if(secVert3PrAOD) {delete secVert3PrAOD; secVert3PrAOD=NULL;} 
@@ -1086,9 +1084,9 @@ void AliAnalysisVertexingHF::FindCandidates(AliVEvent *event,
              AddRefs(v3Prong,rd,event,threeTrackArray);
            }
            // Set selection bit for PID
-           SetSelectionBitForPID(fCutsDplustoKpipi,rd);
-           SetSelectionBitForPID(fCutsDstoKKpi,rd);
-           SetSelectionBitForPID(fCutsLctopKpi,rd);
+           SetSelectionBitForPID(fCutsDplustoKpipi,rd,AliRDHFCuts::kDplusPID);
+           SetSelectionBitForPID(fCutsDstoKKpi,rd,AliRDHFCuts::kDsPID);
+           SetSelectionBitForPID(fCutsLctopKpi,rd,AliRDHFCuts::kLcPID);
          }
          if(io3Prong) {delete io3Prong; io3Prong=NULL;} 
          if(secVert3PrAOD) {delete secVert3PrAOD; secVert3PrAOD=NULL;}
@@ -2200,7 +2198,7 @@ void AliAnalysisVertexingHF::SelectTracksAndCopyVertex(const AliVEvent *event,
   return;
 }
 //-----------------------------------------------------------------------------
-void AliAnalysisVertexingHF::SetSelectionBitForPID(AliRDHFCuts *cuts,AliAODRecoDecayHF *rd) {
+void AliAnalysisVertexingHF::SetSelectionBitForPID(AliRDHFCuts *cuts,AliAODRecoDecayHF *rd,Int_t bit) {
   //
   // Set the selection bit for PID
   //
@@ -2208,7 +2206,7 @@ void AliAnalysisVertexingHF::SetSelectionBitForPID(AliRDHFCuts *cuts,AliAODRecoD
     Bool_t usepid=cuts->GetIsUsePID();
     cuts->SetUsePID(kTRUE);
     if(cuts->IsSelectedPID(rd))
-      rd->SetSelectionBit(AliRDHFCuts::kDstarPID);
+      rd->SetSelectionBit(bit);
     cuts->SetUsePID(usepid);
   }
   return;
index 24baec0..bda72ce 100644 (file)
@@ -213,7 +213,7 @@ 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);
+  void   SetSelectionBitForPID(AliRDHFCuts *cuts,AliAODRecoDecayHF *rd,Int_t bit);
 
   AliAODv0* TransformESDv0toAODv0(AliESDv0 *esdv0, 
                                  TObjArray *twoTrackArrayV0);