]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Added the possibility to use a manually set up TPC BB definition
authorpulvir <pulvir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 29 Aug 2011 14:47:34 +0000 (14:47 +0000)
committerpulvir <pulvir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 29 Aug 2011 14:47:34 +0000 (14:47 +0000)
PWG2/RESONANCES/AliRsnCutKaonForPhi2010PP.cxx
PWG2/RESONANCES/AliRsnCutKaonForPhi2010PP.h

index 1d8d9cc6756150eb12140b7b92a6f19b4f90a927..047c3bcab649e2d57debbbc46849dbc5533206be 100644 (file)
@@ -9,6 +9,9 @@
 
 #include "AliPID.h"
 #include "AliPIDResponse.h"
+#include "AliESDpid.h"
+#include "AliAODpidUtil.h"
+
 #include "AliRsnCutKaonForPhi2010PP.h"
 
 ClassImp(AliRsnCutKaonForPhi2010PP)
@@ -20,6 +23,7 @@ AliRsnCutKaonForPhi2010PP::AliRsnCutKaonForPhi2010PP(const char *name) :
    fNSigmaTPCHigh(3.0),
    fLimitTPC(0.350),
    fNSigmaTOF(3.0),
+   fMyPID(0x0),
    fCutQuality(Form("%sQuality", name))
 {
 //
@@ -44,6 +48,53 @@ AliRsnCutKaonForPhi2010PP::AliRsnCutKaonForPhi2010PP(const char *name) :
    fCutQuality.SetAODTestFilterBit(5);
 }
 
+//__________________________________________________________________________________________________
+AliRsnCutKaonForPhi2010PP::AliRsnCutKaonForPhi2010PP(const AliRsnCutKaonForPhi2010PP &copy) :
+   AliRsnCut(copy),
+   fNSigmaTPCLow(copy.fNSigmaTPCLow),
+   fNSigmaTPCHigh(copy.fNSigmaTPCHigh),
+   fLimitTPC(copy.fLimitTPC),
+   fNSigmaTOF(copy.fNSigmaTOF),
+   fMyPID(copy.fMyPID),
+   fCutQuality(copy.fCutQuality)
+{
+//
+// Copy constructor
+//
+}
+
+//__________________________________________________________________________________________________
+AliRsnCutKaonForPhi2010PP& AliRsnCutKaonForPhi2010PP::operator=(const AliRsnCutKaonForPhi2010PP &copy)
+{
+//
+// Assignment operator
+//
+
+   AliRsnCut::operator=(copy);
+   
+   fNSigmaTPCLow = copy.fNSigmaTPCLow;
+   fNSigmaTPCHigh = copy.fNSigmaTPCHigh;
+   fLimitTPC = copy.fLimitTPC;
+   fNSigmaTOF = copy.fNSigmaTOF;
+   fMyPID = copy.fMyPID;
+   fCutQuality = copy.fCutQuality;
+   
+   return *this;
+}
+
+//__________________________________________________________________________________________________
+void AliRsnCutKaonForPhi2010PP::InitMyPID(Bool_t isMC, Bool_t isESD)
+{
+//
+// Initialize manual PID object
+//
+
+   if (isESD) 
+      fMyPID = new AliESDpid(isMC);
+   else
+      fMyPID = new AliAODpidUtil(isMC);
+}
+
 //__________________________________________________________________________________________________
 Bool_t AliRsnCutKaonForPhi2010PP::IsSelected(TObject *obj)
 {
@@ -78,11 +129,15 @@ Bool_t AliRsnCutKaonForPhi2010PP::IsSelected(TObject *obj)
    
    // PID TPC :
    // depends on momentum
+   // and if local PID object is initialized, it is used instead of that got from manager
    if (track->GetTPCmomentum() < fLimitTPC) 
       SetRangeD(0.0, fNSigmaTPCLow);
    else
       SetRangeD(0.0, fNSigmaTPCHigh);
-   fCutValueD = TMath::Abs(pid->NumberOfSigmasTPC(track, AliPID::kKaon));
+   if (fMyPID) 
+      fCutValueD = TMath::Abs(fMyPID->NumberOfSigmasTPC(track, AliPID::kKaon));
+   else
+      fCutValueD = TMath::Abs(pid->NumberOfSigmasTPC(track, AliPID::kKaon));
    if (!OkRangeD()) return kFALSE;
    
    // if TOF is not matched, end here
index 6c722e1d063f4911245382e9ee686babeee43320..cf7712c65d3a236371de5d8dd49c57b348f03d03 100644 (file)
@@ -17,6 +17,8 @@ class AliRsnCutKaonForPhi2010PP : public AliRsnCut {
 public:
 
    AliRsnCutKaonForPhi2010PP(const char *name = "");
+   AliRsnCutKaonForPhi2010PP(const AliRsnCutKaonForPhi2010PP &copy);
+   AliRsnCutKaonForPhi2010PP& operator=(const AliRsnCutKaonForPhi2010PP &copy);
    virtual ~AliRsnCutKaonForPhi2010PP() { }
    
    void           SetTPCNSigmaLow (Double_t v) {fNSigmaTPCLow  = v;}
@@ -25,8 +27,10 @@ public:
    void           SetTOFNSigma(Double_t v)     {fNSigmaTOF     = v;}
    
    virtual Bool_t IsSelected(TObject *obj);
+   void           InitMyPID(Bool_t isMC, Bool_t isESD);
    
    AliRsnCutTrackQuality *CutQuality() {return &fCutQuality;}
+   AliPIDResponse        *MyPID()      {return fMyPID;}
 
 private:
 
@@ -37,6 +41,7 @@ private:
    Double_t              fLimitTPC;       // TPC: momentum limit 
    Double_t              fNSigmaTOF;      // TOF: nsigma cut (unique)
 
+   AliPIDResponse       *fMyPID;          // PID response object to be configured manyally
    AliRsnCutTrackQuality fCutQuality;     // track quality cut
 
    ClassDef(AliRsnCutKaonForPhi2010PP,1)