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 //-------------------------------------------------------------------------
26 class AliProtonAnalysisBase : public TObject {
28 enum TriggerMode { kMB1 = 0, kMB2, kSPDFASTOR };
29 enum AnalysisMode { kInvalid = -1, kTPC = 0, kHybrid, kGlobal };
30 enum PIDMode { kBayesian = 0, kRatio, kSigma1, kSigma2 };
32 AliProtonAnalysisBase();
33 virtual ~AliProtonAnalysisBase();
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;}
41 const char *GetAnalysisLevel() {return fProtonAnalysisLevel.Data();}
42 AnalysisMode GetAnalysisMode() const {return fProtonAnalysisMode;}
43 Bool_t GetEtaMode() const {return fAnalysisEtaMode;}
44 TriggerMode GetTriggerMode() const {return fTriggerMode;}
45 PIDMode GetPIDMode() const {return fProtonPIDMode;}
47 const AliESDVertex *GetVertex(AliESDEvent *esd,
52 void SetAcceptedVertexDiamond(Double_t gVx, Double_t gVy, Double_t gVz) {
53 fVxMax = gVx; fVyMax = gVy; fVzMax = gVz;}
54 Double_t GetVxMax() const {return fVxMax;}
55 Double_t GetVyMax() const {return fVyMax;}
56 Double_t GetVzMax() const {return fVzMax;}
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;
63 Int_t GetNBinsX() const {return fNBinsX;}
64 Int_t GetNBinsY() const {return fNBinsY;}
65 Double_t GetMinX() const {return fMinX;}
66 Double_t GetMinY() const {return fMinY;}
67 Double_t GetMaxX() const {return fMaxX;}
68 Double_t GetMaxY() const {return fMaxY;}
70 static Bool_t IsEventTriggered(const AliESDEvent *esd,
71 TriggerMode trigger = kMB2);
72 Bool_t IsAccepted(AliESDEvent *esd,
73 const AliESDVertex *vertex,
75 Bool_t IsInPhaseSpace(AliESDtrack *track);
77 Float_t GetSigmaToVertex(AliESDtrack* esdTrack) const;
78 Double_t Rapidity(Double_t Px, Double_t Py, Double_t Pz) const;
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;}
87 Bool_t IsUsedPointOnITSLayer1() const {return fPointOnITSLayer1Flag;}
88 Bool_t IsUsedPointOnITSLayer2() const {return fPointOnITSLayer2Flag;}
89 Bool_t IsUsedPointOnITSLayer3() const {return fPointOnITSLayer3Flag;}
90 Bool_t IsUsedPointOnITSLayer4() const {return fPointOnITSLayer4Flag;}
91 Bool_t IsUsedPointOnITSLayer5() const {return fPointOnITSLayer5Flag;}
92 Bool_t IsUsedPointOnITSLayer6() const {return fPointOnITSLayer6Flag;}
93 void SetMinITSClusters(Int_t minITSClusters) {
94 fMinITSClusters = minITSClusters;
95 fMinITSClustersFlag = kTRUE;
97 Int_t GetMinITSClusters() const {return fMinITSClusters;}
98 Bool_t IsUsedMinITSClusters() const {return fMinITSClustersFlag;}
100 void SetMaxChi2PerITSCluster(Double_t maxChi2PerITSCluster) {
101 fMaxChi2PerITSCluster = maxChi2PerITSCluster;
102 fMaxChi2PerITSClusterFlag = kTRUE;
104 Bool_t IsUsedMaxChi2PerITSCluster() const {return fMaxChi2PerITSClusterFlag;}
105 Double_t GetMaxChi2PerITSCluster() const {return fMaxChi2PerITSCluster;}
107 void SetMinTPCClusters(Int_t minTPCClusters) {
108 fMinTPCClusters = minTPCClusters;
109 fMinTPCClustersFlag = kTRUE;
111 Bool_t IsUsedMinTPCClusters() const {return fMinTPCClustersFlag;}
112 Int_t GetMinTPCClusters() const {return fMinTPCClusters;}
114 void SetMaxChi2PerTPCCluster(Double_t maxChi2PerTPCCluster) {
115 fMaxChi2PerTPCCluster = maxChi2PerTPCCluster;
116 fMaxChi2PerTPCClusterFlag = kTRUE;
118 Bool_t IsUsedMaxChi2PerTPCCluster() const {return fMaxChi2PerTPCClusterFlag;}
119 Double_t GetMaxChi2PerTPCCluster() const {return fMaxChi2PerTPCCluster;}
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;}
131 Bool_t IsUsedMaxCov11() const {return fMaxCov11Flag;}
132 Bool_t IsUsedMaxCov22() const {return fMaxCov22Flag;}
133 Bool_t IsUsedMaxCov33() const {return fMaxCov33Flag;}
134 Bool_t IsUsedMaxCov44() const {return fMaxCov44Flag;}
135 Bool_t IsUsedMaxCov55() const {return fMaxCov55Flag;}
136 Double_t GetMaxCov11() const {return fMaxCov11;}
137 Double_t GetMaxCov22() const {return fMaxCov22;}
138 Double_t GetMaxCov33() const {return fMaxCov33;}
139 Double_t GetMaxCov44() const {return fMaxCov44;}
140 Double_t GetMaxCov55() const {return fMaxCov55;}
142 void SetMaxSigmaToVertex(Double_t maxSigmaToVertex) {
143 fMaxSigmaToVertex = maxSigmaToVertex;
144 fMaxSigmaToVertexFlag = kTRUE;
146 Bool_t IsUsedMaxSigmaToVertex() const {return fMaxSigmaToVertexFlag;}
147 Double_t GetMaxSigmaToVertex() const {return fMaxSigmaToVertex;}
149 void SetMaxSigmaToVertexTPC(Double_t maxSigmaToVertex) {
150 fMaxSigmaToVertexTPC = maxSigmaToVertex;
151 fMaxSigmaToVertexTPCFlag = kTRUE;
153 Bool_t IsUsedMaxSigmaToVertexTPC() const {return fMaxSigmaToVertexTPCFlag;}
154 Double_t GetMaxSigmaToVertexTPC() const {return fMaxSigmaToVertexTPC;}
156 void SetMaxDCAXY(Double_t maxDCAXY) {
157 fMaxDCAXY = maxDCAXY;
158 fMaxDCAXYFlag = kTRUE;
160 Bool_t IsUsedMaxDCAXY() const {return fMaxDCAXYFlag;}
161 Double_t GetMaxDCAXY() const {return fMaxDCAXY;}
163 void SetMaxDCAXYTPC(Double_t maxDCAXY) {
164 fMaxDCAXYTPC = maxDCAXY;
165 fMaxDCAXYTPCFlag = kTRUE;
167 Bool_t IsUsedMaxDCAXYTPC() const {return fMaxDCAXYTPCFlag;}
168 Double_t GetMaxDCAXYTPC() const {return fMaxDCAXYTPC;}
170 void SetMaxDCAZ(Double_t maxDCAZ) {
172 fMaxDCAZFlag = kTRUE;
174 Bool_t IsUsedMaxDCAZ() const {return fMaxDCAZFlag;}
175 Double_t GetMaxDCAZ() const {return fMaxDCAZ;}
177 void SetMaxDCAZTPC(Double_t maxDCAZ) {
178 fMaxDCAZTPC = maxDCAZ;
179 fMaxDCAZTPCFlag = kTRUE;
181 Bool_t IsUsedMaxDCAZTPC() const {return fMaxDCAZTPCFlag;}
182 Double_t GetMaxDCAZTPC() const {return fMaxDCAZTPC;}
184 void SetMaxDCA3D(Double_t maxDCA3D) {
185 fMaxDCA3D = maxDCA3D;
186 fMaxDCA3DFlag = kTRUE;
188 Bool_t IsUsedMaxDCA3D() const {return fMaxDCA3DFlag;}
189 Double_t GetMaxDCA3D() const {return fMaxDCA3D;}
191 void SetMaxDCA3DTPC(Double_t maxDCA3D) {
192 fMaxDCA3DTPC = maxDCA3D;
193 fMaxDCA3DTPCFlag = kTRUE;
195 Bool_t IsUsedMaxDCA3DTPC() const {return fMaxDCA3DTPCFlag;}
196 Double_t GetMaxDCA3DTPC() const {return fMaxDCA3DTPC;}
198 void SetMaxConstrainChi2(Double_t maxConstrainChi2) {
199 fMaxConstrainChi2 = maxConstrainChi2;
200 fMaxConstrainChi2Flag = kTRUE;
202 Bool_t IsUsedMaxConstrainChi2() const {return fMaxConstrainChi2Flag;}
203 Double_t GetMaxConstrainChi2() const {return fMaxConstrainChi2;}
205 void SetMinTPCdEdxPoints(Int_t mindEdxpoints) {
206 fMinTPCdEdxPoints = mindEdxpoints;
207 fMinTPCdEdxPointsFlag = kTRUE;
209 Bool_t IsUsedMinTPCdEdxPoints() const {return fMinTPCdEdxPointsFlag;}
210 Int_t GetMinTPCdEdxPoints() const {return fMinTPCdEdxPoints;}
212 void SetITSRefit() {fITSRefitFlag = kTRUE;}
213 Bool_t IsUsedITSRefit() const {return fITSRefitFlag;}
214 void SetTPCRefit() {fTPCRefitFlag = kTRUE;}
215 Bool_t IsUsedTPCRefit() const {return fTPCRefitFlag;}
216 void SetESDpid() {fESDpidFlag = kTRUE;}
217 Bool_t IsUsedESDpid() const {return fESDpidFlag;}
218 void SetTPCpid() {fTPCpidFlag = kTRUE;}
219 Bool_t IsUsedTPCpid() const {return fTPCpidFlag;}
221 TCanvas *GetListOfCuts();
223 //PID related functions
224 Bool_t IsProton(AliESDtrack *track);
225 void SetNSigma(Int_t nsigma) {fNSigma = nsigma;}
226 Int_t GetNSigma() const {return fNSigma;}
227 void SetdEdxBandInfo(const char* filename);
228 void SetPriorProbabilities(Double_t * const partFrac) {
229 for(Int_t i = 0; i < AliPID::kSPECIESN; i++) fPartFrac[i] = partFrac[i];}
230 void SetPriorProbabilityFunctions(TF1 *const felectron,
234 TF1 *const fproton) {
235 fFunctionProbabilityFlag = kTRUE;
236 fElectronFunction = felectron; fMuonFunction = fmuon;
237 fPionFunction = fpion; fKaonFunction = fkaon; fProtonFunction = fproton;
239 Bool_t IsPriorProbabilityFunctionUsed() const {return fFunctionProbabilityFlag;}
240 Double_t GetParticleFraction(Int_t i, Double_t p);
241 Double_t Bethe(Double_t bg) const;
243 void SetDebugMode() {fDebugMode = kTRUE;}
244 Bool_t GetDebugMode() const {return fDebugMode;}
247 AliProtonAnalysisBase(const AliProtonAnalysisBase&); // Not implemented
248 AliProtonAnalysisBase& operator=(const AliProtonAnalysisBase&); // Not implemented
250 TString fProtonAnalysisLevel;//"ESD", "AOD" or "MC"
251 TriggerMode fTriggerMode; //Trigger mode
252 AnalysisMode fProtonAnalysisMode; //Analysis mode: TPC-Hybrid-Global
253 PIDMode fProtonPIDMode; //PID mode: Bayesian-dE/dx ratio-Nsigma areas
254 Bool_t fAnalysisEtaMode; //run the analysis in eta or y
256 Double_t fVxMax, fVyMax, fVzMax; //vertex diamond constrain
258 Int_t fNBinsX; //number of bins in y or eta
259 Double_t fMinX, fMaxX; //min & max value of y or eta
260 Int_t fNBinsY; //number of bins in pT
261 Double_t fMinY, fMaxY; //min & max value of pT
264 Int_t fMinTPCClusters, fMinITSClusters; //min TPC & ITS clusters
265 Double_t fMaxChi2PerTPCCluster, fMaxChi2PerITSCluster; //max chi2 per TPC & ITS cluster
266 Double_t fMaxCov11, fMaxCov22, fMaxCov33, fMaxCov44, fMaxCov55; //max values of cov. matrix
267 Double_t fMaxSigmaToVertex; //max sigma to vertex cut
268 Double_t fMaxSigmaToVertexTPC; //max sigma to vertex cut
269 Double_t fMaxDCAXY, fMaxDCAXYTPC; //max DCA xy
270 Double_t fMaxDCAZ, fMaxDCAZTPC; //max DCA z
271 Double_t fMaxDCA3D, fMaxDCA3DTPC; //max DCA 3D
272 Double_t fMaxConstrainChi2; //max constrain chi2 - vertex
273 Int_t fMinTPCdEdxPoints;//min number of TPC points used for the dE/dx
274 Bool_t fMinTPCClustersFlag, fMinITSClustersFlag; //shows if this cut is used or not
275 Bool_t fMaxChi2PerTPCClusterFlag, fMaxChi2PerITSClusterFlag; //shows if this cut is used or not
276 Bool_t fMaxCov11Flag, fMaxCov22Flag, fMaxCov33Flag, fMaxCov44Flag, fMaxCov55Flag; //shows if this cut is used or not
277 Bool_t fMaxSigmaToVertexFlag; //shows if this cut is used or not
278 Bool_t fMaxSigmaToVertexTPCFlag; //shows if this cut is used or not
279 Bool_t fMaxDCAXYFlag, fMaxDCAXYTPCFlag; //shows if this cut is used or not
280 Bool_t fMaxDCAZFlag, fMaxDCAZTPCFlag; //shows if this cut is used or not
281 Bool_t fMaxDCA3DFlag, fMaxDCA3DTPCFlag; //shows if this cut is used or not
282 Bool_t fMaxConstrainChi2Flag; //shows if this cut is used or not
283 Bool_t fITSRefitFlag, fTPCRefitFlag; //shows if this cut is used or not
284 Bool_t fESDpidFlag, fTPCpidFlag; //shows if this cut is used or not
285 Bool_t fPointOnITSLayer1Flag, fPointOnITSLayer2Flag; //shows if this cut is used or not
286 Bool_t fPointOnITSLayer3Flag, fPointOnITSLayer4Flag; //shows if this cut is used or not
287 Bool_t fPointOnITSLayer5Flag, fPointOnITSLayer6Flag; //shows if this cut is used or not
288 Bool_t fMinTPCdEdxPointsFlag; //shows if this cut is used or not
291 Bool_t fFunctionProbabilityFlag; //flag: kTRUE if functions used
292 Int_t fNSigma; //N-sigma cut in the dE/dx band
293 Double_t fdEdxMean[24]; //mean values of the dE/dx distributions for the proton band - P slices
294 Double_t fdEdxSigma[24]; //sigma values of the dE/dx distributions for the proton band - P slices
295 Double_t fPartFrac[10]; //prior probabilities
296 TF1 *fElectronFunction; //momentum dependence of the prior probs
297 TF1 *fMuonFunction; //momentum dependence of the prior probs
298 TF1 *fPionFunction; //momentum dependence of the prior probs
299 TF1 *fKaonFunction; //momentum dependence of the prior probs
300 TF1 *fProtonFunction; //momentum dependence of the prior probs
303 Bool_t fDebugMode; //Enable the debug mode
305 ClassDef(AliProtonAnalysisBase,1);