Added flag to apply cuts via filter bit or full list (A.Knospe)
authorfbellini <fbellini@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 1 Nov 2012 14:00:20 +0000 (14:00 +0000)
committerfbellini <fbellini@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 1 Nov 2012 14:00:20 +0000 (14:00 +0000)
PWGLF/RESONANCES/AliRsnCutTrackQuality.cxx
PWGLF/RESONANCES/AliRsnCutTrackQuality.h

index 4877edb..039b851 100644 (file)
@@ -48,6 +48,7 @@ AliRsnCutTrackQuality::AliRsnCutTrackQuality(const char *name) :
    fTPCmaxChi2(1E20),
    fCutMaxChi2TPCConstrainedVsGlobal(1E20),
    fAODTestFilterBit(-1),
+   fCheckOnlyFilterBit(kTRUE),
    fESDtrackCuts(0x0)
 {
 //
@@ -78,6 +79,7 @@ AliRsnCutTrackQuality::AliRsnCutTrackQuality(const AliRsnCutTrackQuality &copy)
    fTPCmaxChi2(copy.fTPCmaxChi2),
    fCutMaxChi2TPCConstrainedVsGlobal(copy.fCutMaxChi2TPCConstrainedVsGlobal),
    fAODTestFilterBit(copy.fAODTestFilterBit),
+   fCheckOnlyFilterBit(copy.fCheckOnlyFilterBit),
    fESDtrackCuts(copy.fESDtrackCuts)
 {
 //
@@ -115,6 +117,7 @@ AliRsnCutTrackQuality &AliRsnCutTrackQuality::operator=(const AliRsnCutTrackQual
    fTPCminNClusters = copy.fTPCminNClusters;
    fTPCmaxChi2 = copy.fTPCmaxChi2;
    fAODTestFilterBit = copy.fAODTestFilterBit;
+   fCheckOnlyFilterBit = copy.fCheckOnlyFilterBit;
    fESDtrackCuts = copy.fESDtrackCuts;
    SetPtRange(copy.fPt[0], copy.fPt[1]);
    SetEtaRange(copy.fEta[0], copy.fEta[1]);
@@ -274,7 +277,7 @@ Bool_t AliRsnCutTrackQuality::CheckAOD(AliAODTrack *track)
       else {
          if (track->Pt() < fPt[0] || track->Pt() > fPt[1]) return kFALSE;
          if (track->Eta() < fEta[0] || track->Eta() > fEta[1]) return kFALSE;
-         return kTRUE;
+         if (fCheckOnlyFilterBit) return kTRUE;
       }
    }
 
@@ -343,9 +346,9 @@ Bool_t AliRsnCutTrackQuality::CheckAOD(AliAODTrack *track)
    }
    // if the DCA cut is not fixed, compute current value
    if (!fDCARfixed) {
-      static TString str(fDCARptFormula);
+      TString str(fDCARptFormula);
       str.ReplaceAll("pt", "x");
-      static const TFormula dcaXY(Form("%s_dcaXY", GetName()), str.Data());
+      TFormula dcaXY(Form("%s_dcaXY", GetName()), str.Data());
       fDCARmax = dcaXY.Eval(track->Pt());
    }
    // check the cut
@@ -358,9 +361,9 @@ Bool_t AliRsnCutTrackQuality::CheckAOD(AliAODTrack *track)
    // the DCA has already been computed above
    // if the DCA cut is not fixed, compute current value
    if (!fDCAZfixed) {
-      static TString str(fDCAZptFormula);
+      TString str(fDCAZptFormula);
       str.ReplaceAll("pt", "x");
-      static const TFormula dcaZ(Form("%s_dcaXY", GetName()), str.Data());
+      TFormula dcaZ(Form("%s_dcaXY", GetName()), str.Data());
       fDCAZmax = dcaZ.Eval(track->Pt());
    }
    // check the cut
@@ -409,6 +412,9 @@ void AliRsnCutTrackQuality::Print(const Option_t *) const
    } else {
       AliInfo(Form("DCA z cut formula       : %s", fDCAZptFormula.Data()));
    }
+
+   AliInfo(Form("fAODTestFilterBit       : filter bit %i",fAODTestFilterBit));
+   AliInfo(Form("fCheckOnlyFilterBit     : %i",((int) fCheckOnlyFilterBit)));
 }
 //__________________________________________________________________________________________________
 void AliRsnCutTrackQuality::SetDefaults2010()
index 63aa93d..d1d80f6 100644 (file)
@@ -52,6 +52,7 @@ public:
    void      SetRejectKinkDaughters(Bool_t yn = kTRUE) {fRejectKinkDaughters = yn;}
 
    void      SetAODTestFilterBit(Int_t value)          {fAODTestFilterBit = value;}
+   void      SetCheckOnlyFilterBit(Bool_t on=kTRUE)    {fCheckOnlyFilterBit=on;}
 
    void      SetDefaults2010();
    void      SetESDtrackCuts(AliESDtrackCuts *esdTrackCuts) {fESDtrackCuts = esdTrackCuts;}
@@ -89,6 +90,7 @@ protected:
    Double_t   fTPCmaxChi2;             // maximum chi2 / number of clusters in TPC
    Float_t    fCutMaxChi2TPCConstrainedVsGlobal;  // max chi2 TPC track constrained with vtx vs. global track
    Int_t      fAODTestFilterBit;       // test filter bit for AOD tracks
+   Bool_t     fCheckOnlyFilterBit;     // check only the filter bit
    AliESDtrackCuts *fESDtrackCuts;     // pointer to AliESDtrackCuts object
 
    ClassDef(AliRsnCutTrackQuality, 2)