]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGDQ/dielectron/AliDielectronPID.h
o update package
[u/mrichter/AliRoot.git] / PWGDQ / dielectron / AliDielectronPID.h
1 #ifndef ALIDIELECTRONPID_H
2 #define ALIDIELECTRONPID_H
3
4 /* Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6
7 //#############################################################
8 //#                                                           # 
9 //#         Class AliDielectronPID                     #
10 //#                                                           #
11 //#  Authors:                                                 #
12 //#   Anton     Andronic, GSI / A.Andronic@gsi.de             #
13 //#   Ionut C.  Arsene,   GSI / I.C.Arsene@gsi.de             #
14 //#   Julian    Book,     Uni Ffm / Julian.Book@cern.ch       #
15 //#   Frederick Kramer,   Uni Ffm, / Frederick.Kramer@cern.ch #
16 //#   Magnus    Mager,    CERN / Magnus.Mager@cern.ch         #
17 //#   WooJin J. Park,     GSI / W.J.Park@gsi.de               #
18 //#   Jens      Wiechula, Uni HD / Jens.Wiechula@cern.ch      #
19 //#                                                           #
20 //#############################################################
21
22 #include <AliPID.h>
23 #include <AliAnalysisCuts.h>
24
25 class TF1;
26 class TList;
27 class AliVTrack;
28 class TGraph;
29 class AliPIDResponse;
30 class AliDielectronVarManager;
31
32 class AliDielectronPID : public AliAnalysisCuts {
33 public:
34   enum DetType {kITS, kTPC, kTRD, kTRDeleEff, kTOF, kEMCAL};
35   enum PIDbitType {kIgnore=0, kRequire, kIfAvailable};
36   
37   AliDielectronPID();
38   AliDielectronPID(const char*name, const char* title);
39
40   virtual ~AliDielectronPID();
41
42   void AddCut(DetType det, AliPID::EParticleType type, Double_t nSigmaLow, Double_t nSigmaUp=-99999.,
43               Double_t min=0, Double_t max=0, Bool_t exclude=kFALSE, UInt_t pidBitType=AliDielectronPID::kRequire, 
44               Int_t var=-1);
45
46   void AddCut(DetType det, AliPID::EParticleType type, Double_t nSigmaLow, TF1 * const funUp,
47               Double_t min=0, Double_t max=0, Bool_t exclude=kFALSE, UInt_t pidBitType=AliDielectronPID::kRequire, 
48               Int_t var=-1);
49
50   void AddCut(DetType det, AliPID::EParticleType type, TF1 * const funLow, Double_t nSigmaUp,
51               Double_t min=0, Double_t max=0, Bool_t exclude=kFALSE, UInt_t pidBitType=AliDielectronPID::kRequire, 
52               Int_t var=-1);
53
54   void AddCut(DetType det, AliPID::EParticleType type, TF1 * const funLow, TF1 * const funUp,
55               Double_t min=0, Double_t max=0, Bool_t exclude=kFALSE, UInt_t pidBitType=AliDielectronPID::kRequire, 
56               Int_t var=-1);
57   
58   void SetDefaults(Int_t def);
59
60   //
61   //Analysis cuts interface
62   //const
63   virtual Bool_t IsSelected(TObject* track);
64   virtual Bool_t IsSelected(TList*   /* list */ ) {return kFALSE;}
65
66   static void SetCorrGraph(TGraph * const gr) { fgFitCorr=gr; }
67   static TGraph *GetCorrGraph()  { return fgFitCorr; }
68   
69   static void SetCorrVal(Double_t run);
70   static Double_t GetCorrVal()   { return fgCorr; }
71   static Double_t GetCorrValdEdx()   { return fgCorrdEdx; }
72   
73   static void SetCorrGraphdEdx(TGraph * const gr) { fgdEdxRunCorr=gr; }
74   static TGraph *GetCorrGraphdEdx()  { return fgdEdxRunCorr; }
75
76   static void SetEtaCorrFunction(TF1 *fun) {fgFunEtaCorr=fun;}
77   static TF1* GetEtaCorrFunction() { return fgFunEtaCorr; }
78
79   static Double_t GetEtaCorr(AliVTrack *track);
80
81 private:
82   enum {kNmaxPID=30};
83
84   DetType  fDetType[kNmaxPID];    //detector type of nsigma cut
85   AliPID::EParticleType fPartType[kNmaxPID]; //particle type
86   Float_t  fNsigmaLow[kNmaxPID];  //lower nsigma bound
87   Float_t  fNsigmaUp[kNmaxPID];   //upper nsigma bound
88   Double_t fmin[kNmaxPID];        //lower cut limit
89   Double_t fmax[kNmaxPID];        //upper cut limit
90   Bool_t   fExclude[kNmaxPID];    //use as exclusion band
91   TF1     *fFunUpperCut[kNmaxPID];//use function as upper cut
92   TF1     *fFunLowerCut[kNmaxPID];//use function as lower cut
93   UChar_t  fNcuts;                //number of cuts
94   UChar_t  fRequirePIDbit[kNmaxPID]; //How to make use of the pid bit (see)
95   UShort_t fActiveCuts[kNmaxPID]; // list of activated cuts
96
97   AliPIDResponse *fPIDResponse;   //! pid response object
98   
99   static TGraph *fgFitCorr;       //spline fit object to correct the nsigma deviation in the TPC electron band
100   static Double_t fgCorr;         //!correction value for current run. Set if fgFitCorr is set and SetCorrVal(run)
101                                   // was called
102   static Double_t fgCorrdEdx;     //!dEdx correction value for current run. Set if fgFitCorr is set and SetCorrVal(run)
103                                   // was called
104   static TF1    *fgFunEtaCorr;    //function for eta correction of electron sigma
105   static TGraph *fgdEdxRunCorr;   //run by run correction for dEdx
106   
107   Bool_t IsSelectedITS(AliVTrack * const part, Int_t icut);
108   Bool_t IsSelectedTPC(AliVTrack * const part, Int_t icut);
109   Bool_t IsSelectedTRD(AliVTrack * const part, Int_t icut);
110   Bool_t IsSelectedTRDeleEff(AliVTrack * const part, Int_t icut);
111   Bool_t IsSelectedTOF(AliVTrack * const part, Int_t icut);
112   Bool_t IsSelectedEMCAL(AliVTrack * const part, Int_t icut);
113
114   AliDielectronPID(const AliDielectronPID &c);
115   AliDielectronPID &operator=(const AliDielectronPID &c);
116
117   ClassDef(AliDielectronPID,3)         // Dielectron PID
118 };
119
120 #endif