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