]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGHF/hfe/AliHFEpidTPC.h
Update hfe package
[u/mrichter/AliRoot.git] / PWGHF / hfe / AliHFEpidTPC.h
1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 *                                                                        *
4 * Author: The ALICE Off-line Project.                                    *
5 * Contributors are mentioned in the code where appropriate.              *
6 *                                                                        *
7 * Permission to use, copy, modify and distribute this software and its   *
8 * documentation strictly for non-commercial purposes is hereby granted   *
9 * without fee, provided that the above copyright notice appears in all   *
10 * copies and that both the copyright notice and this permission notice   *
11 * appear in the supporting documentation. The authors make no claims     *
12 * about the suitability of this software for any purpose. It is          *
13 * provided "as is" without express or implied warranty.                  *
14 **************************************************************************/
15 //
16 // Class for TPC PID
17 // Does electron selection based on dE/dx
18 // For more information please check the implementation file
19 //
20 #ifndef ALIHFEPIDTPC_H
21 #define ALIHFEPIDTPC_H
22
23 #ifndef ALIHFEPIDBASE_H
24 #include "AliHFEpidBase.h"
25 #endif
26
27 #ifndef ALIPID_H
28 #include "AliPID.h"
29 #endif
30
31 class TList;
32 class AliAODTrack;
33 class AliAODMCParticle;
34 class AliESDtrack;
35 class AliMCParticle;
36 class AliVParticle;
37 class AliHFEcollection;
38 class AliHFEpidQAmanager;
39
40 class AliHFEpidTPC : public AliHFEpidBase{
41   public:
42     AliHFEpidTPC();
43     AliHFEpidTPC(const Char_t *name);
44     AliHFEpidTPC(const AliHFEpidTPC &ref);
45     AliHFEpidTPC &operator=(const AliHFEpidTPC &ref);
46     virtual ~AliHFEpidTPC();
47     
48     virtual Bool_t InitializePID(Int_t /*run*/);
49     virtual Int_t IsSelected(const AliHFEpidObject *track, AliHFEpidQAmanager *pidqa) const;
50
51     void AddTPCdEdxLineCrossing(Int_t species, Double_t sigma);
52     Bool_t HasAsymmetricSigmaCut() const { return TestBit(kAsymmetricSigmaCut);}
53     Bool_t HasParticleRejection() const { return TestBit(kRejection); }
54     void SetTPCnSigma(Short_t nSigma) { fNsigmaTPC = nSigma; };
55     void SetUseOnlyOROC(Bool_t useOnlyOROC) { fUseOnlyOROC = useOnlyOROC; };
56     inline void SetAsymmetricTPCsigmaCut(Float_t pmin, Float_t pmax, Float_t sigmaMin, Float_t sigmaMax);
57     inline void SetRejectParticle(Int_t species, Float_t pmin, Float_t sigmaMin, Float_t pmax, Float_t sigmaMax);
58
59     void SetUpperSigmaCutDefault(const TF1 * const model) { fkUpperSigmaCut[0] = model; fHasCutModel = kTRUE; }
60     void SetUpperSigmaCutCentrality(const TF1 * const model, Int_t centralityBin) { if(centralityBin < 11) fkUpperSigmaCut[centralityBin+1] = model; fHasCutModel = kTRUE; }
61     void SetLowerSigmaCutDefault(const TF1 * const model) { fkLowerSigmaCut[0] = model; fHasCutModel = kTRUE; }
62     void SetLowerSigmaCutCentrality(const TF1 * const model, Int_t centralityBin) { if(centralityBin < 11) fkLowerSigmaCut[centralityBin+1] = model; fHasCutModel = kTRUE; }
63     void SetEtaCorrection(const TF1 *const param) { fkEtaCorrection = param; }
64     Bool_t HasEtaCorrection() const { return fkEtaCorrection != NULL; }
65
66     Double_t GetP(const AliVParticle *track, AliHFEpidObject::AnalysisType_t anaType) const;
67     void ApplyEtaCorrection(AliVTrack *track, AliHFEpidObject::AnalysisType_t anatype) const;
68     void UseOROC(AliVTrack *track, AliHFEpidObject::AnalysisType_t anatype) const;
69
70   protected:
71     void Copy(TObject &o) const;
72     Int_t Reject(const AliVParticle *track, AliHFEpidObject::AnalysisType_t anaType) const;
73
74     Bool_t CutSigmaModel(const AliHFEpidObject *anaType) const;
75
76   private:
77     enum{
78       kAsymmetricSigmaCut = BIT(20),
79       kRejection = BIT(21)
80     };
81     Double_t fLineCrossingSigma[AliPID::kSPECIES];          // with of the exclusion point
82     UChar_t fLineCrossingsEnabled;                          // Bitmap showing which line crossing is set
83     const TF1 *fkUpperSigmaCut[12];                         // Upper Sigma Cut
84     const TF1 *fkLowerSigmaCut[12];                         // Lower Sigma Cut
85     const TF1 *fkEtaCorrection;                             // Correction for the eta dependence
86     Bool_t fHasCutModel;                                    // Has cut model functions
87     Bool_t fUseOnlyOROC;                                    // Use only OROC
88     Float_t fPAsigCut[2];                                   // Momentum region where to perform asymmetric sigma cut
89     Float_t fNAsigmaTPC[2];                                 // Asymmetric TPC Sigma band        
90     Short_t fNsigmaTPC;                                     // TPC sigma band
91     Float_t fRejection[4*AliPID::kSPECIES];                 // All informations for Particle Rejection, order pmin, sigmin, pmax, sigmax
92     UChar_t fRejectionEnabled;                              // Bitmap for enabled particle rejection
93
94   ClassDef(AliHFEpidTPC, 1)   // TPC Electron ID class
95 };
96
97 inline void AliHFEpidTPC::SetAsymmetricTPCsigmaCut(Float_t pmin, Float_t pmax, Float_t sigmaMin, Float_t sigmaMax) { 
98   fPAsigCut[0] = pmin; 
99   fPAsigCut[1] = pmax; 
100   fNAsigmaTPC[0] = sigmaMin; 
101   fNAsigmaTPC[1] = sigmaMax; 
102   SetBit(kAsymmetricSigmaCut, kTRUE);
103 }
104
105 inline void AliHFEpidTPC::SetRejectParticle(Int_t species, Float_t pmin, Float_t sigmaMin, Float_t pmax, Float_t sigmaMax){
106   if(species < 0 || species >= AliPID::kSPECIES) return;
107   fRejection[4*species]   = pmin;
108   fRejection[4*species+1] = sigmaMin;
109   fRejection[4*species+2] = pmax;
110   fRejection[4*species+3] = sigmaMax;
111   SETBIT(fRejectionEnabled, species);
112   SetBit(kRejection, kTRUE);
113 }
114  
115 #endif