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