1 #ifndef ALIPROTONANALYSISBASE_H
2 #define ALIPROTONANALYSISBASE_H
4 /* See cxx source for full Copyright notice */
7 /* $Id: AliProtonAnalysisBase.h 31056 2009-02-16 14:31:41Z pchrist $ */
9 //-------------------------------------------------------------------------
10 // Class AliProtonAnalysisBase
11 // This is the base class for the baryon (proton) analysis
13 // Origin: Panos Christakoglou | Panos.Christakoglou@cern.ch
14 //-------------------------------------------------------------------------
27 class AliProtonAnalysisBase : public TObject {
29 enum TriggerMode { kMB1 = 0, kMB2, kSPDFASTOR };
30 enum AnalysisMode { kInvalid = -1, kTPC = 0, kHybrid, kGlobal };
31 enum PIDMode { kBayesian = 0, kRatio, kSigma1, kSigma2 };
33 AliProtonAnalysisBase();
34 virtual ~AliProtonAnalysisBase();
36 void SetAnalysisLevel(const char* type) {fProtonAnalysisLevel = type;}
37 void SetAnalysisMode(AnalysisMode analysismode) {fProtonAnalysisMode = analysismode;}
38 void SetEtaMode() {fAnalysisEtaMode = kTRUE;}
39 void SetTriggerMode(TriggerMode triggermode) {
40 fAnalysisMC = kTRUE; fTriggerMode = triggermode;}
41 void SetPIDMode(PIDMode pidmode) {fProtonPIDMode = pidmode;}
43 const char *GetAnalysisLevel() {return fProtonAnalysisLevel.Data();}
44 AnalysisMode GetAnalysisMode() const {return fProtonAnalysisMode;}
45 Bool_t GetEtaMode() const {return fAnalysisEtaMode;}
46 TriggerMode GetTriggerMode() const {return fTriggerMode;}
47 PIDMode GetPIDMode() const {return fProtonPIDMode;}
48 Bool_t GetMCAnalysisMode() {return fAnalysisMC;}
50 const AliESDVertex *GetVertex(AliESDEvent *esd,
55 void SetAcceptedVertexDiamond(Double_t gVx, Double_t gVy, Double_t gVz) {
56 fVxMax = gVx; fVyMax = gVy; fVzMax = gVz;}
57 Double_t GetVxMax() const {return fVxMax;}
58 Double_t GetVyMax() const {return fVyMax;}
59 Double_t GetVzMax() const {return fVzMax;}
61 void SetPhaseSpace(Int_t nBinsX, Double_t gXmin, Double_t gXmax,
62 Int_t nBinsY, Double_t gYmin, Double_t gYmax) {
63 fNBinsX = nBinsX; fMinX = gXmin; fMaxX = gXmax;
64 fNBinsY = nBinsY; fMinY = gYmin; fMaxY = gYmax;
66 Int_t GetNBinsX() const {return fNBinsX;}
67 Int_t GetNBinsY() const {return fNBinsY;}
68 Double_t GetMinX() const {return fMinX;}
69 Double_t GetMinY() const {return fMinY;}
70 Double_t GetMaxX() const {return fMaxX;}
71 Double_t GetMaxY() const {return fMaxY;}
73 static Bool_t IsEventTriggered(const AliESDEvent *esd,
74 TriggerMode trigger = kMB2);
75 Bool_t IsAccepted(AliESDEvent *esd,
76 const AliESDVertex *vertex,
78 Bool_t IsInPhaseSpace(AliESDtrack *track);
80 Float_t GetSigmaToVertex(AliESDtrack* esdTrack) const;
81 Double_t Rapidity(Double_t Px, Double_t Py, Double_t Pz) const;
84 void SetPointOnITSLayer1() {fPointOnITSLayer1Flag = kTRUE;}
85 void SetPointOnITSLayer2() {fPointOnITSLayer2Flag = kTRUE;}
86 void SetPointOnITSLayer3() {fPointOnITSLayer3Flag = kTRUE;}
87 void SetPointOnITSLayer4() {fPointOnITSLayer4Flag = kTRUE;}
88 void SetPointOnITSLayer5() {fPointOnITSLayer5Flag = kTRUE;}
89 void SetPointOnITSLayer6() {fPointOnITSLayer6Flag = kTRUE;}
90 Bool_t IsUsedPointOnITSLayer1() const {return fPointOnITSLayer1Flag;}
91 Bool_t IsUsedPointOnITSLayer2() const {return fPointOnITSLayer2Flag;}
92 Bool_t IsUsedPointOnITSLayer3() const {return fPointOnITSLayer3Flag;}
93 Bool_t IsUsedPointOnITSLayer4() const {return fPointOnITSLayer4Flag;}
94 Bool_t IsUsedPointOnITSLayer5() const {return fPointOnITSLayer5Flag;}
95 Bool_t IsUsedPointOnITSLayer6() const {return fPointOnITSLayer6Flag;}
96 void SetMinITSClusters(Int_t minITSClusters) {
97 fMinITSClusters = minITSClusters;
98 fMinITSClustersFlag = kTRUE;
100 Int_t GetMinITSClusters() const {return fMinITSClusters;}
101 Bool_t IsUsedMinITSClusters() const {return fMinITSClustersFlag;}
103 void SetMaxChi2PerITSCluster(Double_t maxChi2PerITSCluster) {
104 fMaxChi2PerITSCluster = maxChi2PerITSCluster;
105 fMaxChi2PerITSClusterFlag = kTRUE;
107 Bool_t IsUsedMaxChi2PerITSCluster() const {return fMaxChi2PerITSClusterFlag;}
108 Double_t GetMaxChi2PerITSCluster() const {return fMaxChi2PerITSCluster;}
110 void SetMinTPCClusters(Int_t minTPCClusters) {
111 fMinTPCClusters = minTPCClusters;
112 fMinTPCClustersFlag = kTRUE;
114 Bool_t IsUsedMinTPCClusters() const {return fMinTPCClustersFlag;}
115 Int_t GetMinTPCClusters() const {return fMinTPCClusters;}
117 void SetMaxChi2PerTPCCluster(Double_t maxChi2PerTPCCluster) {
118 fMaxChi2PerTPCCluster = maxChi2PerTPCCluster;
119 fMaxChi2PerTPCClusterFlag = kTRUE;
121 Bool_t IsUsedMaxChi2PerTPCCluster() const {return fMaxChi2PerTPCClusterFlag;}
122 Double_t GetMaxChi2PerTPCCluster() const {return fMaxChi2PerTPCCluster;}
124 void SetMaxCov11(Double_t maxCov11) {
125 fMaxCov11 = maxCov11; fMaxCov11Flag = kTRUE;}
126 void SetMaxCov22(Double_t maxCov22) {
127 fMaxCov22 = maxCov22; fMaxCov22Flag = kTRUE;}
128 void SetMaxCov33(Double_t maxCov33) {
129 fMaxCov33 = maxCov33; fMaxCov33Flag = kTRUE;}
130 void SetMaxCov44(Double_t maxCov44) {
131 fMaxCov44 = maxCov44; fMaxCov44Flag = kTRUE;}
132 void SetMaxCov55(Double_t maxCov55) {
133 fMaxCov55 = maxCov55; fMaxCov55Flag = kTRUE;}
134 Bool_t IsUsedMaxCov11() const {return fMaxCov11Flag;}
135 Bool_t IsUsedMaxCov22() const {return fMaxCov22Flag;}
136 Bool_t IsUsedMaxCov33() const {return fMaxCov33Flag;}
137 Bool_t IsUsedMaxCov44() const {return fMaxCov44Flag;}
138 Bool_t IsUsedMaxCov55() const {return fMaxCov55Flag;}
139 Double_t GetMaxCov11() const {return fMaxCov11;}
140 Double_t GetMaxCov22() const {return fMaxCov22;}
141 Double_t GetMaxCov33() const {return fMaxCov33;}
142 Double_t GetMaxCov44() const {return fMaxCov44;}
143 Double_t GetMaxCov55() const {return fMaxCov55;}
145 void SetMaxSigmaToVertex(Double_t maxSigmaToVertex) {
146 fMaxSigmaToVertex = maxSigmaToVertex;
147 fMaxSigmaToVertexFlag = kTRUE;
149 Bool_t IsUsedMaxSigmaToVertex() const {return fMaxSigmaToVertexFlag;}
150 Double_t GetMaxSigmaToVertex() const {return fMaxSigmaToVertex;}
152 void SetMaxSigmaToVertexTPC(Double_t maxSigmaToVertex) {
153 fMaxSigmaToVertexTPC = maxSigmaToVertex;
154 fMaxSigmaToVertexTPCFlag = kTRUE;
156 Bool_t IsUsedMaxSigmaToVertexTPC() const {return fMaxSigmaToVertexTPCFlag;}
157 Double_t GetMaxSigmaToVertexTPC() const {return fMaxSigmaToVertexTPC;}
159 void SetMaxDCAXY(Double_t maxDCAXY) {
160 fMaxDCAXY = maxDCAXY;
161 fMaxDCAXYFlag = kTRUE;
163 Bool_t IsUsedMaxDCAXY() const {return fMaxDCAXYFlag;}
164 Double_t GetMaxDCAXY() const {return fMaxDCAXY;}
166 void SetMaxDCAXYTPC(Double_t maxDCAXY) {
167 fMaxDCAXYTPC = maxDCAXY;
168 fMaxDCAXYTPCFlag = kTRUE;
170 Bool_t IsUsedMaxDCAXYTPC() const {return fMaxDCAXYTPCFlag;}
171 Double_t GetMaxDCAXYTPC() const {return fMaxDCAXYTPC;}
173 void SetMaxDCAZ(Double_t maxDCAZ) {
175 fMaxDCAZFlag = kTRUE;
177 Bool_t IsUsedMaxDCAZ() const {return fMaxDCAZFlag;}
178 Double_t GetMaxDCAZ() const {return fMaxDCAZ;}
180 void SetMaxDCAZTPC(Double_t maxDCAZ) {
181 fMaxDCAZTPC = maxDCAZ;
182 fMaxDCAZTPCFlag = kTRUE;
184 Bool_t IsUsedMaxDCAZTPC() const {return fMaxDCAZTPCFlag;}
185 Double_t GetMaxDCAZTPC() const {return fMaxDCAZTPC;}
187 void SetMaxDCA3D(Double_t maxDCA3D) {
188 fMaxDCA3D = maxDCA3D;
189 fMaxDCA3DFlag = kTRUE;
191 Bool_t IsUsedMaxDCA3D() const {return fMaxDCA3DFlag;}
192 Double_t GetMaxDCA3D() const {return fMaxDCA3D;}
194 void SetMaxDCA3DTPC(Double_t maxDCA3D) {
195 fMaxDCA3DTPC = maxDCA3D;
196 fMaxDCA3DTPCFlag = kTRUE;
198 Bool_t IsUsedMaxDCA3DTPC() const {return fMaxDCA3DTPCFlag;}
199 Double_t GetMaxDCA3DTPC() const {return fMaxDCA3DTPC;}
201 void SetMaxConstrainChi2(Double_t maxConstrainChi2) {
202 fMaxConstrainChi2 = maxConstrainChi2;
203 fMaxConstrainChi2Flag = kTRUE;
205 Bool_t IsUsedMaxConstrainChi2() const {return fMaxConstrainChi2Flag;}
206 Double_t GetMaxConstrainChi2() const {return fMaxConstrainChi2;}
208 void SetMinTPCdEdxPoints(Int_t mindEdxpoints) {
209 fMinTPCdEdxPoints = mindEdxpoints;
210 fMinTPCdEdxPointsFlag = kTRUE;
212 Bool_t IsUsedMinTPCdEdxPoints() const {return fMinTPCdEdxPointsFlag;}
213 Int_t GetMinTPCdEdxPoints() const {return fMinTPCdEdxPoints;}
215 void SetITSRefit() {fITSRefitFlag = kTRUE;}
216 Bool_t IsUsedITSRefit() const {return fITSRefitFlag;}
217 void SetTPCRefit() {fTPCRefitFlag = kTRUE;}
218 Bool_t IsUsedTPCRefit() const {return fTPCRefitFlag;}
219 void SetESDpid() {fESDpidFlag = kTRUE;}
220 Bool_t IsUsedESDpid() const {return fESDpidFlag;}
221 void SetTPCpid() {fTPCpidFlag = kTRUE;}
222 Bool_t IsUsedTPCpid() const {return fTPCpidFlag;}
223 void SetTOFpid() {fTOFpidFlag = kTRUE;}
224 Bool_t IsUsedTOFpid() const {return fTOFpidFlag;}
226 TCanvas *GetListOfCuts();
228 //PID related functions
229 Bool_t IsProton(AliESDtrack *track);
230 void SetNSigma(Int_t nsigma) {fNSigma = nsigma;}
231 Int_t GetNSigma() const {return fNSigma;}
232 void SetdEdxBandInfo(const char* filename);
233 void SetPriorProbabilities(Double_t * const partFrac) {
234 for(Int_t i = 0; i < AliPID::kSPECIESN; i++) fPartFrac[i] = partFrac[i];}
235 void SetPriorProbabilityFunctions(TF1 *const felectron,
239 TF1 *const fproton) {
240 fFunctionProbabilityFlag = kTRUE;
241 fElectronFunction = felectron; fMuonFunction = fmuon;
242 fPionFunction = fpion; fKaonFunction = fkaon; fProtonFunction = fproton;
244 Bool_t IsPriorProbabilityFunctionUsed() const {return fFunctionProbabilityFlag;}
245 Double_t GetParticleFraction(Int_t i, Double_t p);
246 Double_t Bethe(Double_t bg) const;
248 void SetDebugMode() {fDebugMode = kTRUE;}
249 Bool_t GetDebugMode() const {return fDebugMode;}
251 TList *GetVertexQAList() {return fListVertexQA;}
254 AliProtonAnalysisBase(const AliProtonAnalysisBase&); // Not implemented
255 AliProtonAnalysisBase& operator=(const AliProtonAnalysisBase&); // Not implemented
257 TString fProtonAnalysisLevel;//"ESD", "AOD" or "MC"
258 Bool_t fAnalysisMC; //kTRUE if MC analysis
259 TriggerMode fTriggerMode; //Trigger mode
260 AnalysisMode fProtonAnalysisMode; //Analysis mode: TPC-Hybrid-Global
261 PIDMode fProtonPIDMode; //PID mode: Bayesian-dE/dx ratio-Nsigma areas
262 Bool_t fAnalysisEtaMode; //run the analysis in eta or y
264 Double_t fVxMax, fVyMax, fVzMax; //vertex diamond constrain
266 Int_t fNBinsX; //number of bins in y or eta
267 Double_t fMinX, fMaxX; //min & max value of y or eta
268 Int_t fNBinsY; //number of bins in pT
269 Double_t fMinY, fMaxY; //min & max value of pT
272 Int_t fMinTPCClusters, fMinITSClusters; //min TPC & ITS clusters
273 Double_t fMaxChi2PerTPCCluster, fMaxChi2PerITSCluster; //max chi2 per TPC & ITS cluster
274 Double_t fMaxCov11, fMaxCov22, fMaxCov33, fMaxCov44, fMaxCov55; //max values of cov. matrix
275 Double_t fMaxSigmaToVertex; //max sigma to vertex cut
276 Double_t fMaxSigmaToVertexTPC; //max sigma to vertex cut
277 Double_t fMaxDCAXY, fMaxDCAXYTPC; //max DCA xy
278 Double_t fMaxDCAZ, fMaxDCAZTPC; //max DCA z
279 Double_t fMaxDCA3D, fMaxDCA3DTPC; //max DCA 3D
280 Double_t fMaxConstrainChi2; //max constrain chi2 - vertex
281 Int_t fMinTPCdEdxPoints;//min number of TPC points used for the dE/dx
282 Bool_t fMinTPCClustersFlag, fMinITSClustersFlag; //shows if this cut is used or not
283 Bool_t fMaxChi2PerTPCClusterFlag, fMaxChi2PerITSClusterFlag; //shows if this cut is used or not
284 Bool_t fMaxCov11Flag, fMaxCov22Flag, fMaxCov33Flag, fMaxCov44Flag, fMaxCov55Flag; //shows if this cut is used or not
285 Bool_t fMaxSigmaToVertexFlag; //shows if this cut is used or not
286 Bool_t fMaxSigmaToVertexTPCFlag; //shows if this cut is used or not
287 Bool_t fMaxDCAXYFlag, fMaxDCAXYTPCFlag; //shows if this cut is used or not
288 Bool_t fMaxDCAZFlag, fMaxDCAZTPCFlag; //shows if this cut is used or not
289 Bool_t fMaxDCA3DFlag, fMaxDCA3DTPCFlag; //shows if this cut is used or not
290 Bool_t fMaxConstrainChi2Flag; //shows if this cut is used or not
291 Bool_t fITSRefitFlag, fTPCRefitFlag; //shows if this cut is used or not
292 Bool_t fESDpidFlag, fTPCpidFlag, fTOFpidFlag; //shows if this cut is used or not
293 Bool_t fPointOnITSLayer1Flag, fPointOnITSLayer2Flag; //shows if this cut is used or not
294 Bool_t fPointOnITSLayer3Flag, fPointOnITSLayer4Flag; //shows if this cut is used or not
295 Bool_t fPointOnITSLayer5Flag, fPointOnITSLayer6Flag; //shows if this cut is used or not
296 Bool_t fMinTPCdEdxPointsFlag; //shows if this cut is used or not
299 Bool_t fFunctionProbabilityFlag; //flag: kTRUE if functions used
300 Int_t fNSigma; //N-sigma cut in the dE/dx band
301 Double_t fdEdxMean[24]; //mean values of the dE/dx distributions for the proton band - P slices
302 Double_t fdEdxSigma[24]; //sigma values of the dE/dx distributions for the proton band - P slices
303 Double_t fPartFrac[10]; //prior probabilities
304 TF1 *fElectronFunction; //momentum dependence of the prior probs
305 TF1 *fMuonFunction; //momentum dependence of the prior probs
306 TF1 *fPionFunction; //momentum dependence of the prior probs
307 TF1 *fKaonFunction; //momentum dependence of the prior probs
308 TF1 *fProtonFunction; //momentum dependence of the prior probs
311 Bool_t fDebugMode; //Enable the debug mode
314 TList *fListVertexQA; //vertex QA list
316 ClassDef(AliProtonAnalysisBase,1);