1 #ifndef ALIDIELECTRONPID_H
2 #define ALIDIELECTRONPID_H
4 /* Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
7 //#############################################################
9 //# Class AliDielectronPID #
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 #
20 //#############################################################
23 #include <AliAnalysisCuts.h>
24 #include <AliTRDPIDResponse.h>
32 class AliDielectronVarManager;
33 class AliDielectronVarCuts;
35 class AliDielectronPID : public AliAnalysisCuts {
37 enum DetType {kITS, kTPC, kTRD, kTRDeleEff, kTRDeleEff2D, kTOF, kEMCAL};
38 enum PIDbitType {kIgnore=0, kRequire, kIfAvailable};
41 AliDielectronPID(const char*name, const char* title);
43 virtual ~AliDielectronPID();
45 void AddCut(DetType det, AliPID::EParticleType type, Double_t nSigmaLow, Double_t nSigmaUp=-99999.,
46 Double_t min=0, Double_t max=0, Bool_t exclude=kFALSE, UInt_t pidBitType=AliDielectronPID::kRequire,
49 void AddCut(DetType det, AliPID::EParticleType type, Double_t nSigmaLow, TF1 * const funUp,
50 Double_t min=0, Double_t max=0, Bool_t exclude=kFALSE, UInt_t pidBitType=AliDielectronPID::kRequire,
53 void AddCut(DetType det, AliPID::EParticleType type, TF1 * const funLow, Double_t nSigmaUp,
54 Double_t min=0, Double_t max=0, Bool_t exclude=kFALSE, UInt_t pidBitType=AliDielectronPID::kRequire,
57 void AddCut(DetType det, AliPID::EParticleType type, TF1 * const funLow, TF1 * const funUp,
58 Double_t min=0, Double_t max=0, Bool_t exclude=kFALSE, UInt_t pidBitType=AliDielectronPID::kRequire,
60 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);
61 void AddCut(DetType det, AliPID::EParticleType type, Double_t nSigmaLow, Double_t nSigmaUp,
62 AliDielectronVarCuts *varcuts, Bool_t exclude=kFALSE, UInt_t pidBitType=AliDielectronPID::kRequire );
64 void AddCut(DetType det, AliPID::EParticleType type, THnBase * const histLow, Double_t nSigmaUp,
65 Double_t min=0, Double_t max=0, Bool_t exclude=kFALSE,
66 UInt_t pidBitType=AliDielectronPID::kRequire, Int_t var=-1);
68 void SetDefaults(Int_t def);
71 //Analysis cuts interface
73 virtual Bool_t IsSelected(TObject* track);
74 virtual Bool_t IsSelected(TList* /* list */ ) {return kFALSE;}
76 static void SetCorrGraph(TGraph * const gr) { fgFitCorr=gr; }
77 static TGraph *GetCorrGraph() { return fgFitCorr; }
79 static void SetCorrVal(Double_t run);
80 static Double_t GetCorrVal() { return fgCorr; }
81 static Double_t GetCorrValdEdx() { return fgCorrdEdx; }
83 static void SetCorrGraphdEdx(TGraph * const gr) { fgdEdxRunCorr=gr; }
84 static TGraph *GetCorrGraphdEdx() { return fgdEdxRunCorr; }
86 static void SetEtaCorrFunction(TF1 *fun) {fgFunEtaCorr=fun;}
87 static void SetCentroidCorrFunction(TF1 *fun) { fgFunCntrdCorr=fun; }
88 static void SetWidthCorrFunction(TF1 *fun) { fgFunWdthCorr=fun; }
89 static TF1* GetEtaCorrFunction() { return fgFunEtaCorr; }
90 static TF1* GetCentroidCorrFunction() { return fgFunCntrdCorr; }
91 static TF1* GetWidthCorrFunction() { return fgFunWdthCorr; }
93 static Double_t GetEtaCorr(const AliVTrack *track);
94 static Double_t GetCntrdCorr(const AliVTrack *track) { return (fgFunCntrdCorr ? GetPIDCorr(track,fgFunCntrdCorr) : 0.0); }
95 static Double_t GetWdthCorr(const AliVTrack *track) { return (fgFunWdthCorr ? GetPIDCorr(track,fgFunWdthCorr) : 1.0); }
100 DetType fDetType[kNmaxPID]; //detector type of nsigma cut
101 AliPID::EParticleType fPartType[kNmaxPID]; //particle type
102 Float_t fNsigmaLow[kNmaxPID]; //lower nsigma bound
103 Float_t fNsigmaUp[kNmaxPID]; //upper nsigma bound
104 Double_t fmin[kNmaxPID]; //lower cut limit
105 Double_t fmax[kNmaxPID]; //upper cut limit
106 Bool_t fExclude[kNmaxPID]; //use as exclusion band
107 TF1 *fFunUpperCut[kNmaxPID];//use function as upper cut
108 TF1 *fFunLowerCut[kNmaxPID];//use function as lower cut
109 UChar_t fNcuts; //number of cuts
110 UChar_t fRequirePIDbit[kNmaxPID]; //How to make use of the pid bit (see)
111 UShort_t fActiveCuts[kNmaxPID]; // list of activated cuts
112 Double_t fSigmaFunLow[kNmaxPID]; // lower bound for fFunSigma
113 Double_t fSigmaFunUp[kNmaxPID]; // upper bound for fFunSigma
114 TF1 *fFunSigma[kNmaxPID]; // use function as cut range
115 AliDielectronVarCuts *fVarCuts[kNmaxPID]; // varcuts
117 AliPIDResponse *fPIDResponse; //! pid response object
119 static TGraph *fgFitCorr; //spline fit object to correct the nsigma deviation in the TPC electron band
120 static Double_t fgCorr; //!correction value for current run. Set if fgFitCorr is set and SetCorrVal(run)
122 static Double_t fgCorrdEdx; //!dEdx correction value for current run. Set if fgFitCorr is set and SetCorrVal(run)
124 static TF1 *fgFunEtaCorr; //function for eta correction of electron sigma
125 static TF1 *fgFunCntrdCorr; //function for correction of electron sigma (centroid)
126 static TF1 *fgFunWdthCorr; //function for correction of electron sigma (width)
127 static TGraph *fgdEdxRunCorr; //run by run correction for dEdx
129 static Double_t GetPIDCorr(const AliVTrack *track, TF1 *fun);
131 THnBase* fMapElectronCutLow[kNmaxPID]; //map for the electron lower cut in units of n-sigma widths 1 centered to zero
132 Bool_t IsSelectedITS(AliVTrack * const part, Int_t icut);
133 Bool_t IsSelectedTPC(AliVTrack * const part, Int_t icut, Double_t *values);
134 Bool_t IsSelectedTRD(AliVTrack * const part, Int_t icut);
135 Bool_t IsSelectedTRDeleEff(AliVTrack * const part, Int_t icut, AliTRDPIDResponse::ETRDPIDMethod PIDmethod=AliTRDPIDResponse::kLQ1D);
136 Bool_t IsSelectedTOF(AliVTrack * const part, Int_t icut);
137 Bool_t IsSelectedEMCAL(AliVTrack * const part, Int_t icut);
139 AliDielectronPID(const AliDielectronPID &c);
140 AliDielectronPID &operator=(const AliDielectronPID &c);
142 ClassDef(AliDielectronPID,6) // Dielectron PID