Adding flexibility to submission macros
[u/mrichter/AliRoot.git] / PWG0 / dNdPt / AlidNdPtAnalysis.h
CommitLineData
00b81913 1#ifndef ALIDNDPTANALYSIS_H
2#define ALIDNDPTANALYSIS_H
0aaa8b91 3
4//------------------------------------------------------------------------------
00b81913 5// AlidNdPtAnalysis class used for dNdPt analysis.
0aaa8b91 6//
0aaa8b91 7// Author: J.Otwinowski 04/11/2008
68f10917 8// last change: 2011-04-04 by M.Knichel
0aaa8b91 9//------------------------------------------------------------------------------
10
00b81913 11class iostream;
12
13class TFile;
14class TCint;
0aaa8b91 15class TProfile;
16class TFolder;
17class TObjArray;
18class TString;
00b81913 19class THnSparse;
0aaa8b91 20
21class AliESDtrackCuts;
22class AliVertexerTracks;
23class AliESD;
24class AliESDfriend;
25class AliESDfriendTrack;
bad4ba69 26class AlidNdPtHelper;
27
0aaa8b91 28#include "AlidNdPt.h"
0aaa8b91 29
30class AlidNdPtAnalysis : public AlidNdPt {
31public :
32 AlidNdPtAnalysis();
33 AlidNdPtAnalysis(Char_t* name, Char_t* title);
34 ~AlidNdPtAnalysis();
35
36 // Init data members
37 virtual void Init();
38
39 // Process events
40 virtual void Process(AliESDEvent *const esdEvent=0, AliMCEvent *const mcEvent=0);
41
42 // Merge output objects (needed by PROOF)
00b81913 43 virtual Long64_t Merge(TCollection* const list);
0aaa8b91 44
45 // Analyse output histograms
46 virtual void Analyse();
47
48 // Export objects to folder
c931948b 49 virtual TFolder *ExportToFolder(TObjArray * const array=0);
0aaa8b91 50
51 // Get analysis folder
00b81913 52 TFolder* GetAnalysisFolder() const {return fAnalysisFolder;}
0aaa8b91 53
54 // Fill control histograms
00b81913 55 void SetHistogramsOn(const Bool_t histOn=kTRUE) {fHistogramsOn = histOn;}
56 Bool_t IsHistogramsOn() const {return fHistogramsOn;}
0aaa8b91 57
791aaf54 58 // Define 0-multiplicity bin for LHC
59 // background calculation
60 static Bool_t IsBinZeroSPDvtx(const AliESDEvent* esdEvent);
61 static Bool_t IsBinZeroTrackSPDvtx(const AliESDEvent* esdEvent);
62
0aaa8b91 63 // Create folder for analysed histograms
64 TFolder *CreateFolder(TString folder = "folderdNdPtAnalysis",TString title = "Analysed dNdPt histograms");
65
68f10917 66 // Set binning for Histograms (if not set default binning is used)
67 void SetBinsMult(Int_t nbins, Double_t* edges) { fMultNbins = nbins; fBinsMult = edges; }
68 void SetBinsPt(Int_t nbins, Double_t* edges) { fPtNbins = nbins; fBinsPt = edges; }
69 void SetBinsPtCorr(Int_t nbins, Double_t* edges) { fPtCorrNbins = nbins; fBinsPtCorr = edges; }
70 void SetBinsEta(Int_t nbins, Double_t* edges) { fEtaNbins = nbins; fBinsEta = edges; }
71 void SetBinsZv(Int_t nbins, Double_t* edges) { fZvNbins = nbins; fBinsZv = edges; }
72
73
0aaa8b91 74 // Fill histograms
fff1caf5 75 void FillHistograms(AliESDtrack *const esdTrack, AliStack *const stack, const Double_t zv, AlidNdPtHelper::TrackObject trackObj, Int_t multMB);
0aaa8b91 76 void FillHistograms(AliStack *const stack, Int_t label, AlidNdPtHelper::TrackObject trackObj);
77 void FillHistograms(TObjArray *const allChargedTracks,Int_t *const labelsAll,Int_t multAll,Int_t *const labelsAcc,Int_t multAcc,Int_t *const labelsRec,Int_t multRec);
78
79 // Getters
00b81913 80 THnSparseF *GetEventMultCorrelationMatrix() const {return fEventMultCorrelationMatrix;}
81 THnSparseF *GetTrackPtCorrelationMatrix() const {return fTrackPtCorrelationMatrix;}
0aaa8b91 82
83 //
00b81913 84 THnSparseF *GetGenEventMatrix() const {return fGenEventMatrix;}
85 THnSparseF *GetGenSDEventMatrix() const {return fGenSDEventMatrix;}
86 THnSparseF *GetGenDDEventMatrix() const {return fGenDDEventMatrix;}
87 THnSparseF *GetGenNDEventMatrix() const {return fGenNDEventMatrix;}
88 THnSparseF *GetGenNSDEventMatrix() const {return fGenNSDEventMatrix;}
89
90 THnSparseF *GetTriggerEventMatrix() const {return fTriggerEventMatrix;}
91 THnSparseF *GetTriggerSDEventMatrix() const {return fTriggerSDEventMatrix;}
92 THnSparseF *GetTriggerDDEventMatrix() const {return fTriggerDDEventMatrix;}
93 THnSparseF *GetTriggerNDEventMatrix() const {return fTriggerNDEventMatrix;}
94 THnSparseF *GetTriggerNSDEventMatrix() const {return fTriggerNSDEventMatrix;}
95
96 THnSparseF *GetRecEventMatrix() const {return fRecEventMatrix;}
97 THnSparseF *GetRecSDEventMatrix() const {return fRecSDEventMatrix;}
98 THnSparseF *GetRecDDEventMatrix() const {return fRecDDEventMatrix;}
99 THnSparseF *GetRecNDEventMatrix() const {return fRecNDEventMatrix;}
100 THnSparseF *GetRecNSDEventMatrix() const {return fRecNSDEventMatrix;}
0aaa8b91 101
55468faf 102 //
103 THnSparseF *GetRecCandleEventMatrix() const {return fRecCandleEventMatrix;}
104
0aaa8b91 105 //
00b81913 106 THnSparseF *GetGenTrackEventMatrix() const {return fGenTrackEventMatrix;}
107 THnSparseF *GetGenTrackSDEventMatrix() const {return fGenTrackSDEventMatrix;}
108 THnSparseF *GetGenTrackDDEventMatrix() const {return fGenTrackDDEventMatrix;}
109 THnSparseF *GetGenTrackNDEventMatrix() const {return fGenTrackNDEventMatrix;}
110 THnSparseF *GetGenTrackNSDEventMatrix() const {return fGenTrackNSDEventMatrix;}
111
112 THnSparseF *GetTriggerTrackEventMatrix() const {return fTriggerTrackEventMatrix;}
113 THnSparseF *GetTriggerTrackSDEventMatrix() const {return fTriggerTrackSDEventMatrix;}
114 THnSparseF *GetTriggerTrackDDEventMatrix() const {return fTriggerTrackDDEventMatrix;}
115 THnSparseF *GetTriggerTrackNDEventMatrix() const {return fTriggerTrackNDEventMatrix;}
116 THnSparseF *GetTriggerTrackNSDEventMatrix() const {return fTriggerTrackNSDEventMatrix;}
117
118 THnSparseF *GetRecTrackEventMatrix() const {return fRecTrackEventMatrix;}
119 THnSparseF *GetRecTrackSDEventMatrix() const {return fRecTrackSDEventMatrix;}
120 THnSparseF *GetRecTrackDDEventMatrix() const {return fRecTrackDDEventMatrix;}
121 THnSparseF *GetRecTrackNDEventMatrix() const {return fRecTrackNDEventMatrix;}
122 THnSparseF *GetRecTrackNSDEventMatrix() const {return fRecTrackNSDEventMatrix;}
0aaa8b91 123
124 //
00b81913 125 THnSparseF *GetGenTrackMatrix() const {return fGenTrackMatrix;}
126 THnSparseF *GetGenPrimTrackMatrix() const {return fGenPrimTrackMatrix;}
127 THnSparseF *GetRecPrimTrackMatrix() const {return fRecPrimTrackMatrix;}
0aaa8b91 128
00b81913 129 THnSparseF *GetRecTrackMatrix() const {return fRecTrackMatrix;}
130 THnSparseF *GetRecSecTrackMatrix() const {return fRecSecTrackMatrix;}
131 THnSparseF *GetRecMultTrackMatrix() const {return fRecMultTrackMatrix;}
0aaa8b91 132
133 //
134 // control histograms
135 //
00b81913 136 THnSparseF *GetMCEventHist1() const {return fMCEventHist1;}
137 THnSparseF *GetRecEventHist1() const {return fRecEventHist1;}
138 THnSparseF *GetRecEventHist2() const {return fRecEventHist2;}
139 THnSparseF *GetRecMCEventHist1() const {return fRecMCEventHist1;}
140 THnSparseF *GetRecMCEventHist2() const {return fRecMCEventHist2;}
141 THnSparseF *GetRecMCEventHist3() const {return fRecMCEventHist3;}
0aaa8b91 142
00b81913 143 THnSparseF *GetMCTrackHist1(Int_t i) const {return fMCTrackHist1[i];}
144 THnSparseF *GetMCPrimTrackHist1(Int_t i) const {return fMCPrimTrackHist1[i];}
7f7dd416 145 THnSparseF *GetMCPrimTrackHist2(Int_t i) const {return fMCPrimTrackHist2[i];}
00b81913 146 THnSparseF *GetMCSecTrackHist1(Int_t i) const {return fMCSecTrackHist1[i];}
0aaa8b91 147
00b81913 148 THnSparseF *GetRecTrackHist1(Int_t i) const {return fRecTrackHist1[i];}
149 THnSparseF *GetRecTrackMultHist1(Int_t i) const {return fRecTrackMultHist1[i];}
0aaa8b91 150
00b81913 151 THnSparseF *GetRecMCTrackHist1() const {return fRecMCTrackHist1;}
152 THnSparseF *GetMCMultRecTrackHist1() const {return fMCMultRecTrackHist1;}
0aaa8b91 153
00b81913 154 THnSparseF *GetRecTrackHist2() const {return fRecTrackHist2;}
985bdfd5 155
f4f8cae4 156
157 //
158 // Generic histograms to be corrected
159 //
160 THnSparseF *GetRecEventHist() const {return fRecEventHist;}
161 THnSparseF *GetRecTrackHist() const {return fRecTrackHist;}
162
0aaa8b91 163private:
164
165 // analysis folder
166 TFolder *fAnalysisFolder; // folder for analysed histograms
00b81913 167 Bool_t fHistogramsOn; // switch on/off filling of control histograms
0aaa8b91 168
169 //
170 // correlation matrices (histograms)
171 //
172
173 // event rec. track vs true track multiplicity correlation matrix
fff1caf5 174 THnSparseF *fEventMultCorrelationMatrix; //-> mult:mult_true_tracks:multMB
0aaa8b91 175
176 // rec. track pt vs true track pt correlation matrix for given eta
177 THnSparseF *fTrackPtCorrelationMatrix; //-> Pt:mcPt:mcEta
178
179 //
180 // event level correction
181 //
182
183 // all genertated
bad4ba69 184 THnSparseF *fGenEventMatrix; //-> mcZv:multMB (inelastic)
185 THnSparseF *fGenSDEventMatrix; //-> mcZv:multMB (single diffractive)
186 THnSparseF *fGenDDEventMatrix; //-> mcZv:multMB (single diffractive)
187 THnSparseF *fGenNDEventMatrix; //-> mcZv:multMB (non diffractive)
188 THnSparseF *fGenNSDEventMatrix; //-> mcZv:multMB (non single diffractive)
0aaa8b91 189
190 // trigger bias corrections (fTriggerEventMatrix / fGenEventMatrix)
bad4ba69 191 THnSparseF *fTriggerEventMatrix; //-> mcZv:multMB
192 THnSparseF *fTriggerSDEventMatrix; //-> mcZv:multMB
193 THnSparseF *fTriggerDDEventMatrix; //-> mcZv:multMB
194 THnSparseF *fTriggerNDEventMatrix; //-> mcZv:multMB
195 THnSparseF *fTriggerNSDEventMatrix; //-> mcZv:multMB
0aaa8b91 196
197 // event vertex rec. eff correction (fRecEventMatrix / fTriggerEventMatrix)
bad4ba69 198 THnSparseF *fRecEventMatrix; //-> mcZv:multMB
199 THnSparseF *fRecSDEventMatrix; //-> mcZv:multMB
200 THnSparseF *fRecDDEventMatrix; //-> mcZv:multMB
201 THnSparseF *fRecNDEventMatrix; //-> mcZv:multMB
202 THnSparseF *fRecNSDEventMatrix; //-> mcZv:multMB
0aaa8b91 203
55468faf 204
0aaa8b91 205 //
206 // track-event level correction
207 //
208
209 THnSparseF *fGenTrackEventMatrix; //-> mcZv:mcPt:mcEta
210 THnSparseF *fGenTrackSDEventMatrix; //-> mcZv:mcPt:mcEta
211 THnSparseF *fGenTrackDDEventMatrix; //-> mcZv:mcPt:mcEta
212 THnSparseF *fGenTrackNDEventMatrix; //-> mcZv:mcPt:mcEta
213 THnSparseF *fGenTrackNSDEventMatrix; //-> mcZv:mcPt:mcEta
214
215 // trigger bias corrections (fTriggerTrackEventMatrix / fGenTrackEventMatrix)
216 THnSparseF *fTriggerTrackEventMatrix; //-> mcZv:mcPt:mcEta
217 THnSparseF *fTriggerTrackSDEventMatrix; //-> mcZv:mcPt:mcEta
218 THnSparseF *fTriggerTrackDDEventMatrix; //-> mcZv:mcPt:mcEta
219 THnSparseF *fTriggerTrackNDEventMatrix; //-> mcZv:mcPt:mcEta
220 THnSparseF *fTriggerTrackNSDEventMatrix; //-> mcZv:mcPt:mcEta
221
222 // event vertex rec. corrections (fRecTrackEventMatrix / fTriggerTrackEventMatrix)
223 THnSparseF *fRecTrackEventMatrix; //-> mcZv:Pt:mcEta
224 THnSparseF *fRecTrackSDEventMatrix; //-> mcZv:Pt:mcEta
225 THnSparseF *fRecTrackDDEventMatrix; //-> mcZv:Pt:mcEta
226 THnSparseF *fRecTrackNDEventMatrix; //-> mcZv:Pt:mcEta
227 THnSparseF *fRecTrackNSDEventMatrix; //-> mcZv:Pt:mcEta
228
229 //
230 // track level correction
231 //
232
233 // track rec. efficiency correction (fRecPrimTrackMatrix / fGenPrimTrackMatrix)
985bdfd5 234 THnSparseF *fGenTrackMatrix; //-> mcZv:mcPt:mcEta
0aaa8b91 235 THnSparseF *fGenPrimTrackMatrix; //-> mcZv:mcPt:mcEta
236 THnSparseF *fRecPrimTrackMatrix; //-> mcZv:mcPt:mcEta
237
238 // secondary track contamination correction (fRecSecTrackMatrix / fRecTrackMatrix)
239 THnSparseF *fRecTrackMatrix; //-> mcZv:mcPt:mcEta
240 THnSparseF *fRecSecTrackMatrix; //-> mcZv:mcPt:mcEta
241
242 // multiple rec. track corrections (fRecMultTrackMatrix / fRecTrackMatrix)
243 THnSparseF *fRecMultTrackMatrix; //-> mcZv:Pt:mcEta
244
245 //
246 // ESD and MC control analysis histograms
247 //
248
249 // THnSparse event histograms
250 THnSparseF *fMCEventHist1; //-> mcXv:mcYv:mcZv
251 THnSparseF *fRecEventHist1; //-> Xv:Yv:Zv
bad4ba69 252 THnSparseF *fRecEventHist2; //-> Zv:multMB:mult
0aaa8b91 253 THnSparseF *fRecMCEventHist1; //-> Xv-mcXv:Yv-mcYv:Zv-mcZv
bad4ba69 254 THnSparseF *fRecMCEventHist2; //-> Xv-mcXv:Zv-mcZv:mult
255 THnSparseF *fRecMCEventHist3; //-> mult:EventType (ND, DD, SD)
0aaa8b91 256
257 // THnSparse track histograms
258 // [0] - after charged track selection, [1] - after acceptance cuts, [2] - after esd track cuts
259
260 THnSparseF *fMCTrackHist1[AlidNdPtHelper::kCutSteps]; //-> mcPt:mcEta:mcPhi
261 THnSparseF *fMCPrimTrackHist1[AlidNdPtHelper::kCutSteps]; //-> mcPt:mcEta:pid:mech:mother
7f7dd416 262 THnSparseF *fMCPrimTrackHist2[AlidNdPtHelper::kCutSteps]; //-> pdg:mech:mother
0aaa8b91 263 THnSparseF *fMCSecTrackHist1[AlidNdPtHelper::kCutSteps]; //-> mcPt:mcEta:pid:mech:mother
264
265 THnSparseF *fRecTrackHist1[AlidNdPtHelper::kCutSteps]; //-> Pt:Eta:Phi
bad4ba69 266 THnSparseF *fRecTrackMultHist1[AlidNdPtHelper::kCutSteps]; //-> Pt:mult
0aaa8b91 267
268 THnSparseF *fRecMCTrackHist1; //-> mcPt:mcEta:(Pt-mcPt)/mcPt:(Eta-mcEta)
269
270 //multple reconstructed tracks
271 THnSparseF *fMCMultRecTrackHist1; //-> mcPt:mcEta:pid
272
985bdfd5 273 // track control histograms
274 THnSparseF *fRecTrackHist2; //-> nclust:chi2:Pt:Eta:Phi
275
f4f8cae4 276 //
277 // Generic histograms to be corrected
278 //
279 THnSparseF *fRecEventHist; //-> Zv:multMB
fff1caf5 280 THnSparseF *fRecTrackHist; //-> Zv:pT:eta:multRec
f4f8cae4 281
55468faf 282 //
283 // candle events track corrections
284 //
285 THnSparseF *fRecCandleEventMatrix; //-> Zv:multMB
286
68f10917 287 //binning for THNsparse
288 Int_t fMultNbins;
289 Int_t fPtNbins;
290 Int_t fPtCorrNbins;
291 Int_t fEtaNbins;
292 Int_t fZvNbins;
293 Double_t* fBinsMult;
294 Double_t* fBinsPt;
295 Double_t* fBinsPtCorr;
296 Double_t* fBinsEta;
297 Double_t* fBinsZv;
298
299 Bool_t fIsInit;
300
0aaa8b91 301 AlidNdPtAnalysis(const AlidNdPtAnalysis&); // not implemented
302 AlidNdPtAnalysis& operator=(const AlidNdPtAnalysis&); // not implemented
303
68f10917 304 ClassDef(AlidNdPtAnalysis,5);
0aaa8b91 305};
306
307#endif