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