]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/SPECTRA/AliProtonAnalysisBase.h
Fix in printing the missing DCS DPs.
[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;
735cc63d 20class TList;
0ab648ea 21
f203beb9 22#include "AliPhysicsSelection.h"
df201289 23#include "AliBackgroundSelection.h"
0ab648ea 24#include "AliPID.h"
25class AliESDEvent;
26class AliESDtrack;
27class AliESDVertex;
28
29class AliProtonAnalysisBase : public TObject {
30 public:
31 enum TriggerMode { kMB1 = 0, kMB2, kSPDFASTOR };
32 enum AnalysisMode { kInvalid = -1, kTPC = 0, kHybrid, kGlobal };
c6909683 33 enum PIDMode { kBayesian = 0, kRatio, kSigma};
0ab648ea 34
35 AliProtonAnalysisBase();
36 virtual ~AliProtonAnalysisBase();
37
38 void SetAnalysisLevel(const char* type) {fProtonAnalysisLevel = type;}
39 void SetAnalysisMode(AnalysisMode analysismode) {fProtonAnalysisMode = analysismode;}
40 void SetEtaMode() {fAnalysisEtaMode = kTRUE;}
790140ac 41 void SetTriggerMode(TriggerMode triggermode) {
42 fAnalysisMC = kTRUE; fTriggerMode = triggermode;}
0ab648ea 43 void SetPIDMode(PIDMode pidmode) {fProtonPIDMode = pidmode;}
44
45 const char *GetAnalysisLevel() {return fProtonAnalysisLevel.Data();}
73aba974 46 AnalysisMode GetAnalysisMode() const {return fProtonAnalysisMode;}
47 Bool_t GetEtaMode() const {return fAnalysisEtaMode;}
48 TriggerMode GetTriggerMode() const {return fTriggerMode;}
49 PIDMode GetPIDMode() const {return fProtonPIDMode;}
790140ac 50 Bool_t GetMCAnalysisMode() {return fAnalysisMC;}
0ab648ea 51
52 const AliESDVertex *GetVertex(AliESDEvent *esd,
53 AnalysisMode mode,
54 Double_t gVx = 100.,
55 Double_t gVy = 100.,
56 Double_t gVz = 100.);
57 void SetAcceptedVertexDiamond(Double_t gVx, Double_t gVy, Double_t gVz) {
58 fVxMax = gVx; fVyMax = gVy; fVzMax = gVz;}
73aba974 59 Double_t GetVxMax() const {return fVxMax;}
60 Double_t GetVyMax() const {return fVyMax;}
61 Double_t GetVzMax() const {return fVzMax;}
e56f08ed 62 void SetMinNumOfContributors(Int_t nContributors) {
63 fMinNumOfContributors = nContributors;}
64 Int_t GetMinNumOfContributors() {return fMinNumOfContributors;}
0ab648ea 65
66 void SetPhaseSpace(Int_t nBinsX, Double_t gXmin, Double_t gXmax,
67 Int_t nBinsY, Double_t gYmin, Double_t gYmax) {
68 fNBinsX = nBinsX; fMinX = gXmin; fMaxX = gXmax;
69 fNBinsY = nBinsY; fMinY = gYmin; fMaxY = gYmax;
70 }
73aba974 71 Int_t GetNBinsX() const {return fNBinsX;}
72 Int_t GetNBinsY() const {return fNBinsY;}
73 Double_t GetMinX() const {return fMinX;}
74 Double_t GetMinY() const {return fMinY;}
75 Double_t GetMaxX() const {return fMaxX;}
76 Double_t GetMaxY() const {return fMaxY;}
0ab648ea 77
c21b8f31 78 //Trigger
e56f08ed 79 Bool_t IsOnlineTriggerUsed() {return kUseOnlineTrigger;}
80 void UseOnlineTrigger() {kUseOnlineTrigger = kTRUE;}
42270c4c 81 Bool_t IsEventTriggered(const AliESDEvent *esd,
82 TriggerMode trigger = kMB2);
df201289 83 void OfflineTriggerInit() {
f203beb9 84 kUseOfflineTrigger = kTRUE;
85 fPhysicsSelection = new AliPhysicsSelection();
c21b8f31 86 fPhysicsSelection->AddBackgroundIdentification(new AliBackgroundSelection());
df201289 87 fPhysicsSelection->SetAnalyzeMC(fAnalysisMC);
f203beb9 88 }
89 Bool_t IsOfflineTriggerUsed() {return kUseOfflineTrigger;}
90 AliPhysicsSelection *GetPhysicsSelectionObject() {return fPhysicsSelection;}
c21b8f31 91
e56f08ed 92 Bool_t IsPrimary(AliESDEvent *esd,
93 const AliESDVertex *vertex,
94 AliESDtrack *track);
30f87a5b 95 Bool_t IsAccepted(AliESDtrack *track);
0ab648ea 96 Bool_t IsInPhaseSpace(AliESDtrack *track);
97
98 Float_t GetSigmaToVertex(AliESDtrack* esdTrack) const;
99 Double_t Rapidity(Double_t Px, Double_t Py, Double_t Pz) const;
100
101 //Cut functions
102 void SetPointOnITSLayer1() {fPointOnITSLayer1Flag = kTRUE;}
103 void SetPointOnITSLayer2() {fPointOnITSLayer2Flag = kTRUE;}
104 void SetPointOnITSLayer3() {fPointOnITSLayer3Flag = kTRUE;}
105 void SetPointOnITSLayer4() {fPointOnITSLayer4Flag = kTRUE;}
106 void SetPointOnITSLayer5() {fPointOnITSLayer5Flag = kTRUE;}
107 void SetPointOnITSLayer6() {fPointOnITSLayer6Flag = kTRUE;}
73aba974 108 Bool_t IsUsedPointOnITSLayer1() const {return fPointOnITSLayer1Flag;}
109 Bool_t IsUsedPointOnITSLayer2() const {return fPointOnITSLayer2Flag;}
110 Bool_t IsUsedPointOnITSLayer3() const {return fPointOnITSLayer3Flag;}
111 Bool_t IsUsedPointOnITSLayer4() const {return fPointOnITSLayer4Flag;}
112 Bool_t IsUsedPointOnITSLayer5() const {return fPointOnITSLayer5Flag;}
113 Bool_t IsUsedPointOnITSLayer6() const {return fPointOnITSLayer6Flag;}
0ab648ea 114 void SetMinITSClusters(Int_t minITSClusters) {
115 fMinITSClusters = minITSClusters;
116 fMinITSClustersFlag = kTRUE;
117 }
73aba974 118 Int_t GetMinITSClusters() const {return fMinITSClusters;}
119 Bool_t IsUsedMinITSClusters() const {return fMinITSClustersFlag;}
e7df5638 120
0ab648ea 121 void SetMaxChi2PerITSCluster(Double_t maxChi2PerITSCluster) {
122 fMaxChi2PerITSCluster = maxChi2PerITSCluster;
123 fMaxChi2PerITSClusterFlag = kTRUE;
124 }
73aba974 125 Bool_t IsUsedMaxChi2PerITSCluster() const {return fMaxChi2PerITSClusterFlag;}
126 Double_t GetMaxChi2PerITSCluster() const {return fMaxChi2PerITSCluster;}
e7df5638 127
0ab648ea 128 void SetMinTPCClusters(Int_t minTPCClusters) {
129 fMinTPCClusters = minTPCClusters;
130 fMinTPCClustersFlag = kTRUE;
131 }
73aba974 132 Bool_t IsUsedMinTPCClusters() const {return fMinTPCClustersFlag;}
133 Int_t GetMinTPCClusters() const {return fMinTPCClusters;}
e7df5638 134
0ab648ea 135 void SetMaxChi2PerTPCCluster(Double_t maxChi2PerTPCCluster) {
136 fMaxChi2PerTPCCluster = maxChi2PerTPCCluster;
137 fMaxChi2PerTPCClusterFlag = kTRUE;
138 }
73aba974 139 Bool_t IsUsedMaxChi2PerTPCCluster() const {return fMaxChi2PerTPCClusterFlag;}
140 Double_t GetMaxChi2PerTPCCluster() const {return fMaxChi2PerTPCCluster;}
e7df5638 141
0ab648ea 142 void SetMaxCov11(Double_t maxCov11) {
143 fMaxCov11 = maxCov11; fMaxCov11Flag = kTRUE;}
144 void SetMaxCov22(Double_t maxCov22) {
145 fMaxCov22 = maxCov22; fMaxCov22Flag = kTRUE;}
146 void SetMaxCov33(Double_t maxCov33) {
147 fMaxCov33 = maxCov33; fMaxCov33Flag = kTRUE;}
148 void SetMaxCov44(Double_t maxCov44) {
149 fMaxCov44 = maxCov44; fMaxCov44Flag = kTRUE;}
150 void SetMaxCov55(Double_t maxCov55) {
151 fMaxCov55 = maxCov55; fMaxCov55Flag = kTRUE;}
73aba974 152 Bool_t IsUsedMaxCov11() const {return fMaxCov11Flag;}
153 Bool_t IsUsedMaxCov22() const {return fMaxCov22Flag;}
154 Bool_t IsUsedMaxCov33() const {return fMaxCov33Flag;}
155 Bool_t IsUsedMaxCov44() const {return fMaxCov44Flag;}
156 Bool_t IsUsedMaxCov55() const {return fMaxCov55Flag;}
157 Double_t GetMaxCov11() const {return fMaxCov11;}
158 Double_t GetMaxCov22() const {return fMaxCov22;}
159 Double_t GetMaxCov33() const {return fMaxCov33;}
160 Double_t GetMaxCov44() const {return fMaxCov44;}
161 Double_t GetMaxCov55() const {return fMaxCov55;}
e7df5638 162
0ab648ea 163 void SetMaxSigmaToVertex(Double_t maxSigmaToVertex) {
164 fMaxSigmaToVertex = maxSigmaToVertex;
165 fMaxSigmaToVertexFlag = kTRUE;
166 }
73aba974 167 Bool_t IsUsedMaxSigmaToVertex() const {return fMaxSigmaToVertexFlag;}
168 Double_t GetMaxSigmaToVertex() const {return fMaxSigmaToVertex;}
e7df5638 169
0ab648ea 170 void SetMaxSigmaToVertexTPC(Double_t maxSigmaToVertex) {
171 fMaxSigmaToVertexTPC = maxSigmaToVertex;
172 fMaxSigmaToVertexTPCFlag = kTRUE;
173 }
73aba974 174 Bool_t IsUsedMaxSigmaToVertexTPC() const {return fMaxSigmaToVertexTPCFlag;}
175 Double_t GetMaxSigmaToVertexTPC() const {return fMaxSigmaToVertexTPC;}
e7df5638 176
0ab648ea 177 void SetMaxDCAXY(Double_t maxDCAXY) {
178 fMaxDCAXY = maxDCAXY;
179 fMaxDCAXYFlag = kTRUE;
180 }
73aba974 181 Bool_t IsUsedMaxDCAXY() const {return fMaxDCAXYFlag;}
182 Double_t GetMaxDCAXY() const {return fMaxDCAXY;}
e7df5638 183
0ab648ea 184 void SetMaxDCAXYTPC(Double_t maxDCAXY) {
185 fMaxDCAXYTPC = maxDCAXY;
186 fMaxDCAXYTPCFlag = kTRUE;
187 }
73aba974 188 Bool_t IsUsedMaxDCAXYTPC() const {return fMaxDCAXYTPCFlag;}
189 Double_t GetMaxDCAXYTPC() const {return fMaxDCAXYTPC;}
e7df5638 190
0ab648ea 191 void SetMaxDCAZ(Double_t maxDCAZ) {
192 fMaxDCAZ = maxDCAZ;
193 fMaxDCAZFlag = kTRUE;
194 }
73aba974 195 Bool_t IsUsedMaxDCAZ() const {return fMaxDCAZFlag;}
196 Double_t GetMaxDCAZ() const {return fMaxDCAZ;}
e7df5638 197
0ab648ea 198 void SetMaxDCAZTPC(Double_t maxDCAZ) {
199 fMaxDCAZTPC = maxDCAZ;
200 fMaxDCAZTPCFlag = kTRUE;
201 }
73aba974 202 Bool_t IsUsedMaxDCAZTPC() const {return fMaxDCAZTPCFlag;}
203 Double_t GetMaxDCAZTPC() const {return fMaxDCAZTPC;}
e7df5638 204
0ab648ea 205 void SetMaxDCA3D(Double_t maxDCA3D) {
206 fMaxDCA3D = maxDCA3D;
207 fMaxDCA3DFlag = kTRUE;
208 }
73aba974 209 Bool_t IsUsedMaxDCA3D() const {return fMaxDCA3DFlag;}
210 Double_t GetMaxDCA3D() const {return fMaxDCA3D;}
e7df5638 211
0ab648ea 212 void SetMaxDCA3DTPC(Double_t maxDCA3D) {
213 fMaxDCA3DTPC = maxDCA3D;
214 fMaxDCA3DTPCFlag = kTRUE;
215 }
73aba974 216 Bool_t IsUsedMaxDCA3DTPC() const {return fMaxDCA3DTPCFlag;}
217 Double_t GetMaxDCA3DTPC() const {return fMaxDCA3DTPC;}
e7df5638 218
0ab648ea 219 void SetMaxConstrainChi2(Double_t maxConstrainChi2) {
220 fMaxConstrainChi2 = maxConstrainChi2;
221 fMaxConstrainChi2Flag = kTRUE;
222 }
73aba974 223 Bool_t IsUsedMaxConstrainChi2() const {return fMaxConstrainChi2Flag;}
224 Double_t GetMaxConstrainChi2() const {return fMaxConstrainChi2;}
e7df5638 225
87a55728 226 void SetMinTPCdEdxPoints(Int_t mindEdxpoints) {
227 fMinTPCdEdxPoints = mindEdxpoints;
228 fMinTPCdEdxPointsFlag = kTRUE;
229 }
73aba974 230 Bool_t IsUsedMinTPCdEdxPoints() const {return fMinTPCdEdxPointsFlag;}
231 Int_t GetMinTPCdEdxPoints() const {return fMinTPCdEdxPoints;}
87a55728 232
0ab648ea 233 void SetITSRefit() {fITSRefitFlag = kTRUE;}
73aba974 234 Bool_t IsUsedITSRefit() const {return fITSRefitFlag;}
0ab648ea 235 void SetTPCRefit() {fTPCRefitFlag = kTRUE;}
73aba974 236 Bool_t IsUsedTPCRefit() const {return fTPCRefitFlag;}
0ab648ea 237 void SetESDpid() {fESDpidFlag = kTRUE;}
73aba974 238 Bool_t IsUsedESDpid() const {return fESDpidFlag;}
0ab648ea 239 void SetTPCpid() {fTPCpidFlag = kTRUE;}
73aba974 240 Bool_t IsUsedTPCpid() const {return fTPCpidFlag;}
f62e9410 241 void SetTOFpid() {fTOFpidFlag = kTRUE;}
242 Bool_t IsUsedTOFpid() const {return fTOFpidFlag;}
0ab648ea 243
244 TCanvas *GetListOfCuts();
245
246 //PID related functions
247 Bool_t IsProton(AliESDtrack *track);
87a55728 248 void SetNSigma(Int_t nsigma) {fNSigma = nsigma;}
73aba974 249 Int_t GetNSigma() const {return fNSigma;}
c6909683 250 void SetRatio(Double_t ratio) {fNRatio = ratio;}
251 Double_t GetRatio() {return fNRatio;}
0ab648ea 252 void SetPriorProbabilities(Double_t * const partFrac) {
253 for(Int_t i = 0; i < AliPID::kSPECIESN; i++) fPartFrac[i] = partFrac[i];}
254 void SetPriorProbabilityFunctions(TF1 *const felectron,
255 TF1 *const fmuon,
256 TF1 *const fpion,
257 TF1 *const fkaon,
258 TF1 *const fproton) {
259 fFunctionProbabilityFlag = kTRUE;
73aba974 260 fElectronFunction = felectron; fMuonFunction = fmuon;
261 fPionFunction = fpion; fKaonFunction = fkaon; fProtonFunction = fproton;
0ab648ea 262 }
73aba974 263 Bool_t IsPriorProbabilityFunctionUsed() const {return fFunctionProbabilityFlag;}
0ab648ea 264 Double_t GetParticleFraction(Int_t i, Double_t p);
c6909683 265 //Double_t Bethe(Double_t bg) const;
0ab648ea 266
267 void SetDebugMode() {fDebugMode = kTRUE;}
73aba974 268 Bool_t GetDebugMode() const {return fDebugMode;}
0ab648ea 269
735cc63d 270 TList *GetVertexQAList() {return fListVertexQA;}
271
0ab648ea 272 private:
273 AliProtonAnalysisBase(const AliProtonAnalysisBase&); // Not implemented
274 AliProtonAnalysisBase& operator=(const AliProtonAnalysisBase&); // Not implemented
275
276 TString fProtonAnalysisLevel;//"ESD", "AOD" or "MC"
0bb8f6b4 277 Bool_t fAnalysisMC; //kTRUE if MC analysis while reading the ESDs
0ab648ea 278 TriggerMode fTriggerMode; //Trigger mode
e56f08ed 279 Bool_t kUseOnlineTrigger; //use the online trigger or not
f203beb9 280 Bool_t kUseOfflineTrigger; //use the offline trigger or not
281 AliPhysicsSelection *fPhysicsSelection; //Trigger selection: offline
0ab648ea 282 AnalysisMode fProtonAnalysisMode; //Analysis mode: TPC-Hybrid-Global
283 PIDMode fProtonPIDMode; //PID mode: Bayesian-dE/dx ratio-Nsigma areas
284 Bool_t fAnalysisEtaMode; //run the analysis in eta or y
285
286 Double_t fVxMax, fVyMax, fVzMax; //vertex diamond constrain
e56f08ed 287 Int_t fMinNumOfContributors;//min number of contributors
0ab648ea 288
289 Int_t fNBinsX; //number of bins in y or eta
290 Double_t fMinX, fMaxX; //min & max value of y or eta
291 Int_t fNBinsY; //number of bins in pT
292 Double_t fMinY, fMaxY; //min & max value of pT
293
294 //cuts
295 Int_t fMinTPCClusters, fMinITSClusters; //min TPC & ITS clusters
296 Double_t fMaxChi2PerTPCCluster, fMaxChi2PerITSCluster; //max chi2 per TPC & ITS cluster
297 Double_t fMaxCov11, fMaxCov22, fMaxCov33, fMaxCov44, fMaxCov55; //max values of cov. matrix
298 Double_t fMaxSigmaToVertex; //max sigma to vertex cut
299 Double_t fMaxSigmaToVertexTPC; //max sigma to vertex cut
300 Double_t fMaxDCAXY, fMaxDCAXYTPC; //max DCA xy
301 Double_t fMaxDCAZ, fMaxDCAZTPC; //max DCA z
302 Double_t fMaxDCA3D, fMaxDCA3DTPC; //max DCA 3D
303 Double_t fMaxConstrainChi2; //max constrain chi2 - vertex
87a55728 304 Int_t fMinTPCdEdxPoints;//min number of TPC points used for the dE/dx
0ab648ea 305 Bool_t fMinTPCClustersFlag, fMinITSClustersFlag; //shows if this cut is used or not
306 Bool_t fMaxChi2PerTPCClusterFlag, fMaxChi2PerITSClusterFlag; //shows if this cut is used or not
307 Bool_t fMaxCov11Flag, fMaxCov22Flag, fMaxCov33Flag, fMaxCov44Flag, fMaxCov55Flag; //shows if this cut is used or not
308 Bool_t fMaxSigmaToVertexFlag; //shows if this cut is used or not
309 Bool_t fMaxSigmaToVertexTPCFlag; //shows if this cut is used or not
310 Bool_t fMaxDCAXYFlag, fMaxDCAXYTPCFlag; //shows if this cut is used or not
311 Bool_t fMaxDCAZFlag, fMaxDCAZTPCFlag; //shows if this cut is used or not
312 Bool_t fMaxDCA3DFlag, fMaxDCA3DTPCFlag; //shows if this cut is used or not
313 Bool_t fMaxConstrainChi2Flag; //shows if this cut is used or not
314 Bool_t fITSRefitFlag, fTPCRefitFlag; //shows if this cut is used or not
f62e9410 315 Bool_t fESDpidFlag, fTPCpidFlag, fTOFpidFlag; //shows if this cut is used or not
0ab648ea 316 Bool_t fPointOnITSLayer1Flag, fPointOnITSLayer2Flag; //shows if this cut is used or not
317 Bool_t fPointOnITSLayer3Flag, fPointOnITSLayer4Flag; //shows if this cut is used or not
318 Bool_t fPointOnITSLayer5Flag, fPointOnITSLayer6Flag; //shows if this cut is used or not
87a55728 319 Bool_t fMinTPCdEdxPointsFlag; //shows if this cut is used or not
320
0ab648ea 321 //pid
322 Bool_t fFunctionProbabilityFlag; //flag: kTRUE if functions used
87a55728 323 Int_t fNSigma; //N-sigma cut in the dE/dx band
c6909683 324 Double_t fNRatio; //min value of the ratio of the measured dE/dx vs the expected
0ab648ea 325 Double_t fPartFrac[10]; //prior probabilities
326 TF1 *fElectronFunction; //momentum dependence of the prior probs
327 TF1 *fMuonFunction; //momentum dependence of the prior probs
328 TF1 *fPionFunction; //momentum dependence of the prior probs
329 TF1 *fKaonFunction; //momentum dependence of the prior probs
330 TF1 *fProtonFunction; //momentum dependence of the prior probs
331
332 //Debug
333 Bool_t fDebugMode; //Enable the debug mode
334
735cc63d 335 //QA list
336 TList *fListVertexQA; //vertex QA list
337
e7df5638 338 ClassDef(AliProtonAnalysisBase,1);
0ab648ea 339};
340
341#endif