]>
Commit | Line | Data |
---|---|---|
8df8e382 | 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 | ||
a94c2e7e | 22 | #include <TBits.h> |
23 | ||
8df8e382 | 24 | #include <AliPID.h> |
8df8e382 | 25 | #include <AliAnalysisCuts.h> |
6d5dea7c | 26 | #include <AliTRDPIDResponse.h> |
8df8e382 | 27 | |
28 | class TF1; | |
8df8e382 | 29 | class TList; |
164bfb53 | 30 | class AliVTrack; |
48609e3d | 31 | class TGraph; |
5317c468 | 32 | class THnBase; |
5720c765 | 33 | class AliPIDResponse; |
34 | class AliDielectronVarManager; | |
8c2440d0 | 35 | class AliDielectronVarCuts; |
8df8e382 | 36 | |
37 | class AliDielectronPID : public AliAnalysisCuts { | |
38 | public: | |
6d5dea7c | 39 | enum DetType {kITS, kTPC, kTRD, kTRDeleEff, kTRDeleEff2D, kTOF, kEMCAL}; |
5720c765 | 40 | enum PIDbitType {kIgnore=0, kRequire, kIfAvailable}; |
8df8e382 | 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., | |
5720c765 | 48 | Double_t min=0, Double_t max=0, Bool_t exclude=kFALSE, UInt_t pidBitType=AliDielectronPID::kRequire, |
49 | Int_t var=-1); | |
8df8e382 | 50 | |
51 | void AddCut(DetType det, AliPID::EParticleType type, Double_t nSigmaLow, TF1 * const funUp, | |
5720c765 | 52 | Double_t min=0, Double_t max=0, Bool_t exclude=kFALSE, UInt_t pidBitType=AliDielectronPID::kRequire, |
53 | Int_t var=-1); | |
8df8e382 | 54 | |
55 | void AddCut(DetType det, AliPID::EParticleType type, TF1 * const funLow, Double_t nSigmaUp, | |
5720c765 | 56 | Double_t min=0, Double_t max=0, Bool_t exclude=kFALSE, UInt_t pidBitType=AliDielectronPID::kRequire, |
57 | Int_t var=-1); | |
8df8e382 | 58 | |
59 | void AddCut(DetType det, AliPID::EParticleType type, TF1 * const funLow, TF1 * const funUp, | |
5720c765 | 60 | Double_t min=0, Double_t max=0, Bool_t exclude=kFALSE, UInt_t pidBitType=AliDielectronPID::kRequire, |
61 | Int_t var=-1); | |
88204efa | 62 | void AddCut(DetType det, AliPID::EParticleType type, Double_t nSigmaLow, Double_t nSigmaUp, Double_t min, Double_t max, Bool_t exclude, UInt_t pidBitType, TF1 * const funSigma); |
8c2440d0 | 63 | void AddCut(DetType det, AliPID::EParticleType type, Double_t nSigmaLow, Double_t nSigmaUp, |
64 | AliDielectronVarCuts *varcuts, Bool_t exclude=kFALSE, UInt_t pidBitType=AliDielectronPID::kRequire ); | |
5317c468 | 65 | |
66 | void AddCut(DetType det, AliPID::EParticleType type, THnBase * const histLow, Double_t nSigmaUp, | |
67 | Double_t min=0, Double_t max=0, Bool_t exclude=kFALSE, | |
68 | UInt_t pidBitType=AliDielectronPID::kRequire, Int_t var=-1); | |
69 | ||
8df8e382 | 70 | void SetDefaults(Int_t def); |
71 | ||
a390cb66 | 72 | Int_t GetNCuts() { return fNcuts;} |
8df8e382 | 73 | // |
74 | //Analysis cuts interface | |
75 | //const | |
76 | virtual Bool_t IsSelected(TObject* track); | |
77 | virtual Bool_t IsSelected(TList* /* list */ ) {return kFALSE;} | |
48609e3d | 78 | |
79 | static void SetCorrGraph(TGraph * const gr) { fgFitCorr=gr; } | |
d327d9cd | 80 | static TGraph *GetCorrGraph() { return fgFitCorr; } |
81 | ||
48609e3d | 82 | static void SetCorrVal(Double_t run); |
83 | static Double_t GetCorrVal() { return fgCorr; } | |
d327d9cd | 84 | static Double_t GetCorrValdEdx() { return fgCorrdEdx; } |
85 | ||
86 | static void SetCorrGraphdEdx(TGraph * const gr) { fgdEdxRunCorr=gr; } | |
87 | static TGraph *GetCorrGraphdEdx() { return fgdEdxRunCorr; } | |
5720c765 | 88 | |
89 | static void SetEtaCorrFunction(TF1 *fun) {fgFunEtaCorr=fun;} | |
9ad9e048 | 90 | static void SetCentroidCorrFunction(TH1 *fun) { fgFunCntrdCorr=fun; } |
91 | static void SetWidthCorrFunction(TH1 *fun) { fgFunWdthCorr=fun; } | |
5720c765 | 92 | static TF1* GetEtaCorrFunction() { return fgFunEtaCorr; } |
93 | ||
0c09cae4 | 94 | static Double_t GetEtaCorr(const AliVTrack *track); |
61749cc7 | 95 | static Double_t GetCntrdCorr(const AliVTrack *track) { return (fgFunCntrdCorr ? GetPIDCorr(track,fgFunCntrdCorr) : 0.0); } |
96 | static Double_t GetWdthCorr(const AliVTrack *track) { return (fgFunWdthCorr ? GetPIDCorr(track,fgFunWdthCorr) : 1.0); } | |
5720c765 | 97 | |
8df8e382 | 98 | private: |
a823f01b | 99 | enum {kNmaxPID=30}; |
5720c765 | 100 | |
a94c2e7e | 101 | TBits *fUsedVars; // list of used variables |
8df8e382 | 102 | DetType fDetType[kNmaxPID]; //detector type of nsigma cut |
103 | AliPID::EParticleType fPartType[kNmaxPID]; //particle type | |
104 | Float_t fNsigmaLow[kNmaxPID]; //lower nsigma bound | |
105 | Float_t fNsigmaUp[kNmaxPID]; //upper nsigma bound | |
5720c765 | 106 | Double_t fmin[kNmaxPID]; //lower cut limit |
107 | Double_t fmax[kNmaxPID]; //upper cut limit | |
8df8e382 | 108 | Bool_t fExclude[kNmaxPID]; //use as exclusion band |
109 | TF1 *fFunUpperCut[kNmaxPID];//use function as upper cut | |
110 | TF1 *fFunLowerCut[kNmaxPID];//use function as lower cut | |
111 | UChar_t fNcuts; //number of cuts | |
61d106d3 | 112 | UChar_t fRequirePIDbit[kNmaxPID]; //How to make use of the pid bit (see) |
5720c765 | 113 | UShort_t fActiveCuts[kNmaxPID]; // list of activated cuts |
88204efa | 114 | Double_t fSigmaFunLow[kNmaxPID]; // lower bound for fFunSigma |
115 | Double_t fSigmaFunUp[kNmaxPID]; // upper bound for fFunSigma | |
116 | TF1 *fFunSigma[kNmaxPID]; // use function as cut range | |
8c2440d0 | 117 | AliDielectronVarCuts *fVarCuts[kNmaxPID]; // varcuts |
8df8e382 | 118 | |
5720c765 | 119 | AliPIDResponse *fPIDResponse; //! pid response object |
2a14a7b1 | 120 | |
48609e3d | 121 | static TGraph *fgFitCorr; //spline fit object to correct the nsigma deviation in the TPC electron band |
122 | static Double_t fgCorr; //!correction value for current run. Set if fgFitCorr is set and SetCorrVal(run) | |
123 | // was called | |
d327d9cd | 124 | static Double_t fgCorrdEdx; //!dEdx correction value for current run. Set if fgFitCorr is set and SetCorrVal(run) |
125 | // was called | |
5720c765 | 126 | static TF1 *fgFunEtaCorr; //function for eta correction of electron sigma |
9ad9e048 | 127 | static TH1 *fgFunCntrdCorr; //function for correction of electron sigma (centroid) |
128 | static TH1 *fgFunWdthCorr; //function for correction of electron sigma (width) | |
d327d9cd | 129 | static TGraph *fgdEdxRunCorr; //run by run correction for dEdx |
8c2440d0 | 130 | |
9ad9e048 | 131 | static Double_t GetPIDCorr(const AliVTrack *track, TH1 *hist); |
8d42b5b9 | 132 | |
5317c468 | 133 | THnBase* fMapElectronCutLow[kNmaxPID]; //map for the electron lower cut in units of n-sigma widths 1 centered to zero |
ffbede40 | 134 | Bool_t IsSelectedITS(AliVTrack * const part, Int_t icut); |
5317c468 | 135 | Bool_t IsSelectedTPC(AliVTrack * const part, Int_t icut, Double_t *values); |
ffbede40 | 136 | Bool_t IsSelectedTRD(AliVTrack * const part, Int_t icut); |
6d5dea7c | 137 | Bool_t IsSelectedTRDeleEff(AliVTrack * const part, Int_t icut, AliTRDPIDResponse::ETRDPIDMethod PIDmethod=AliTRDPIDResponse::kLQ1D); |
ffbede40 | 138 | Bool_t IsSelectedTOF(AliVTrack * const part, Int_t icut); |
5720c765 | 139 | Bool_t IsSelectedEMCAL(AliVTrack * const part, Int_t icut); |
8df8e382 | 140 | |
8df8e382 | 141 | AliDielectronPID(const AliDielectronPID &c); |
142 | AliDielectronPID &operator=(const AliDielectronPID &c); | |
143 | ||
a94c2e7e | 144 | ClassDef(AliDielectronPID,7) // Dielectron PID |
8df8e382 | 145 | }; |
146 | ||
8df8e382 | 147 | #endif |