]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGLF/totEt/AliAnalysisEt.cxx
Corrected names: PWG2 ->PWGLF
[u/mrichter/AliRoot.git] / PWGLF / totEt / AliAnalysisEt.cxx
CommitLineData
cf6522d1 1//_________________________________________________________________________
2// Utility Class for transverse energy studies
3// Base class for ESD & MC analysis
4// - reconstruction and MonteCarlo output
5// implementation file
6//
7//*-- Authors: Oystein Djuvsland (Bergen), David Silvermyr (ORNL)
8//_________________________________________________________________________
9
2fbf38ac 10#include "AliAnalysisEt.h"
11#include "TMath.h"
12#include "TList.h"
13#include "TH1F.h"
14#include "TH2F.h"
ce546038 15#include "TTree.h"
2fbf38ac 16#include <iostream>
17#include "AliAnalysisEtCuts.h"
951efd81 18#include "AliESDtrackCuts.h"
f9a4ed81 19#include "AliESDCaloCluster.h"
641e1e0c 20#include "AliVEvent.h"
cf6522d1 21#include "Rtypes.h"
0f97be4c 22#include "TString.h"
d0c22dcc 23#include "AliCentrality.h"
1423b942 24 //#include "THnSparse.h"
641e1e0c 25
26using namespace std;
2fbf38ac 27ClassImp(AliAnalysisEt);
28
0651f6b4 29/* Auxiliary Histogram variables */
30Int_t AliAnalysisEt::fgnumOfEtaBins = 16;
31Float_t AliAnalysisEt::fgEtaAxis[17]={-0.78, -0.7, -0.58, -0.46, -0.34, -0.22, -0.12, -0.06, -0.0, 0.06, 0.12, 0.22, 0.34, 0.46, 0.58, 0.7, 0.78};
32
1423b942 33Int_t AliAnalysisEt::fgNumOfPtBins = 111;
34Float_t AliAnalysisEt::fgPtAxis[117]=
35 {0.0,0.01,0.02,0.03,0.04, 0.05, 0.06,0.07,0.08,0.09, 0.10,0.11, .12,0.13, .14,0.15, .16,0.17, .18,0.19,
36 0.2, .22, .24, .26, .28, 0.30, 0.32, .34, .36, .38, 0.40, .42, .44, .46, .48,
37 0.5, .52, .54, .56, .58, 0.60, 0.62, .64, .66, .68, 0.70, .72, .74, .76, .78,
38 .80, .82, .84, .86, .88, 0.90, 0.92, .94, .96, .98, 1.00,1.05, 1.1,1.15, 1.2,
39 1.25, 1.3,1.35,1.40,1.45, 1.50, 1.55, 1.6,1.65, 1.7, 1.75, 1.8,1.85, 1.9,1.95,
40 2.0, 2.2, 2.4, 2.6, 2.8, 3.00, 3.20, 3.4, 3.6, 3.8, 4.00, 4.2, 4.4, 4.6, 4.8,
41 5.0, 5.5, 6.0, 6.5, 7.0, 7.50, 8.00, 8.5, 9.0, 9.5, 10.0,12.0,14.0,16.0,18.0,
42 20.0,25.0,30.0,35.0,40.0, 45.0, 50.0};
43
0651f6b4 44Int_t AliAnalysisEt::fgNumOfEBins = 78;
45Float_t AliAnalysisEt::fgEAxis[79]={0., 0.05, 0.10, 0.15, 0.20, 0.25, 0.30, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95,
46 1.,1.5,2.,2.5,3.,3.5,4.,4.5,5.,5.5,6.,6.5,7.,7.5,8.,8.5,9.,9.5,10.,11.,
47 12.,13.,14.,15.,16.,17.,18.,19.,20.,21.,22.,23.,24.,25.,26.,27.,28.,29.,30.,31.,
48 32.,33.,34.,35.,36.,37.,38.,39.,40.,41.,42.,43.,44.,45.,46.,47.,48.,49.,50.};
49
1423b942 50Int_t AliAnalysisEt::fgNumOfRBins = 47;
51Float_t AliAnalysisEt::fgRAxis[48]={-2.,-1.,0.,0.0005,0.001,0.0015,0.002,0.0025,0.003,0.0035,0.004,0.0045,0.005,0.0055,0.006,0.0065,0.007,0.0075,0.008,0.0085,0.009,0.0095,0.01,
52 0.011,0.012,0.013,0.014,0.015,0.016,0.017,0.018,0.019,0.020,0.022,0.024,0.026,0.028,0.03,0.032,0.034,0.036,0.038,0.04,0.042,0.044,0.046,0.048,0.05};
53
2fbf38ac 54
7d2d1773 55AliAnalysisEt::AliAnalysisEt() : AliAnalysisEtCommon()
7d2d1773 56 ,fTotEt(0)
57 ,fTotEtAcc(0)
58 ,fTotNeutralEt(0)
59 ,fTotNeutralEtAcc(0)
60 ,fTotChargedEt(0)
61 ,fTotChargedEtAcc(0)
62 ,fMultiplicity(0)
63 ,fChargedMultiplicity(0)
64 ,fNeutralMultiplicity(0)
65 ,fBaryonEt(0)
66 ,fAntiBaryonEt(0)
67 ,fMesonEt(0)
68 ,fProtonEt(0)
69 ,fPionEt(0)
70 ,fChargedKaonEt(0)
71 ,fMuonEt(0)
72 ,fElectronEt(0)
73 ,fNeutronEt(0)
74 ,fAntiNeutronEt(0)
75 ,fGammaEt(0)
76 ,fProtonEtAcc(0)
77 ,fPionEtAcc(0)
78 ,fChargedKaonEtAcc(0)
79 ,fMuonEtAcc(0)
80 ,fElectronEtAcc(0)
81 ,fEnergyDeposited(0)
82 ,fEnergyTPC(0)
83 ,fCharge(0)
84 ,fParticlePid(0)
85 ,fPidProb(0)
86 ,fTrackPassedCut(kFALSE)
f9a4ed81 87 ,fCentClass(0)
7d2d1773 88 ,fEtaCut(0)
89 ,fEtaCutAcc(0)
90 ,fPhiCutAccMin(0)
91 ,fPhiCutAccMax(0)
92 ,fDetectorRadius(0)
93 ,fClusterEnergyCut(0)
94 ,fSingleCellEnergyCut(0)
f9a4ed81 95 ,fTrackDistanceCut(0)
476828ae 96 ,fTrackDxCut(0)
97 ,fTrackDzCut(0)
7d2d1773 98 ,fHistEt(0)
99 ,fHistChargedEt(0)
100 ,fHistNeutralEt(0)
101 ,fHistEtAcc(0)
102 ,fHistChargedEtAcc(0)
103 ,fHistNeutralEtAcc(0)
104 ,fHistMult(0)
105 ,fHistChargedMult(0)
106 ,fHistNeutralMult(0)
107 ,fHistPhivsPtPos(0)
108 ,fHistPhivsPtNeg(0)
109 ,fHistBaryonEt(0)
110 ,fHistAntiBaryonEt(0)
111 ,fHistMesonEt(0)
112 ,fHistProtonEt(0)
113 ,fHistPionEt(0)
114 ,fHistChargedKaonEt(0)
115 ,fHistMuonEt(0)
116 ,fHistElectronEt(0)
117 ,fHistNeutronEt(0)
118 ,fHistAntiNeutronEt(0)
119 ,fHistGammaEt(0)
120 ,fHistProtonEtAcc(0)
121 ,fHistPionEtAcc(0)
122 ,fHistChargedKaonEtAcc(0)
123 ,fHistMuonEtAcc(0)
124 ,fHistElectronEtAcc(0)
125 ,fHistTMDeltaR(0)
f9a4ed81 126 ,fHistTMDxDz(0)
7d2d1773 127 ,fTree(0)
128 ,fTreeDeposit(0)
5501aa9c 129 ,fCentrality(0)
f9a4ed81 130 ,fDetector(0)
01b73fb0 131 ,fMakeSparse(kFALSE)
f9a4ed81 132 ,fSparseHistTracks(0)
133 ,fSparseHistClusters(0)
134 ,fSparseHistEt(0)
135 ,fSparseTracks(0)
136 ,fSparseClusters(0)
137 ,fSparseEt(0)
138
0651f6b4 139{}
2fbf38ac 140
141AliAnalysisEt::~AliAnalysisEt()
464aa50c 142{//Destructor
951efd81 143 if(fTreeDeposit){
144 fTreeDeposit->Clear();
145 delete fTreeDeposit; // optional TTree
146 }
147 if(fTree){
148 fTree->Clear();
149 delete fTree; // optional TTree
150 }
7d2d1773 151 delete fHistEt; //Et spectrum
152 delete fHistChargedEt; //Charged Et spectrum
153 delete fHistNeutralEt; //Neutral Et spectrum
154 delete fHistEtAcc; //Et in acceptance
155 delete fHistChargedEtAcc; //Charged Et in acceptance
156 delete fHistNeutralEtAcc; //Et in acceptance
157 delete fHistMult; //Multiplicity
158 delete fHistChargedMult; //Charged multiplicity
159 delete fHistNeutralMult; //Neutral multiplicity
160 delete fHistPhivsPtPos; //phi vs pT plot for positive tracks
161 delete fHistPhivsPtNeg; //phi vs pT plot for negative tracks
162 delete fHistBaryonEt; /** Et of identified baryons */
163 delete fHistAntiBaryonEt; /** Et of identified anti-baryons */
164 delete fHistMesonEt; /** Et of identified mesons */
165 delete fHistProtonEt; /** Et of identified protons */
166 delete fHistPionEt; /** Et of identified protons */
167 delete fHistChargedKaonEt; /** Et of identified charged kaons */
168 delete fHistMuonEt; /** Et of identified muons */
169 delete fHistElectronEt; /** Et of identified electrons */
170 delete fHistNeutronEt; /** Et of neutrons (MC only for now) */
171 delete fHistAntiNeutronEt; /** Et of anti-neutrons (MC only for now) */
172 delete fHistGammaEt; /** Et of gammas (MC only for now) */
173 delete fHistProtonEtAcc; /** Et of identified protons in calorimeter acceptance */
174 delete fHistPionEtAcc; /** Et of identified protons in calorimeter acceptance */
175 delete fHistChargedKaonEtAcc; /** Et of identified charged kaons in calorimeter acceptance */
176 delete fHistMuonEtAcc; /** Et of identified muons in calorimeter acceptance */
177 delete fHistElectronEtAcc; /** Et of identified electrons in calorimeter acceptance */
178 delete fHistTMDeltaR; /* Track matching plots; Rec only for now */
f9a4ed81 179 delete fHistTMDxDz; /* Track matching plots; Rec only for now */
d0c22dcc 180 //arrays for axes were not dynamically created so don't need to be deleted
181 delete fTree;
182 delete fTreeDeposit;
183 //delete fCentrality;//this code does not actually own AliCentrality so we don't have to worry about deleting it... we just borrow it...
184 delete fSparseHistTracks;
185 delete fSparseHistClusters;
186 delete fSparseHistEt;
187 delete [] fSparseTracks;
188 delete [] fSparseClusters;
189 delete [] fSparseEt;
2fbf38ac 190}
191
192void AliAnalysisEt::FillOutputList(TList *list)
cf6522d1 193{ // histograms to be added to output
2fbf38ac 194 list->Add(fHistEt);
195 list->Add(fHistChargedEt);
196 list->Add(fHistNeutralEt);
197
198 list->Add(fHistEtAcc);
199 list->Add(fHistChargedEtAcc);
200 list->Add(fHistNeutralEtAcc);
201
202 list->Add(fHistMult);
203 list->Add(fHistChargedMult);
204 list->Add(fHistNeutralMult);
205
206 list->Add(fHistPhivsPtPos);
207 list->Add(fHistPhivsPtNeg);
208
209 list->Add(fHistBaryonEt);
210 list->Add(fHistAntiBaryonEt);
211 list->Add(fHistMesonEt);
212
43056f1b 213 list->Add(fHistProtonEt);
214 list->Add(fHistPionEt);
215 list->Add(fHistChargedKaonEt);
216 list->Add(fHistMuonEt);
217 list->Add(fHistElectronEt);
218
219 list->Add(fHistNeutronEt);
220 list->Add(fHistAntiNeutronEt);
221 list->Add(fHistGammaEt);
222
87efb15c 223 list->Add(fHistProtonEtAcc);
43056f1b 224 list->Add(fHistPionEtAcc);
87efb15c 225 list->Add(fHistChargedKaonEtAcc);
226 list->Add(fHistMuonEtAcc);
227 list->Add(fHistElectronEtAcc);
228
2fbf38ac 229 list->Add(fHistTMDeltaR);
f9a4ed81 230 list->Add(fHistTMDxDz);
0651f6b4 231
ce546038 232 if (fCuts) {
233 if (fCuts->GetHistMakeTree()) {
234 list->Add(fTree);
235 }
f9a4ed81 236 if (fCuts->GetHistMakeTreeDeposit()) {
237 list->Add(fTreeDeposit);
238 }
ce546038 239 }
f9a4ed81 240
01b73fb0 241 if(fMakeSparse){
242 list->Add(fSparseHistTracks);
243 list->Add(fSparseHistClusters);
244 list->Add(fSparseHistEt);
245 }
ce546038 246
2fbf38ac 247}
248
249void AliAnalysisEt::Init()
0065531a 250{// clear variables, set up cuts and PDG info
7d2d1773 251 AliAnalysisEtCommon::Init();
0065531a 252 ResetEventValues();
2fbf38ac 253}
254
255void AliAnalysisEt::CreateHistograms()
cf6522d1 256{ // create histograms..
13b0d3c1 257 // histogram binning for E_T, p_T and Multiplicity: defaults for p+p
f9a4ed81 258 Int_t nbinsEt = 10000;
259 Double_t minEt = 0.0;
260 Double_t maxEt = 1000;
13b0d3c1 261 Int_t nbinsPt = 200;
262 Double_t minPt = 0;
263 Double_t maxPt = 20;
264 Int_t nbinsMult = 200;
265 Double_t minMult = -0.5; // offset -0.5 to have integer bins centered around 0
266 Double_t maxMult = nbinsMult + minMult; // 1 bin per integer value
2fbf38ac 267
ce546038 268 // see if we should change histogram limits etc, and possibly create a tree
269 if (fCuts) {
bf4eaf10 270 if (fCuts->GetHistMakeTree()) {
8ea99ab0 271 CreateTrees();
bf4eaf10 272 }
0fa8c632 273
274 nbinsMult = fCuts->GetHistNbinsMult();
275 minMult = fCuts->GetHistMinMult();
276 maxMult = fCuts->GetHistMaxMult();
277
278 nbinsEt = fCuts->GetHistNbinsTotEt();
279 minEt = fCuts->GetHistMinTotEt();
280 maxEt = fCuts->GetHistMaxTotEt();
281
282 nbinsPt = fCuts->GetHistNbinsParticlePt();
283 minPt = fCuts->GetHistMinParticlePt();
284 maxPt = fCuts->GetHistMaxParticlePt();
ce546038 285 }
286
2fbf38ac 287 TString histname = "fHistEt" + fHistogramNameSuffix;
13b0d3c1 288 fHistEt = new TH1F(histname.Data(), "Total E_{T} Distribution", nbinsEt, minEt, maxEt);
2fbf38ac 289 fHistEt->GetXaxis()->SetTitle("E_{T} (GeV/c^{2})");
290 fHistEt->GetYaxis()->SetTitle("dN/dE_{T} (c^{2}/GeV)");
291
292 histname = "fHistChargedEt" + fHistogramNameSuffix;
13b0d3c1 293 fHistChargedEt = new TH1F(histname.Data(), "Total Charged E_{T} Distribution", nbinsEt, minEt, maxEt);
2fbf38ac 294 fHistChargedEt->GetXaxis()->SetTitle("E_{T} (GeV/c^{2})");
295 fHistChargedEt->GetYaxis()->SetTitle("dN/dE_{T} (c^{2}/GeV)");
296
297 histname = "fHistNeutralEt" + fHistogramNameSuffix;
13b0d3c1 298 fHistNeutralEt = new TH1F(histname.Data(), "Total Neutral E_{T} Distribution", nbinsEt, minEt, maxEt);
2fbf38ac 299 fHistNeutralEt->GetXaxis()->SetTitle("E_{T} (GeV/c^{2})");
300 fHistNeutralEt->GetYaxis()->SetTitle("dN/dE_{T} (c^{2}/GeV)");
301
302 histname = "fHistEtAcc" + fHistogramNameSuffix;
13b0d3c1 303 fHistEtAcc = new TH1F(histname.Data(), "Total E_{T} Distribution in Acceptance", nbinsEt, minEt, maxEt);
2fbf38ac 304 fHistEtAcc->GetXaxis()->SetTitle("E_{T} (GeV/c^{2})");
305 fHistEtAcc->GetYaxis()->SetTitle("dN/dE_{T} (c^{2}/GeV)");
306
307 histname = "fHistChargedEtAcc" + fHistogramNameSuffix;
13b0d3c1 308 fHistChargedEtAcc = new TH1F(histname.Data(), "Total Charged E_{T} Distribution in Acceptance", nbinsEt, minEt, maxEt);
2fbf38ac 309 fHistChargedEtAcc->GetXaxis()->SetTitle("E_{T} (GeV/c^{2})");
310 fHistChargedEtAcc->GetYaxis()->SetTitle("dN/dE_{T} (c^{2}/GeV)");
311
312 histname = "fHistNeutralEtAcc" + fHistogramNameSuffix;
13b0d3c1 313 fHistNeutralEtAcc = new TH1F(histname.Data(), "Total Neutral E_{T} Distribution in Acceptance", nbinsEt, minEt, maxEt);
2fbf38ac 314 fHistNeutralEtAcc->GetXaxis()->SetTitle("E_{T} (GeV/c^{2})");
315 fHistNeutralEtAcc->GetYaxis()->SetTitle("dN/dE_{T} (c^{2}/GeV)");
316 std::cout << histname << std::endl;
0651f6b4 317
318 histname = "fHistMult" + fHistogramNameSuffix;
13b0d3c1 319 fHistMult = new TH1F(histname.Data(), "Total Multiplicity", nbinsMult, minMult, maxMult);
2fbf38ac 320 fHistMult->GetXaxis()->SetTitle("N");
321 fHistMult->GetYaxis()->SetTitle("Multiplicity");
322
323 histname = "fHistChargedMult" + fHistogramNameSuffix;
13b0d3c1 324 fHistChargedMult = new TH1F(histname.Data(), "Charged Multiplicity", nbinsMult, minMult, maxMult);
2fbf38ac 325 fHistChargedMult->GetXaxis()->SetTitle("N");
326 fHistChargedMult->GetYaxis()->SetTitle("Multiplicity");
327
328 histname = "fHistNeutralMult" + fHistogramNameSuffix;
13b0d3c1 329 fHistNeutralMult = new TH1F(histname.Data(), "Neutral Multiplicity", nbinsMult, minMult, maxMult);
2fbf38ac 330 fHistNeutralMult->GetXaxis()->SetTitle("N");
331 fHistNeutralMult->GetYaxis()->SetTitle("Multiplicity");
332
333 histname = "fHistPhivsPtPos" + fHistogramNameSuffix;
13b0d3c1 334 fHistPhivsPtPos = new TH2F(histname.Data(), "Phi vs pT of positively charged tracks hitting the calorimeter", 200, 0, 2*TMath::Pi(), nbinsPt, minPt, maxPt);
2fbf38ac 335
336 histname = "fHistPhivsPtNeg" + fHistogramNameSuffix;
13b0d3c1 337 fHistPhivsPtNeg = new TH2F(histname.Data(), "Phi vs pT of negatively charged tracks hitting the calorimeter", 200, 0, 2*TMath::Pi(), nbinsPt, minPt, maxPt);
2fbf38ac 338
339 histname = "fHistBaryonEt" + fHistogramNameSuffix;
13b0d3c1 340 fHistBaryonEt = new TH1F(histname.Data(), "E_{T} for baryons", nbinsEt, minEt, maxEt);
2fbf38ac 341
342 histname = "fHistAntiBaryonEt" + fHistogramNameSuffix;
13b0d3c1 343 fHistAntiBaryonEt = new TH1F(histname.Data(), "E_{T} for anti baryons", nbinsEt, minEt, maxEt);
2fbf38ac 344
345 histname = "fHistMesonEt" + fHistogramNameSuffix;
13b0d3c1 346 fHistMesonEt = new TH1F(histname.Data(), "E_{T} for mesons", nbinsEt, minEt, maxEt);
2fbf38ac 347
87efb15c 348 histname = "fHistProtonEt" + fHistogramNameSuffix;
349 fHistProtonEt = new TH1F(histname.Data(), "E_{T} for (anti-)protons", nbinsEt, minEt, maxEt);
350
43056f1b 351 histname = "fHistPionEt" + fHistogramNameSuffix;
352 fHistPionEt = new TH1F(histname.Data(), "E_{T} for #pi^+/#pi^-", nbinsEt, minEt, maxEt);
353
87efb15c 354 histname = "fHistKaonEt" + fHistogramNameSuffix;
355 fHistChargedKaonEt = new TH1F(histname.Data(), "E_{T} for charged kaons", nbinsEt, minEt, maxEt);
356
357 histname = "fHistMuonEt" + fHistogramNameSuffix;
358 fHistMuonEt = new TH1F(histname.Data(), "E_{T} for muons", nbinsEt, minEt, maxEt);
359
360 histname = "fHistElectronEt" + fHistogramNameSuffix;
361 fHistElectronEt = new TH1F(histname.Data(), "E_{T} for electrons/positrons", nbinsEt, minEt, maxEt);
362
43056f1b 363 histname = "fHistNeutronEt" + fHistogramNameSuffix;
364 fHistNeutronEt = new TH1F(histname.Data(), "E_{T} for neutrons", nbinsEt, minEt, maxEt);
365
366 histname = "fHistAntiNeutronEt" + fHistogramNameSuffix;
367 fHistAntiNeutronEt = new TH1F(histname.Data(), "E_{T} for anti-neutrons", nbinsEt, minEt, maxEt);
368
369 histname = "fHistGammaEt" + fHistogramNameSuffix;
370 fHistGammaEt = new TH1F(histname.Data(), "E_{T} for gammas", nbinsEt, minEt, maxEt);
371
87efb15c 372 histname = "fHistProtonEtAcc" + fHistogramNameSuffix;
373 fHistProtonEtAcc = new TH1F(histname.Data(), "E_{T} for (anti-)protons in calorimeter acceptance", nbinsEt, minEt, maxEt);
374
43056f1b 375 histname = "fHistPionEtAcc" + fHistogramNameSuffix;
376 fHistPionEtAcc = new TH1F(histname.Data(), "E_{T} for #pi^+/#pi^- in calorimeter acceptance", nbinsEt, minEt, maxEt);
377
87efb15c 378 histname = "fHistKaonEtAcc" + fHistogramNameSuffix;
379 fHistChargedKaonEtAcc = new TH1F(histname.Data(), "E_{T} for charged kaons in calorimeter acceptance", nbinsEt, minEt, maxEt);
380
381 histname = "fHistMuonEtAcc" + fHistogramNameSuffix;
382 fHistMuonEtAcc = new TH1F(histname.Data(), "E_{T} for muons in calorimeter acceptance", nbinsEt, minEt, maxEt);
383
384 histname = "fHistElectronEtAcc" + fHistogramNameSuffix;
385 fHistElectronEtAcc = new TH1F(histname.Data(), "E_{T} for electrons/positrons in calorimeter acceptance", nbinsEt, minEt, maxEt);
386
cf6522d1 387 //
2fbf38ac 388 histname = "fHistTMDeltaR" + fHistogramNameSuffix;
389 fHistTMDeltaR = new TH1F(histname.Data(), "#Delta R for calorimeter clusters", 200, 0, 50);
f9a4ed81 390
391 histname = "fHistTMDxDz" + fHistogramNameSuffix;
392 fHistTMDxDz = new TH2F(histname.Data(), "#Delta x vs #Delta z for calorimeter clusters", 800, -200, 200, 800, -200, 200);
393
01b73fb0 394 if(fMakeSparse){
395 histname = "fSparseHistTracks" + fHistogramNameSuffix;
396 const Int_t stsize = 7;
397 Int_t binsHist[stsize] = { 1001, 7, 200000, 10000, 10000, 100, 11};
398 Double_t minHist[stsize] = {-500.5, -3.5, 0.0, 0.0, 0.0, -1.5, -0.5};
399 Double_t maxHist[stsize] = { 499.5, 3.5, 200.0, 100.0, 100.0, 1.5, 10.5};
400 fSparseTracks = new Double_t[stsize];
401 fSparseHistTracks = new THnSparseF(histname.Data(), "pid:charge:mass:et:pt:rap:cent", stsize, binsHist, minHist, maxHist);
f9a4ed81 402
01b73fb0 403 fSparseHistTracks->GetAxis(0)->SetTitle("pid");
404 fSparseHistTracks->GetAxis(1)->SetTitle("charge");
405 fSparseHistTracks->GetAxis(2)->SetTitle("mass");
406 fSparseHistTracks->GetAxis(3)->SetTitle("et");
407 fSparseHistTracks->GetAxis(4)->SetTitle("pt");
408 fSparseHistTracks->GetAxis(5)->SetTitle("rap");
409 fSparseHistTracks->GetAxis(6)->SetTitle("cent");
410
411 histname = "fSparseHistClusters" + fHistogramNameSuffix;
412 const Int_t scsize = 11;
413 // pid ch mass et pt eta et_t pt_t eta_t cent dist
414 Int_t scbinsHist[scsize] = { 1001, 7, 200000, 10000, 10000, 100, 10000, 10000, 100, 11, 4000};
415 Double_t scminHist[scsize] = {-500.5, -3.5, 0.0, 0.0, 0.0, -1.5, 0.0, 0.0, -1.5, -0.5, -200.0};
416 Double_t scmaxHist[scsize] = { 499.5, 3.5, 200.0, 100.0, 100.0, 1.5, 100.0, 100.0, 1.5, 10.5, 200.0};
417 fSparseClusters = new Double_t[scsize];
418 fSparseHistClusters = new THnSparseF(histname.Data(), "pid:charge:mass:et:pt:rap:et_track:pt_track:eta_track:cent:dist_matched", scsize, scbinsHist, scminHist, scmaxHist);
f9a4ed81 419
01b73fb0 420 fSparseHistClusters->GetAxis(0)->SetTitle("pid");
421 fSparseHistClusters->GetAxis(1)->SetTitle("charge");
422 fSparseHistClusters->GetAxis(2)->SetTitle("mass");
423 fSparseHistClusters->GetAxis(3)->SetTitle("et");
424 fSparseHistClusters->GetAxis(4)->SetTitle("pt");
425 fSparseHistClusters->GetAxis(5)->SetTitle("rap");
426 fSparseHistClusters->GetAxis(6)->SetTitle("et_track");
427 fSparseHistClusters->GetAxis(7)->SetTitle("pt_track");
428 fSparseHistClusters->GetAxis(8)->SetTitle("rap_track");
429 fSparseHistClusters->GetAxis(9)->SetTitle("cent");
430 fSparseHistClusters->GetAxis(10)->SetTitle("dist_matched");
431
432 histname = "fSparseHistEt" + fHistogramNameSuffix;
433 const Int_t etsize = 7;
434 Int_t etbinsHist[etsize] = { 10000, 10000, 10000, 3000, 500, 30000, 11};
435 Double_t etminHist[etsize] = { 0.0, 0.0, 0.0, -0.5, -0.5, -0.5, -0.5};
436 Double_t etmaxHist[etsize] = { 200.0, 200.0, 200.0, 2999.5, 499.5, 2999.5, 10.5};
437 fSparseEt = new Double_t[etsize];
438 fSparseHistEt = new THnSparseF(histname.Data(), "tot_et:neutral_et:charged_et:tot_mult:neutral_mult:charged_mult:cent", etsize, etbinsHist, etminHist, etmaxHist);
f9a4ed81 439
01b73fb0 440 fSparseHistEt->GetAxis(0)->SetTitle("tot_et");
441 fSparseHistEt->GetAxis(1)->SetTitle("neutral_et");
442 fSparseHistEt->GetAxis(2)->SetTitle("charged_et");
443 fSparseHistEt->GetAxis(3)->SetTitle("tot_mult");
444 fSparseHistEt->GetAxis(4)->SetTitle("netral_mult");
445 fSparseHistEt->GetAxis(5)->SetTitle("charged_mult");
446 fSparseHistEt->GetAxis(6)->SetTitle("cent");
447 }
0651f6b4 448}
2fbf38ac 449
0651f6b4 450TH2F* AliAnalysisEt::CreateEtaEHisto2D(TString name, TString title, TString ztitle)
451{ //creates a 2-d histogram in eta and E and adds it to the list of histograms to be saved
1423b942 452 TString histoname = name + fHistogramNameSuffix;
453
454 TH2F *histo = new TH2F(histoname.Data(),title.Data(),fgNumOfEBins, fgEAxis, fgnumOfEtaBins, fgEtaAxis);
455 histo->SetYTitle("#eta");
456 histo->SetXTitle("E (GeV)");
457 histo->SetZTitle(ztitle.Data());
458 histo->Sumw2();
459
460 return histo;
461}
462
463
464TH2F* AliAnalysisEt::CreateEtaPtHisto2D(TString name, TString title, TString ztitle)
465{ //creates a 2-d histogram in eta and phi and adds it to the list of histograms to be saved
466 TString histoname = name + fHistogramNameSuffix;
467
468 TH2F *histo = new TH2F(histoname.Data(),title.Data(),fgNumOfPtBins, fgPtAxis, fgnumOfEtaBins, fgEtaAxis);
469 histo->SetYTitle("#eta");
470 histo->SetXTitle("p_{T}");
471 histo->SetZTitle(ztitle.Data());
472 histo->Sumw2();
0651f6b4 473
1423b942 474 return histo;
475}
476
477TH2F* AliAnalysisEt::CreateEtaEtHisto2D(TString name, TString title, TString ztitle)
478{ //creates a 2-d histogram in eta and phi and adds it to the list of histograms to be saved
479 TString histoname = name + fHistogramNameSuffix;
0651f6b4 480
1423b942 481 TH2F *histo = new TH2F(histoname.Data(),title.Data(),fgNumOfEBins, fgEAxis, fgnumOfEtaBins, fgEtaAxis);
0651f6b4 482 histo->SetYTitle("#eta");
1423b942 483 histo->SetXTitle("E_{T}");
484 histo->SetZTitle(ztitle.Data());
485 histo->Sumw2();
486
487 return histo;
488}
489
490TH2F* AliAnalysisEt::CreateResEHisto2D(TString name, TString title, TString ztitle)
491{ //creates a 2-d histogram in eta and E and adds it to the list of histograms to be saved
492 TString histoname = name + fHistogramNameSuffix;
493
494 TH2F *histo = new TH2F(histoname.Data(),title.Data(),fgNumOfEBins, fgEAxis, fgNumOfRBins, fgRAxis);
495 histo->SetYTitle("R");
0651f6b4 496 histo->SetXTitle("E (GeV)");
1423b942 497 histo->SetZTitle(ztitle.Data());
498 histo->Sumw2();
499
500 return histo;
501}
502
503
504TH2F* AliAnalysisEt::CreateResPtHisto2D(TString name, TString title, TString ztitle)
505{ //creates a 2-d histogram in eta and phi and adds it to the list of histograms to be saved
506 TString histoname = name + fHistogramNameSuffix;
507
508 TH2F *histo = new TH2F(histoname.Data(),title.Data(),fgNumOfPtBins, fgPtAxis, fgNumOfRBins, fgRAxis);
509 histo->SetYTitle("R");
510 histo->SetXTitle("p_{T}");
511 histo->SetZTitle(ztitle.Data());
512 histo->Sumw2();
513
514 return histo;
515}
516
01b73fb0 517THnSparseF* AliAnalysisEt::CreateClusterHistoSparse(TString name, TString title)
1423b942 518{ //creates a 2D sparse histogram
519 TString histoname = name + fHistogramNameSuffix;
520
521 Int_t nBins[4] = {200,200,240,20};
522 Double_t min[4] = {0.,-1.,70.,0.5};
523 Double_t max[4] = {50.,1.,190,20.5};
524
01b73fb0 525 THnSparseF *histo = new THnSparseF(histoname.Data(),title.Data(),4,nBins,min, max);
1423b942 526 histo->GetAxis(0)->SetTitle("E");
527 histo->GetAxis(1)->SetTitle("#eta_{cluster}");
528 histo->GetAxis(2)->SetTitle("#phi_{cluster}");
529 histo->GetAxis(3)->SetTitle("n_{cells}");
530 histo->Sumw2();
531
532 return histo;
533}
534
01b73fb0 535THnSparseF* AliAnalysisEt::CreateNeutralPartHistoSparse(TString name, TString title)
1423b942 536{ //creates a sparse neutral particle histogram
537 TString histoname = name + fHistogramNameSuffix;
538
539 Int_t nBins[6] = {20,200,200,200,240,20};
540 Double_t min[6] = {-1.,0.,0.,-1.,70.,0.5};
541 Double_t max[6] = {1.,50.,50.,1.,190,20.5};
542
01b73fb0 543 THnSparseF *histo = new THnSparseF(histoname.Data(),title.Data(),6,nBins,min, max);
1423b942 544 histo->GetAxis(0)->SetTitle("#eta");
545 histo->GetAxis(1)->SetTitle("p_{T}");
546 histo->GetAxis(2)->SetTitle("E");
547 histo->GetAxis(3)->SetTitle("#eta_{cluster}");
548 histo->GetAxis(4)->SetTitle("#phi_{cluster}");
549 histo->GetAxis(5)->SetTitle("n_{cells}");
550 histo->Sumw2();
551
552 return histo;
553}
554
01b73fb0 555THnSparseF* AliAnalysisEt::CreateChargedPartHistoSparse(TString name, TString title)
1423b942 556{ //creates a sparse charged particle histogram
557 TString histoname = name + fHistogramNameSuffix;
558
559 Int_t nBins[7] = {20,200,200,200,240,20,100};
560 Double_t min[7] = {-1.,0.,0.,-1.,70.,0.5,0.};
561 Double_t max[7] = {1.,50.,50.,1.,190,20.5,0.1};
562
01b73fb0 563 THnSparseF *histo = new THnSparseF(histoname.Data(),title.Data(),7,nBins,min, max);
1423b942 564 histo->GetAxis(0)->SetTitle("#eta");
565 histo->GetAxis(1)->SetTitle("p_{T}");
566 histo->GetAxis(2)->SetTitle("E");
567 histo->GetAxis(3)->SetTitle("#eta_{cluster}");
568 histo->GetAxis(4)->SetTitle("#phi_{cluster}");
569 histo->GetAxis(5)->SetTitle("n_{cells}");
570 histo->GetAxis(6)->SetTitle("R_{match}");
0651f6b4 571 histo->Sumw2();
0651f6b4 572
573 return histo;
2fbf38ac 574}
575
0651f6b4 576
8ea99ab0 577void AliAnalysisEt::CreateTrees()
ce546038 578{ // create tree..
579 TString treename = "fTree" + fHistogramNameSuffix;
8ea99ab0 580 if(fCuts->GetHistMakeTree())
581 {
582
583 fTree = new TTree(treename, treename);
584 fTree->Branch("fTotEt",&fTotEt,"fTotEt/D");
585 fTree->Branch("fTotEtAcc",&fTotEtAcc,"fTotEtAcc/D");
586 fTree->Branch("fTotNeutralEt",&fTotNeutralEt,"fTotNeutralEt/D");
587 fTree->Branch("fTotNeutralEtAcc",&fTotNeutralEtAcc,"fTotNeutralEtAcc/D");
588 fTree->Branch("fTotChargedEt",&fTotChargedEt,"fTotChargedEt/D");
589 fTree->Branch("fTotChargedEtAcc",&fTotChargedEtAcc,"fTotChargedEtAcc/D");
590 fTree->Branch("fMultiplicity",&fMultiplicity,"fMultiplicity/I");
591 fTree->Branch("fChargedMultiplicity",&fChargedMultiplicity,"fChargedMultiplicity/I");
592 fTree->Branch("fNeutralMultiplicity",&fNeutralMultiplicity,"fNeutralMultiplicity/I");
f9a4ed81 593 fTree->Branch("fCentClass",&fCentClass,"fCentClass/I");
594
8ea99ab0 595 fTree->Branch("fBaryonEt",&fBaryonEt,"fBaryonEt/D");
596 fTree->Branch("fAntiBaryonEt",&fAntiBaryonEt,"fAntiBaryonEt/D");
597 fTree->Branch("fMesonEt",&fMesonEt,"fMesonEt/D");
8ea99ab0 598 fTree->Branch("fProtonEt",&fProtonEt,"fProtonEt/D");
599 fTree->Branch("fChargedKaonEt",&fChargedKaonEt,"fChargedKaonEt/D");
600 fTree->Branch("fMuonEt",&fMuonEt,"fMuonEt/D");
601 fTree->Branch("fElectronEt",&fElectronEt,"fElectronEt/D");
602 fTree->Branch("fProtonEtAcc",&fProtonEtAcc,"fProtonEtAcc/D");
603 fTree->Branch("fChargedKaonEtAcc",&fChargedKaonEtAcc,"fChargedKaonEtAcc/D");
604 fTree->Branch("fMuonEtAcc",&fMuonEtAcc,"fMuonEtAcc/D");
605 fTree->Branch("fElectronEtAcc",&fElectronEtAcc,"fElectronEtAcc/D");
606 }
607
608 if(fCuts->GetHistMakeTreeDeposit())
609 {
610 treename = "fTreeDeposit" + fHistogramNameSuffix;
611 fTreeDeposit = new TTree(treename, treename);
612
613 fTreeDeposit->Branch("fEnergyDeposited", &fEnergyDeposited, "fEnergyDeposited/F");
614 fTreeDeposit->Branch("fEnergyTPC", &fEnergyTPC, "fEnergyTPC/F");
615 fTreeDeposit->Branch("fCharge", &fCharge, "fCharge/S");
616 fTreeDeposit->Branch("fParticlePid", &fParticlePid, "fParticlePid/S");
617 fTreeDeposit->Branch("fPidProb", &fPidProb, "fPidProb/F");
618 fTreeDeposit->Branch("fTrackPassedCut", &fTrackPassedCut, "fTrackPassedCut/B");
619
620 }
7b873813 621
ce546038 622 return;
623}
2fbf38ac 624void AliAnalysisEt::FillHistograms()
cf6522d1 625{ // fill histograms..
2fbf38ac 626 fHistEt->Fill(fTotEt);
627 fHistChargedEt->Fill(fTotChargedEt);
628 fHistNeutralEt->Fill(fTotNeutralEt);
629
630 fHistEtAcc->Fill(fTotEtAcc);
631 fHistChargedEtAcc->Fill(fTotChargedEtAcc);
632 fHistNeutralEtAcc->Fill(fTotNeutralEtAcc);
633
634 fHistMult->Fill(fMultiplicity);
635 fHistChargedMult->Fill(fChargedMultiplicity);
636 fHistNeutralMult->Fill(fNeutralMultiplicity);
637
ce546038 638 fHistBaryonEt->Fill(fBaryonEt);
639 fHistAntiBaryonEt->Fill(fAntiBaryonEt);
640 fHistMesonEt->Fill(fMesonEt);
2fbf38ac 641
87efb15c 642 fHistProtonEt->Fill(fProtonEt);
43056f1b 643 fHistPionEt->Fill(fPionEt);
87efb15c 644 fHistChargedKaonEt->Fill(fChargedKaonEt);
645 fHistMuonEt->Fill(fMuonEt);
646 fHistElectronEt->Fill(fElectronEt);
43056f1b 647 fHistNeutronEt->Fill(fNeutronEt);
648 fHistAntiNeutronEt->Fill(fAntiNeutronEt);
649 fHistGammaEt->Fill(fGammaEt);
87efb15c 650
651 fHistProtonEtAcc->Fill(fProtonEtAcc);
43056f1b 652 fHistPionEtAcc->Fill(fPionEtAcc);
87efb15c 653 fHistChargedKaonEtAcc->Fill(fChargedKaonEtAcc);
654 fHistMuonEtAcc->Fill(fMuonEtAcc);
655 fHistElectronEtAcc->Fill(fElectronEtAcc);
ce546038 656
657 if (fCuts) {
658 if (fCuts->GetHistMakeTree()) {
659 fTree->Fill();
660 }
661 }
f9a4ed81 662
663 fSparseHistEt->Fill(fSparseEt);
2fbf38ac 664}
0065531a 665
641e1e0c 666Int_t AliAnalysisEt::AnalyseEvent(AliVEvent *event)
0065531a 667{ //this line is basically here to eliminate a compiler warning that event is not used. Making it a virtual function did not work with the plugin.
7d2d1773 668 AliAnalysisEtCommon::AnalyseEvent(event);
0065531a 669 ResetEventValues();
641e1e0c 670 return 0;
671}
2fbf38ac 672
673void AliAnalysisEt::ResetEventValues()
cf6522d1 674{ // clear
7d2d1773 675 AliAnalysisEtCommon::ResetEventValues();
0065531a 676 fTotEt = 0;
677 fTotEtAcc = 0;
678 fTotNeutralEt = 0;
679 fTotNeutralEtAcc = 0;
680 fTotChargedEt = 0;
681 fTotChargedEtAcc = 0;
682 fMultiplicity = 0;
683 fChargedMultiplicity = 0;
684 fNeutralMultiplicity = 0;
87efb15c 685 fBaryonEt = 0;
686 fAntiBaryonEt = 0;
687 fMesonEt = 0;
87efb15c 688 fProtonEt = 0;
7b873813 689 fPionEt = 0;
87efb15c 690 fChargedKaonEt = 0;
691 fMuonEt = 0;
692 fElectronEt = 0;
7b873813 693 fNeutronEt = 0;
694 fAntiNeutronEt = 0;
695 fGammaEt = 0;
87efb15c 696 fProtonEtAcc = 0;
7b873813 697 fPionEtAcc = 0;
87efb15c 698 fChargedKaonEtAcc = 0;
699 fMuonEtAcc = 0;
ce546038 700 fElectronEtAcc = 0;
0065531a 701 return;
2fbf38ac 702}
99a6613d 703
f9a4ed81 704Double_t AliAnalysisEt::CalculateTransverseEnergy(AliESDCaloCluster* cluster)
537e541d 705{ // based on cluster energy and cluster pos
f9a4ed81 706
707 Float_t pos[3];
708 cluster->GetPosition(pos);
709 TVector3 cp(pos);
710
711 return cluster->E() * TMath::Sin(cp.Theta());
712
713}