]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG3/dielectron/AliDielectronPID.h
Adding Id to PWG3 classes for better tracking of the coverity defect fixes (Ivana)
[u/mrichter/AliRoot.git] / PWG3 / 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 /* $Id$ */ 
8
9 //#############################################################
10 //#                                                           # 
11 //#         Class AliDielectronPID                     #
12 //#                                                           #
13 //#  Authors:                                                 #
14 //#   Anton     Andronic, GSI / A.Andronic@gsi.de             #
15 //#   Ionut C.  Arsene,   GSI / I.C.Arsene@gsi.de             #
16 //#   Julian    Book,     Uni Ffm / Julian.Book@cern.ch       #
17 //#   Frederick Kramer,   Uni Ffm, / Frederick.Kramer@cern.ch #
18 //#   Magnus    Mager,    CERN / Magnus.Mager@cern.ch         #
19 //#   WooJin J. Park,     GSI / W.J.Park@gsi.de               #
20 //#   Jens      Wiechula, Uni HD / Jens.Wiechula@cern.ch      #
21 //#                                                           #
22 //#############################################################
23
24 #include <AliPID.h>
25 #include <AliAODTrack.h>
26 #include <AliAODPid.h>
27
28 #include <AliAnalysisCuts.h>
29
30 class TF1;
31 class TList;
32 class AliVTrack;
33 class TGraph;
34 class AliESDpid;
35 class AliAODpidUtil;
36
37 class AliDielectronPID : public AliAnalysisCuts {
38 public:
39   enum DetType {kITS, kTPC, kTRD, kTOF};
40   enum PIDbitTupe {kIgnore=0, kRequire, kIfAvailable};
41   
42   AliDielectronPID();
43   AliDielectronPID(const char*name, const char* title);
44
45   virtual ~AliDielectronPID();
46
47   void AddCut(DetType det, AliPID::EParticleType type, Double_t nSigmaLow, Double_t nSigmaUp=-99999.,
48               Double_t pMin=0, Double_t pMax=0, Bool_t exclude=kFALSE, UInt_t pidBitType=AliDielectronPID::kRequire);
49
50   void AddCut(DetType det, AliPID::EParticleType type, Double_t nSigmaLow, TF1 * const funUp,
51               Double_t pMin=0, Double_t pMax=0, Bool_t exclude=kFALSE, UInt_t pidBitType=AliDielectronPID::kRequire);
52
53   void AddCut(DetType det, AliPID::EParticleType type, TF1 * const funLow, Double_t nSigmaUp,
54               Double_t pMin=0, Double_t pMax=0, Bool_t exclude=kFALSE, UInt_t pidBitType=AliDielectronPID::kRequire);
55
56   void AddCut(DetType det, AliPID::EParticleType type, TF1 * const funLow, TF1 * const funUp,
57               Double_t pMin=0, Double_t pMax=0, Bool_t exclude=kFALSE, UInt_t pidBitType=AliDielectronPID::kRequire);
58   
59   void SetDefaults(Int_t def);
60
61   //
62   //Analysis cuts interface
63   //const
64   virtual Bool_t IsSelected(TObject* track);
65   virtual Bool_t IsSelected(TList*   /* list */ ) {return kFALSE;}
66
67   static void SetCorrGraph(TGraph * const gr) { fgFitCorr=gr; }
68   static void SetCorrVal(Double_t run);
69   static Double_t GetCorrVal()   { return fgCorr; }
70   static TGraph *GetCorrGraph()  { return fgFitCorr; }
71   
72 private:
73   enum {kNmaxPID=10};
74   
75   DetType  fDetType[kNmaxPID];    //detector type of nsigma cut
76   AliPID::EParticleType fPartType[kNmaxPID]; //particle type
77   Float_t  fNsigmaLow[kNmaxPID];  //lower nsigma bound
78   Float_t  fNsigmaUp[kNmaxPID];   //upper nsigma bound
79   Double_t fPmin[kNmaxPID];       //lower momentum
80   Double_t fPmax[kNmaxPID];       //upper momentum
81   Bool_t   fExclude[kNmaxPID];    //use as exclusion band
82   TF1     *fFunUpperCut[kNmaxPID];//use function as upper cut
83   TF1     *fFunLowerCut[kNmaxPID];//use function as lower cut
84   UChar_t  fNcuts;                //number of cuts
85   UChar_t  fRequirePIDbit[kNmaxPID]; //How to make use of the pid bit (see)
86
87   AliESDpid *fESDpid;             //! esd pid object
88   AliAODpidUtil *fAODpidUtil;     //! AOD pid object
89   
90   static TGraph *fgFitCorr;       //spline fit object to correct the nsigma deviation in the TPC electron band
91   static Double_t fgCorr;         //!correction value for current run. Set if fgFitCorr is set and SetCorrVal(run)
92                                   // was called
93   
94   Bool_t IsSelectedITS(AliVTrack * const part, Int_t icut);
95   Bool_t IsSelectedTPC(AliVTrack * const part, Int_t icut);
96   Bool_t IsSelectedTRD(AliVTrack * const part, Int_t icut);
97   Bool_t IsSelectedTOF(AliVTrack * const part, Int_t icut);
98
99   AliDielectronPID(const AliDielectronPID &c);
100   AliDielectronPID &operator=(const AliDielectronPID &c);
101
102   ClassDef(AliDielectronPID,3)         // Dielectron PID
103 };
104
105 #endif