Moved fRemoveDaughtersFromPrim to base class and added signature of IsSelected that...
authordainese <dainese@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 14 Sep 2010 22:19:05 +0000 (22:19 +0000)
committerdainese <dainese@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 14 Sep 2010 22:19:05 +0000 (22:19 +0000)
PWG3/vertexingHF/AliRDHFCuts.cxx
PWG3/vertexingHF/AliRDHFCuts.h
PWG3/vertexingHF/AliRDHFCutsD0toKpi.cxx
PWG3/vertexingHF/AliRDHFCutsD0toKpi.h

index 9ef0870..bc56977 100644 (file)
@@ -56,7 +56,8 @@ fCutsRD(0),
 fIsUpperCut(0),
 fUsePID(kFALSE),
 fPidHF(0),
-fWhyRejection(0)
+fWhyRejection(0),
+fRemoveDaughtersFromPrimary(kFALSE)
 {
   //
   // Default Constructor
@@ -83,7 +84,8 @@ AliRDHFCuts::AliRDHFCuts(const AliRDHFCuts &source) :
   fIsUpperCut(0),
   fUsePID(source.fUsePID),
   fPidHF(0),
-  fWhyRejection(source.fWhyRejection)
+  fWhyRejection(source.fWhyRejection),
+  fRemoveDaughtersFromPrimary(source.fRemoveDaughtersFromPrimary)
 {
   //
   // Copy constructor
@@ -120,6 +122,7 @@ AliRDHFCuts &AliRDHFCuts::operator=(const AliRDHFCuts &source)
   fUsePID=source.fUsePID;
   SetPidHF(source.GetPidHF());
   fWhyRejection=source.fWhyRejection;
+  fRemoveDaughtersFromPrimary=source.fRemoveDaughtersFromPrimary;
 
   if(source.GetTrackCuts()) AddTrackCuts(source.GetTrackCuts());
   if(source.fPtBinLimits) SetPtBins(source.fnPtBinLimits,source.fPtBinLimits);
index 2e1369e..3fdd7d0 100644 (file)
@@ -12,6 +12,7 @@
 #include "AliAnalysisCuts.h"
 #include "AliESDtrackCuts.h"
 #include "AliAODPidHF.h"
+#include "AliAODEvent.h"
 #include "AliVEvent.h"
 
 class AliAODTrack;
@@ -48,8 +49,9 @@ class AliRDHFCuts : public AliAnalysisCuts
     if(fPidHF) delete fPidHF;
     fPidHF=new AliAODPidHF(*pidObj);
   }
-  AliAODPidHF* GetPidHF() const {return fPidHF;}
+  void SetRemoveDaughtersFromPrim(Bool_t removeDaughtersPrim) {fRemoveDaughtersFromPrimary=removeDaughtersPrim;}
 
+  AliAODPidHF* GetPidHF() const {return fPidHF;}
   Float_t *GetPtBinLimits() const {return fPtBinLimits;}
   Int_t   GetNPtBins() const {return fnPtBins;}
   Int_t   GetNVars() const {return fnVars;} 
@@ -65,6 +67,7 @@ class AliRDHFCuts : public AliAnalysisCuts
   Int_t   GetGlobalIndex(Int_t iVar,Int_t iPtBin) const;
   void    GetVarPtIndex(Int_t iGlob, Int_t& iVar, Int_t& iPtBin) const;
   Bool_t  GetIsUsePID() const {return fUsePID;}
+  Bool_t  GetIsPrimaryWithoutDaughters() const {return fRemoveDaughtersFromPrimary;}
 
   Bool_t IsSelected(TObject *obj) {return IsSelected(obj,AliRDHFCuts::kAll);}
   Bool_t IsSelected(TList *list) {if(!list) return kTRUE; return kFALSE;}
@@ -74,7 +77,8 @@ class AliRDHFCuts : public AliAnalysisCuts
   virtual Int_t IsSelectedPID(AliAODRecoDecayHF * /*rd*/) {return 1;}
 
   virtual Int_t IsSelected(TObject* obj,Int_t selectionLevel) = 0;
-
+  virtual Int_t IsSelected(TObject* obj,Int_t selectionLevel,AliAODEvent* /*aod*/)
+                {return IsSelected(obj,selectionLevel);}
   Int_t PtBin(Double_t pt) const;
   void PrintAll()const;
 
@@ -112,8 +116,9 @@ class AliRDHFCuts : public AliAnalysisCuts
   Bool_t fUsePID; // enable PID usage (off by default)
   AliAODPidHF *fPidHF; // PID for heavy flavours manager
   Int_t fWhyRejection; // used to code the step at which candidate was rejected
+  Bool_t fRemoveDaughtersFromPrimary; // flag to switch on the removal of duaghters from the primary vertex computation
 
-  ClassDef(AliRDHFCuts,4);  // base class for cuts on AOD reconstructed heavy-flavour decays
+  ClassDef(AliRDHFCuts,5);  // base class for cuts on AOD reconstructed heavy-flavour decays
 };
 
 #endif
index 414d05d..c804635 100644 (file)
@@ -36,7 +36,6 @@ ClassImp(AliRDHFCutsD0toKpi)
 //--------------------------------------------------------------------------
 AliRDHFCutsD0toKpi::AliRDHFCutsD0toKpi(const char* name) : 
 AliRDHFCuts(name),
-fRemoveDaughtersFromPrimary(kFALSE),
 fUseSpecialCuts(kFALSE)
 {
   //
@@ -76,11 +75,11 @@ fUseSpecialCuts(kFALSE)
   Float_t limits[2]={0,999999999.};
   SetPtBins(2,limits);
 
+  SetRemoveDaughtersFromPrim(kTRUE);
 }
 //--------------------------------------------------------------------------
 AliRDHFCutsD0toKpi::AliRDHFCutsD0toKpi(const AliRDHFCutsD0toKpi &source) :
   AliRDHFCuts(source),  
-  fRemoveDaughtersFromPrimary(source.fRemoveDaughtersFromPrimary),
   fUseSpecialCuts(source.fUseSpecialCuts)
 {
   //
@@ -97,7 +96,6 @@ AliRDHFCutsD0toKpi &AliRDHFCutsD0toKpi::operator=(const AliRDHFCutsD0toKpi &sour
   if(&source == this) return *this;
 
   AliRDHFCuts::operator=(source);
-  fRemoveDaughtersFromPrimary=source.fRemoveDaughtersFromPrimary;
   fUseSpecialCuts=source.fUseSpecialCuts;
 
   return *this;
@@ -231,7 +229,11 @@ Int_t AliRDHFCutsD0toKpi::IsSelected(TObject* obj,Int_t selectionLevel,AliAODEve
     //recalculate vertex w/o daughters
     AliAODVertex *origownvtx=0x0;
     AliAODVertex *recvtx=0x0;
-    if(aod && fRemoveDaughtersFromPrimary) {
+    if(fRemoveDaughtersFromPrimary) {
+      if(!aod) {
+       AliError("Can not remove daughters from vertex without AOD event");
+       return 0;
+      }
       if(d->GetOwnPrimaryVtx()) origownvtx=new AliAODVertex(*d->GetOwnPrimaryVtx());
       recvtx=d->RemoveDaughtersFromPrimaryVtx(aod);
       if(!recvtx){
index b736abf..f537e13 100644 (file)
@@ -40,16 +40,14 @@ class AliRDHFCutsD0toKpi : public AliRDHFCuts
   virtual Int_t IsSelectedPID(AliAODRecoDecayHF *rd);
   Int_t IsSelectedSpecialCuts(AliAODRecoDecayHF *d) const;
   void SetUseSpecialCuts(Bool_t useSpecialCuts) {fUseSpecialCuts=useSpecialCuts;}
-  void SetRemoveDaughtersFromPrim(Bool_t removeDaughtersPrim) {fRemoveDaughtersFromPrimary=removeDaughtersPrim;}
   Bool_t GetUseSpecialCuts() const {return fUseSpecialCuts;}
-  Bool_t GetIsPrimaryWithoutDaughters() const {return fRemoveDaughtersFromPrimary;}
   
   
  protected:
-  Bool_t fRemoveDaughtersFromPrimary;      // flag to switch on the removal of duaghters from the primary vertex computation
+
   Bool_t fUseSpecialCuts;           // flag to switch on/off special cuts
 
-  ClassDef(AliRDHFCutsD0toKpi,2);  // class for cuts on AOD reconstructed D0->Kpi
+  ClassDef(AliRDHFCutsD0toKpi,3);  // class for cuts on AOD reconstructed D0->Kpi
 };
 
 #endif