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 "AliVEvent.h"
19 #include "TDatabasePDG.h"
23 ClassImp(AliAnalysisEt);
26 AliAnalysisEt::AliAnalysisEt() :
27 fHistogramNameSuffix("")
60 ,fChargedMultiplicity(0)
61 ,fNeutralMultiplicity(0)
82 ,fSingleCellEnergyCut(0)
98 ,fHistAntiBaryonEtAcc(0)
101 ,fHistChargedKaonEt(0)
105 ,fHistChargedKaonEtAcc(0)
107 ,fHistElectronEtAcc(0)
115 AliAnalysisEt::~AliAnalysisEt()
120 void AliAnalysisEt::FillOutputList(TList *list)
121 { // histograms to be added to output
123 list->Add(fHistChargedEt);
124 list->Add(fHistNeutralEt);
126 list->Add(fHistEtAcc);
127 list->Add(fHistChargedEtAcc);
128 list->Add(fHistNeutralEtAcc);
130 list->Add(fHistMult);
131 list->Add(fHistChargedMult);
132 list->Add(fHistNeutralMult);
134 list->Add(fHistPhivsPtPos);
135 list->Add(fHistPhivsPtNeg);
137 list->Add(fHistBaryonEt);
138 list->Add(fHistAntiBaryonEt);
139 list->Add(fHistMesonEt);
141 list->Add(fHistBaryonEtAcc);
142 list->Add(fHistAntiBaryonEtAcc);
143 list->Add(fHistMesonEtAcc);
145 list->Add(fHistProtonEtAcc);
146 list->Add(fHistChargedKaonEtAcc);
147 list->Add(fHistMuonEtAcc);
148 list->Add(fHistElectronEtAcc);
150 list->Add(fHistEtRecvsEtMC);
152 list->Add(fHistTMDeltaR);
155 if (fCuts->GetHistMakeTree()) {
162 void AliAnalysisEt::Init()
163 {// clear variables, set up cuts and PDG info
167 void AliAnalysisEt::CreateHistograms()
168 { // create histograms..
169 // histogram binning for E_T, p_T and Multiplicity: defaults for p+p
170 Int_t nbinsEt = 1000;
171 Double_t minEt = 0.0001;
172 Double_t maxEt = 100;
176 Int_t nbinsMult = 200;
177 Double_t minMult = -0.5; // offset -0.5 to have integer bins centered around 0
178 Double_t maxMult = nbinsMult + minMult; // 1 bin per integer value
180 // see if we should change histogram limits etc, and possibly create a tree
182 if (fCuts->GetHistMakeTree()) {
186 nbinsMult = fCuts->GetHistNbinsMult();
187 minMult = fCuts->GetHistMinMult();
188 maxMult = fCuts->GetHistMaxMult();
190 nbinsEt = fCuts->GetHistNbinsTotEt();
191 minEt = fCuts->GetHistMinTotEt();
192 maxEt = fCuts->GetHistMaxTotEt();
194 nbinsPt = fCuts->GetHistNbinsParticlePt();
195 minPt = fCuts->GetHistMinParticlePt();
196 maxPt = fCuts->GetHistMaxParticlePt();
199 TString histname = "fHistEt" + fHistogramNameSuffix;
200 fHistEt = new TH1F(histname.Data(), "Total E_{T} Distribution", nbinsEt, minEt, maxEt);
201 fHistEt->GetXaxis()->SetTitle("E_{T} (GeV/c^{2})");
202 fHistEt->GetYaxis()->SetTitle("dN/dE_{T} (c^{2}/GeV)");
204 histname = "fHistChargedEt" + fHistogramNameSuffix;
205 fHistChargedEt = new TH1F(histname.Data(), "Total Charged E_{T} Distribution", nbinsEt, minEt, maxEt);
206 fHistChargedEt->GetXaxis()->SetTitle("E_{T} (GeV/c^{2})");
207 fHistChargedEt->GetYaxis()->SetTitle("dN/dE_{T} (c^{2}/GeV)");
209 histname = "fHistNeutralEt" + fHistogramNameSuffix;
210 fHistNeutralEt = new TH1F(histname.Data(), "Total Neutral E_{T} Distribution", nbinsEt, minEt, maxEt);
211 fHistNeutralEt->GetXaxis()->SetTitle("E_{T} (GeV/c^{2})");
212 fHistNeutralEt->GetYaxis()->SetTitle("dN/dE_{T} (c^{2}/GeV)");
214 histname = "fHistEtAcc" + fHistogramNameSuffix;
215 fHistEtAcc = new TH1F(histname.Data(), "Total E_{T} Distribution in Acceptance", nbinsEt, minEt, maxEt);
216 fHistEtAcc->GetXaxis()->SetTitle("E_{T} (GeV/c^{2})");
217 fHistEtAcc->GetYaxis()->SetTitle("dN/dE_{T} (c^{2}/GeV)");
219 histname = "fHistChargedEtAcc" + fHistogramNameSuffix;
220 fHistChargedEtAcc = new TH1F(histname.Data(), "Total Charged E_{T} Distribution in Acceptance", nbinsEt, minEt, maxEt);
221 fHistChargedEtAcc->GetXaxis()->SetTitle("E_{T} (GeV/c^{2})");
222 fHistChargedEtAcc->GetYaxis()->SetTitle("dN/dE_{T} (c^{2}/GeV)");
224 histname = "fHistNeutralEtAcc" + fHistogramNameSuffix;
225 fHistNeutralEtAcc = new TH1F(histname.Data(), "Total Neutral E_{T} Distribution in Acceptance", nbinsEt, minEt, maxEt);
226 fHistNeutralEtAcc->GetXaxis()->SetTitle("E_{T} (GeV/c^{2})");
227 fHistNeutralEtAcc->GetYaxis()->SetTitle("dN/dE_{T} (c^{2}/GeV)");
228 std::cout << histname << std::endl;
229 histname = "fHistMult" + fHistogramNameSuffix;
230 fHistMult = new TH1F(histname.Data(), "Total Multiplicity", nbinsMult, minMult, maxMult);
231 fHistMult->GetXaxis()->SetTitle("N");
232 fHistMult->GetYaxis()->SetTitle("Multiplicity");
234 histname = "fHistChargedMult" + fHistogramNameSuffix;
235 fHistChargedMult = new TH1F(histname.Data(), "Charged Multiplicity", nbinsMult, minMult, maxMult);
236 fHistChargedMult->GetXaxis()->SetTitle("N");
237 fHistChargedMult->GetYaxis()->SetTitle("Multiplicity");
239 histname = "fHistNeutralMult" + fHistogramNameSuffix;
240 fHistNeutralMult = new TH1F(histname.Data(), "Neutral Multiplicity", nbinsMult, minMult, maxMult);
241 fHistNeutralMult->GetXaxis()->SetTitle("N");
242 fHistNeutralMult->GetYaxis()->SetTitle("Multiplicity");
244 histname = "fHistPhivsPtPos" + fHistogramNameSuffix;
245 fHistPhivsPtPos = new TH2F(histname.Data(), "Phi vs pT of positively charged tracks hitting the calorimeter", 200, 0, 2*TMath::Pi(), nbinsPt, minPt, maxPt);
247 histname = "fHistPhivsPtNeg" + fHistogramNameSuffix;
248 fHistPhivsPtNeg = new TH2F(histname.Data(), "Phi vs pT of negatively charged tracks hitting the calorimeter", 200, 0, 2*TMath::Pi(), nbinsPt, minPt, maxPt);
250 histname = "fHistBaryonEt" + fHistogramNameSuffix;
251 fHistBaryonEt = new TH1F(histname.Data(), "E_{T} for baryons", nbinsEt, minEt, maxEt);
253 histname = "fHistAntiBaryonEt" + fHistogramNameSuffix;
254 fHistAntiBaryonEt = new TH1F(histname.Data(), "E_{T} for anti baryons", nbinsEt, minEt, maxEt);
256 histname = "fHistMesonEt" + fHistogramNameSuffix;
257 fHistMesonEt = new TH1F(histname.Data(), "E_{T} for mesons", nbinsEt, minEt, maxEt);
259 histname = "fHistBaryonEtAcc" + fHistogramNameSuffix;
260 fHistBaryonEtAcc = new TH1F(histname.Data(), "E_{T} for baryons in calorimeter acceptance", nbinsEt, minEt, maxEt);
262 histname = "fHistAntiBaryonEtAcc" + fHistogramNameSuffix;
263 fHistAntiBaryonEtAcc = new TH1F(histname.Data(), "E_{T} for anti baryons in calorimeter acceptance", nbinsEt, minEt, maxEt);
265 histname = "fHistMesonEtAcc" + fHistogramNameSuffix;
266 fHistMesonEtAcc = new TH1F(histname.Data(), "E_{T} for mesons in calorimeter acceptance", nbinsEt, minEt, maxEt);
268 histname = "fHistProtonEt" + fHistogramNameSuffix;
269 fHistProtonEt = new TH1F(histname.Data(), "E_{T} for (anti-)protons", nbinsEt, minEt, maxEt);
271 histname = "fHistKaonEt" + fHistogramNameSuffix;
272 fHistChargedKaonEt = new TH1F(histname.Data(), "E_{T} for charged kaons", nbinsEt, minEt, maxEt);
274 histname = "fHistMuonEt" + fHistogramNameSuffix;
275 fHistMuonEt = new TH1F(histname.Data(), "E_{T} for muons", nbinsEt, minEt, maxEt);
277 histname = "fHistElectronEt" + fHistogramNameSuffix;
278 fHistElectronEt = new TH1F(histname.Data(), "E_{T} for electrons/positrons", nbinsEt, minEt, maxEt);
280 histname = "fHistProtonEtAcc" + fHistogramNameSuffix;
281 fHistProtonEtAcc = new TH1F(histname.Data(), "E_{T} for (anti-)protons in calorimeter acceptance", nbinsEt, minEt, maxEt);
283 histname = "fHistKaonEtAcc" + fHistogramNameSuffix;
284 fHistChargedKaonEtAcc = new TH1F(histname.Data(), "E_{T} for charged kaons in calorimeter acceptance", nbinsEt, minEt, maxEt);
286 histname = "fHistMuonEtAcc" + fHistogramNameSuffix;
287 fHistMuonEtAcc = new TH1F(histname.Data(), "E_{T} for muons in calorimeter acceptance", nbinsEt, minEt, maxEt);
289 histname = "fHistElectronEtAcc" + fHistogramNameSuffix;
290 fHistElectronEtAcc = new TH1F(histname.Data(), "E_{T} for electrons/positrons in calorimeter acceptance", nbinsEt, minEt, maxEt);
292 histname = "fHistEtRecvsEtMC" + fHistogramNameSuffix;
293 fHistEtRecvsEtMC = new TH2F(histname.Data(), "Reconstructed E_{t} vs MC E_{t}", nbinsEt, minEt, maxEt, nbinsEt, minEt, maxEt);
296 histname = "fHistTMDeltaR" + fHistogramNameSuffix;
297 fHistTMDeltaR = new TH1F(histname.Data(), "#Delta R for calorimeter clusters", 200, 0, 50);
301 void AliAnalysisEt::CreateTree()
303 TString treename = "fTree" + fHistogramNameSuffix;
304 fTree = new TTree(treename, treename);
305 fTree->Branch("fTotEt",&fTotEt,"fTotEt/D");
306 fTree->Branch("fTotEtAcc",&fTotEtAcc,"fTotEtAcc/D");
307 fTree->Branch("fTotNeutralEt",&fTotNeutralEt,"fTotNeutralEt/D");
308 fTree->Branch("fTotNeutralEtAcc",&fTotNeutralEtAcc,"fTotNeutralEtAcc/D");
309 fTree->Branch("fTotChargedEt",&fTotChargedEt,"fTotChargedEt/D");
310 fTree->Branch("fTotChargedEtAcc",&fTotChargedEtAcc,"fTotChargedEtAcc/D");
311 fTree->Branch("fMultiplicity",&fMultiplicity,"fMultiplicity/I");
312 fTree->Branch("fChargedMultiplicity",&fChargedMultiplicity,"fChargedMultiplicity/I");
313 fTree->Branch("fNeutralMultiplicity",&fNeutralMultiplicity,"fNeutralMultiplicity/I");
314 fTree->Branch("fBaryonEt",&fBaryonEt,"fBaryonEt/D");
315 fTree->Branch("fAntiBaryonEt",&fAntiBaryonEt,"fAntiBaryonEt/D");
316 fTree->Branch("fMesonEt",&fMesonEt,"fMesonEt/D");
317 fTree->Branch("fBaryonEtAcc",&fBaryonEtAcc,"fBaryonEtAcc/D");
318 fTree->Branch("fAntiBaryonEtAcc",&fAntiBaryonEtAcc,"fAntiBaryonEtAcc/D");
319 fTree->Branch("fMesonEtAcc",&fMesonEtAcc,"fMesonEtAcc/D");
320 fTree->Branch("fProtonEt",&fProtonEt,"fProtonEt/D");
321 fTree->Branch("fChargedKaonEt",&fChargedKaonEt,"fChargedKaonEt/D");
322 fTree->Branch("fMuonEt",&fMuonEt,"fMuonEt/D");
323 fTree->Branch("fElectronEt",&fElectronEt,"fElectronEt/D");
324 fTree->Branch("fProtonEtAcc",&fProtonEtAcc,"fProtonEtAcc/D");
325 fTree->Branch("fChargedKaonEtAcc",&fChargedKaonEtAcc,"fChargedKaonEtAcc/D");
326 fTree->Branch("fMuonEtAcc",&fMuonEtAcc,"fMuonEtAcc/D");
327 fTree->Branch("fElectronEtAcc",&fElectronEtAcc,"fElectronEtAcc/D");
332 void AliAnalysisEt::FillHistograms()
333 { // fill histograms..
334 fHistEt->Fill(fTotEt);
335 fHistChargedEt->Fill(fTotChargedEt);
336 fHistNeutralEt->Fill(fTotNeutralEt);
338 fHistEtAcc->Fill(fTotEtAcc);
339 fHistChargedEtAcc->Fill(fTotChargedEtAcc);
340 fHistNeutralEtAcc->Fill(fTotNeutralEtAcc);
342 fHistMult->Fill(fMultiplicity);
343 fHistChargedMult->Fill(fChargedMultiplicity);
344 fHistNeutralMult->Fill(fNeutralMultiplicity);
346 fHistBaryonEt->Fill(fBaryonEt);
347 fHistAntiBaryonEt->Fill(fAntiBaryonEt);
348 fHistMesonEt->Fill(fMesonEt);
350 fHistBaryonEtAcc->Fill(fBaryonEtAcc);
351 fHistAntiBaryonEtAcc->Fill(fAntiBaryonEtAcc);
352 fHistMesonEtAcc->Fill(fMesonEtAcc);
354 fHistProtonEt->Fill(fProtonEt);
355 fHistChargedKaonEt->Fill(fChargedKaonEt);
356 fHistMuonEt->Fill(fMuonEt);
357 fHistElectronEt->Fill(fElectronEt);
359 fHistProtonEtAcc->Fill(fProtonEtAcc);
360 fHistChargedKaonEtAcc->Fill(fChargedKaonEtAcc);
361 fHistMuonEtAcc->Fill(fMuonEtAcc);
362 fHistElectronEtAcc->Fill(fElectronEtAcc);
365 if (fCuts->GetHistMakeTree()) {
372 Int_t AliAnalysisEt::AnalyseEvent(AliVEvent *event)
373 { //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.
374 cout << "This event has " << event->GetNumberOfTracks() << " tracks" << endl;
379 void AliAnalysisEt::ResetEventValues()
384 fTotNeutralEtAcc = 0;
386 fTotChargedEtAcc = 0;
388 fChargedMultiplicity = 0;
389 fNeutralMultiplicity = 0;
394 fAntiBaryonEtAcc = 0;
401 fChargedKaonEtAcc = 0;
405 if (!fCuts || !fPdgDB || fPiPlusCode==0) { // some Init's needed
406 cout << __FILE__ << ":" << __LINE__ << " : Init " << endl;
408 cout << " setting up Cuts " << endl;
409 fCuts = new AliAnalysisEtCuts();
412 cout << " setting up PdgDB " << endl;
413 fPdgDB = new TDatabasePDG();
416 if (fPiPlusCode==0) {
424 void AliAnalysisEt::SetParticleCodes()
426 fPionMass = fPdgDB->GetParticle("pi+")->Mass();
427 fPiPlusCode = fPdgDB->GetParticle("pi+")->PdgCode();
428 fPiMinusCode = fPdgDB->GetParticle("pi-")->PdgCode();
429 fKPlusCode = fPdgDB->GetParticle("K+")->PdgCode();
430 fKMinusCode = fPdgDB->GetParticle("K-")->PdgCode();
431 fProtonCode = fPdgDB->GetParticle("proton")->PdgCode();
432 fAntiProtonCode = fPdgDB->GetParticle("antiproton")->PdgCode();
433 fLambdaCode = fPdgDB->GetParticle("Lambda0")->PdgCode();
434 fAntiLambdaCode = fPdgDB->GetParticle("Lambda0_bar")->PdgCode();
435 fK0SCode = fPdgDB->GetParticle("K_S0")->PdgCode();
436 fOmegaCode = fPdgDB->GetParticle("Omega-")->PdgCode();
437 fAntiOmegaCode = fPdgDB->GetParticle("Omega+")->PdgCode();
438 fXi0Code = fPdgDB->GetParticle("Xi0")->PdgCode();
439 fAntiXi0Code = fPdgDB->GetParticle("Xi0_bar")->PdgCode();
440 fXiCode = fPdgDB->GetParticle("Xi-")->PdgCode();
441 fAntiXiCode = fPdgDB->GetParticle("Xi-_bar")->PdgCode();
442 fSigmaCode = fPdgDB->GetParticle("Sigma-")->PdgCode();
443 fAntiSigmaCode = fPdgDB->GetParticle("Sigma+")->PdgCode();
444 fK0LCode = fPdgDB->GetParticle("K_L0")->PdgCode();
445 fNeutronCode = fPdgDB->GetParticle("neutron")->PdgCode();
446 fAntiNeutronCode = fPdgDB->GetParticle("antineutron")->PdgCode();
447 fEPlusCode = fPdgDB->GetParticle("e+")->PdgCode();
448 fEMinusCode = fPdgDB->GetParticle("e-")->PdgCode();
449 cout << "Resetting Codes: Pion " << fPiPlusCode
450 << "," << fPiMinusCode
451 << " Kaon " << fKPlusCode
452 << "," << fKMinusCode << endl;