1 //_________________________________________________________________________
2 // Utility Class for transverse energy studies
3 // Base class for ESD & MC analysis
4 // - reconstruction and MonteCarlo output
7 //*-- Authors: Oystein Djuvsland (Bergen), David Silvermyr (ORNL)
8 //_________________________________________________________________________
10 #include "AliAnalysisEt.h"
17 #include "AliAnalysisEtCuts.h"
18 #include "AliESDtrackCuts.h"
19 #include "AliESDCaloCluster.h"
20 #include "AliVEvent.h"
23 #include "AliCentrality.h"
24 //#include "THnSparse.h"
27 ClassImp(AliAnalysisEt);
29 /* Auxiliary Histogram variables */
30 Int_t AliAnalysisEt::fgnumOfEtaBins = 16;
31 Float_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};
33 Int_t AliAnalysisEt::fgNumOfPtBins = 111;
34 Float_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};
44 Int_t AliAnalysisEt::fgNumOfEBins = 78;
45 Float_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.};
50 Int_t AliAnalysisEt::fgNumOfRBins = 47;
51 Float_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};
55 AliAnalysisEt::AliAnalysisEt() : AliAnalysisEtCommon()
63 ,fChargedMultiplicity(0)
64 ,fNeutralMultiplicity(0)
86 ,fTrackPassedCut(kFALSE)
94 ,fSingleCellEnergyCut(0)
102 ,fHistChargedEtAcc(0)
103 ,fHistNeutralEtAcc(0)
110 ,fHistAntiBaryonEt(0)
114 ,fHistChargedKaonEt(0)
118 ,fHistAntiNeutronEt(0)
122 ,fHistChargedKaonEtAcc(0)
124 ,fHistElectronEtAcc(0)
131 ,fSparseHistTracks(0)
132 ,fSparseHistClusters(0)
140 AliAnalysisEt::~AliAnalysisEt()
143 fTreeDeposit->Clear();
144 delete fTreeDeposit; // optional TTree
148 delete fTree; // optional TTree
150 delete fHistEt; //Et spectrum
151 delete fHistChargedEt; //Charged Et spectrum
152 delete fHistNeutralEt; //Neutral Et spectrum
153 delete fHistEtAcc; //Et in acceptance
154 delete fHistChargedEtAcc; //Charged Et in acceptance
155 delete fHistNeutralEtAcc; //Et in acceptance
156 delete fHistMult; //Multiplicity
157 delete fHistChargedMult; //Charged multiplicity
158 delete fHistNeutralMult; //Neutral multiplicity
159 delete fHistPhivsPtPos; //phi vs pT plot for positive tracks
160 delete fHistPhivsPtNeg; //phi vs pT plot for negative tracks
161 delete fHistBaryonEt; /** Et of identified baryons */
162 delete fHistAntiBaryonEt; /** Et of identified anti-baryons */
163 delete fHistMesonEt; /** Et of identified mesons */
164 delete fHistProtonEt; /** Et of identified protons */
165 delete fHistPionEt; /** Et of identified protons */
166 delete fHistChargedKaonEt; /** Et of identified charged kaons */
167 delete fHistMuonEt; /** Et of identified muons */
168 delete fHistElectronEt; /** Et of identified electrons */
169 delete fHistNeutronEt; /** Et of neutrons (MC only for now) */
170 delete fHistAntiNeutronEt; /** Et of anti-neutrons (MC only for now) */
171 delete fHistGammaEt; /** Et of gammas (MC only for now) */
172 delete fHistProtonEtAcc; /** Et of identified protons in calorimeter acceptance */
173 delete fHistPionEtAcc; /** Et of identified protons in calorimeter acceptance */
174 delete fHistChargedKaonEtAcc; /** Et of identified charged kaons in calorimeter acceptance */
175 delete fHistMuonEtAcc; /** Et of identified muons in calorimeter acceptance */
176 delete fHistElectronEtAcc; /** Et of identified electrons in calorimeter acceptance */
177 delete fHistTMDeltaR; /* Track matching plots; Rec only for now */
178 delete fHistTMDxDz; /* Track matching plots; Rec only for now */
179 //arrays for axes were not dynamically created so don't need to be deleted
182 //delete fCentrality;//this code does not actually own AliCentrality so we don't have to worry about deleting it... we just borrow it...
183 delete fSparseHistTracks;
184 delete fSparseHistClusters;
185 delete fSparseHistEt;
186 delete [] fSparseTracks;
187 delete [] fSparseClusters;
191 void AliAnalysisEt::FillOutputList(TList *list)
192 { // histograms to be added to output
194 list->Add(fHistChargedEt);
195 list->Add(fHistNeutralEt);
197 list->Add(fHistEtAcc);
198 list->Add(fHistChargedEtAcc);
199 list->Add(fHistNeutralEtAcc);
201 list->Add(fHistMult);
202 list->Add(fHistChargedMult);
203 list->Add(fHistNeutralMult);
205 list->Add(fHistPhivsPtPos);
206 list->Add(fHistPhivsPtNeg);
208 list->Add(fHistBaryonEt);
209 list->Add(fHistAntiBaryonEt);
210 list->Add(fHistMesonEt);
212 list->Add(fHistProtonEt);
213 list->Add(fHistPionEt);
214 list->Add(fHistChargedKaonEt);
215 list->Add(fHistMuonEt);
216 list->Add(fHistElectronEt);
218 list->Add(fHistNeutronEt);
219 list->Add(fHistAntiNeutronEt);
220 list->Add(fHistGammaEt);
222 list->Add(fHistProtonEtAcc);
223 list->Add(fHistPionEtAcc);
224 list->Add(fHistChargedKaonEtAcc);
225 list->Add(fHistMuonEtAcc);
226 list->Add(fHistElectronEtAcc);
228 list->Add(fHistTMDeltaR);
229 list->Add(fHistTMDxDz);
232 if (fCuts->GetHistMakeTree()) {
235 if (fCuts->GetHistMakeTreeDeposit()) {
236 list->Add(fTreeDeposit);
240 list->Add(fSparseHistTracks);
241 list->Add(fSparseHistClusters);
242 list->Add(fSparseHistEt);
247 void AliAnalysisEt::Init()
248 {// clear variables, set up cuts and PDG info
249 AliAnalysisEtCommon::Init();
253 void AliAnalysisEt::CreateHistograms()
254 { // create histograms..
255 // histogram binning for E_T, p_T and Multiplicity: defaults for p+p
256 Int_t nbinsEt = 10000;
257 Double_t minEt = 0.0;
258 Double_t maxEt = 1000;
262 Int_t nbinsMult = 200;
263 Double_t minMult = -0.5; // offset -0.5 to have integer bins centered around 0
264 Double_t maxMult = nbinsMult + minMult; // 1 bin per integer value
266 // see if we should change histogram limits etc, and possibly create a tree
268 if (fCuts->GetHistMakeTree()) {
272 nbinsMult = fCuts->GetHistNbinsMult();
273 minMult = fCuts->GetHistMinMult();
274 maxMult = fCuts->GetHistMaxMult();
276 nbinsEt = fCuts->GetHistNbinsTotEt();
277 minEt = fCuts->GetHistMinTotEt();
278 maxEt = fCuts->GetHistMaxTotEt();
280 nbinsPt = fCuts->GetHistNbinsParticlePt();
281 minPt = fCuts->GetHistMinParticlePt();
282 maxPt = fCuts->GetHistMaxParticlePt();
285 TString histname = "fHistEt" + fHistogramNameSuffix;
286 fHistEt = new TH1F(histname.Data(), "Total E_{T} Distribution", nbinsEt, minEt, maxEt);
287 fHistEt->GetXaxis()->SetTitle("E_{T} (GeV/c^{2})");
288 fHistEt->GetYaxis()->SetTitle("dN/dE_{T} (c^{2}/GeV)");
290 histname = "fHistChargedEt" + fHistogramNameSuffix;
291 fHistChargedEt = new TH1F(histname.Data(), "Total Charged E_{T} Distribution", nbinsEt, minEt, maxEt);
292 fHistChargedEt->GetXaxis()->SetTitle("E_{T} (GeV/c^{2})");
293 fHistChargedEt->GetYaxis()->SetTitle("dN/dE_{T} (c^{2}/GeV)");
295 histname = "fHistNeutralEt" + fHistogramNameSuffix;
296 fHistNeutralEt = new TH1F(histname.Data(), "Total Neutral E_{T} Distribution", nbinsEt, minEt, maxEt);
297 fHistNeutralEt->GetXaxis()->SetTitle("E_{T} (GeV/c^{2})");
298 fHistNeutralEt->GetYaxis()->SetTitle("dN/dE_{T} (c^{2}/GeV)");
300 histname = "fHistEtAcc" + fHistogramNameSuffix;
301 fHistEtAcc = new TH1F(histname.Data(), "Total E_{T} Distribution in Acceptance", nbinsEt, minEt, maxEt);
302 fHistEtAcc->GetXaxis()->SetTitle("E_{T} (GeV/c^{2})");
303 fHistEtAcc->GetYaxis()->SetTitle("dN/dE_{T} (c^{2}/GeV)");
305 histname = "fHistChargedEtAcc" + fHistogramNameSuffix;
306 fHistChargedEtAcc = new TH1F(histname.Data(), "Total Charged E_{T} Distribution in Acceptance", nbinsEt, minEt, maxEt);
307 fHistChargedEtAcc->GetXaxis()->SetTitle("E_{T} (GeV/c^{2})");
308 fHistChargedEtAcc->GetYaxis()->SetTitle("dN/dE_{T} (c^{2}/GeV)");
310 histname = "fHistNeutralEtAcc" + fHistogramNameSuffix;
311 fHistNeutralEtAcc = new TH1F(histname.Data(), "Total Neutral E_{T} Distribution in Acceptance", nbinsEt, minEt, maxEt);
312 fHistNeutralEtAcc->GetXaxis()->SetTitle("E_{T} (GeV/c^{2})");
313 fHistNeutralEtAcc->GetYaxis()->SetTitle("dN/dE_{T} (c^{2}/GeV)");
314 std::cout << histname << std::endl;
316 histname = "fHistMult" + fHistogramNameSuffix;
317 fHistMult = new TH1F(histname.Data(), "Total Multiplicity", nbinsMult, minMult, maxMult);
318 fHistMult->GetXaxis()->SetTitle("N");
319 fHistMult->GetYaxis()->SetTitle("Multiplicity");
321 histname = "fHistChargedMult" + fHistogramNameSuffix;
322 fHistChargedMult = new TH1F(histname.Data(), "Charged Multiplicity", nbinsMult, minMult, maxMult);
323 fHistChargedMult->GetXaxis()->SetTitle("N");
324 fHistChargedMult->GetYaxis()->SetTitle("Multiplicity");
326 histname = "fHistNeutralMult" + fHistogramNameSuffix;
327 fHistNeutralMult = new TH1F(histname.Data(), "Neutral Multiplicity", nbinsMult, minMult, maxMult);
328 fHistNeutralMult->GetXaxis()->SetTitle("N");
329 fHistNeutralMult->GetYaxis()->SetTitle("Multiplicity");
331 histname = "fHistPhivsPtPos" + fHistogramNameSuffix;
332 fHistPhivsPtPos = new TH2F(histname.Data(), "Phi vs pT of positively charged tracks hitting the calorimeter", 200, 0, 2*TMath::Pi(), nbinsPt, minPt, maxPt);
334 histname = "fHistPhivsPtNeg" + fHistogramNameSuffix;
335 fHistPhivsPtNeg = new TH2F(histname.Data(), "Phi vs pT of negatively charged tracks hitting the calorimeter", 200, 0, 2*TMath::Pi(), nbinsPt, minPt, maxPt);
337 histname = "fHistBaryonEt" + fHistogramNameSuffix;
338 fHistBaryonEt = new TH1F(histname.Data(), "E_{T} for baryons", nbinsEt, minEt, maxEt);
340 histname = "fHistAntiBaryonEt" + fHistogramNameSuffix;
341 fHistAntiBaryonEt = new TH1F(histname.Data(), "E_{T} for anti baryons", nbinsEt, minEt, maxEt);
343 histname = "fHistMesonEt" + fHistogramNameSuffix;
344 fHistMesonEt = new TH1F(histname.Data(), "E_{T} for mesons", nbinsEt, minEt, maxEt);
346 histname = "fHistProtonEt" + fHistogramNameSuffix;
347 fHistProtonEt = new TH1F(histname.Data(), "E_{T} for (anti-)protons", nbinsEt, minEt, maxEt);
349 histname = "fHistPionEt" + fHistogramNameSuffix;
350 fHistPionEt = new TH1F(histname.Data(), "E_{T} for #pi^+/#pi^-", nbinsEt, minEt, maxEt);
352 histname = "fHistKaonEt" + fHistogramNameSuffix;
353 fHistChargedKaonEt = new TH1F(histname.Data(), "E_{T} for charged kaons", nbinsEt, minEt, maxEt);
355 histname = "fHistMuonEt" + fHistogramNameSuffix;
356 fHistMuonEt = new TH1F(histname.Data(), "E_{T} for muons", nbinsEt, minEt, maxEt);
358 histname = "fHistElectronEt" + fHistogramNameSuffix;
359 fHistElectronEt = new TH1F(histname.Data(), "E_{T} for electrons/positrons", nbinsEt, minEt, maxEt);
361 histname = "fHistNeutronEt" + fHistogramNameSuffix;
362 fHistNeutronEt = new TH1F(histname.Data(), "E_{T} for neutrons", nbinsEt, minEt, maxEt);
364 histname = "fHistAntiNeutronEt" + fHistogramNameSuffix;
365 fHistAntiNeutronEt = new TH1F(histname.Data(), "E_{T} for anti-neutrons", nbinsEt, minEt, maxEt);
367 histname = "fHistGammaEt" + fHistogramNameSuffix;
368 fHistGammaEt = new TH1F(histname.Data(), "E_{T} for gammas", nbinsEt, minEt, maxEt);
370 histname = "fHistProtonEtAcc" + fHistogramNameSuffix;
371 fHistProtonEtAcc = new TH1F(histname.Data(), "E_{T} for (anti-)protons in calorimeter acceptance", nbinsEt, minEt, maxEt);
373 histname = "fHistPionEtAcc" + fHistogramNameSuffix;
374 fHistPionEtAcc = new TH1F(histname.Data(), "E_{T} for #pi^+/#pi^- in calorimeter acceptance", nbinsEt, minEt, maxEt);
376 histname = "fHistKaonEtAcc" + fHistogramNameSuffix;
377 fHistChargedKaonEtAcc = new TH1F(histname.Data(), "E_{T} for charged kaons in calorimeter acceptance", nbinsEt, minEt, maxEt);
379 histname = "fHistMuonEtAcc" + fHistogramNameSuffix;
380 fHistMuonEtAcc = new TH1F(histname.Data(), "E_{T} for muons in calorimeter acceptance", nbinsEt, minEt, maxEt);
382 histname = "fHistElectronEtAcc" + fHistogramNameSuffix;
383 fHistElectronEtAcc = new TH1F(histname.Data(), "E_{T} for electrons/positrons in calorimeter acceptance", nbinsEt, minEt, maxEt);
386 histname = "fHistTMDeltaR" + fHistogramNameSuffix;
387 fHistTMDeltaR = new TH1F(histname.Data(), "#Delta R for calorimeter clusters", 200, 0, 50);
389 histname = "fHistTMDxDz" + fHistogramNameSuffix;
390 fHistTMDxDz = new TH2F(histname.Data(), "#Delta x vs #Delta z for calorimeter clusters", 800, -200, 200, 800, -200, 200);
392 histname = "fSparseHistTracks" + fHistogramNameSuffix;
393 const Int_t stsize = 7;
394 Int_t binsHist[stsize] = { 1001, 7, 200000, 10000, 10000, 100, 11};
395 Double_t minHist[stsize] = {-500.5, -3.5, 0.0, 0.0, 0.0, -1.5, -0.5};
396 Double_t maxHist[stsize] = { 499.5, 3.5, 200.0, 100.0, 100.0, 1.5, 10.5};
397 fSparseTracks = new Double_t[stsize];
398 fSparseHistTracks = new THnSparseD(histname.Data(), "pid:charge:mass:et:pt:rap:cent", stsize, binsHist, minHist, maxHist);
400 fSparseHistTracks->GetAxis(0)->SetTitle("pid");
401 fSparseHistTracks->GetAxis(1)->SetTitle("charge");
402 fSparseHistTracks->GetAxis(2)->SetTitle("mass");
403 fSparseHistTracks->GetAxis(3)->SetTitle("et");
404 fSparseHistTracks->GetAxis(4)->SetTitle("pt");
405 fSparseHistTracks->GetAxis(5)->SetTitle("rap");
406 fSparseHistTracks->GetAxis(6)->SetTitle("cent");
408 histname = "fSparseHistClusters" + fHistogramNameSuffix;
409 const Int_t scsize = 11;
410 // pid ch mass et pt eta et_t pt_t eta_t cent dist
411 Int_t scbinsHist[scsize] = { 1001, 7, 200000, 10000, 10000, 100, 10000, 10000, 100, 11, 4000};
412 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};
413 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};
414 fSparseClusters = new Double_t[scsize];
415 fSparseHistClusters = new THnSparseD(histname.Data(), "pid:charge:mass:et:pt:rap:et_track:pt_track:eta_track:cent:dist_matched", scsize, scbinsHist, scminHist, scmaxHist);
417 fSparseHistClusters->GetAxis(0)->SetTitle("pid");
418 fSparseHistClusters->GetAxis(1)->SetTitle("charge");
419 fSparseHistClusters->GetAxis(2)->SetTitle("mass");
420 fSparseHistClusters->GetAxis(3)->SetTitle("et");
421 fSparseHistClusters->GetAxis(4)->SetTitle("pt");
422 fSparseHistClusters->GetAxis(5)->SetTitle("rap");
423 fSparseHistClusters->GetAxis(6)->SetTitle("et_track");
424 fSparseHistClusters->GetAxis(7)->SetTitle("pt_track");
425 fSparseHistClusters->GetAxis(8)->SetTitle("rap_track");
426 fSparseHistClusters->GetAxis(9)->SetTitle("cent");
427 fSparseHistClusters->GetAxis(10)->SetTitle("dist_matched");
429 histname = "fSparseHistEt" + fHistogramNameSuffix;
430 const Int_t etsize = 7;
431 Int_t etbinsHist[etsize] = { 10000, 10000, 10000, 3000, 500, 30000, 11};
432 Double_t etminHist[etsize] = { 0.0, 0.0, 0.0, -0.5, -0.5, -0.5, -0.5};
433 Double_t etmaxHist[etsize] = { 200.0, 200.0, 200.0, 2999.5, 499.5, 2999.5, 10.5};
434 fSparseEt = new Double_t[etsize];
435 fSparseHistEt = new THnSparseD(histname.Data(), "tot_et:neutral_et:charged_et:tot_mult:neutral_mult:charged_mult:cent", etsize, etbinsHist, etminHist, etmaxHist);
437 fSparseHistEt->GetAxis(0)->SetTitle("tot_et");
438 fSparseHistEt->GetAxis(1)->SetTitle("neutral_et");
439 fSparseHistEt->GetAxis(2)->SetTitle("charged_et");
440 fSparseHistEt->GetAxis(3)->SetTitle("tot_mult");
441 fSparseHistEt->GetAxis(4)->SetTitle("netral_mult");
442 fSparseHistEt->GetAxis(5)->SetTitle("charged_mult");
443 fSparseHistEt->GetAxis(6)->SetTitle("cent");
447 TH2F* AliAnalysisEt::CreateEtaEHisto2D(TString name, TString title, TString ztitle)
448 { //creates a 2-d histogram in eta and E and adds it to the list of histograms to be saved
449 TString histoname = name + fHistogramNameSuffix;
451 TH2F *histo = new TH2F(histoname.Data(),title.Data(),fgNumOfEBins, fgEAxis, fgnumOfEtaBins, fgEtaAxis);
452 histo->SetYTitle("#eta");
453 histo->SetXTitle("E (GeV)");
454 histo->SetZTitle(ztitle.Data());
461 TH2F* AliAnalysisEt::CreateEtaPtHisto2D(TString name, TString title, TString ztitle)
462 { //creates a 2-d histogram in eta and phi and adds it to the list of histograms to be saved
463 TString histoname = name + fHistogramNameSuffix;
465 TH2F *histo = new TH2F(histoname.Data(),title.Data(),fgNumOfPtBins, fgPtAxis, fgnumOfEtaBins, fgEtaAxis);
466 histo->SetYTitle("#eta");
467 histo->SetXTitle("p_{T}");
468 histo->SetZTitle(ztitle.Data());
474 TH2F* AliAnalysisEt::CreateEtaEtHisto2D(TString name, TString title, TString ztitle)
475 { //creates a 2-d histogram in eta and phi and adds it to the list of histograms to be saved
476 TString histoname = name + fHistogramNameSuffix;
478 TH2F *histo = new TH2F(histoname.Data(),title.Data(),fgNumOfEBins, fgEAxis, fgnumOfEtaBins, fgEtaAxis);
479 histo->SetYTitle("#eta");
480 histo->SetXTitle("E_{T}");
481 histo->SetZTitle(ztitle.Data());
487 TH2F* AliAnalysisEt::CreateResEHisto2D(TString name, TString title, TString ztitle)
488 { //creates a 2-d histogram in eta and E and adds it to the list of histograms to be saved
489 TString histoname = name + fHistogramNameSuffix;
491 TH2F *histo = new TH2F(histoname.Data(),title.Data(),fgNumOfEBins, fgEAxis, fgNumOfRBins, fgRAxis);
492 histo->SetYTitle("R");
493 histo->SetXTitle("E (GeV)");
494 histo->SetZTitle(ztitle.Data());
501 TH2F* AliAnalysisEt::CreateResPtHisto2D(TString name, TString title, TString ztitle)
502 { //creates a 2-d histogram in eta and phi and adds it to the list of histograms to be saved
503 TString histoname = name + fHistogramNameSuffix;
505 TH2F *histo = new TH2F(histoname.Data(),title.Data(),fgNumOfPtBins, fgPtAxis, fgNumOfRBins, fgRAxis);
506 histo->SetYTitle("R");
507 histo->SetXTitle("p_{T}");
508 histo->SetZTitle(ztitle.Data());
514 THnSparseD* AliAnalysisEt::CreateClusterHistoSparse(TString name, TString title)
515 { //creates a 2D sparse histogram
516 TString histoname = name + fHistogramNameSuffix;
518 Int_t nBins[4] = {200,200,240,20};
519 Double_t min[4] = {0.,-1.,70.,0.5};
520 Double_t max[4] = {50.,1.,190,20.5};
522 THnSparseD *histo = new THnSparseD(histoname.Data(),title.Data(),4,nBins,min, max);
523 histo->GetAxis(0)->SetTitle("E");
524 histo->GetAxis(1)->SetTitle("#eta_{cluster}");
525 histo->GetAxis(2)->SetTitle("#phi_{cluster}");
526 histo->GetAxis(3)->SetTitle("n_{cells}");
532 THnSparseD* AliAnalysisEt::CreateNeutralPartHistoSparse(TString name, TString title)
533 { //creates a sparse neutral particle histogram
534 TString histoname = name + fHistogramNameSuffix;
536 Int_t nBins[6] = {20,200,200,200,240,20};
537 Double_t min[6] = {-1.,0.,0.,-1.,70.,0.5};
538 Double_t max[6] = {1.,50.,50.,1.,190,20.5};
540 THnSparseD *histo = new THnSparseD(histoname.Data(),title.Data(),6,nBins,min, max);
541 histo->GetAxis(0)->SetTitle("#eta");
542 histo->GetAxis(1)->SetTitle("p_{T}");
543 histo->GetAxis(2)->SetTitle("E");
544 histo->GetAxis(3)->SetTitle("#eta_{cluster}");
545 histo->GetAxis(4)->SetTitle("#phi_{cluster}");
546 histo->GetAxis(5)->SetTitle("n_{cells}");
552 THnSparseD* AliAnalysisEt::CreateChargedPartHistoSparse(TString name, TString title)
553 { //creates a sparse charged particle histogram
554 TString histoname = name + fHistogramNameSuffix;
556 Int_t nBins[7] = {20,200,200,200,240,20,100};
557 Double_t min[7] = {-1.,0.,0.,-1.,70.,0.5,0.};
558 Double_t max[7] = {1.,50.,50.,1.,190,20.5,0.1};
560 THnSparseD *histo = new THnSparseD(histoname.Data(),title.Data(),7,nBins,min, max);
561 histo->GetAxis(0)->SetTitle("#eta");
562 histo->GetAxis(1)->SetTitle("p_{T}");
563 histo->GetAxis(2)->SetTitle("E");
564 histo->GetAxis(3)->SetTitle("#eta_{cluster}");
565 histo->GetAxis(4)->SetTitle("#phi_{cluster}");
566 histo->GetAxis(5)->SetTitle("n_{cells}");
567 histo->GetAxis(6)->SetTitle("R_{match}");
574 void AliAnalysisEt::CreateTrees()
576 TString treename = "fTree" + fHistogramNameSuffix;
577 if(fCuts->GetHistMakeTree())
580 fTree = new TTree(treename, treename);
581 fTree->Branch("fTotEt",&fTotEt,"fTotEt/D");
582 fTree->Branch("fTotEtAcc",&fTotEtAcc,"fTotEtAcc/D");
583 fTree->Branch("fTotNeutralEt",&fTotNeutralEt,"fTotNeutralEt/D");
584 fTree->Branch("fTotNeutralEtAcc",&fTotNeutralEtAcc,"fTotNeutralEtAcc/D");
585 fTree->Branch("fTotChargedEt",&fTotChargedEt,"fTotChargedEt/D");
586 fTree->Branch("fTotChargedEtAcc",&fTotChargedEtAcc,"fTotChargedEtAcc/D");
587 fTree->Branch("fMultiplicity",&fMultiplicity,"fMultiplicity/I");
588 fTree->Branch("fChargedMultiplicity",&fChargedMultiplicity,"fChargedMultiplicity/I");
589 fTree->Branch("fNeutralMultiplicity",&fNeutralMultiplicity,"fNeutralMultiplicity/I");
590 fTree->Branch("fCentClass",&fCentClass,"fCentClass/I");
592 fTree->Branch("fBaryonEt",&fBaryonEt,"fBaryonEt/D");
593 fTree->Branch("fAntiBaryonEt",&fAntiBaryonEt,"fAntiBaryonEt/D");
594 fTree->Branch("fMesonEt",&fMesonEt,"fMesonEt/D");
595 fTree->Branch("fProtonEt",&fProtonEt,"fProtonEt/D");
596 fTree->Branch("fChargedKaonEt",&fChargedKaonEt,"fChargedKaonEt/D");
597 fTree->Branch("fMuonEt",&fMuonEt,"fMuonEt/D");
598 fTree->Branch("fElectronEt",&fElectronEt,"fElectronEt/D");
599 fTree->Branch("fProtonEtAcc",&fProtonEtAcc,"fProtonEtAcc/D");
600 fTree->Branch("fChargedKaonEtAcc",&fChargedKaonEtAcc,"fChargedKaonEtAcc/D");
601 fTree->Branch("fMuonEtAcc",&fMuonEtAcc,"fMuonEtAcc/D");
602 fTree->Branch("fElectronEtAcc",&fElectronEtAcc,"fElectronEtAcc/D");
605 if(fCuts->GetHistMakeTreeDeposit())
607 treename = "fTreeDeposit" + fHistogramNameSuffix;
608 fTreeDeposit = new TTree(treename, treename);
610 fTreeDeposit->Branch("fEnergyDeposited", &fEnergyDeposited, "fEnergyDeposited/F");
611 fTreeDeposit->Branch("fEnergyTPC", &fEnergyTPC, "fEnergyTPC/F");
612 fTreeDeposit->Branch("fCharge", &fCharge, "fCharge/S");
613 fTreeDeposit->Branch("fParticlePid", &fParticlePid, "fParticlePid/S");
614 fTreeDeposit->Branch("fPidProb", &fPidProb, "fPidProb/F");
615 fTreeDeposit->Branch("fTrackPassedCut", &fTrackPassedCut, "fTrackPassedCut/B");
621 void AliAnalysisEt::FillHistograms()
622 { // fill histograms..
623 fHistEt->Fill(fTotEt);
624 fHistChargedEt->Fill(fTotChargedEt);
625 fHistNeutralEt->Fill(fTotNeutralEt);
627 fHistEtAcc->Fill(fTotEtAcc);
628 fHistChargedEtAcc->Fill(fTotChargedEtAcc);
629 fHistNeutralEtAcc->Fill(fTotNeutralEtAcc);
631 fHistMult->Fill(fMultiplicity);
632 fHistChargedMult->Fill(fChargedMultiplicity);
633 fHistNeutralMult->Fill(fNeutralMultiplicity);
635 fHistBaryonEt->Fill(fBaryonEt);
636 fHistAntiBaryonEt->Fill(fAntiBaryonEt);
637 fHistMesonEt->Fill(fMesonEt);
639 fHistProtonEt->Fill(fProtonEt);
640 fHistPionEt->Fill(fPionEt);
641 fHistChargedKaonEt->Fill(fChargedKaonEt);
642 fHistMuonEt->Fill(fMuonEt);
643 fHistElectronEt->Fill(fElectronEt);
644 fHistNeutronEt->Fill(fNeutronEt);
645 fHistAntiNeutronEt->Fill(fAntiNeutronEt);
646 fHistGammaEt->Fill(fGammaEt);
648 fHistProtonEtAcc->Fill(fProtonEtAcc);
649 fHistPionEtAcc->Fill(fPionEtAcc);
650 fHistChargedKaonEtAcc->Fill(fChargedKaonEtAcc);
651 fHistMuonEtAcc->Fill(fMuonEtAcc);
652 fHistElectronEtAcc->Fill(fElectronEtAcc);
655 if (fCuts->GetHistMakeTree()) {
660 fSparseHistEt->Fill(fSparseEt);
663 Int_t AliAnalysisEt::AnalyseEvent(AliVEvent *event)
664 { //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.
665 AliAnalysisEtCommon::AnalyseEvent(event);
670 void AliAnalysisEt::ResetEventValues()
672 AliAnalysisEtCommon::ResetEventValues();
676 fTotNeutralEtAcc = 0;
678 fTotChargedEtAcc = 0;
680 fChargedMultiplicity = 0;
681 fNeutralMultiplicity = 0;
695 fChargedKaonEtAcc = 0;
701 Double_t AliAnalysisEt::CalculateTransverseEnergy(AliESDCaloCluster* cluster)
702 { // based on cluster energy and cluster pos
705 cluster->GetPosition(pos);
708 return cluster->E() * TMath::Sin(cp.Theta());