]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG3/hfe/AliHFEpidTPC.h
Cleanup the code. Fix memory leak. Now inherit from AliAnalysisTaskSE (Antoine, Phili...
[u/mrichter/AliRoot.git] / PWG3 / hfe / AliHFEpidTPC.h
index ddd0f044b0757bdf6185dce13ffc4f7c72a0ec52..4709d67e3229980eac9b98690144ecd6056f5a86 100644 (file)
@@ -1,3 +1,6 @@
+#ifndef ALIHFEPIDTPC_H
+#define ALIHFEPIDTPC_H
+
 /**************************************************************************
 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 *                                                                        *
 * about the suitability of this software for any purpose. It is          *
 * provided "as is" without express or implied warranty.                  *
 **************************************************************************/
-#ifndef __ALIHFEPIDTPC_H__
-#define __ALIHFEPIDTPC_H__
 
-#ifndef __ALIHFEPIDBASE_H__
+/* $Id$ */ 
+
+//
+// Class for TPC PID
+// Does electron selection based on dE/dx
+// For more information please check the implementation file
+//
+#ifndef ALIHFEPIDBASE_H
 #include "AliHFEpidBase.h"
 #endif
 
 #endif
 
 class TList;
+class AliAODTrack;
+class AliAODMCParticle;
 class AliESDtrack;
-class AliTPCpidESD;
+class AliMCParticle;
 class AliVParticle;
+class AliHFEcollection;
+class AliHFEpidQAmanager;
 
 class AliHFEpidTPC : public AliHFEpidBase{
-  typedef enum{
-    kHistTPCelectron = 0,
-    kHistTPCpion = 1,
-    kHistTPCmuon = 2,
-      kHistTPCkaon = 3,
-      kHistTPCproton = 4,
-      kHistTPCothers = 5,
-      kHistTPCall = 6,
-      kHistTPCprobEl = 7,
-      kHistTPCprobPi = 8,
-      kHistTPCprobMu = 9,
-      kHistTPCprobKa = 10,
-      kHistTPCprobPro = 11,
-      kHistTPCprobOth = 12,
-      kHistTPCprobAll = 13,
-      kHistTPCsuppressPi = 14,
-      kHistTPCsuppressMu = 15,
-      kHistTPCsuppressKa = 16,
-      kHistTPCsuppressPro = 17,
-      kHistTPCenhanceElPi = 18,
-      kHistTPCenhanceElMu = 19,
-      kHistTPCenhanceElKa = 20,
-      kHistTPCenhanceElPro = 21,
-      kHistTPCElprobPi = 22,
-      kHistTPCElprobMu = 23,
-      kHistTPCElprobKa = 24,
-      kHistTPCElprobPro = 25
-  } QAHist_t;
   public:
+    AliHFEpidTPC();
     AliHFEpidTPC(const Char_t *name);
     AliHFEpidTPC(const AliHFEpidTPC &ref);
     AliHFEpidTPC &operator=(const AliHFEpidTPC &ref);
     virtual ~AliHFEpidTPC();
     
     virtual Bool_t InitializePID();
-    virtual Int_t IsSelected(AliVParticle *track);
-    virtual Bool_t HasQAhistos() const { return kTRUE; };
+    virtual Int_t IsSelected(const AliHFEpidObject *track, AliHFEpidQAmanager *pidqa) const;
 
-    void AddTPCdEdxLineCrossing(Int_t species, Double_t p, Double_t sigma_p);
+    void AddTPCdEdxLineCrossing(Int_t species, Double_t sigma);
+    Bool_t HasAsymmetricSigmaCut() const { return TestBit(kAsymmetricSigmaCut);}
+    Bool_t HasParticleRejection() const { return TestBit(kRejection); }
+    void SetElectronMeanCorrection(TF1 *electronLineCorrection) { fElectronMeanCorrection = electronLineCorrection; }
     void SetTPCnSigma(Short_t nSigma) { fNsigmaTPC = nSigma; };
-    Double_t Likelihood(const AliESDtrack *track, Int_t species);
-    Double_t Likelihood(const AliESDtrack *track, Int_t species, Float_t rsig);
+    inline void SetAsymmetricTPCsigmaCut(Float_t pmin, Float_t pmax, Float_t sigmaMin, Float_t sigmaMax);
+    inline void SetRejectParticle(Int_t species, Float_t pmin, Float_t sigmaMin, Float_t pmax, Float_t sigmaMax);
+
+    void SetUpperSigmaCut(TF1 * const model) { fUpperSigmaCut = model; }
+    void SetLowerSigmaCut(TF1 * const model) { fLowerSigmaCut = model; }
 
-    Double_t Suppression(const AliESDtrack *track, Int_t species);
+    Double_t NumberOfSigmas(const AliVParticle *track, AliPID::EParticleType species, AliHFEpidObject::AnalysisType_t) const;
+    Double_t GetP(const AliVParticle *track, AliHFEpidObject::AnalysisType_t anaType) const;
 
   protected:
     void Copy(TObject &o) const;
-    void AddQAhistograms(TList *qaList);
-    void FillTPChistograms(const AliESDtrack *track);
-    Double_t GetTPCsigma(Double_t p, Int_t species);
+    Int_t Reject(const AliVParticle *track, AliHFEpidObject::AnalysisType_t anaType) const;
+
+    Bool_t CutSigmaModel(const AliVParticle *track, AliHFEpidObject::AnalysisType_t anaType) const;
+
   private:
-    Double_t fLineCrossingCenter[AliPID::kSPECIES];         // Line crossing ExclusionPoints
+    enum{
+      kAsymmetricSigmaCut = BIT(20),
+      kRejection = BIT(21)
+    };
     Double_t fLineCrossingSigma[AliPID::kSPECIES];          // with of the exclusion point
     UChar_t fLineCrossingsEnabled;                          // Bitmap showing which line crossing is set
+    TF1 *fUpperSigmaCut;                                    // Upper Sigma Cut
+    TF1 *fLowerSigmaCut;                                    // Lower Sigma Cut
+    TF1 *fElectronMeanCorrection;                           // Correct the mean of the electron line position as function  of the momentum
+    Float_t fPAsigCut[2];                                   // Momentum region where to perform asymmetric sigma cut
+    Float_t fNAsigmaTPC[2];                                 // Asymmetric TPC Sigma band        
     Short_t fNsigmaTPC;                                     // TPC sigma band
+    Float_t fRejection[4*AliPID::kSPECIES];                 // All informations for Particle Rejection, order pmin, sigmin, pmax, sigmax
+    UChar_t fRejectionEnabled;                              // Bitmap for enabled particle rejection
     AliPID *fPID;                                           //! PID Object
-    AliTPCpidESD *fPIDtpcESD;                               //! TPC PID object
-    TList *fQAList;                                         //! QA histograms
 
   ClassDef(AliHFEpidTPC, 1)   // TPC Electron ID class
 };
+
+inline void AliHFEpidTPC::SetAsymmetricTPCsigmaCut(Float_t pmin, Float_t pmax, Float_t sigmaMin, Float_t sigmaMax) { 
+  fPAsigCut[0] = pmin; 
+  fPAsigCut[1] = pmax; 
+  fNAsigmaTPC[0] = sigmaMin; 
+  fNAsigmaTPC[1] = sigmaMax; 
+  SetBit(kAsymmetricSigmaCut, kTRUE);
+}
+
+inline void AliHFEpidTPC::SetRejectParticle(Int_t species, Float_t pmin, Float_t sigmaMin, Float_t pmax, Float_t sigmaMax){
+  if(species < 0 || species >= AliPID::kSPECIES) return;
+  fRejection[4*species]   = pmin;
+  fRejection[4*species+1] = sigmaMin;
+  fRejection[4*species+2] = pmax;
+  fRejection[4*species+3] = sigmaMax;
+  SETBIT(fRejectionEnabled, species);
+  SetBit(kRejection, kTRUE);
+}
 #endif