]>
Commit | Line | Data |
---|---|---|
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" | |
641e1e0c | 18 | #include "AliVEvent.h" |
cf6522d1 | 19 | #include "TDatabasePDG.h" |
20 | #include "Rtypes.h" | |
641e1e0c | 21 | |
22 | using namespace std; | |
2fbf38ac | 23 | ClassImp(AliAnalysisEt); |
24 | ||
25 | ||
26 | AliAnalysisEt::AliAnalysisEt() : | |
27 | fHistogramNameSuffix("") | |
4998becf | 28 | ,fCuts(0) |
2fbf38ac | 29 | ,fPdgDB(0) |
8985c506 | 30 | ,fPiPlusCode(0) |
31 | ,fPiMinusCode(0) | |
32 | ,fKPlusCode(0) | |
33 | ,fKMinusCode(0) | |
34 | ,fProtonCode(0) | |
35 | ,fAntiProtonCode(0) | |
36 | ,fLambdaCode(0) | |
37 | ,fAntiLambdaCode(0) | |
38 | ,fK0SCode(0) | |
39 | ,fOmegaCode(0) | |
40 | ,fAntiOmegaCode(0) | |
41 | ,fXi0Code(0) | |
42 | ,fAntiXi0Code(0) | |
43 | ,fXiCode(0) | |
44 | ,fAntiXiCode(0) | |
45 | ,fSigmaCode(0) | |
46 | ,fAntiSigmaCode(0) | |
47 | ,fK0LCode(0) | |
48 | ,fNeutronCode(0) | |
49 | ,fAntiNeutronCode(0) | |
50 | ,fEPlusCode(0) | |
51 | ,fEMinusCode(0) | |
43056f1b | 52 | ,fGammaCode(0) |
8985c506 | 53 | ,fPionMass(0) |
2fbf38ac | 54 | ,fTotEt(0) |
55 | ,fTotEtAcc(0) | |
56 | ,fTotNeutralEt(0) | |
57 | ,fTotNeutralEtAcc(0) | |
58 | ,fTotChargedEt(0) | |
59 | ,fTotChargedEtAcc(0) | |
60 | ,fMultiplicity(0) | |
61 | ,fChargedMultiplicity(0) | |
62 | ,fNeutralMultiplicity(0) | |
87efb15c | 63 | ,fBaryonEt(0) |
64 | ,fAntiBaryonEt(0) | |
65 | ,fMesonEt(0) | |
66 | ,fBaryonEtAcc(0) | |
67 | ,fAntiBaryonEtAcc(0) | |
68 | ,fMesonEtAcc(0) | |
69 | ,fProtonEt(0) | |
43056f1b | 70 | ,fPionEt(0) |
87efb15c | 71 | ,fChargedKaonEt(0) |
72 | ,fMuonEt(0) | |
73 | ,fElectronEt(0) | |
43056f1b | 74 | ,fNeutronEt(0) |
75 | ,fAntiNeutronEt(0) | |
76 | ,fGammaEt(0) | |
87efb15c | 77 | ,fProtonEtAcc(0) |
43056f1b | 78 | ,fPionEtAcc(0) |
87efb15c | 79 | ,fChargedKaonEtAcc(0) |
80 | ,fMuonEtAcc(0) | |
81 | ,fElectronEtAcc(0) | |
8ea99ab0 | 82 | ,fEnergyDeposited(0) |
83 | ,fEnergyTPC(0) | |
84 | ,fCharge(0) | |
85 | ,fParticlePid(0) | |
86 | ,fPidProb(0) | |
87 | ,fTrackPassedCut(kFALSE) | |
87efb15c | 88 | ,fEtaCut(0) |
4998becf | 89 | ,fEtaCutAcc(0) |
90 | ,fPhiCutAccMin(0) | |
91 | ,fPhiCutAccMax(0) | |
92 | ,fDetectorRadius(0) | |
93 | ,fClusterEnergyCut(0) | |
94 | ,fSingleCellEnergyCut(0) | |
2fbf38ac | 95 | ,fHistEt(0) |
96 | ,fHistChargedEt(0) | |
97 | ,fHistNeutralEt(0) | |
98 | ,fHistEtAcc(0) | |
99 | ,fHistChargedEtAcc(0) | |
100 | ,fHistNeutralEtAcc(0) | |
101 | ,fHistMult(0) | |
102 | ,fHistChargedMult(0) | |
103 | ,fHistNeutralMult(0) | |
104 | ,fHistPhivsPtPos(0) | |
105 | ,fHistPhivsPtNeg(0) | |
106 | ,fHistBaryonEt(0) | |
107 | ,fHistAntiBaryonEt(0) | |
108 | ,fHistMesonEt(0) | |
109 | ,fHistBaryonEtAcc(0) | |
110 | ,fHistAntiBaryonEtAcc(0) | |
111 | ,fHistMesonEtAcc(0) | |
87efb15c | 112 | ,fHistProtonEt(0) |
43056f1b | 113 | ,fHistPionEt(0) |
87efb15c | 114 | ,fHistChargedKaonEt(0) |
115 | ,fHistMuonEt(0) | |
116 | ,fHistElectronEt(0) | |
43056f1b | 117 | ,fHistNeutronEt(0) |
118 | ,fHistAntiNeutronEt(0) | |
119 | ,fHistGammaEt(0) | |
87efb15c | 120 | ,fHistProtonEtAcc(0) |
43056f1b | 121 | ,fHistPionEtAcc(0) |
87efb15c | 122 | ,fHistChargedKaonEtAcc(0) |
123 | ,fHistMuonEtAcc(0) | |
124 | ,fHistElectronEtAcc(0) | |
125 | ,fHistEtRecvsEtMC(0) | |
2fbf38ac | 126 | ,fHistTMDeltaR(0) |
ce546038 | 127 | ,fTree(0) |
8ea99ab0 | 128 | ,fTreeDeposit(0) |
b5821c13 | 129 | ,fEsdtrackCutsTPC(0) |
2fbf38ac | 130 | { |
2fbf38ac | 131 | } |
132 | ||
133 | AliAnalysisEt::~AliAnalysisEt() | |
134 | { | |
135 | ||
136 | } | |
137 | ||
138 | void AliAnalysisEt::FillOutputList(TList *list) | |
cf6522d1 | 139 | { // histograms to be added to output |
2fbf38ac | 140 | list->Add(fHistEt); |
141 | list->Add(fHistChargedEt); | |
142 | list->Add(fHistNeutralEt); | |
143 | ||
144 | list->Add(fHistEtAcc); | |
145 | list->Add(fHistChargedEtAcc); | |
146 | list->Add(fHistNeutralEtAcc); | |
147 | ||
148 | list->Add(fHistMult); | |
149 | list->Add(fHistChargedMult); | |
150 | list->Add(fHistNeutralMult); | |
151 | ||
152 | list->Add(fHistPhivsPtPos); | |
153 | list->Add(fHistPhivsPtNeg); | |
154 | ||
155 | list->Add(fHistBaryonEt); | |
156 | list->Add(fHistAntiBaryonEt); | |
157 | list->Add(fHistMesonEt); | |
158 | ||
159 | list->Add(fHistBaryonEtAcc); | |
160 | list->Add(fHistAntiBaryonEtAcc); | |
161 | list->Add(fHistMesonEtAcc); | |
162 | ||
43056f1b | 163 | list->Add(fHistProtonEt); |
164 | list->Add(fHistPionEt); | |
165 | list->Add(fHistChargedKaonEt); | |
166 | list->Add(fHistMuonEt); | |
167 | list->Add(fHistElectronEt); | |
168 | ||
169 | list->Add(fHistNeutronEt); | |
170 | list->Add(fHistAntiNeutronEt); | |
171 | list->Add(fHistGammaEt); | |
172 | ||
87efb15c | 173 | list->Add(fHistProtonEtAcc); |
43056f1b | 174 | list->Add(fHistPionEtAcc); |
87efb15c | 175 | list->Add(fHistChargedKaonEtAcc); |
176 | list->Add(fHistMuonEtAcc); | |
177 | list->Add(fHistElectronEtAcc); | |
178 | ||
179 | list->Add(fHistEtRecvsEtMC); | |
180 | ||
2fbf38ac | 181 | list->Add(fHistTMDeltaR); |
ce546038 | 182 | |
183 | if (fCuts) { | |
184 | if (fCuts->GetHistMakeTree()) { | |
185 | list->Add(fTree); | |
186 | } | |
187 | } | |
8ea99ab0 | 188 | list->Add(fTreeDeposit); |
ce546038 | 189 | |
2fbf38ac | 190 | } |
191 | ||
192 | void AliAnalysisEt::Init() | |
0065531a | 193 | {// clear variables, set up cuts and PDG info |
194 | ResetEventValues(); | |
2fbf38ac | 195 | } |
196 | ||
197 | void AliAnalysisEt::CreateHistograms() | |
cf6522d1 | 198 | { // create histograms.. |
13b0d3c1 | 199 | // histogram binning for E_T, p_T and Multiplicity: defaults for p+p |
200 | Int_t nbinsEt = 1000; | |
201 | Double_t minEt = 0.0001; | |
202 | Double_t maxEt = 100; | |
203 | Int_t nbinsPt = 200; | |
204 | Double_t minPt = 0; | |
205 | Double_t maxPt = 20; | |
206 | Int_t nbinsMult = 200; | |
207 | Double_t minMult = -0.5; // offset -0.5 to have integer bins centered around 0 | |
208 | Double_t maxMult = nbinsMult + minMult; // 1 bin per integer value | |
2fbf38ac | 209 | |
ce546038 | 210 | // see if we should change histogram limits etc, and possibly create a tree |
211 | if (fCuts) { | |
8ea99ab0 | 212 | //if (fCuts->GetHistMakeTree()) { |
213 | CreateTrees(); | |
214 | //} | |
0fa8c632 | 215 | |
216 | nbinsMult = fCuts->GetHistNbinsMult(); | |
217 | minMult = fCuts->GetHistMinMult(); | |
218 | maxMult = fCuts->GetHistMaxMult(); | |
219 | ||
220 | nbinsEt = fCuts->GetHistNbinsTotEt(); | |
221 | minEt = fCuts->GetHistMinTotEt(); | |
222 | maxEt = fCuts->GetHistMaxTotEt(); | |
223 | ||
224 | nbinsPt = fCuts->GetHistNbinsParticlePt(); | |
225 | minPt = fCuts->GetHistMinParticlePt(); | |
226 | maxPt = fCuts->GetHistMaxParticlePt(); | |
ce546038 | 227 | } |
228 | ||
2fbf38ac | 229 | TString histname = "fHistEt" + fHistogramNameSuffix; |
13b0d3c1 | 230 | fHistEt = new TH1F(histname.Data(), "Total E_{T} Distribution", nbinsEt, minEt, maxEt); |
2fbf38ac | 231 | fHistEt->GetXaxis()->SetTitle("E_{T} (GeV/c^{2})"); |
232 | fHistEt->GetYaxis()->SetTitle("dN/dE_{T} (c^{2}/GeV)"); | |
233 | ||
234 | histname = "fHistChargedEt" + fHistogramNameSuffix; | |
13b0d3c1 | 235 | fHistChargedEt = new TH1F(histname.Data(), "Total Charged E_{T} Distribution", nbinsEt, minEt, maxEt); |
2fbf38ac | 236 | fHistChargedEt->GetXaxis()->SetTitle("E_{T} (GeV/c^{2})"); |
237 | fHistChargedEt->GetYaxis()->SetTitle("dN/dE_{T} (c^{2}/GeV)"); | |
238 | ||
239 | histname = "fHistNeutralEt" + fHistogramNameSuffix; | |
13b0d3c1 | 240 | fHistNeutralEt = new TH1F(histname.Data(), "Total Neutral E_{T} Distribution", nbinsEt, minEt, maxEt); |
2fbf38ac | 241 | fHistNeutralEt->GetXaxis()->SetTitle("E_{T} (GeV/c^{2})"); |
242 | fHistNeutralEt->GetYaxis()->SetTitle("dN/dE_{T} (c^{2}/GeV)"); | |
243 | ||
244 | histname = "fHistEtAcc" + fHistogramNameSuffix; | |
13b0d3c1 | 245 | fHistEtAcc = new TH1F(histname.Data(), "Total E_{T} Distribution in Acceptance", nbinsEt, minEt, maxEt); |
2fbf38ac | 246 | fHistEtAcc->GetXaxis()->SetTitle("E_{T} (GeV/c^{2})"); |
247 | fHistEtAcc->GetYaxis()->SetTitle("dN/dE_{T} (c^{2}/GeV)"); | |
248 | ||
249 | histname = "fHistChargedEtAcc" + fHistogramNameSuffix; | |
13b0d3c1 | 250 | fHistChargedEtAcc = new TH1F(histname.Data(), "Total Charged E_{T} Distribution in Acceptance", nbinsEt, minEt, maxEt); |
2fbf38ac | 251 | fHistChargedEtAcc->GetXaxis()->SetTitle("E_{T} (GeV/c^{2})"); |
252 | fHistChargedEtAcc->GetYaxis()->SetTitle("dN/dE_{T} (c^{2}/GeV)"); | |
253 | ||
254 | histname = "fHistNeutralEtAcc" + fHistogramNameSuffix; | |
13b0d3c1 | 255 | fHistNeutralEtAcc = new TH1F(histname.Data(), "Total Neutral E_{T} Distribution in Acceptance", nbinsEt, minEt, maxEt); |
2fbf38ac | 256 | fHistNeutralEtAcc->GetXaxis()->SetTitle("E_{T} (GeV/c^{2})"); |
257 | fHistNeutralEtAcc->GetYaxis()->SetTitle("dN/dE_{T} (c^{2}/GeV)"); | |
258 | std::cout << histname << std::endl; | |
259 | histname = "fHistMult" + fHistogramNameSuffix; | |
13b0d3c1 | 260 | fHistMult = new TH1F(histname.Data(), "Total Multiplicity", nbinsMult, minMult, maxMult); |
2fbf38ac | 261 | fHistMult->GetXaxis()->SetTitle("N"); |
262 | fHistMult->GetYaxis()->SetTitle("Multiplicity"); | |
263 | ||
264 | histname = "fHistChargedMult" + fHistogramNameSuffix; | |
13b0d3c1 | 265 | fHistChargedMult = new TH1F(histname.Data(), "Charged Multiplicity", nbinsMult, minMult, maxMult); |
2fbf38ac | 266 | fHistChargedMult->GetXaxis()->SetTitle("N"); |
267 | fHistChargedMult->GetYaxis()->SetTitle("Multiplicity"); | |
268 | ||
269 | histname = "fHistNeutralMult" + fHistogramNameSuffix; | |
13b0d3c1 | 270 | fHistNeutralMult = new TH1F(histname.Data(), "Neutral Multiplicity", nbinsMult, minMult, maxMult); |
2fbf38ac | 271 | fHistNeutralMult->GetXaxis()->SetTitle("N"); |
272 | fHistNeutralMult->GetYaxis()->SetTitle("Multiplicity"); | |
273 | ||
274 | histname = "fHistPhivsPtPos" + fHistogramNameSuffix; | |
13b0d3c1 | 275 | fHistPhivsPtPos = new TH2F(histname.Data(), "Phi vs pT of positively charged tracks hitting the calorimeter", 200, 0, 2*TMath::Pi(), nbinsPt, minPt, maxPt); |
2fbf38ac | 276 | |
277 | histname = "fHistPhivsPtNeg" + fHistogramNameSuffix; | |
13b0d3c1 | 278 | fHistPhivsPtNeg = new TH2F(histname.Data(), "Phi vs pT of negatively charged tracks hitting the calorimeter", 200, 0, 2*TMath::Pi(), nbinsPt, minPt, maxPt); |
2fbf38ac | 279 | |
280 | histname = "fHistBaryonEt" + fHistogramNameSuffix; | |
13b0d3c1 | 281 | fHistBaryonEt = new TH1F(histname.Data(), "E_{T} for baryons", nbinsEt, minEt, maxEt); |
2fbf38ac | 282 | |
283 | histname = "fHistAntiBaryonEt" + fHistogramNameSuffix; | |
13b0d3c1 | 284 | fHistAntiBaryonEt = new TH1F(histname.Data(), "E_{T} for anti baryons", nbinsEt, minEt, maxEt); |
2fbf38ac | 285 | |
286 | histname = "fHistMesonEt" + fHistogramNameSuffix; | |
13b0d3c1 | 287 | fHistMesonEt = new TH1F(histname.Data(), "E_{T} for mesons", nbinsEt, minEt, maxEt); |
2fbf38ac | 288 | |
289 | histname = "fHistBaryonEtAcc" + fHistogramNameSuffix; | |
13b0d3c1 | 290 | fHistBaryonEtAcc = new TH1F(histname.Data(), "E_{T} for baryons in calorimeter acceptance", nbinsEt, minEt, maxEt); |
2fbf38ac | 291 | |
292 | histname = "fHistAntiBaryonEtAcc" + fHistogramNameSuffix; | |
13b0d3c1 | 293 | fHistAntiBaryonEtAcc = new TH1F(histname.Data(), "E_{T} for anti baryons in calorimeter acceptance", nbinsEt, minEt, maxEt); |
2fbf38ac | 294 | |
295 | histname = "fHistMesonEtAcc" + fHistogramNameSuffix; | |
13b0d3c1 | 296 | fHistMesonEtAcc = new TH1F(histname.Data(), "E_{T} for mesons in calorimeter acceptance", nbinsEt, minEt, maxEt); |
2fbf38ac | 297 | |
87efb15c | 298 | histname = "fHistProtonEt" + fHistogramNameSuffix; |
299 | fHistProtonEt = new TH1F(histname.Data(), "E_{T} for (anti-)protons", nbinsEt, minEt, maxEt); | |
300 | ||
43056f1b | 301 | histname = "fHistPionEt" + fHistogramNameSuffix; |
302 | fHistPionEt = new TH1F(histname.Data(), "E_{T} for #pi^+/#pi^-", nbinsEt, minEt, maxEt); | |
303 | ||
87efb15c | 304 | histname = "fHistKaonEt" + fHistogramNameSuffix; |
305 | fHistChargedKaonEt = new TH1F(histname.Data(), "E_{T} for charged kaons", nbinsEt, minEt, maxEt); | |
306 | ||
307 | histname = "fHistMuonEt" + fHistogramNameSuffix; | |
308 | fHistMuonEt = new TH1F(histname.Data(), "E_{T} for muons", nbinsEt, minEt, maxEt); | |
309 | ||
310 | histname = "fHistElectronEt" + fHistogramNameSuffix; | |
311 | fHistElectronEt = new TH1F(histname.Data(), "E_{T} for electrons/positrons", nbinsEt, minEt, maxEt); | |
312 | ||
43056f1b | 313 | histname = "fHistNeutronEt" + fHistogramNameSuffix; |
314 | fHistNeutronEt = new TH1F(histname.Data(), "E_{T} for neutrons", nbinsEt, minEt, maxEt); | |
315 | ||
316 | histname = "fHistAntiNeutronEt" + fHistogramNameSuffix; | |
317 | fHistAntiNeutronEt = new TH1F(histname.Data(), "E_{T} for anti-neutrons", nbinsEt, minEt, maxEt); | |
318 | ||
319 | histname = "fHistGammaEt" + fHistogramNameSuffix; | |
320 | fHistGammaEt = new TH1F(histname.Data(), "E_{T} for gammas", nbinsEt, minEt, maxEt); | |
321 | ||
87efb15c | 322 | histname = "fHistProtonEtAcc" + fHistogramNameSuffix; |
323 | fHistProtonEtAcc = new TH1F(histname.Data(), "E_{T} for (anti-)protons in calorimeter acceptance", nbinsEt, minEt, maxEt); | |
324 | ||
43056f1b | 325 | histname = "fHistPionEtAcc" + fHistogramNameSuffix; |
326 | fHistPionEtAcc = new TH1F(histname.Data(), "E_{T} for #pi^+/#pi^- in calorimeter acceptance", nbinsEt, minEt, maxEt); | |
327 | ||
87efb15c | 328 | histname = "fHistKaonEtAcc" + fHistogramNameSuffix; |
329 | fHistChargedKaonEtAcc = new TH1F(histname.Data(), "E_{T} for charged kaons in calorimeter acceptance", nbinsEt, minEt, maxEt); | |
330 | ||
331 | histname = "fHistMuonEtAcc" + fHistogramNameSuffix; | |
332 | fHistMuonEtAcc = new TH1F(histname.Data(), "E_{T} for muons in calorimeter acceptance", nbinsEt, minEt, maxEt); | |
333 | ||
334 | histname = "fHistElectronEtAcc" + fHistogramNameSuffix; | |
335 | fHistElectronEtAcc = new TH1F(histname.Data(), "E_{T} for electrons/positrons in calorimeter acceptance", nbinsEt, minEt, maxEt); | |
336 | ||
337 | histname = "fHistEtRecvsEtMC" + fHistogramNameSuffix; | |
338 | fHistEtRecvsEtMC = new TH2F(histname.Data(), "Reconstructed E_{t} vs MC E_{t}", nbinsEt, minEt, maxEt, nbinsEt, minEt, maxEt); | |
339 | ||
cf6522d1 | 340 | // |
2fbf38ac | 341 | histname = "fHistTMDeltaR" + fHistogramNameSuffix; |
342 | fHistTMDeltaR = new TH1F(histname.Data(), "#Delta R for calorimeter clusters", 200, 0, 50); | |
343 | ||
344 | } | |
345 | ||
8ea99ab0 | 346 | void AliAnalysisEt::CreateTrees() |
ce546038 | 347 | { // create tree.. |
348 | TString treename = "fTree" + fHistogramNameSuffix; | |
8ea99ab0 | 349 | if(fCuts->GetHistMakeTree()) |
350 | { | |
351 | ||
352 | fTree = new TTree(treename, treename); | |
353 | fTree->Branch("fTotEt",&fTotEt,"fTotEt/D"); | |
354 | fTree->Branch("fTotEtAcc",&fTotEtAcc,"fTotEtAcc/D"); | |
355 | fTree->Branch("fTotNeutralEt",&fTotNeutralEt,"fTotNeutralEt/D"); | |
356 | fTree->Branch("fTotNeutralEtAcc",&fTotNeutralEtAcc,"fTotNeutralEtAcc/D"); | |
357 | fTree->Branch("fTotChargedEt",&fTotChargedEt,"fTotChargedEt/D"); | |
358 | fTree->Branch("fTotChargedEtAcc",&fTotChargedEtAcc,"fTotChargedEtAcc/D"); | |
359 | fTree->Branch("fMultiplicity",&fMultiplicity,"fMultiplicity/I"); | |
360 | fTree->Branch("fChargedMultiplicity",&fChargedMultiplicity,"fChargedMultiplicity/I"); | |
361 | fTree->Branch("fNeutralMultiplicity",&fNeutralMultiplicity,"fNeutralMultiplicity/I"); | |
362 | fTree->Branch("fBaryonEt",&fBaryonEt,"fBaryonEt/D"); | |
363 | fTree->Branch("fAntiBaryonEt",&fAntiBaryonEt,"fAntiBaryonEt/D"); | |
364 | fTree->Branch("fMesonEt",&fMesonEt,"fMesonEt/D"); | |
365 | fTree->Branch("fBaryonEtAcc",&fBaryonEtAcc,"fBaryonEtAcc/D"); | |
366 | fTree->Branch("fAntiBaryonEtAcc",&fAntiBaryonEtAcc,"fAntiBaryonEtAcc/D"); | |
367 | fTree->Branch("fMesonEtAcc",&fMesonEtAcc,"fMesonEtAcc/D"); | |
368 | fTree->Branch("fProtonEt",&fProtonEt,"fProtonEt/D"); | |
369 | fTree->Branch("fChargedKaonEt",&fChargedKaonEt,"fChargedKaonEt/D"); | |
370 | fTree->Branch("fMuonEt",&fMuonEt,"fMuonEt/D"); | |
371 | fTree->Branch("fElectronEt",&fElectronEt,"fElectronEt/D"); | |
372 | fTree->Branch("fProtonEtAcc",&fProtonEtAcc,"fProtonEtAcc/D"); | |
373 | fTree->Branch("fChargedKaonEtAcc",&fChargedKaonEtAcc,"fChargedKaonEtAcc/D"); | |
374 | fTree->Branch("fMuonEtAcc",&fMuonEtAcc,"fMuonEtAcc/D"); | |
375 | fTree->Branch("fElectronEtAcc",&fElectronEtAcc,"fElectronEtAcc/D"); | |
376 | } | |
377 | ||
378 | if(fCuts->GetHistMakeTreeDeposit()) | |
379 | { | |
380 | treename = "fTreeDeposit" + fHistogramNameSuffix; | |
381 | fTreeDeposit = new TTree(treename, treename); | |
382 | ||
383 | fTreeDeposit->Branch("fEnergyDeposited", &fEnergyDeposited, "fEnergyDeposited/F"); | |
384 | fTreeDeposit->Branch("fEnergyTPC", &fEnergyTPC, "fEnergyTPC/F"); | |
385 | fTreeDeposit->Branch("fCharge", &fCharge, "fCharge/S"); | |
386 | fTreeDeposit->Branch("fParticlePid", &fParticlePid, "fParticlePid/S"); | |
387 | fTreeDeposit->Branch("fPidProb", &fPidProb, "fPidProb/F"); | |
388 | fTreeDeposit->Branch("fTrackPassedCut", &fTrackPassedCut, "fTrackPassedCut/B"); | |
389 | ||
390 | } | |
ce546038 | 391 | return; |
392 | } | |
2fbf38ac | 393 | void AliAnalysisEt::FillHistograms() |
cf6522d1 | 394 | { // fill histograms.. |
2fbf38ac | 395 | fHistEt->Fill(fTotEt); |
396 | fHistChargedEt->Fill(fTotChargedEt); | |
397 | fHistNeutralEt->Fill(fTotNeutralEt); | |
398 | ||
399 | fHistEtAcc->Fill(fTotEtAcc); | |
400 | fHistChargedEtAcc->Fill(fTotChargedEtAcc); | |
401 | fHistNeutralEtAcc->Fill(fTotNeutralEtAcc); | |
402 | ||
403 | fHistMult->Fill(fMultiplicity); | |
404 | fHistChargedMult->Fill(fChargedMultiplicity); | |
405 | fHistNeutralMult->Fill(fNeutralMultiplicity); | |
406 | ||
ce546038 | 407 | fHistBaryonEt->Fill(fBaryonEt); |
408 | fHistAntiBaryonEt->Fill(fAntiBaryonEt); | |
409 | fHistMesonEt->Fill(fMesonEt); | |
2fbf38ac | 410 | |
ce546038 | 411 | fHistBaryonEtAcc->Fill(fBaryonEtAcc); |
412 | fHistAntiBaryonEtAcc->Fill(fAntiBaryonEtAcc); | |
413 | fHistMesonEtAcc->Fill(fMesonEtAcc); | |
414 | ||
87efb15c | 415 | fHistProtonEt->Fill(fProtonEt); |
43056f1b | 416 | fHistPionEt->Fill(fPionEt); |
87efb15c | 417 | fHistChargedKaonEt->Fill(fChargedKaonEt); |
418 | fHistMuonEt->Fill(fMuonEt); | |
419 | fHistElectronEt->Fill(fElectronEt); | |
43056f1b | 420 | fHistNeutronEt->Fill(fNeutronEt); |
421 | fHistAntiNeutronEt->Fill(fAntiNeutronEt); | |
422 | fHistGammaEt->Fill(fGammaEt); | |
87efb15c | 423 | |
424 | fHistProtonEtAcc->Fill(fProtonEtAcc); | |
43056f1b | 425 | fHistPionEtAcc->Fill(fPionEtAcc); |
87efb15c | 426 | fHistChargedKaonEtAcc->Fill(fChargedKaonEtAcc); |
427 | fHistMuonEtAcc->Fill(fMuonEtAcc); | |
428 | fHistElectronEtAcc->Fill(fElectronEtAcc); | |
ce546038 | 429 | |
430 | if (fCuts) { | |
431 | if (fCuts->GetHistMakeTree()) { | |
432 | fTree->Fill(); | |
433 | } | |
434 | } | |
435 | ||
2fbf38ac | 436 | } |
0065531a | 437 | |
641e1e0c | 438 | Int_t AliAnalysisEt::AnalyseEvent(AliVEvent *event) |
0065531a | 439 | { //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. |
440 | cout << "This event has " << event->GetNumberOfTracks() << " tracks" << endl; | |
441 | ResetEventValues(); | |
641e1e0c | 442 | return 0; |
443 | } | |
2fbf38ac | 444 | |
445 | void AliAnalysisEt::ResetEventValues() | |
cf6522d1 | 446 | { // clear |
0065531a | 447 | fTotEt = 0; |
448 | fTotEtAcc = 0; | |
449 | fTotNeutralEt = 0; | |
450 | fTotNeutralEtAcc = 0; | |
451 | fTotChargedEt = 0; | |
452 | fTotChargedEtAcc = 0; | |
453 | fMultiplicity = 0; | |
454 | fChargedMultiplicity = 0; | |
455 | fNeutralMultiplicity = 0; | |
87efb15c | 456 | fBaryonEt = 0; |
457 | fAntiBaryonEt = 0; | |
458 | fMesonEt = 0; | |
459 | fBaryonEtAcc = 0; | |
460 | fAntiBaryonEtAcc = 0; | |
461 | fMesonEtAcc = 0; | |
462 | fProtonEt = 0; | |
463 | fChargedKaonEt = 0; | |
464 | fMuonEt = 0; | |
465 | fElectronEt = 0; | |
466 | fProtonEtAcc = 0; | |
467 | fChargedKaonEtAcc = 0; | |
468 | fMuonEtAcc = 0; | |
ce546038 | 469 | fElectronEtAcc = 0; |
43056f1b | 470 | fNeutronEt = 0; |
471 | fAntiNeutronEt = 0; | |
472 | fGammaEt = 0; | |
473 | ||
0065531a | 474 | if (!fCuts || !fPdgDB || fPiPlusCode==0) { // some Init's needed |
475 | cout << __FILE__ << ":" << __LINE__ << " : Init " << endl; | |
476 | if (!fCuts) { | |
477 | cout << " setting up Cuts " << endl; | |
478 | fCuts = new AliAnalysisEtCuts(); | |
479 | } | |
480 | if(!fPdgDB) { | |
481 | cout << " setting up PdgDB " << endl; | |
482 | fPdgDB = new TDatabasePDG(); | |
483 | } | |
0065531a | 484 | if (fPiPlusCode==0) { |
99a6613d | 485 | SetParticleCodes(); |
486 | } | |
0065531a | 487 | } |
488 | return; | |
2fbf38ac | 489 | } |
99a6613d | 490 | |
0065531a | 491 | |
99a6613d | 492 | void AliAnalysisEt::SetParticleCodes() |
cf6522d1 | 493 | { // set PDG info |
8985c506 | 494 | fPionMass = fPdgDB->GetParticle("pi+")->Mass(); |
495 | fPiPlusCode = fPdgDB->GetParticle("pi+")->PdgCode(); | |
496 | fPiMinusCode = fPdgDB->GetParticle("pi-")->PdgCode(); | |
497 | fKPlusCode = fPdgDB->GetParticle("K+")->PdgCode(); | |
498 | fKMinusCode = fPdgDB->GetParticle("K-")->PdgCode(); | |
499 | fProtonCode = fPdgDB->GetParticle("proton")->PdgCode(); | |
500 | fAntiProtonCode = fPdgDB->GetParticle("antiproton")->PdgCode(); | |
501 | fLambdaCode = fPdgDB->GetParticle("Lambda0")->PdgCode(); | |
502 | fAntiLambdaCode = fPdgDB->GetParticle("Lambda0_bar")->PdgCode(); | |
503 | fK0SCode = fPdgDB->GetParticle("K_S0")->PdgCode(); | |
504 | fOmegaCode = fPdgDB->GetParticle("Omega-")->PdgCode(); | |
505 | fAntiOmegaCode = fPdgDB->GetParticle("Omega+")->PdgCode(); | |
506 | fXi0Code = fPdgDB->GetParticle("Xi0")->PdgCode(); | |
507 | fAntiXi0Code = fPdgDB->GetParticle("Xi0_bar")->PdgCode(); | |
508 | fXiCode = fPdgDB->GetParticle("Xi-")->PdgCode(); | |
509 | fAntiXiCode = fPdgDB->GetParticle("Xi-_bar")->PdgCode(); | |
510 | fSigmaCode = fPdgDB->GetParticle("Sigma-")->PdgCode(); | |
511 | fAntiSigmaCode = fPdgDB->GetParticle("Sigma+")->PdgCode(); | |
512 | fK0LCode = fPdgDB->GetParticle("K_L0")->PdgCode(); | |
513 | fNeutronCode = fPdgDB->GetParticle("neutron")->PdgCode(); | |
514 | fAntiNeutronCode = fPdgDB->GetParticle("antineutron")->PdgCode(); | |
515 | fEPlusCode = fPdgDB->GetParticle("e+")->PdgCode(); | |
516 | fEMinusCode = fPdgDB->GetParticle("e-")->PdgCode(); | |
43056f1b | 517 | fGammaCode = fPdgDB->GetParticle("gamma")->PdgCode(); |
518 | ||
8985c506 | 519 | cout << "Resetting Codes: Pion " << fPiPlusCode |
520 | << "," << fPiMinusCode | |
521 | << " Kaon " << fKPlusCode | |
522 | << "," << fKMinusCode << endl; | |
99a6613d | 523 | } |
524 |