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 "AliVEvent.h"
23 ClassImp(AliAnalysisEt);
26 AliAnalysisEt::AliAnalysisEt() : AliAnalysisEtCommon()
27 ,fHistogramNameSuffix("")
35 ,fChargedMultiplicity(0)
36 ,fNeutralMultiplicity(0)
58 ,fTrackPassedCut(kFALSE)
65 ,fSingleCellEnergyCut(0)
82 ,fHistChargedKaonEt(0)
86 ,fHistAntiNeutronEt(0)
90 ,fHistChargedKaonEtAcc(0)
92 ,fHistElectronEtAcc(0)
99 AliAnalysisEt::~AliAnalysisEt()
102 fTreeDeposit->Clear();
103 delete fTreeDeposit; // optional TTree
107 delete fTree; // optional TTree
109 delete fHistEt; //Et spectrum
110 delete fHistChargedEt; //Charged Et spectrum
111 delete fHistNeutralEt; //Neutral Et spectrum
112 delete fHistEtAcc; //Et in acceptance
113 delete fHistChargedEtAcc; //Charged Et in acceptance
114 delete fHistNeutralEtAcc; //Et in acceptance
115 delete fHistMult; //Multiplicity
116 delete fHistChargedMult; //Charged multiplicity
117 delete fHistNeutralMult; //Neutral multiplicity
118 delete fHistPhivsPtPos; //phi vs pT plot for positive tracks
119 delete fHistPhivsPtNeg; //phi vs pT plot for negative tracks
120 delete fHistBaryonEt; /** Et of identified baryons */
121 delete fHistAntiBaryonEt; /** Et of identified anti-baryons */
122 delete fHistMesonEt; /** Et of identified mesons */
123 delete fHistProtonEt; /** Et of identified protons */
124 delete fHistPionEt; /** Et of identified protons */
125 delete fHistChargedKaonEt; /** Et of identified charged kaons */
126 delete fHistMuonEt; /** Et of identified muons */
127 delete fHistElectronEt; /** Et of identified electrons */
128 delete fHistNeutronEt; /** Et of neutrons (MC only for now) */
129 delete fHistAntiNeutronEt; /** Et of anti-neutrons (MC only for now) */
130 delete fHistGammaEt; /** Et of gammas (MC only for now) */
131 delete fHistProtonEtAcc; /** Et of identified protons in calorimeter acceptance */
132 delete fHistPionEtAcc; /** Et of identified protons in calorimeter acceptance */
133 delete fHistChargedKaonEtAcc; /** Et of identified charged kaons in calorimeter acceptance */
134 delete fHistMuonEtAcc; /** Et of identified muons in calorimeter acceptance */
135 delete fHistElectronEtAcc; /** Et of identified electrons in calorimeter acceptance */
136 delete fHistTMDeltaR; /* Track matching plots; Rec only for now */
139 void AliAnalysisEt::FillOutputList(TList *list)
140 { // histograms to be added to output
142 list->Add(fHistChargedEt);
143 list->Add(fHistNeutralEt);
145 list->Add(fHistEtAcc);
146 list->Add(fHistChargedEtAcc);
147 list->Add(fHistNeutralEtAcc);
149 list->Add(fHistMult);
150 list->Add(fHistChargedMult);
151 list->Add(fHistNeutralMult);
153 list->Add(fHistPhivsPtPos);
154 list->Add(fHistPhivsPtNeg);
156 list->Add(fHistBaryonEt);
157 list->Add(fHistAntiBaryonEt);
158 list->Add(fHistMesonEt);
160 list->Add(fHistProtonEt);
161 list->Add(fHistPionEt);
162 list->Add(fHistChargedKaonEt);
163 list->Add(fHistMuonEt);
164 list->Add(fHistElectronEt);
166 list->Add(fHistNeutronEt);
167 list->Add(fHistAntiNeutronEt);
168 list->Add(fHistGammaEt);
170 list->Add(fHistProtonEtAcc);
171 list->Add(fHistPionEtAcc);
172 list->Add(fHistChargedKaonEtAcc);
173 list->Add(fHistMuonEtAcc);
174 list->Add(fHistElectronEtAcc);
176 list->Add(fHistTMDeltaR);
179 if (fCuts->GetHistMakeTree()) {
183 list->Add(fTreeDeposit);
187 void AliAnalysisEt::Init()
188 {// clear variables, set up cuts and PDG info
189 AliAnalysisEtCommon::Init();
193 void AliAnalysisEt::CreateHistograms()
194 { // create histograms..
195 // histogram binning for E_T, p_T and Multiplicity: defaults for p+p
196 Int_t nbinsEt = 1000;
197 Double_t minEt = 0.0001;
198 Double_t maxEt = 100;
202 Int_t nbinsMult = 200;
203 Double_t minMult = -0.5; // offset -0.5 to have integer bins centered around 0
204 Double_t maxMult = nbinsMult + minMult; // 1 bin per integer value
206 // see if we should change histogram limits etc, and possibly create a tree
208 //if (fCuts->GetHistMakeTree()) {
212 nbinsMult = fCuts->GetHistNbinsMult();
213 minMult = fCuts->GetHistMinMult();
214 maxMult = fCuts->GetHistMaxMult();
216 nbinsEt = fCuts->GetHistNbinsTotEt();
217 minEt = fCuts->GetHistMinTotEt();
218 maxEt = fCuts->GetHistMaxTotEt();
220 nbinsPt = fCuts->GetHistNbinsParticlePt();
221 minPt = fCuts->GetHistMinParticlePt();
222 maxPt = fCuts->GetHistMaxParticlePt();
225 TString histname = "fHistEt" + fHistogramNameSuffix;
226 fHistEt = new TH1F(histname.Data(), "Total E_{T} Distribution", nbinsEt, minEt, maxEt);
227 fHistEt->GetXaxis()->SetTitle("E_{T} (GeV/c^{2})");
228 fHistEt->GetYaxis()->SetTitle("dN/dE_{T} (c^{2}/GeV)");
230 histname = "fHistChargedEt" + fHistogramNameSuffix;
231 fHistChargedEt = new TH1F(histname.Data(), "Total Charged E_{T} Distribution", nbinsEt, minEt, maxEt);
232 fHistChargedEt->GetXaxis()->SetTitle("E_{T} (GeV/c^{2})");
233 fHistChargedEt->GetYaxis()->SetTitle("dN/dE_{T} (c^{2}/GeV)");
235 histname = "fHistNeutralEt" + fHistogramNameSuffix;
236 fHistNeutralEt = new TH1F(histname.Data(), "Total Neutral E_{T} Distribution", nbinsEt, minEt, maxEt);
237 fHistNeutralEt->GetXaxis()->SetTitle("E_{T} (GeV/c^{2})");
238 fHistNeutralEt->GetYaxis()->SetTitle("dN/dE_{T} (c^{2}/GeV)");
240 histname = "fHistEtAcc" + fHistogramNameSuffix;
241 fHistEtAcc = new TH1F(histname.Data(), "Total E_{T} Distribution in Acceptance", nbinsEt, minEt, maxEt);
242 fHistEtAcc->GetXaxis()->SetTitle("E_{T} (GeV/c^{2})");
243 fHistEtAcc->GetYaxis()->SetTitle("dN/dE_{T} (c^{2}/GeV)");
245 histname = "fHistChargedEtAcc" + fHistogramNameSuffix;
246 fHistChargedEtAcc = new TH1F(histname.Data(), "Total Charged E_{T} Distribution in Acceptance", nbinsEt, minEt, maxEt);
247 fHistChargedEtAcc->GetXaxis()->SetTitle("E_{T} (GeV/c^{2})");
248 fHistChargedEtAcc->GetYaxis()->SetTitle("dN/dE_{T} (c^{2}/GeV)");
250 histname = "fHistNeutralEtAcc" + fHistogramNameSuffix;
251 fHistNeutralEtAcc = new TH1F(histname.Data(), "Total Neutral E_{T} Distribution in Acceptance", nbinsEt, minEt, maxEt);
252 fHistNeutralEtAcc->GetXaxis()->SetTitle("E_{T} (GeV/c^{2})");
253 fHistNeutralEtAcc->GetYaxis()->SetTitle("dN/dE_{T} (c^{2}/GeV)");
254 std::cout << histname << std::endl;
255 histname = "fHistMult" + fHistogramNameSuffix;
256 fHistMult = new TH1F(histname.Data(), "Total Multiplicity", nbinsMult, minMult, maxMult);
257 fHistMult->GetXaxis()->SetTitle("N");
258 fHistMult->GetYaxis()->SetTitle("Multiplicity");
260 histname = "fHistChargedMult" + fHistogramNameSuffix;
261 fHistChargedMult = new TH1F(histname.Data(), "Charged Multiplicity", nbinsMult, minMult, maxMult);
262 fHistChargedMult->GetXaxis()->SetTitle("N");
263 fHistChargedMult->GetYaxis()->SetTitle("Multiplicity");
265 histname = "fHistNeutralMult" + fHistogramNameSuffix;
266 fHistNeutralMult = new TH1F(histname.Data(), "Neutral Multiplicity", nbinsMult, minMult, maxMult);
267 fHistNeutralMult->GetXaxis()->SetTitle("N");
268 fHistNeutralMult->GetYaxis()->SetTitle("Multiplicity");
270 histname = "fHistPhivsPtPos" + fHistogramNameSuffix;
271 fHistPhivsPtPos = new TH2F(histname.Data(), "Phi vs pT of positively charged tracks hitting the calorimeter", 200, 0, 2*TMath::Pi(), nbinsPt, minPt, maxPt);
273 histname = "fHistPhivsPtNeg" + fHistogramNameSuffix;
274 fHistPhivsPtNeg = new TH2F(histname.Data(), "Phi vs pT of negatively charged tracks hitting the calorimeter", 200, 0, 2*TMath::Pi(), nbinsPt, minPt, maxPt);
276 histname = "fHistBaryonEt" + fHistogramNameSuffix;
277 fHistBaryonEt = new TH1F(histname.Data(), "E_{T} for baryons", nbinsEt, minEt, maxEt);
279 histname = "fHistAntiBaryonEt" + fHistogramNameSuffix;
280 fHistAntiBaryonEt = new TH1F(histname.Data(), "E_{T} for anti baryons", nbinsEt, minEt, maxEt);
282 histname = "fHistMesonEt" + fHistogramNameSuffix;
283 fHistMesonEt = new TH1F(histname.Data(), "E_{T} for mesons", nbinsEt, minEt, maxEt);
285 histname = "fHistProtonEt" + fHistogramNameSuffix;
286 fHistProtonEt = new TH1F(histname.Data(), "E_{T} for (anti-)protons", nbinsEt, minEt, maxEt);
288 histname = "fHistPionEt" + fHistogramNameSuffix;
289 fHistPionEt = new TH1F(histname.Data(), "E_{T} for #pi^+/#pi^-", nbinsEt, minEt, maxEt);
291 histname = "fHistKaonEt" + fHistogramNameSuffix;
292 fHistChargedKaonEt = new TH1F(histname.Data(), "E_{T} for charged kaons", nbinsEt, minEt, maxEt);
294 histname = "fHistMuonEt" + fHistogramNameSuffix;
295 fHistMuonEt = new TH1F(histname.Data(), "E_{T} for muons", nbinsEt, minEt, maxEt);
297 histname = "fHistElectronEt" + fHistogramNameSuffix;
298 fHistElectronEt = new TH1F(histname.Data(), "E_{T} for electrons/positrons", nbinsEt, minEt, maxEt);
300 histname = "fHistNeutronEt" + fHistogramNameSuffix;
301 fHistNeutronEt = new TH1F(histname.Data(), "E_{T} for neutrons", nbinsEt, minEt, maxEt);
303 histname = "fHistAntiNeutronEt" + fHistogramNameSuffix;
304 fHistAntiNeutronEt = new TH1F(histname.Data(), "E_{T} for anti-neutrons", nbinsEt, minEt, maxEt);
306 histname = "fHistGammaEt" + fHistogramNameSuffix;
307 fHistGammaEt = new TH1F(histname.Data(), "E_{T} for gammas", nbinsEt, minEt, maxEt);
309 histname = "fHistProtonEtAcc" + fHistogramNameSuffix;
310 fHistProtonEtAcc = new TH1F(histname.Data(), "E_{T} for (anti-)protons in calorimeter acceptance", nbinsEt, minEt, maxEt);
312 histname = "fHistPionEtAcc" + fHistogramNameSuffix;
313 fHistPionEtAcc = new TH1F(histname.Data(), "E_{T} for #pi^+/#pi^- in calorimeter acceptance", nbinsEt, minEt, maxEt);
315 histname = "fHistKaonEtAcc" + fHistogramNameSuffix;
316 fHistChargedKaonEtAcc = new TH1F(histname.Data(), "E_{T} for charged kaons in calorimeter acceptance", nbinsEt, minEt, maxEt);
318 histname = "fHistMuonEtAcc" + fHistogramNameSuffix;
319 fHistMuonEtAcc = new TH1F(histname.Data(), "E_{T} for muons in calorimeter acceptance", nbinsEt, minEt, maxEt);
321 histname = "fHistElectronEtAcc" + fHistogramNameSuffix;
322 fHistElectronEtAcc = new TH1F(histname.Data(), "E_{T} for electrons/positrons in calorimeter acceptance", nbinsEt, minEt, maxEt);
325 histname = "fHistTMDeltaR" + fHistogramNameSuffix;
326 fHistTMDeltaR = new TH1F(histname.Data(), "#Delta R for calorimeter clusters", 200, 0, 50);
330 void AliAnalysisEt::CreateTrees()
332 TString treename = "fTree" + fHistogramNameSuffix;
333 if(fCuts->GetHistMakeTree())
336 fTree = new TTree(treename, treename);
337 fTree->Branch("fTotEt",&fTotEt,"fTotEt/D");
338 fTree->Branch("fTotEtAcc",&fTotEtAcc,"fTotEtAcc/D");
339 fTree->Branch("fTotNeutralEt",&fTotNeutralEt,"fTotNeutralEt/D");
340 fTree->Branch("fTotNeutralEtAcc",&fTotNeutralEtAcc,"fTotNeutralEtAcc/D");
341 fTree->Branch("fTotChargedEt",&fTotChargedEt,"fTotChargedEt/D");
342 fTree->Branch("fTotChargedEtAcc",&fTotChargedEtAcc,"fTotChargedEtAcc/D");
343 fTree->Branch("fMultiplicity",&fMultiplicity,"fMultiplicity/I");
344 fTree->Branch("fChargedMultiplicity",&fChargedMultiplicity,"fChargedMultiplicity/I");
345 fTree->Branch("fNeutralMultiplicity",&fNeutralMultiplicity,"fNeutralMultiplicity/I");
346 fTree->Branch("fBaryonEt",&fBaryonEt,"fBaryonEt/D");
347 fTree->Branch("fAntiBaryonEt",&fAntiBaryonEt,"fAntiBaryonEt/D");
348 fTree->Branch("fMesonEt",&fMesonEt,"fMesonEt/D");
349 fTree->Branch("fProtonEt",&fProtonEt,"fProtonEt/D");
350 fTree->Branch("fChargedKaonEt",&fChargedKaonEt,"fChargedKaonEt/D");
351 fTree->Branch("fMuonEt",&fMuonEt,"fMuonEt/D");
352 fTree->Branch("fElectronEt",&fElectronEt,"fElectronEt/D");
353 fTree->Branch("fProtonEtAcc",&fProtonEtAcc,"fProtonEtAcc/D");
354 fTree->Branch("fChargedKaonEtAcc",&fChargedKaonEtAcc,"fChargedKaonEtAcc/D");
355 fTree->Branch("fMuonEtAcc",&fMuonEtAcc,"fMuonEtAcc/D");
356 fTree->Branch("fElectronEtAcc",&fElectronEtAcc,"fElectronEtAcc/D");
359 if(fCuts->GetHistMakeTreeDeposit())
361 treename = "fTreeDeposit" + fHistogramNameSuffix;
362 fTreeDeposit = new TTree(treename, treename);
364 fTreeDeposit->Branch("fEnergyDeposited", &fEnergyDeposited, "fEnergyDeposited/F");
365 fTreeDeposit->Branch("fEnergyTPC", &fEnergyTPC, "fEnergyTPC/F");
366 fTreeDeposit->Branch("fCharge", &fCharge, "fCharge/S");
367 fTreeDeposit->Branch("fParticlePid", &fParticlePid, "fParticlePid/S");
368 fTreeDeposit->Branch("fPidProb", &fPidProb, "fPidProb/F");
369 fTreeDeposit->Branch("fTrackPassedCut", &fTrackPassedCut, "fTrackPassedCut/B");
375 void AliAnalysisEt::FillHistograms()
376 { // fill histograms..
377 fHistEt->Fill(fTotEt);
378 fHistChargedEt->Fill(fTotChargedEt);
379 fHistNeutralEt->Fill(fTotNeutralEt);
381 fHistEtAcc->Fill(fTotEtAcc);
382 fHistChargedEtAcc->Fill(fTotChargedEtAcc);
383 fHistNeutralEtAcc->Fill(fTotNeutralEtAcc);
385 fHistMult->Fill(fMultiplicity);
386 fHistChargedMult->Fill(fChargedMultiplicity);
387 fHistNeutralMult->Fill(fNeutralMultiplicity);
389 fHistBaryonEt->Fill(fBaryonEt);
390 fHistAntiBaryonEt->Fill(fAntiBaryonEt);
391 fHistMesonEt->Fill(fMesonEt);
393 fHistProtonEt->Fill(fProtonEt);
394 fHistPionEt->Fill(fPionEt);
395 fHistChargedKaonEt->Fill(fChargedKaonEt);
396 fHistMuonEt->Fill(fMuonEt);
397 fHistElectronEt->Fill(fElectronEt);
398 fHistNeutronEt->Fill(fNeutronEt);
399 fHistAntiNeutronEt->Fill(fAntiNeutronEt);
400 fHistGammaEt->Fill(fGammaEt);
402 fHistProtonEtAcc->Fill(fProtonEtAcc);
403 fHistPionEtAcc->Fill(fPionEtAcc);
404 fHistChargedKaonEtAcc->Fill(fChargedKaonEtAcc);
405 fHistMuonEtAcc->Fill(fMuonEtAcc);
406 fHistElectronEtAcc->Fill(fElectronEtAcc);
409 if (fCuts->GetHistMakeTree()) {
416 Int_t AliAnalysisEt::AnalyseEvent(AliVEvent *event)
417 { //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.
418 AliAnalysisEtCommon::AnalyseEvent(event);
423 void AliAnalysisEt::ResetEventValues()
425 AliAnalysisEtCommon::ResetEventValues();
429 fTotNeutralEtAcc = 0;
431 fTotChargedEtAcc = 0;
433 fChargedMultiplicity = 0;
434 fNeutralMultiplicity = 0;
448 fChargedKaonEtAcc = 0;