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)
132 ,fSparseHistTracks(0)
133 ,fSparseHistClusters(0)
141 AliAnalysisEt::~AliAnalysisEt()
144 fTreeDeposit->Clear();
145 delete fTreeDeposit; // optional TTree
149 delete fTree; // optional TTree
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 */
179 delete fHistTMDxDz; /* Track matching plots; Rec only for now */
180 //arrays for axes were not dynamically created so don't need to be deleted
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;
192 void AliAnalysisEt::FillOutputList(TList *list)
193 { // histograms to be added to output
195 list->Add(fHistChargedEt);
196 list->Add(fHistNeutralEt);
198 list->Add(fHistEtAcc);
199 list->Add(fHistChargedEtAcc);
200 list->Add(fHistNeutralEtAcc);
202 list->Add(fHistMult);
203 list->Add(fHistChargedMult);
204 list->Add(fHistNeutralMult);
206 list->Add(fHistPhivsPtPos);
207 list->Add(fHistPhivsPtNeg);
209 list->Add(fHistBaryonEt);
210 list->Add(fHistAntiBaryonEt);
211 list->Add(fHistMesonEt);
213 list->Add(fHistProtonEt);
214 list->Add(fHistPionEt);
215 list->Add(fHistChargedKaonEt);
216 list->Add(fHistMuonEt);
217 list->Add(fHistElectronEt);
219 list->Add(fHistNeutronEt);
220 list->Add(fHistAntiNeutronEt);
221 list->Add(fHistGammaEt);
223 list->Add(fHistProtonEtAcc);
224 list->Add(fHistPionEtAcc);
225 list->Add(fHistChargedKaonEtAcc);
226 list->Add(fHistMuonEtAcc);
227 list->Add(fHistElectronEtAcc);
229 list->Add(fHistTMDeltaR);
230 list->Add(fHistTMDxDz);
233 if (fCuts->GetHistMakeTree()) {
236 if (fCuts->GetHistMakeTreeDeposit()) {
237 list->Add(fTreeDeposit);
242 list->Add(fSparseHistTracks);
243 list->Add(fSparseHistClusters);
244 list->Add(fSparseHistEt);
249 void AliAnalysisEt::Init()
250 {// clear variables, set up cuts and PDG info
251 AliAnalysisEtCommon::Init();
255 void AliAnalysisEt::CreateHistograms()
256 { // create histograms..
257 // histogram binning for E_T, p_T and Multiplicity: defaults for p+p
258 Int_t nbinsEt = 10000;
259 Double_t minEt = 0.0;
260 Double_t maxEt = 1000;
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
268 // see if we should change histogram limits etc, and possibly create a tree
270 if (fCuts->GetHistMakeTree()) {
274 nbinsMult = fCuts->GetHistNbinsMult();
275 minMult = fCuts->GetHistMinMult();
276 maxMult = fCuts->GetHistMaxMult();
278 nbinsEt = fCuts->GetHistNbinsTotEt();
279 minEt = fCuts->GetHistMinTotEt();
280 maxEt = fCuts->GetHistMaxTotEt();
282 nbinsPt = fCuts->GetHistNbinsParticlePt();
283 minPt = fCuts->GetHistMinParticlePt();
284 maxPt = fCuts->GetHistMaxParticlePt();
287 TString histname = "fHistEt" + fHistogramNameSuffix;
288 fHistEt = new TH1F(histname.Data(), "Total E_{T} Distribution", nbinsEt, minEt, maxEt);
289 fHistEt->GetXaxis()->SetTitle("E_{T} (GeV/c^{2})");
290 fHistEt->GetYaxis()->SetTitle("dN/dE_{T} (c^{2}/GeV)");
292 histname = "fHistChargedEt" + fHistogramNameSuffix;
293 fHistChargedEt = new TH1F(histname.Data(), "Total Charged E_{T} Distribution", nbinsEt, minEt, maxEt);
294 fHistChargedEt->GetXaxis()->SetTitle("E_{T} (GeV/c^{2})");
295 fHistChargedEt->GetYaxis()->SetTitle("dN/dE_{T} (c^{2}/GeV)");
297 histname = "fHistNeutralEt" + fHistogramNameSuffix;
298 fHistNeutralEt = new TH1F(histname.Data(), "Total Neutral E_{T} Distribution", nbinsEt, minEt, maxEt);
299 fHistNeutralEt->GetXaxis()->SetTitle("E_{T} (GeV/c^{2})");
300 fHistNeutralEt->GetYaxis()->SetTitle("dN/dE_{T} (c^{2}/GeV)");
302 histname = "fHistEtAcc" + fHistogramNameSuffix;
303 fHistEtAcc = new TH1F(histname.Data(), "Total E_{T} Distribution in Acceptance", nbinsEt, minEt, maxEt);
304 fHistEtAcc->GetXaxis()->SetTitle("E_{T} (GeV/c^{2})");
305 fHistEtAcc->GetYaxis()->SetTitle("dN/dE_{T} (c^{2}/GeV)");
307 histname = "fHistChargedEtAcc" + fHistogramNameSuffix;
308 fHistChargedEtAcc = new TH1F(histname.Data(), "Total Charged E_{T} Distribution in Acceptance", nbinsEt, minEt, maxEt);
309 fHistChargedEtAcc->GetXaxis()->SetTitle("E_{T} (GeV/c^{2})");
310 fHistChargedEtAcc->GetYaxis()->SetTitle("dN/dE_{T} (c^{2}/GeV)");
312 histname = "fHistNeutralEtAcc" + fHistogramNameSuffix;
313 fHistNeutralEtAcc = new TH1F(histname.Data(), "Total Neutral E_{T} Distribution in Acceptance", nbinsEt, minEt, maxEt);
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;
318 histname = "fHistMult" + fHistogramNameSuffix;
319 fHistMult = new TH1F(histname.Data(), "Total Multiplicity", nbinsMult, minMult, maxMult);
320 fHistMult->GetXaxis()->SetTitle("N");
321 fHistMult->GetYaxis()->SetTitle("Multiplicity");
323 histname = "fHistChargedMult" + fHistogramNameSuffix;
324 fHistChargedMult = new TH1F(histname.Data(), "Charged Multiplicity", nbinsMult, minMult, maxMult);
325 fHistChargedMult->GetXaxis()->SetTitle("N");
326 fHistChargedMult->GetYaxis()->SetTitle("Multiplicity");
328 histname = "fHistNeutralMult" + fHistogramNameSuffix;
329 fHistNeutralMult = new TH1F(histname.Data(), "Neutral Multiplicity", nbinsMult, minMult, maxMult);
330 fHistNeutralMult->GetXaxis()->SetTitle("N");
331 fHistNeutralMult->GetYaxis()->SetTitle("Multiplicity");
333 histname = "fHistPhivsPtPos" + fHistogramNameSuffix;
334 fHistPhivsPtPos = new TH2F(histname.Data(), "Phi vs pT of positively charged tracks hitting the calorimeter", 200, 0, 2*TMath::Pi(), nbinsPt, minPt, maxPt);
336 histname = "fHistPhivsPtNeg" + fHistogramNameSuffix;
337 fHistPhivsPtNeg = new TH2F(histname.Data(), "Phi vs pT of negatively charged tracks hitting the calorimeter", 200, 0, 2*TMath::Pi(), nbinsPt, minPt, maxPt);
339 histname = "fHistBaryonEt" + fHistogramNameSuffix;
340 fHistBaryonEt = new TH1F(histname.Data(), "E_{T} for baryons", nbinsEt, minEt, maxEt);
342 histname = "fHistAntiBaryonEt" + fHistogramNameSuffix;
343 fHistAntiBaryonEt = new TH1F(histname.Data(), "E_{T} for anti baryons", nbinsEt, minEt, maxEt);
345 histname = "fHistMesonEt" + fHistogramNameSuffix;
346 fHistMesonEt = new TH1F(histname.Data(), "E_{T} for mesons", nbinsEt, minEt, maxEt);
348 histname = "fHistProtonEt" + fHistogramNameSuffix;
349 fHistProtonEt = new TH1F(histname.Data(), "E_{T} for (anti-)protons", nbinsEt, minEt, maxEt);
351 histname = "fHistPionEt" + fHistogramNameSuffix;
352 fHistPionEt = new TH1F(histname.Data(), "E_{T} for #pi^+/#pi^-", nbinsEt, minEt, maxEt);
354 histname = "fHistKaonEt" + fHistogramNameSuffix;
355 fHistChargedKaonEt = new TH1F(histname.Data(), "E_{T} for charged kaons", nbinsEt, minEt, maxEt);
357 histname = "fHistMuonEt" + fHistogramNameSuffix;
358 fHistMuonEt = new TH1F(histname.Data(), "E_{T} for muons", nbinsEt, minEt, maxEt);
360 histname = "fHistElectronEt" + fHistogramNameSuffix;
361 fHistElectronEt = new TH1F(histname.Data(), "E_{T} for electrons/positrons", nbinsEt, minEt, maxEt);
363 histname = "fHistNeutronEt" + fHistogramNameSuffix;
364 fHistNeutronEt = new TH1F(histname.Data(), "E_{T} for neutrons", nbinsEt, minEt, maxEt);
366 histname = "fHistAntiNeutronEt" + fHistogramNameSuffix;
367 fHistAntiNeutronEt = new TH1F(histname.Data(), "E_{T} for anti-neutrons", nbinsEt, minEt, maxEt);
369 histname = "fHistGammaEt" + fHistogramNameSuffix;
370 fHistGammaEt = new TH1F(histname.Data(), "E_{T} for gammas", nbinsEt, minEt, maxEt);
372 histname = "fHistProtonEtAcc" + fHistogramNameSuffix;
373 fHistProtonEtAcc = new TH1F(histname.Data(), "E_{T} for (anti-)protons in calorimeter acceptance", nbinsEt, minEt, maxEt);
375 histname = "fHistPionEtAcc" + fHistogramNameSuffix;
376 fHistPionEtAcc = new TH1F(histname.Data(), "E_{T} for #pi^+/#pi^- in calorimeter acceptance", nbinsEt, minEt, maxEt);
378 histname = "fHistKaonEtAcc" + fHistogramNameSuffix;
379 fHistChargedKaonEtAcc = new TH1F(histname.Data(), "E_{T} for charged kaons in calorimeter acceptance", nbinsEt, minEt, maxEt);
381 histname = "fHistMuonEtAcc" + fHistogramNameSuffix;
382 fHistMuonEtAcc = new TH1F(histname.Data(), "E_{T} for muons in calorimeter acceptance", nbinsEt, minEt, maxEt);
384 histname = "fHistElectronEtAcc" + fHistogramNameSuffix;
385 fHistElectronEtAcc = new TH1F(histname.Data(), "E_{T} for electrons/positrons in calorimeter acceptance", nbinsEt, minEt, maxEt);
388 histname = "fHistTMDeltaR" + fHistogramNameSuffix;
389 fHistTMDeltaR = new TH1F(histname.Data(), "#Delta R for calorimeter clusters", 200, 0, 50);
391 histname = "fHistTMDxDz" + fHistogramNameSuffix;
392 fHistTMDxDz = new TH2F(histname.Data(), "#Delta x vs #Delta z for calorimeter clusters", 800, -200, 200, 800, -200, 200);
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);
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");
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);
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");
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);
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");
450 TH2F* 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
452 TString histoname = name + fHistogramNameSuffix;
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());
464 TH2F* 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;
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());
477 TH2F* 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;
481 TH2F *histo = new TH2F(histoname.Data(),title.Data(),fgNumOfEBins, fgEAxis, fgnumOfEtaBins, fgEtaAxis);
482 histo->SetYTitle("#eta");
483 histo->SetXTitle("E_{T}");
484 histo->SetZTitle(ztitle.Data());
490 TH2F* 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;
494 TH2F *histo = new TH2F(histoname.Data(),title.Data(),fgNumOfEBins, fgEAxis, fgNumOfRBins, fgRAxis);
495 histo->SetYTitle("R");
496 histo->SetXTitle("E (GeV)");
497 histo->SetZTitle(ztitle.Data());
504 TH2F* 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;
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());
517 THnSparseF* AliAnalysisEt::CreateClusterHistoSparse(TString name, TString title)
518 { //creates a 2D sparse histogram
519 TString histoname = name + fHistogramNameSuffix;
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};
525 THnSparseF *histo = new THnSparseF(histoname.Data(),title.Data(),4,nBins,min, max);
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}");
535 THnSparseF* AliAnalysisEt::CreateNeutralPartHistoSparse(TString name, TString title)
536 { //creates a sparse neutral particle histogram
537 TString histoname = name + fHistogramNameSuffix;
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};
543 THnSparseF *histo = new THnSparseF(histoname.Data(),title.Data(),6,nBins,min, max);
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}");
555 THnSparseF* AliAnalysisEt::CreateChargedPartHistoSparse(TString name, TString title)
556 { //creates a sparse charged particle histogram
557 TString histoname = name + fHistogramNameSuffix;
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};
563 THnSparseF *histo = new THnSparseF(histoname.Data(),title.Data(),7,nBins,min, max);
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}");
577 void AliAnalysisEt::CreateTrees()
579 TString treename = "fTree" + fHistogramNameSuffix;
580 if(fCuts->GetHistMakeTree())
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");
593 fTree->Branch("fCentClass",&fCentClass,"fCentClass/I");
595 fTree->Branch("fBaryonEt",&fBaryonEt,"fBaryonEt/D");
596 fTree->Branch("fAntiBaryonEt",&fAntiBaryonEt,"fAntiBaryonEt/D");
597 fTree->Branch("fMesonEt",&fMesonEt,"fMesonEt/D");
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");
608 if(fCuts->GetHistMakeTreeDeposit())
610 treename = "fTreeDeposit" + fHistogramNameSuffix;
611 fTreeDeposit = new TTree(treename, treename);
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");
624 void AliAnalysisEt::FillHistograms()
625 { // fill histograms..
626 fHistEt->Fill(fTotEt);
627 fHistChargedEt->Fill(fTotChargedEt);
628 fHistNeutralEt->Fill(fTotNeutralEt);
630 fHistEtAcc->Fill(fTotEtAcc);
631 fHistChargedEtAcc->Fill(fTotChargedEtAcc);
632 fHistNeutralEtAcc->Fill(fTotNeutralEtAcc);
634 fHistMult->Fill(fMultiplicity);
635 fHistChargedMult->Fill(fChargedMultiplicity);
636 fHistNeutralMult->Fill(fNeutralMultiplicity);
638 fHistBaryonEt->Fill(fBaryonEt);
639 fHistAntiBaryonEt->Fill(fAntiBaryonEt);
640 fHistMesonEt->Fill(fMesonEt);
642 fHistProtonEt->Fill(fProtonEt);
643 fHistPionEt->Fill(fPionEt);
644 fHistChargedKaonEt->Fill(fChargedKaonEt);
645 fHistMuonEt->Fill(fMuonEt);
646 fHistElectronEt->Fill(fElectronEt);
647 fHistNeutronEt->Fill(fNeutronEt);
648 fHistAntiNeutronEt->Fill(fAntiNeutronEt);
649 fHistGammaEt->Fill(fGammaEt);
651 fHistProtonEtAcc->Fill(fProtonEtAcc);
652 fHistPionEtAcc->Fill(fPionEtAcc);
653 fHistChargedKaonEtAcc->Fill(fChargedKaonEtAcc);
654 fHistMuonEtAcc->Fill(fMuonEtAcc);
655 fHistElectronEtAcc->Fill(fElectronEtAcc);
658 if (fCuts->GetHistMakeTree()) {
663 fSparseHistEt->Fill(fSparseEt);
666 Int_t AliAnalysisEt::AnalyseEvent(AliVEvent *event)
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.
668 AliAnalysisEtCommon::AnalyseEvent(event);
673 void AliAnalysisEt::ResetEventValues()
675 AliAnalysisEtCommon::ResetEventValues();
679 fTotNeutralEtAcc = 0;
681 fTotChargedEtAcc = 0;
683 fChargedMultiplicity = 0;
684 fNeutralMultiplicity = 0;
698 fChargedKaonEtAcc = 0;
704 Double_t AliAnalysisEt::CalculateTransverseEnergy(AliESDCaloCluster* cluster)
705 { // based on cluster energy and cluster pos
708 cluster->GetPosition(pos);
711 return cluster->E() * TMath::Sin(cp.Theta());