]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGLF/totEt/AliAnalysisEtMonteCarlo.cxx
bug fix for systematics
[u/mrichter/AliRoot.git] / PWGLF / totEt / AliAnalysisEtMonteCarlo.cxx
CommitLineData
cf6522d1 1//_________________________________________________________________________
2// Utility Class for transverse energy studies
3// Base class for MC analysis
4// - MC output
5// implementation file
6//
7//*-- Authors: Oystein Djuvsland (Bergen), David Silvermyr (ORNL)
e2ee5727 8//_________________________________________________________________________
cf6522d1 9
2fbf38ac 10#include "AliAnalysisEtMonteCarlo.h"
11#include "AliAnalysisEtCuts.h"
f61cec2f 12#include "AliAnalysisEtSelector.h"
13#include "AliAnalysisEtSelector.h"
13b0d3c1 14#include "AliESDtrack.h"
2fbf38ac 15#include "AliStack.h"
0651f6b4 16#include "AliVEvent.h"
2fbf38ac 17#include "AliMCEvent.h"
0651f6b4 18#include "AliESDEvent.h"
13b0d3c1 19#include "TH2F.h"
e2ee5727 20#include "TH3F.h"
cf6522d1 21#include "TParticle.h"
ce546038 22#include "AliGenHijingEventHeader.h"
23#include "AliGenPythiaEventHeader.h"
0651f6b4 24#include "TList.h"
25#include "AliESDCaloCluster.h"
0f6416f3 26#include "AliLog.h"
e2ee5727 27#include <iostream>
28#include <AliCentrality.h>
ef647350 29#include "AliPHOSGeoUtils.h"
30#include "AliPHOSGeometry.h"
31#include "TFile.h"
c79c36cc 32#include "AliESDtrackCuts.h"
e2ee5727 33using namespace std;
16abb579 34
35ClassImp(AliAnalysisEtMonteCarlo);
36
37
ce546038 38// ctor
0651f6b4 39AliAnalysisEtMonteCarlo::AliAnalysisEtMonteCarlo():AliAnalysisEt()
c79c36cc 40 ,fIsMC(kTRUE)
f61cec2f 41 ,fImpactParameter(0)
42 ,fNcoll(0)
43 ,fNpart(0)
44 ,fPrimaryTree(0)
45 ,fTotEtWithSecondaryRemoved(0)
46 ,fTotEtSecondaryFromEmEtPrimary(0)
47 ,fTotEtSecondary(0)
48 ,fPrimaryCode(0)
49 ,fPrimaryCharge(0)
50 ,fPrimaryE(0)
51 ,fPrimaryEt(0)
52 ,fPrimaryPx(0)
53 ,fPrimaryPy(0)
54 ,fPrimaryPz(0)
55 ,fPrimaryVx(0)
56 ,fPrimaryVy(0)
57 ,fPrimaryVz(0)
58 ,fPrimaryAccepted(0)
b2c10007 59 ,fPrimaryMatched(0)
f61cec2f 60 ,fDepositedCode(0)
b2c10007 61 ,fDepositedE(0)
f61cec2f 62 ,fDepositedEt(0)
63 ,fDepositedCharge(0)
64 ,fDepositedVx(0)
65 ,fDepositedVy(0)
66 ,fDepositedVz(0)
b2c10007 67 ,fSecondary(kFALSE)
68 ,fReconstructedE(0)
69 ,fReconstructedEt(0)
70 ,fTotPx(0)
71 ,fTotPy(0)
72 ,fTotPz(0)
73 ,fClusterMult(0)
f61cec2f 74 ,fHistDecayVertexNonRemovedCharged(0)
75 ,fHistDecayVertexRemovedCharged(0)
76 ,fHistDecayVertexNonRemovedNeutral(0)
77 ,fHistDecayVertexRemovedNeutral(0)
78
79 ,fHistRemovedOrNot(0)
80 ,fHistEtNonRemovedProtons(0)
81 ,fHistEtNonRemovedAntiProtons(0)
82 ,fHistEtNonRemovedPiPlus(0)
83 ,fHistEtNonRemovedPiMinus(0)
84 ,fHistEtNonRemovedKaonPlus(0)
85 ,fHistEtNonRemovedKaonMinus(0)
86 ,fHistEtNonRemovedK0s(0)
87 ,fHistEtNonRemovedK0L(0)
88 ,fHistEtNonRemovedLambdas(0)
89 ,fHistEtNonRemovedElectrons(0)
90 ,fHistEtNonRemovedPositrons(0)
91 ,fHistEtNonRemovedMuPlus(0)
92 ,fHistEtNonRemovedMuMinus(0)
93 ,fHistEtNonRemovedNeutrons(0)
94 ,fHistEtNonRemovedAntiNeutrons(0)
95 ,fHistEtNonRemovedGammas(0)
96 ,fHistEtNonRemovedGammasFromPi0(0)
97 ,fHistEtRemovedGammas(0)
98 ,fHistEtRemovedNeutrons(0)
99 ,fHistEtRemovedAntiNeutrons(0)
100 ,fHistEtRemovedCharged(0)
101 ,fHistEtRemovedNeutrals(0)
102 ,fHistEtNonRemovedCharged(0)
103 ,fHistEtNonRemovedNeutrals(0)
104 ,fHistMultNonRemovedProtons(0)
105 ,fHistMultNonRemovedAntiProtons(0)
106 ,fHistMultNonRemovedPiPlus(0)
107 ,fHistMultNonRemovedPiMinus(0)
108 ,fHistMultNonRemovedKaonPlus(0)
109 ,fHistMultNonRemovedKaonMinus(0)
110 ,fHistMultNonRemovedK0s(0)
111 ,fHistMultNonRemovedK0L(0)
112 ,fHistMultNonRemovedLambdas(0)
113 ,fHistMultNonRemovedElectrons(0)
114 ,fHistMultNonRemovedPositrons(0)
115 ,fHistMultNonRemovedMuPlus(0)
116 ,fHistMultNonRemovedMuMinus(0)
117 ,fHistMultNonRemovedNeutrons(0)
118 ,fHistMultNonRemovedAntiNeutrons(0)
119 ,fHistMultNonRemovedGammas(0)
120 ,fHistMultRemovedGammas(0)
121 ,fHistMultRemovedNeutrons(0)
122 ,fHistMultRemovedAntiNeutrons(0)
123 ,fHistMultRemovedCharged(0)
124 ,fHistMultRemovedNeutrals(0)
125 ,fHistMultNonRemovedCharged(0)
126 ,fHistMultNonRemovedNeutrals(0)
127 ,fHistTrackMultvsNonRemovedCharged(0)
128 ,fHistTrackMultvsNonRemovedNeutral(0)
129 ,fHistTrackMultvsRemovedGamma(0)
130 ,fHistClusterMultvsNonRemovedCharged(0)
131 ,fHistClusterMultvsNonRemovedNeutral(0)
132 ,fHistClusterMultvsRemovedGamma(0)
133 ,fHistMultvsNonRemovedChargedE(0)
134 ,fHistMultvsNonRemovedNeutralE(0)
03bfd268 135 ,fHistMultvsRemovedGammaE(0)
0861cc1f 136 ,fCalcForKaonCorrection(kFALSE)
137 ,fHistK0EDepositsVsPtInAcceptance(0)
138 ,fHistK0EGammaVsPtInAcceptance(0)
139 ,fHistK0EDepositsVsPtOutOfAcceptance(0)
140 ,fHistK0EGammaVsPtOutOfAcceptance(0)
141 ,fHistSimKaonsInAcceptance(0)
142 ,fHistSimK0SInAcceptance(0)
143 ,fHistSimKPlusInAcceptance(0)
144 ,fHistSimKMinusInAcceptance(0)
145 ,fHistSimK0LInAcceptance(0)
146 ,fHistSimKaonsOutOfAcceptance(0)
147 ,fHistSimKaonsInAcceptanceWithDepositsPrimaries(0)
148 ,fHistSimKaonsOutOfAcceptanceWithDepositsSecondaries(0)
149 ,fHistSimKaonsOutOfAcceptanceWithDepositsPrimaries(0)
f61cec2f 150 ,fEtNonRemovedProtons(0)
151 ,fEtNonRemovedAntiProtons(0)
152 ,fEtNonRemovedPiPlus(0)
153 ,fEtNonRemovedPiMinus(0)
154 ,fEtNonRemovedKaonPlus(0)
155 ,fEtNonRemovedKaonMinus(0)
156 ,fEtNonRemovedK0S(0)
157 ,fEtNonRemovedK0L(0)
158 ,fEtNonRemovedLambdas(0)
159 ,fEtNonRemovedElectrons(0)
160 ,fEtNonRemovedPositrons(0)
161 ,fEtNonRemovedMuMinus(0)
162 ,fEtNonRemovedMuPlus(0)
163 ,fEtNonRemovedGammas(0)
164 ,fEtNonRemovedGammasFromPi0(0)
165 ,fEtNonRemovedNeutrons(0)
166 ,fEtNonRemovedAntiNeutrons(0)
167 ,fEtRemovedProtons(0)
168 ,fEtRemovedAntiProtons(0)
169 ,fEtRemovedPiPlus(0)
170 ,fEtRemovedPiMinus(0)
171 ,fEtRemovedKaonPlus(0)
172 ,fEtRemovedKaonMinus(0)
173 ,fEtRemovedK0s(0)
174 ,fEtRemovedK0L(0)
175 ,fEtRemovedLambdas(0)
176 ,fEtRemovedElectrons(0)
177 ,fEtRemovedPositrons(0)
178 ,fEtRemovedMuMinus(0)
179 ,fEtRemovedMuPlus(0)
180 ,fEtRemovedGammasFromPi0(0)
181 ,fEtRemovedGammas(0)
182 ,fEtRemovedNeutrons(0)
183 ,fEtRemovedAntiNeutrons(0)
184 ,fMultNonRemovedProtons(0)
185 ,fMultNonRemovedAntiProtons(0)
186 ,fMultNonRemovedPiPlus(0)
187 ,fMultNonRemovedPiMinus(0)
188 ,fMultNonRemovedKaonPlus(0)
189 ,fMultNonRemovedKaonMinus(0)
190 ,fMultNonRemovedK0s(0)
191 ,fMultNonRemovedK0L(0)
192 ,fMultNonRemovedLambdas(0)
193 ,fMultNonRemovedElectrons(0)
194 ,fMultNonRemovedPositrons(0)
195 ,fMultNonRemovedMuMinus(0)
196 ,fMultNonRemovedMuPlus(0)
197 ,fMultNonRemovedGammas(0)
198 ,fMultNonRemovedNeutrons(0)
199 ,fMultNonRemovedAntiNeutrons(0)
200 ,fMultRemovedProtons(0)
201 ,fMultRemovedAntiProtons(0)
202 ,fMultRemovedPiPlus(0)
203 ,fMultRemovedPiMinus(0)
204 ,fMultRemovedKaonPlus(0)
205 ,fMultRemovedKaonMinus(0)
206 ,fMultRemovedK0s(0)
207 ,fMultRemovedK0L(0)
208 ,fMultRemovedLambdas(0)
209 ,fMultRemovedElectrons(0)
210 ,fMultRemovedPositrons(0)
211 ,fMultRemovedMuMinus(0)
212 ,fMultRemovedMuPlus(0)
213 ,fMultRemovedGammas(0)
214 ,fMultRemovedNeutrons(0)
215 ,fMultRemovedAntiNeutrons(0)
216 ,fTrackMultInAcc(0)
217 ,fHistDxDzNonRemovedCharged(0)
218 ,fHistDxDzRemovedCharged(0)
219 ,fHistDxDzNonRemovedNeutral(0)
220 ,fHistDxDzRemovedNeutral(0)
221 ,fHistPiPlusMult(0)
222 ,fHistPiMinusMult(0)
223 ,fHistPiZeroMult(0)
224 ,fHistPiPlusMultAcc(0)
225 ,fHistPiMinusMultAcc(0)
226 ,fHistPiZeroMultAcc(0)
b2c10007 227// ,fPiPlusMult(0)
228// ,fPiMinusMult(0)
f61cec2f 229 ,fPiZeroMult(0)
230 ,fPiPlusMultAcc(0)
231 ,fPiMinusMultAcc(0)
232 ,fPiZeroMultAcc(0)
233 ,fNeutralRemoved(0)
234 ,fChargedRemoved(0)
235 ,fChargedNotRemoved(0)
236 ,fNeutralNotRemoved(0)
b2c10007 237 ,fGammaRemoved(0)
238 ,fSecondaryNotRemoved(0)
f61cec2f 239 ,fEnergyNeutralRemoved(0)
240 ,fEnergyChargedRemoved(0)
241 ,fEnergyChargedNotRemoved(0)
242 ,fEnergyNeutralNotRemoved(0)
b2c10007 243 ,fEnergyGammaRemoved(0)
f61cec2f 244 ,fNClusters(0)
245 ,fTotNeutralEtAfterMinEnergyCut(0)
0861cc1f 246 ,fCalcTrackMatchVsMult(kFALSE)
247 ,fHistGammasFound(0)
9ef6f13f 248 ,fHistGammasGenerated(0)
5881f036 249 ,fHistGammasFoundCent(0)
9a365626 250 ,fHistGammasFoundOutOfAccCent(0)
5881f036 251 ,fHistGammasGeneratedCent(0)
9ef6f13f 252 ,fHistChargedTracksCut(0)
253 ,fHistChargedTracksAccepted(0)
254 ,fHistGammasCut(0)
255 ,fHistGammasAccepted(0)
0861cc1f 256 ,fHistChargedTracksCutMult(0)
257 ,fHistChargedTracksAcceptedMult(0)
ac610b08 258 ,fHistChargedTracksAcceptedLowPtCent(0)
5881f036 259 ,fHistChargedTracksAcceptedLowPtCent500MeV(0)
ac610b08 260 ,fHistChargedTracksAcceptedLowPtCentNoAntiProtons(0)
261 ,fHistChargedTracksAcceptedLowPtCentAntiProtons(0)
0861cc1f 262 ,fHistGammasCutMult(0)
263 ,fHistGammasAcceptedMult(0)
9ef6f13f 264 ,fHistBadTrackMatches(0)
265 ,fHistMatchedTracksEvspTBkgd(0)
266 ,fHistMatchedTracksEvspTSignal(0)
267 ,fHistMatchedTracksEvspTBkgdPeripheral(0)
268 ,fHistMatchedTracksEvspTSignalPeripheral(0)
ac610b08 269 ,fHistMatchedTracksEvspTBkgdvsCent(0)
270 ,fHistMatchedTracksEvspTSignalvsCent(0)
271 ,fHistMatchedTracksEvspTBkgdvsCentEffCorr(0)
272 ,fHistMatchedTracksEvspTSignalvsCentEffCorr(0)
0861cc1f 273
9ef6f13f 274 ,fHistChargedTracksCutPeripheral(0)
275 ,fHistChargedTracksAcceptedPeripheral(0)
276 ,fHistGammasCutPeripheral(0)
277 ,fHistGammasAcceptedPeripheral(0)
278 ,fHistBadTrackMatchesdPhidEta(0)
279 ,fHistGoodTrackMatchesdPhidEta(0)
c79c36cc 280 ,fHistHadronDepositsAll(0)
281 ,fHistHadronDepositsReco(0)
ac610b08 282 ,fHistHadronDepositsAllCent(0)
5881f036 283 ,fHistHadronDepositsAllCent500MeV(0)
ac610b08 284 ,fHistHadronDepositsRecoCent(0)
285 ,fHistHadronsAllCent(0)
d3ce32b8 286 ,fHistMultChVsSignalVsMult(0)
9a365626 287 ,fHistNeutralRemovedSecondaryEtVsCent(0)
288 ,fHistChargedRemovedSecondaryEtVsCent(0)
289 ,fHistNeutralNotRemovedSecondaryEtVsCent(0)
290 ,fHistChargedNotRemovedSecondaryEtVsCent(0)
291 ,fHistNeutralRemovedSecondaryNumVsNCluster(0)
292 ,fHistChargedRemovedSecondaryNumVsNCluster(0)
293 ,fHistNeutralNotRemovedSecondaryNumVsNCluster(0)
294 ,fHistChargedNotRemovedSecondaryNumVsNCluster(0)
295 ,fHistNeutralRemovedSecondaryNumVsCent(0)
296 ,fHistChargedRemovedSecondaryNumVsCent(0)
297 ,fHistNeutralNotRemovedSecondaryNumVsCent(0)
298 ,fHistChargedNotRemovedSecondaryNumVsCent(0)
299 ,fHistNeutronsEtVsCent(0)
300 ,fHistNeutronsNumVsCent(0)
301 ,fHistNotNeutronsNumVsCent(0)
302 ,fHistPiKPDepositedVsNch(0)
303 ,fHistPiKPNotTrackMatchedDepositedVsNch(0)
304 ,fHistNeutronsDepositedVsNch(0)
305 ,fHistAntiNeutronsDepositedVsNch(0)
306 ,fHistProtonsDepositedVsNch(0)
307 ,fHistAntiProtonsDepositedVsNch(0)
308 ,fHistProtonsNotTrackMatchedDepositedVsNch(0)
309 ,fHistAntiProtonsNotTrackMatchedDepositedVsNch(0)
310 ,fHistSecondariesVsNch(0)
311 ,fHistSecondariesVsNcl(0)
312 ,fHistSecondariesEffCorrVsNch(0)
313 ,fHistSecondariesEffCorrVsNcl(0)
314 ,fHistCentVsNchVsNcl(0)
03cff249 315 ,fHistSecondaryPositionInDetector(0)
ce546038 316{
317}
318
319// dtor
e2ee5727 320AliAnalysisEtMonteCarlo::~AliAnalysisEtMonteCarlo()
f61cec2f 321{ //Destructor
311c6540 322
323 if(fPrimaryTree){
324 fPrimaryTree->Clear();
325 delete fPrimaryTree;
326 }
f61cec2f 327 delete fHistDecayVertexNonRemovedCharged; // Decay vertex for non-removed charged particles
328 delete fHistDecayVertexRemovedCharged; // Decay vertex for non-removed charged particles
329 delete fHistDecayVertexNonRemovedNeutral; // Decay vertex for non-removed charged particles
330 delete fHistDecayVertexRemovedNeutral; // Decay vertex for non-removed charged particles
331
332 delete fHistRemovedOrNot; // If charged/neutral particles were removed or not
333
334 delete fHistEtNonRemovedProtons; // enter comment here
335 delete fHistEtNonRemovedAntiProtons; // enter comment here
336 delete fHistEtNonRemovedPiPlus; // enter comment here
337 delete fHistEtNonRemovedPiMinus; // enter comment here
338 delete fHistEtNonRemovedKaonPlus; // enter comment here
339 delete fHistEtNonRemovedKaonMinus; // enter comment here
340 delete fHistEtNonRemovedK0s; // enter comment here
341 delete fHistEtNonRemovedK0L; // enter comment here
342 delete fHistEtNonRemovedLambdas; // enter comment here
343 delete fHistEtNonRemovedElectrons; // enter comment here
344 delete fHistEtNonRemovedPositrons; // enter comment here
345 delete fHistEtNonRemovedMuPlus; // enter comment here
346 delete fHistEtNonRemovedMuMinus; // enter comment here
347 delete fHistEtNonRemovedNeutrons; // enter comment here
348 delete fHistEtNonRemovedAntiNeutrons; // enter comment here
349 delete fHistEtNonRemovedGammas; // enter comment here
350 delete fHistEtNonRemovedGammasFromPi0; // enter comment here
351
352 delete fHistEtRemovedGammas; // enter comment here
353 delete fHistEtRemovedNeutrons; // enter comment here
354 delete fHistEtRemovedAntiNeutrons; // enter comment here
355
356
357 delete fHistMultNonRemovedProtons; // enter comment here
358 delete fHistMultNonRemovedAntiProtons; // enter comment here
359 delete fHistMultNonRemovedPiPlus; // enter comment here
360 delete fHistMultNonRemovedPiMinus; // enter comment here
361 delete fHistMultNonRemovedKaonPlus; // enter comment here
362 delete fHistMultNonRemovedKaonMinus; // enter comment here
363 delete fHistMultNonRemovedK0s; // enter comment here
364 delete fHistMultNonRemovedK0L; // enter comment here
365 delete fHistMultNonRemovedLambdas; // enter comment here
366 delete fHistMultNonRemovedElectrons; // enter comment here
367 delete fHistMultNonRemovedPositrons; // enter comment here
368 delete fHistMultNonRemovedMuPlus; // enter comment here
369 delete fHistMultNonRemovedMuMinus; // enter comment here
370 delete fHistMultNonRemovedNeutrons; // enter comment here
371 delete fHistMultNonRemovedAntiNeutrons; // enter comment here
372 delete fHistMultNonRemovedGammas; // enter comment here
373
374 delete fHistMultRemovedGammas; // enter comment here
375 delete fHistMultRemovedNeutrons; // enter comment here
376 delete fHistMultRemovedAntiNeutrons; // enter comment here
377
378 delete fHistTrackMultvsNonRemovedCharged; // enter comment here
379 delete fHistTrackMultvsNonRemovedNeutral; // enter comment here
380 delete fHistTrackMultvsRemovedGamma; // enter comment here
381
382 delete fHistClusterMultvsNonRemovedCharged; // enter comment here
383 delete fHistClusterMultvsNonRemovedNeutral; // enter comment here
384 delete fHistClusterMultvsRemovedGamma; // enter comment here
385
386 delete fHistMultvsNonRemovedChargedE; // enter comment here
387 delete fHistMultvsNonRemovedNeutralE; // enter comment here
388 delete fHistMultvsRemovedGammaE; // enter comment here
0861cc1f 389 delete fHistK0EDepositsVsPtInAcceptance;//enter comment here
390 delete fHistK0EGammaVsPtInAcceptance;//enter comment here
391 delete fHistK0EDepositsVsPtOutOfAcceptance;
392 delete fHistK0EGammaVsPtOutOfAcceptance;
393
394 delete fHistSimKaonsInAcceptance;
395 delete fHistSimK0SInAcceptance;
396 delete fHistSimKPlusInAcceptance;
397 delete fHistSimKMinusInAcceptance;
398 delete fHistSimK0LInAcceptance;
399 delete fHistSimKaonsOutOfAcceptance;
400 delete fHistSimKaonsInAcceptanceWithDepositsPrimaries;
401 delete fHistSimKaonsOutOfAcceptanceWithDepositsSecondaries;
402 delete fHistSimKaonsOutOfAcceptanceWithDepositsPrimaries;
2aab9269 403
f61cec2f 404 delete fHistDxDzNonRemovedCharged; // enter comment here
405 delete fHistDxDzRemovedCharged; // enter comment here
406 delete fHistDxDzNonRemovedNeutral; // enter comment here
407 delete fHistDxDzRemovedNeutral; // enter comment here
408
409 delete fHistPiPlusMult; // enter comment here
410 delete fHistPiMinusMult; // enter comment here
411 delete fHistPiZeroMult; // enter comment here
412
413 delete fHistPiPlusMultAcc; // enter comment here
414 delete fHistPiMinusMultAcc; // enter comment here
415 delete fHistPiZeroMultAcc; // enter comment here
4503e29d 416 delete fHistGammasFound; // enter comment here
417 delete fHistGammasGenerated; // enter comment here
9a365626 418 delete fHistGammasFoundOutOfAccCent; // enter comment here
5881f036 419 delete fHistGammasFoundCent; // enter comment here
420 delete fHistGammasGeneratedCent; // enter comment here
9ef6f13f 421 delete fHistChargedTracksCut;
422 delete fHistChargedTracksAccepted;
423 delete fHistGammasCut;
424 delete fHistGammasAccepted;
0861cc1f 425 delete fHistChargedTracksCutMult;
426 delete fHistChargedTracksAcceptedMult;
ac610b08 427 delete fHistChargedTracksAcceptedLowPtCent;
5881f036 428 delete fHistChargedTracksAcceptedLowPtCent500MeV;
ac610b08 429 delete fHistChargedTracksAcceptedLowPtCentNoAntiProtons;
430 delete fHistChargedTracksAcceptedLowPtCentAntiProtons;
0861cc1f 431 delete fHistGammasCutMult;
432 delete fHistGammasAcceptedMult;
9ef6f13f 433 delete fHistBadTrackMatches;
434 delete fHistMatchedTracksEvspTBkgd;
435 delete fHistMatchedTracksEvspTSignal;
436 delete fHistMatchedTracksEvspTBkgdPeripheral;
437 delete fHistMatchedTracksEvspTSignalPeripheral;
ac610b08 438 delete fHistMatchedTracksEvspTBkgdvsCent;
439 delete fHistMatchedTracksEvspTSignalvsCent;
440 delete fHistMatchedTracksEvspTBkgdvsCentEffCorr;
441 delete fHistMatchedTracksEvspTSignalvsCentEffCorr;
9ef6f13f 442 delete fHistChargedTracksCutPeripheral;
443 delete fHistChargedTracksAcceptedPeripheral;
444 delete fHistGammasCutPeripheral;
445 delete fHistGammasAcceptedPeripheral;
446 delete fHistBadTrackMatchesdPhidEta;
447 delete fHistGoodTrackMatchesdPhidEta;
c79c36cc 448 delete fHistHadronDepositsAll;
449 delete fHistHadronDepositsReco;
ac610b08 450 delete fHistHadronDepositsAllCent;
5881f036 451 delete fHistHadronDepositsAllCent500MeV;
ac610b08 452 delete fHistHadronDepositsRecoCent;
453 delete fHistHadronsAllCent;
d3ce32b8 454 delete fHistMultChVsSignalVsMult;
9a365626 455 delete fHistNeutralRemovedSecondaryEtVsCent;
456 delete fHistChargedRemovedSecondaryEtVsCent;
457 delete fHistNeutralNotRemovedSecondaryEtVsCent;
458 delete fHistChargedNotRemovedSecondaryEtVsCent;
459 delete fHistNeutralRemovedSecondaryNumVsNCluster;
460 delete fHistChargedRemovedSecondaryNumVsNCluster;
461 delete fHistNeutralNotRemovedSecondaryNumVsNCluster;
462 delete fHistChargedNotRemovedSecondaryNumVsNCluster;
463 delete fHistNeutralRemovedSecondaryNumVsCent;
464 delete fHistChargedRemovedSecondaryNumVsCent;
465 delete fHistNeutralNotRemovedSecondaryNumVsCent;
466 delete fHistChargedNotRemovedSecondaryNumVsCent;
467 delete fHistNeutronsEtVsCent;
468 delete fHistNeutronsNumVsCent;
469 delete fHistNotNeutronsNumVsCent;
470 delete fHistPiKPDepositedVsNch;
471 delete fHistPiKPNotTrackMatchedDepositedVsNch;
472 delete fHistNeutronsDepositedVsNch;
473 delete fHistAntiNeutronsDepositedVsNch;
474 delete fHistProtonsDepositedVsNch;
475 delete fHistAntiProtonsDepositedVsNch;
476 delete fHistProtonsNotTrackMatchedDepositedVsNch;
477 delete fHistAntiProtonsNotTrackMatchedDepositedVsNch;
478 delete fHistSecondariesVsNch;
479 delete fHistSecondariesVsNcl;
480 delete fHistSecondariesEffCorrVsNch;
481 delete fHistSecondariesEffCorrVsNcl;
482 delete fHistCentVsNchVsNcl;
03cff249 483 delete fHistSecondaryPositionInDetector;
ce546038 484}
2fbf38ac 485
486Int_t AliAnalysisEtMonteCarlo::AnalyseEvent(AliVEvent* ev)
f61cec2f 487{ // analyse MC event
c79c36cc 488 if(!fIsMC) return 0;
e2ee5727 489 ResetEventValues();
490
b2c10007 491
e2ee5727 492 fPiPlusMult = 0;
493 fPiMinusMult = 0;
494 fPiZeroMult = 0;
495 if (fCentrality)
496 {
ac610b08 497 fCentClass = fCentrality->GetCentralityClass5(fCentralityMethod);
e2ee5727 498
499 }
e2ee5727 500
501 // Get us an mc event
502 if (!ev) {
503 AliFatal("ERROR: Event does not exist");
504 return 0;
505 }
506 AliMCEvent *event = dynamic_cast<AliMCEvent*>(ev);
507 if (!event) {
508 AliFatal("ERROR: MC Event does not exist");
509 return 0;
510 }
511
512 Double_t protonMass =fgProtonMass;
513
514 // Hijing header
515 AliGenEventHeader* genHeader = event->GenEventHeader();
516 if (!genHeader) {
517 Printf("ERROR: Event generation header does not exist");
518 return 0;
519 }
520 AliGenHijingEventHeader* hijingGenHeader = dynamic_cast<AliGenHijingEventHeader*>(genHeader);
521 if (hijingGenHeader) {
522 fImpactParameter = hijingGenHeader->ImpactParameter();
523 fNcoll = hijingGenHeader->HardScatters(); // or should this be some combination of NN() NNw() NwN() NwNw() ?
524 fNpart = hijingGenHeader->ProjectileParticipants() + hijingGenHeader->TargetParticipants();
f61cec2f 525 }
526
e2ee5727 527 // Let's play with the stack!
528 AliStack *stack = event->Stack();
529
530 Int_t nPrim = stack->GetNtrack();
531
532 Int_t partCount = 0;
533 for (Int_t iPart = 0; iPart < nPrim; iPart++)
2fbf38ac 534 {
e2ee5727 535
536 TParticle *part = stack->Particle(iPart);
b2c10007 537
538
e2ee5727 539
540 if (!part)
541 {
542 Printf("ERROR: Could not get particle %d", iPart);
543 continue;
544 }
e2ee5727 545 TParticlePDG *pdg = part->GetPDG(0);
e2ee5727 546
f61cec2f 547 if (!pdg)
2fbf38ac 548 {
f61cec2f 549 Printf("ERROR: Could not get particle PDG %d", iPart);
e2ee5727 550 continue;
2fbf38ac 551 }
552
e2ee5727 553 Double_t particleMassPart = 0; //The mass part in the Et calculation for this particle
f61cec2f 554 Int_t code = pdg->PdgCode();
b2c10007 555
556 if(stack->IsPhysicalPrimary(iPart))
557 {
558 fTotPx += part->Px();
559 fTotPy += part->Py();
560 fTotPz += part->Pz();
561 }
562
e2ee5727 563 // Check for reasonable (for now neutral and singly charged) charge on the particle
86e7d5db 564 if (fSelector->IsNeutralMcParticle(iPart,*stack,*pdg))
e2ee5727 565 {
566
567 fMultiplicity++;
b2c10007 568// PrintFamilyTree(iPart, stack);
f61cec2f 569//
e2ee5727 570 if (TMath::Abs(part->Eta()) < fCuts->GetCommonEtaCut())
2fbf38ac 571 {
f61cec2f 572 //Printf("Particle with eta: %f, pid: %d", part->Eta(), code);
e2ee5727 573 // calculate E_T
574 if (
ef647350 575 TMath::Abs(code) == fgProtonCode ||
576 TMath::Abs(code) == fgNeutronCode ||
577 TMath::Abs(code) == fgLambdaCode ||
578 TMath::Abs(code) == fgXiCode ||
579 TMath::Abs(code) == fgXi0Code ||
580 TMath::Abs(code) == fgOmegaCode
e2ee5727 581 )
582 {
ef647350 583 if (code > 0) {
e2ee5727 584 particleMassPart = - protonMass;
585 }
ef647350 586 if (code < 0) {
e2ee5727 587 particleMassPart = protonMass;
588 }
589 }
590 Double_t et = part->Energy() * TMath::Sin(part->Theta()) + particleMassPart;
591
e2ee5727 592
6a152780 593// // Fill up total E_T counters for each particle species
594// if (code == fgProtonCode || code == fgAntiProtonCode)
595// {
596// }
597// if (code == fgPiPlusCode || code == fgPiMinusCode)
598// {
599// if (code == fgPiPlusCode)
600// {
601// }
602// else
603// {
604// }
605// }
606// if (code == fgGammaCode)
607// {
608// }
609// if (code == fgKPlusCode)
610// {
611// }
612// if(code == fgKMinusCode)
613// {
614// }
615// if (code == fgMuPlusCode || code == fgMuMinusCode)
616// {
617// }
618// if (code == fgEPlusCode || code == fgEMinusCode)
619// {
620// }
621// // some neutrals also
622// if (code == fgNeutronCode)
623// {
624// }
625// if (code == fgAntiNeutronCode)
626// {
627// }
628// if (code == fgGammaCode)
629// {
630// }
e2ee5727 631
632 // Neutral particles
ef647350 633 //if (TMath::Abs(pdg->Charge() - fCuts->GetMonteCarloNeutralParticle()) <1e-3 )
f61cec2f 634
ef647350 635 if(code == fgGammaCode || code == fgPi0Code || code == fgEtaCode)
e2ee5727 636 {
b2c10007 637 // PrintFamilyTree(iPart,stack);
f61cec2f 638 //Printf("Gamma, phi: %f, eta: %f, phi cut min: %f, phi cut max: %f, eta cut: %f", part->Phi(), part->Eta(), fPhiMinCutAcc, fPhiMaxCutAcc, fEtaCutAcc);
639 //if (et > fCuts->GetCommonClusterEnergyCut()) fTotNeutralEt += et;
e2ee5727 640
641 // inside EMCal acceptance
f61cec2f 642
643 //if (TMath::Abs(part->Eta()) < fEtaCutAcc && part->Phi() < fPhiMaxCutAcc && part->Phi() > fPhiMinCutAcc)
644
b2c10007 645 if(fSelector->CutGeometricalAcceptance(*part) )
e2ee5727 646 {
647 fNeutralMultiplicity++;
f61cec2f 648 fTotNeutralEt += et;
86e7d5db 649 if(fSelector->PassMinEnergyCut(*part))
f61cec2f 650 {
651 fTotNeutralEtAfterMinEnergyCut += et;
652 }
e2ee5727 653 if (part->Energy() > 0.05) partCount++;
e2ee5727 654 }
655 }
656 //Charged particles
657 else if (TMath::Abs( pdg->Charge() - fCuts->GetMonteCarloNeutralParticle())>1e-3 )
658 {
e2ee5727 659
660 // inside EMCal acceptance
f61cec2f 661 if (fSelector->CutGeometricalAcceptance(*part))
e2ee5727 662 {
f61cec2f 663
664 fChargedMultiplicity++;
665
666 fTotChargedEt += et;
e2ee5727 667
ef647350 668 if (code == fgProtonCode || code == fgAntiProtonCode)
e2ee5727 669 {
e2ee5727 670 }
ef647350 671 if (code == fgPiPlusCode || code == fgPiMinusCode)
e2ee5727 672 {
e2ee5727 673 }
ef647350 674 if (code == fgKPlusCode || code == fgKMinusCode)
e2ee5727 675 {
e2ee5727 676 }
ef647350 677 if (code == fgMuPlusCode || code == fgMuMinusCode)
e2ee5727 678 {
e2ee5727 679 }
f61cec2f 680
ef647350 681 if (code == fgEPlusCode || code == fgEMinusCode)
e2ee5727 682 {
f61cec2f 683 fTotNeutralEt += et; // calling electrons neutral
684 fTotChargedEt -= et;
e1fa1966 685 }
e2ee5727 686 } // inside EMCal acceptance
687
e2ee5727 688 if (TrackHitsCalorimeter(part)) // magnetic field info not filled?
689 {
690 if (pdg->Charge() > 0) fHistPhivsPtPos->Fill(part->Phi(),part->Pt());
691 else fHistPhivsPtNeg->Fill(part->Phi(), part->Pt());
692 }
693 }
694 }
695
696 }
2fbf38ac 697 }
b2c10007 698 // std::cout << "Total: p_x = " << fTotPx << ", p_y = " << fTotPy << ", p_z = " << fTotPz << std::endl;
e2ee5727 699 fTotEt = fTotChargedEt + fTotNeutralEt;
f61cec2f 700 //fTotEtAcc = fTotChargedEtAcc + fTotNeutralEtAcc;//
e2ee5727 701 //std::cout << "Event done! # of particles: " << partCount << std::endl;
702 return 0;
2fbf38ac 703}
0651f6b4 704//Int_t AliAnalysisEtMonteCarlo::AnalyseEvent(AliMCEvent* mcEvent,AliESDEvent* realEvent)
705Int_t AliAnalysisEtMonteCarlo::AnalyseEvent(AliVEvent* ev,AliVEvent* ev2)
f61cec2f 706{ // analyse MC and real event info
e2ee5727 707 //if(!mcEvent || !realEvent){
c79c36cc 708 if(!fIsMC) return 0;
e2ee5727 709 if (!ev || !ev2) {
710 AliFatal("ERROR: Event does not exist");
711 return 0;
712 }
f61cec2f 713 AliAnalysisEt::AnalyseEvent(ev);
e2ee5727 714 AliMCEvent *mcEvent = dynamic_cast<AliMCEvent*>(ev);
715 AliESDEvent *realEvent = dynamic_cast<AliESDEvent*>(ev2);
716 if (!mcEvent || !realEvent) {
717 AliFatal("ERROR: mcEvent or realEvent does not exist");
b2c10007 718
e2ee5727 719 }
720
b2c10007 721 std::vector<Int_t> foundGammas;
722
f61cec2f 723 fSelector->SetEvent(realEvent);
724
725 AnalyseEvent(ev);
726
e2ee5727 727 AliStack *stack = mcEvent->Stack();
728
9ef6f13f 729 // get all detector clusters
f61cec2f 730 // TRefArray* caloClusters = new TRefArray();
731
732// if (fDetector == fCuts->GetDetectorEmcal()) realEvent->GetEMCALClusters( caloClusters );
733 //else if (fDetector == fCuts->GetDetectorPhos()) realEvent->GetPHOSClusters( caloClusters );
734 //else {
735 //AliFatal("Detector ID has not been specified");
736 //return -1;
737// }
738
4503e29d 739//Note that this only returns clusters for the selected detector. fSelector actually calls the right GetClusters... for the detector
cfe23ff0 740//It does not apply any cuts on these clusters
f61cec2f 741 TRefArray *caloClusters = fSelector->GetClusters();
e2ee5727 742
e2ee5727 743 Int_t nCluster = caloClusters->GetEntries();
b2c10007 744 fClusterMult = nCluster;
ef647350 745 fNClusters = 0;
d3ce32b8 746 Int_t fClusterMultChargedTracks = 0;
747 Int_t fClusterMultGammas = 0;
9a365626 748 Int_t nChargedSecondariesRemoved = 0;
749 Int_t nChargedSecondariesNotRemoved = 0;
750 Int_t nNeutralSecondariesRemoved = 0;
751 Int_t nNeutralSecondariesNotRemoved = 0;
752 Int_t nNeutrons = 0;
753 Int_t nNotNeutrons = 0;
754 //All efficiency corrected except etSecondaries -->
755 Float_t etPiKPDeposited = 0.0;//
756 Float_t etPiKPDepositedNotTrackMatched = 0.0;//
757 Float_t etProtonDepositedNotTrackMatched = 0.0;//
758 Float_t etAntiProtonDepositedNotTrackMatched = 0.0;//
759 //Float_t etPIDProtonDepositedNotTrackMatched = 0.0;//Still has to be filled!
03cff249 760 //1Float_t etPIDAntiProtonDepositedNotTrackMatched = 0.0;//Still has to be filled
9a365626 761 Float_t etProtonDeposited = 0.0;//
762 Float_t etAntiProtonDeposited = 0.0;//
763 Float_t etNeutronDeposited = 0.0;
764 Float_t etAntiNeutronDeposited = 0.0;
765 Float_t etSecondaries = 0.0;
766 Float_t etSecondariesEffCorr = 0.0;
767 Float_t multiplicity = fEsdtrackCutsTPC->GetReferenceMultiplicity(realEvent,kTRUE);
e2ee5727 768 // loop the clusters
769 for (int iCluster = 0; iCluster < nCluster; iCluster++ )
770 {
f61cec2f 771 Int_t cf = 0;
e2ee5727 772 AliESDCaloCluster* caloCluster = ( AliESDCaloCluster* )caloClusters->At( iCluster );
2aab9269 773 //Float_t caloE = caloCluster->E()
5881f036 774 if (!fSelector->CutGeometricalAcceptance(*caloCluster)) continue;
f61cec2f 775 fNClusters++;
b2c10007 776 const UInt_t iPart = (UInt_t)TMath::Abs(caloCluster->GetLabel());
ef647350 777 TParticle *part = stack->Particle(iPart);
e2ee5727 778
779 if (!part)
0651f6b4 780 {
e2ee5727 781 Printf("No MC particle %d", iCluster);
782 continue;
783 }
9ef6f13f 784
f61cec2f 785 int primIdx = iPart;
e2ee5727 786 if (!stack->IsPhysicalPrimary(iPart)) // check whether particle is primary. we keep secondary electron and gamma for testing.
787 {
f61cec2f 788 primIdx = GetPrimMother(iPart, stack);
b2c10007 789 if(primIdx != stack->GetPrimary(iPart))
790 {
791 //std::cout << primIdx << " = " << stack->GetPrimary(iPart) << std::endl;
792 //PrintFamilyTree(iPart, stack);
793 }
2aab9269 794 //if it is from a K0S
f61cec2f 795 if(primIdx < 0)
796 {
ac610b08 797 //std::cout << "What!? No primary?" << std::endl;
798 //PrintFamilyTree(iPart, stack);
9ef6f13f 799 //continue;
800 //This is a work around to fix a bug. For the EMCal when you use the tender supply, the parent particle ID gets messed up.
801 primIdx = iPart;
f61cec2f 802 }
803
e2ee5727 804 } // end of primary particle check
a0dcb3c1 805 //const int primCode = stack->Particle(primIdx)->GetPdgCode();
ef647350 806 TParticlePDG *pdg = part->GetPDG();
f61cec2f 807 if (!pdg)
ef647350 808 {
809 Printf("ERROR: Could not get particle PDG %d", iPart);
810 continue;
f61cec2f 811 }
e2ee5727 812
a0dcb3c1 813 //Int_t code = pdg->PdgCode();
53ad5ec1 814// if(primCode == fgGammaCode)
815// {
816
d3ce32b8 817
818
819 Bool_t nottrackmatched = kTRUE;//default to no track matched
6a152780 820 Float_t matchedTrackp = 0.0;
821 Float_t matchedTrackpt = 0.0;
d3ce32b8 822 nottrackmatched = fSelector->PassTrackMatchingCut(*caloCluster);
823 //by default ALL matched tracks are accepted, whether or not the match is good. So we check to see if the track is good.
584f2478 824 if(!nottrackmatched){//if the track is trackmatched
d3ce32b8 825 Int_t trackMatchedIndex = caloCluster->GetTrackMatchedIndex();
826 if(trackMatchedIndex < 0) nottrackmatched=kTRUE;
827 AliESDtrack *track = realEvent->GetTrack(trackMatchedIndex);
6a152780 828 matchedTrackp = track->P();
829 matchedTrackpt = track->Pt();
d3ce32b8 830 //if this is a good track, accept track will return true. The track matched is good, so not track matched is false
584f2478 831 nottrackmatched = !(fEsdtrackCutsTPC->AcceptTrack(track));//if the track is bad, this is track matched
6a152780 832 //if(!nottrackmatched) cout<<"Matched track p: "<<matchedTrackp<<" sim "<<part->P()<<endl;
d3ce32b8 833 }
834
835
a0dcb3c1 836 for(UInt_t i = 0; i < caloCluster->GetNLabels(); i++)
b2c10007 837 {
53ad5ec1 838 Int_t pIdx = caloCluster->GetLabelAt(i);
5881f036 839
0861cc1f 840 //TParticle *p = stack->Particle(pIdx);
841
53ad5ec1 842 if(!stack->IsPhysicalPrimary(pIdx))
843 {
0861cc1f 844// PrintFamilyTree(pIdx, stack);
53ad5ec1 845 pIdx = GetPrimMother(pIdx, stack);
846 }
0861cc1f 847 if(fSelector->PassDistanceToBadChannelCut(*caloCluster))//&&fSelector->CutGeometricalAcceptance(*(stack->Particle(primIdx))))
848 {
d3ce32b8 849
0861cc1f 850// std::cout << "Gamma primary: " << primIdx << std::endl;
851// foundGammas.push_back(primIdx);
d3ce32b8 852 if(nottrackmatched){
853 foundGammas.push_back(pIdx);
854 }
0861cc1f 855 }
b2c10007 856 }
53ad5ec1 857 fCutFlow->Fill(cf++);
86e7d5db 858 if(!fSelector->PassDistanceToBadChannelCut(*caloCluster)) continue;
5881f036 859 Double_t clEt = CorrectForReconstructionEfficiency(*caloCluster,fCentClass);
ef647350 860// if(code == fgK0SCode) std::cout << "K0 energy: " << caloCluster->E() << std::endl;
86e7d5db 861 if(!fSelector->PassMinEnergyCut(*caloCluster)) continue;
53ad5ec1 862
863
f61cec2f 864 fCutFlow->Fill(cf++);
0861cc1f 865 Float_t pos[3];
866 //PrintFamilyTree(
867 caloCluster->GetPosition(pos);
868 TVector3 cp(pos);
869
f61cec2f 870 TParticle *primPart = stack->Particle(primIdx);
871 fPrimaryCode = primPart->GetPdgCode();
03bfd268 872 fPrimaryCharge = (Int_t) primPart->GetPDG()->Charge();
f61cec2f 873
874 fPrimaryE = primPart->Energy();
875 fPrimaryEt = primPart->Energy()*TMath::Sin(primPart->Theta());
f61cec2f 876 fPrimaryPx = primPart->Px();
877 fPrimaryPy = primPart->Py();
878 fPrimaryPz = primPart->Pz();
cfe23ff0 879 //cout<<"I have a cluster and it's good energy "<<caloCluster->E()<<" simulated "<<fPrimaryE<<endl;
f61cec2f 880 fPrimaryVx = primPart->Vx();
881 fPrimaryVy = primPart->Vy();
882 fPrimaryVz = primPart->Vz();
883
884 fPrimaryAccepted = false;
b2c10007 885 fPrimaryMatched = false;
f61cec2f 886
887 fDepositedCode = part->GetPdgCode();
b2c10007 888 fDepositedE = part->Energy();
889 fDepositedEt = part->Energy()*TMath::Sin(part->Theta());
03bfd268 890 fDepositedCharge = (Int_t) part->GetPDG()->Charge();
f61cec2f 891
892 fDepositedVx = part->Vx();
893 fDepositedVy = part->Vy();
894 fDepositedVz = part->Vz();
b2c10007 895
896 //fSecondary = fSelector->FromSecondaryInteraction(*primPart, *stack);
897 fSecondary =fSelector->FromSecondaryInteraction(*part, *stack);
9ef6f13f 898// if(fSecondary)
899// {
900// //std::cout << "Have secondary!" << std::endl;
901// //PrintFamilyTree(iPart, stack);
902// }
b2c10007 903 fReconstructedE = caloCluster->E();
904 fReconstructedEt = caloCluster->E()*TMath::Sin(cp.Theta());
b2c10007 905
906 pdg = primPart->GetPDG(0);
a0dcb3c1 907 //Int_t code = primPart->GetPdgCode();
e2ee5727 908
9ef6f13f 909 Bool_t written = kFALSE;
910
d3ce32b8 911// Bool_t nottrackmatched = kTRUE;//default to no track matched
912// nottrackmatched = fSelector->PassTrackMatchingCut(*caloCluster);
913// //by default ALL matched tracks are accepted, whether or not the match is good. So we check to see if the track is good.
914// if(!nottrackmatched){
915// Int_t trackMatchedIndex = caloCluster->GetTrackMatchedIndex();
916// if(trackMatchedIndex < 0) nottrackmatched=kTRUE;
917// AliESDtrack *track = realEvent->GetTrack(trackMatchedIndex);
918// //if this is a good track, accept track will return true. The track matched is good, so not track matched is false
919// nottrackmatched = !(fEsdtrackCutsTPC->AcceptTrack(track));
920// }
9ef6f13f 921
922 if(fSecondary){//all particles from secondary interactions
923 written = kTRUE;
924 if(nottrackmatched){//secondaries not removed
03cff249 925// Float_t vtx = TMath::Sqrt( TMath::Power(part->Vx(),2) + TMath::Power(part->Vy(),2) + TMath::Power(part->Vz(),2) );
926 fHistSecondaryPositionInDetector->Fill(part->Vx(),part->Vy(),part->Vz());
927// if(vtx>300){
928// //cout<<"Vtx "<<vtx<<endl;
929// if(fPrimaryCode==fgProtonCode || fPrimaryCode==fgAntiProtonCode || fPrimaryCode==fgPiPlusCode || fPrimaryCode==fgPiMinusCode || fPrimaryCode==fgKPlusCode || fPrimaryCode==fgKMinusCode){
930// cout<<"I think I am really a charged hadron!"<<endl;
931// }
932// //PrintFamilyTree(iPart, stack);
933// }
9a365626 934 fSecondaryNotRemoved++;
935 etSecondaries += fReconstructedEt;
936 etSecondariesEffCorr += clEt;
9ef6f13f 937 if (fDepositedCharge != 0){//charged track not removed
938 fChargedNotRemoved++;
939 fEnergyChargedNotRemoved += clEt;
940 fHistRemovedOrNot->Fill(2.0, fCentClass);
941 fHistDxDzNonRemovedCharged->Fill(caloCluster->GetTrackDx(), caloCluster->GetTrackDz());
9a365626 942 fHistChargedNotRemovedSecondaryEtVsCent->Fill(fReconstructedEt,fCentClass);
943 nChargedSecondariesNotRemoved++;
9ef6f13f 944 }
945 else{
9a365626 946 fHistNeutralNotRemovedSecondaryEtVsCent->Fill(fReconstructedEt,fCentClass);
947 nNeutralSecondariesNotRemoved++;
9ef6f13f 948 }
949 }
950 else{//secondaries removed
951 if (fDepositedCharge != 0){
952 fChargedRemoved++;
953 fEnergyChargedRemoved += clEt;
954 fHistRemovedOrNot->Fill(0.0, fCentClass);
955 fHistDxDzRemovedCharged->Fill(caloCluster->GetTrackDx(), caloCluster->GetTrackDz());
9a365626 956 fHistChargedRemovedSecondaryEtVsCent->Fill(fReconstructedEt,fCentClass);
957 nChargedSecondariesRemoved++;
9ef6f13f 958 fHistChargedTracksCut->Fill(fDepositedEt);
0861cc1f 959 if(fCalcTrackMatchVsMult){
960 fHistChargedTracksCutMult->Fill(fDepositedEt,fClusterMult);
961 if(fClusterMult<25){fHistChargedTracksCutPeripheral->Fill(fDepositedEt);}
962 }
6a152780 963 fHistMatchedTracksEvspTBkgd->Fill(matchedTrackp,fReconstructedE);
0861cc1f 964 if(fCalcTrackMatchVsMult){
6a152780 965 if(fClusterMult<25){fHistMatchedTracksEvspTBkgdPeripheral->Fill(matchedTrackp,fReconstructedEt);}
ac610b08 966 fHistMatchedTracksEvspTBkgdvsCent->Fill(matchedTrackp,fReconstructedEt, fCentClass);
967 fHistMatchedTracksEvspTBkgdvsCentEffCorr->Fill(matchedTrackp,clEt, fCentClass);//Fill with the efficiency corrected energy
0861cc1f 968 }
9ef6f13f 969 Int_t trackindex = (caloCluster->GetLabelsArray())->At(1);
970 if(caloCluster->GetLabel()!=trackindex){
971 fHistBadTrackMatches->Fill(part->Pt(),fReconstructedE);
972 fHistBadTrackMatchesdPhidEta->Fill(caloCluster->GetTrackDx(),caloCluster->GetTrackDz());
973 //cout<<"Track matched, label cluster "<<caloCluster->GetLabel()<<" track "<<trackindex<<endl;
974 }
975 else{
976 fHistGoodTrackMatchesdPhidEta->Fill(caloCluster->GetTrackDx(),caloCluster->GetTrackDz());
977 }
978 }
979 else{//neutral energy removed
980 fNeutralRemoved++;
981 fEnergyNeutralRemoved += clEt;
982 fHistRemovedOrNot->Fill(1.0, fCentClass);
983 fHistDxDzRemovedNeutral->Fill(caloCluster->GetTrackDx(), caloCluster->GetTrackDz());
9a365626 984 fHistNeutralRemovedSecondaryEtVsCent->Fill(fReconstructedEt,fCentClass);
985
986 nNeutralSecondariesRemoved++;
9ef6f13f 987 }
988 }
989 }
9a365626 990 else{//not a secondary
9ef6f13f 991
992 if (fDepositedCharge != 0 && fDepositedCode!=fgEMinusCode && fDepositedCode!=fgEPlusCode){//if the particle hitting the calorimeter is pi/k/p/mu
993 written = kTRUE;
d3ce32b8 994 fClusterMultChargedTracks++;
9a365626 995 etPiKPDeposited += clEt;
996 if(fDepositedCode==fgProtonCode){
997 etProtonDeposited += clEt;
998 }
999 if(fDepositedCode==fgAntiProtonCode){
1000 etAntiProtonDeposited += clEt;
1001 }
9ef6f13f 1002 if(nottrackmatched){//not removed but should be
9a365626 1003 etPiKPDepositedNotTrackMatched += clEt;
1004 if(fDepositedCode==fgProtonCode){
1005 etProtonDepositedNotTrackMatched += clEt;
1006 }
1007 if(fDepositedCode==fgAntiProtonCode){
1008 etAntiProtonDepositedNotTrackMatched += clEt;
1009 }
c79c36cc 1010 fHistHadronDepositsAll->Fill(part->Pt());
ac610b08 1011 fHistHadronDepositsAllCent->Fill(part->Pt(), fCentClass);
5881f036 1012 if(fReconstructedEt>0.5) fHistHadronDepositsAllCent500MeV->Fill(part->Pt(), fCentClass);
9ef6f13f 1013 fChargedNotRemoved++;
1014 fEnergyChargedNotRemoved += clEt;
1015 fHistRemovedOrNot->Fill(2.0, fCentClass);
1016 fHistDxDzNonRemovedCharged->Fill(caloCluster->GetTrackDx(), caloCluster->GetTrackDz());
1017 fHistChargedTracksAccepted->Fill(fDepositedEt);
0861cc1f 1018 if(fCalcTrackMatchVsMult){
6a152780 1019 if(matchedTrackpt<0.5){//if we could never have matched this because of its pt, how much energy did it deposit?
ac610b08 1020 fHistChargedTracksAcceptedLowPtCent->Fill(fDepositedEt, fCentClass);
5881f036 1021 if(fDepositedEt>=0.5) fHistChargedTracksAcceptedLowPtCent500MeV->Fill(fDepositedEt, fCentClass);
ac610b08 1022 if(pdg->PdgCode()!=fgAntiProtonCode){
1023 fHistChargedTracksAcceptedLowPtCentNoAntiProtons->Fill(fDepositedEt, fCentClass);
1024 }
1025 else{
1026 fHistChargedTracksAcceptedLowPtCentAntiProtons->Fill(fDepositedEt, fCentClass);
1027 }
6a152780 1028 }
0861cc1f 1029 fHistChargedTracksAcceptedMult->Fill(fDepositedEt,fClusterMult);
1030 if(fClusterMult<25){fHistChargedTracksAcceptedPeripheral->Fill(fDepositedEt);}
1031 }
9ef6f13f 1032 }
1033 else{//removed and should have been
1034 Int_t trackindex = (caloCluster->GetLabelsArray())->At(0);
c79c36cc 1035 fHistHadronDepositsReco->Fill(part->Pt());
ac610b08 1036 fHistHadronDepositsRecoCent->Fill(part->Pt(), fCentClass);
c79c36cc 1037 fHistHadronDepositsAll->Fill(part->Pt());
ac610b08 1038 fHistHadronDepositsAllCent->Fill(part->Pt(), fCentClass);
5881f036 1039 if(fReconstructedEt>0.5) fHistHadronDepositsAllCent500MeV->Fill(part->Pt(), fCentClass);
9ef6f13f 1040 if(caloCluster->GetLabel()!=trackindex){
1041 fHistBadTrackMatches->Fill(part->Pt(),fReconstructedE);
1042 fHistBadTrackMatchesdPhidEta->Fill(caloCluster->GetTrackDx(),caloCluster->GetTrackDz());
1043 //cout<<"Track matched, label cluster "<<caloCluster->GetLabel()<<" track "<<trackindex<<endl;
1044 }
1045 else{
1046 fHistGoodTrackMatchesdPhidEta->Fill(caloCluster->GetTrackDx(),caloCluster->GetTrackDz());
1047 }
1048 fChargedRemoved++;
1049 fEnergyChargedRemoved += clEt;
1050 fHistRemovedOrNot->Fill(0.0, fCentClass);
1051 fHistDxDzRemovedCharged->Fill(caloCluster->GetTrackDx(), caloCluster->GetTrackDz());
1052 fHistChargedTracksCut->Fill(fDepositedEt);
0861cc1f 1053 if(fCalcTrackMatchVsMult){
1054 fHistChargedTracksCutMult->Fill(fDepositedEt,fClusterMult);
1055 if(fClusterMult<25){fHistChargedTracksCutPeripheral->Fill(fDepositedEt);}
1056 }
6a152780 1057 fHistMatchedTracksEvspTBkgd->Fill(matchedTrackp,fReconstructedE);
0861cc1f 1058 if(fCalcTrackMatchVsMult){
6a152780 1059 if(fClusterMult<25){fHistMatchedTracksEvspTBkgdPeripheral->Fill(matchedTrackp,fReconstructedEt);}
ac610b08 1060 fHistMatchedTracksEvspTBkgdvsCent->Fill(matchedTrackp,fReconstructedEt, fCentClass);
1061 fHistMatchedTracksEvspTBkgdvsCentEffCorr->Fill(matchedTrackp,clEt, fCentClass);//fill with the efficiency corrected energy
0861cc1f 1062 }
9ef6f13f 1063 }
1064 }
1065 //K0L and any neutral particles from the decay of K+/- or K0S
1066 if(!written && (fPrimaryCode==fgKPlusCode || fPrimaryCode==fgKMinusCode || fPrimaryCode==fgK0SCode ||fPrimaryCode==fgK0LCode)){
1067 written = kTRUE;//At this point we are not tracking them but we don't count them as neutrals accidentally removed
cfe23ff0 1068 }
9ef6f13f 1069
1070 if(!written && (fDepositedCode==fgGammaCode || fDepositedCode==fgEMinusCode || fDepositedCode ==fgEPlusCode)){//if the particle hitting the calorimeter is gamma, electron and not from a kaon
d3ce32b8 1071 fClusterMultGammas++;
9ef6f13f 1072 written = kTRUE;
1073 if(nottrackmatched){//Not removed and not supposed to be removed - signal
1074 fEtNonRemovedGammas += clEt;
1075 fMultNonRemovedGammas++;
1076 fNeutralNotRemoved--;
1077 fEnergyNeutralNotRemoved -= clEt;
1078 fHistGammasAccepted->Fill(fDepositedEt);
0861cc1f 1079 if(fCalcTrackMatchVsMult){
1080 fHistGammasAcceptedMult->Fill(fDepositedEt,fClusterMult);
1081 if(fClusterMult<25){fHistGammasAcceptedPeripheral->Fill(fDepositedEt);}
1082 }
9ef6f13f 1083 }
1084 else{//removed but shouldn't have been
1085 Int_t trackindex = (caloCluster->GetLabelsArray())->At(1);
1086 if(caloCluster->GetLabel()!=trackindex){
1087 fHistBadTrackMatches->Fill(part->Pt(),fReconstructedE);
1088 fHistBadTrackMatchesdPhidEta->Fill(caloCluster->GetTrackDx(),caloCluster->GetTrackDz());
1089// cout<<"Track matched, label cluster "<<caloCluster->GetLabel()<<" track "<<trackindex<<endl;
1090// PrintFamilyTree(trackindex, stack);
1091// cout<<"Cluster"<<endl;
1092 }
1093 fGammaRemoved++;
1094 fGammaRemovedEt+=clEt;
1095 fHistGammasCut->Fill(fDepositedEt);
0861cc1f 1096 if(fCalcTrackMatchVsMult){
1097 fHistGammasCutMult->Fill(fDepositedEt,fClusterMult);
1098 if(fClusterMult<25){fHistGammasCutPeripheral->Fill(fDepositedEt);}
1099 }
6a152780 1100 fHistMatchedTracksEvspTSignal->Fill(matchedTrackp,fReconstructedE);
0861cc1f 1101 if(fCalcTrackMatchVsMult){
6a152780 1102 if(fClusterMult<25){fHistMatchedTracksEvspTSignalPeripheral->Fill(matchedTrackp,fReconstructedEt);}
ac610b08 1103 fHistMatchedTracksEvspTSignalvsCent->Fill(matchedTrackp,fReconstructedEt, fCentClass);
1104 fHistMatchedTracksEvspTSignalvsCentEffCorr->Fill(matchedTrackp,clEt, fCentClass);
0861cc1f 1105 }
9ef6f13f 1106 }
1107 }
1108 //all other cases - neutron, anti-neutron, not aware of other cases
1109 if(!written){
1110 fNeutralNotRemoved++;
9a365626 1111 fEnergyNeutralNotRemoved += clEt;//this is the efficiency corrected energy
9ef6f13f 1112 fHistRemovedOrNot->Fill(3.0, fCentClass);
9a365626 1113 if (fDepositedCode == fgNeutronCode || fDepositedCode == fgAntiNeutronCode){
1114 fHistDxDzNonRemovedNeutral->Fill(caloCluster->GetTrackDx(), caloCluster->GetTrackDz());
1115 fHistNeutronsEtVsCent->Fill(clEt,fCentClass);
1116 nNeutrons++;
1117 if(fDepositedCode == fgNeutronCode){
1118 etNeutronDeposited += clEt;
1119 }
1120 if(fDepositedCode == fgAntiNeutronCode){
1121 etAntiNeutronDeposited += clEt;
1122 }
1123 //cout<<"I am a";
1124 //if(fDepositedCode == fgAntiNeutronCode) cout<<"n anti-";
1125 //else{cout<<" ";}
1126 //cout<<"neutron!! pt "<<part->Pt()<<" eta "<<part->Eta()<<" phi "<<part->Phi()<<" Et "<<clEt<<endl;
1127 //PrintFamilyTree(iPart, stack);
1128 }
1129 else{
1130 nNotNeutrons++;
1131// cout<<"I am a";
1132// if(fDepositedCode == fgAntiNeutronCode) cout<<"n anti-";
1133// else{cout<<" ";}
1134// cout<<"neutron!! pt "<<part->Pt()<<" eta "<<part->Eta()<<" phi "<<part->Phi()<<" Et "<<clEt<<endl;
1135// PrintFamilyTree(iPart, stack);
1136// cout<<"I am not a neutron!!"<<endl;
1137// PrintFamilyTree(iPart, stack);
1138 }
9ef6f13f 1139 }
1140 }
f61cec2f 1141 fPrimaryTree->Fill();
9ef6f13f 1142 } // end of loop over clusters
9a365626 1143 fHistPiKPNotTrackMatchedDepositedVsNch->Fill(etPiKPDepositedNotTrackMatched,multiplicity);
1144 fHistPiKPDepositedVsNch->Fill(etPiKPDeposited,multiplicity);
1145 fHistNeutronsDepositedVsNch->Fill(etNeutronDeposited,multiplicity);
1146 fHistAntiNeutronsDepositedVsNch->Fill(etAntiNeutronDeposited,multiplicity);
1147 fHistProtonsDepositedVsNch->Fill(etProtonDeposited,multiplicity);
1148 fHistAntiProtonsDepositedVsNch->Fill(etAntiProtonDeposited,multiplicity);
1149 fHistProtonsNotTrackMatchedDepositedVsNch->Fill(etProtonDepositedNotTrackMatched,multiplicity);
1150 fHistAntiProtonsNotTrackMatchedDepositedVsNch->Fill(etAntiProtonDepositedNotTrackMatched,multiplicity);
1151 fHistSecondariesVsNch->Fill(etSecondaries,multiplicity);
1152 fHistSecondariesVsNcl->Fill(etSecondaries,fNClusters);
1153 fHistSecondariesEffCorrVsNch->Fill(etSecondariesEffCorr,multiplicity);
1154 fHistSecondariesEffCorrVsNcl->Fill(etSecondariesEffCorr,fNClusters);
1155 fHistCentVsNchVsNcl->Fill(fCentClass,multiplicity, fNClusters);
1156
1157 fHistNeutronsNumVsCent->Fill(nNeutrons,fCentClass);
1158 fHistNotNeutronsNumVsCent->Fill(nNotNeutrons,fCentClass);
b2c10007 1159
1160 std::sort(foundGammas.begin(), foundGammas.end());
1161 for (Int_t iPart = 0; iPart < stack->GetNtrack(); iPart++)
1162 {
1163
1164 if(!stack->IsPhysicalPrimary(iPart)) continue;
1165
1166 TParticle *part = stack->Particle(iPart);
1167
1168 if (!part)
1169 {
1170 Printf("ERROR: Could not get particle %d", iPart);
1171 continue;
1172 }
1173 TParticlePDG *pdg = part->GetPDG(0);
1174
1175 if (!pdg)
1176 {
1177 Printf("ERROR: Could not get particle PDG %d", iPart);
1178 continue;
1179 }
1180
9a365626 1181 if(pdg->PdgCode()==fgGammaCode)// TMath::Abs(part->Eta()) < 0.12)
b2c10007 1182 {
9a365626 1183 if(fSelector->CutGeometricalAcceptance(*part)){
1184 fHistGammasGenerated->Fill(part->Energy());
1185 fHistGammasGeneratedCent->Fill(part->Energy(),fCentClass);
1186 }
b2c10007 1187 if(std::binary_search(foundGammas.begin(),foundGammas.end(),iPart))
1188 {
9a365626 1189 if(!fSelector->CutGeometricalAcceptance(*part)){
1190 //cout<<"Gamma NOT in acceptance"<<endl;
1191 fHistGammasFoundOutOfAccCent->Fill(part->Energy(),fCentClass);
1192 }
1193 else{
1194 fHistGammasFound->Fill(part->Energy());
1195 fHistGammasFoundCent->Fill(part->Energy(),fCentClass);
1196 //cout<<"Gamma IN acceptance"<<endl;
1197 }
b2c10007 1198 }
b2c10007 1199 }
6a152780 1200 if(pdg->PdgCode()==fgPiPlusCode || pdg->PdgCode()==fgPiMinusCode || pdg->PdgCode()==fgProtonCode || pdg->PdgCode()==fgAntiProtonCode){//section here for all hadrons generated
ac610b08 1201 fHistHadronsAllCent->Fill(part->Pt(), fCentClass);
6a152780 1202 }
1203
b2c10007 1204
1205 }
0861cc1f 1206 if(fCalcForKaonCorrection){
1207 Float_t etCuts[11] = {0.0,0.05,0.1,0.15,0.2,0.25, 0.3,0.35,0.4,0.45,0.5};
1208 Int_t nEtCuts = 11;
1209 //loop over simulated particles in order to find K0S
1210 for (Int_t iPart = 0; iPart < stack->GetNtrack(); iPart++){
1211 TParticle *part = stack->Particle(iPart);
1212 if (!part){
1213 //Printf("ERROR: Could not get particle %d", iPart);
1214 continue;
1215 }
1216 TParticlePDG *pdg = part->GetPDG(0);
1217 if (!pdg){
1218 //Printf("ERROR: Could not get particle PDG %d", iPart);
1219 continue;
1220 }
1221 //if(stack->IsPhysicalPrimary(iPart)){//if it is a K0 it might have decayed into four pions
2aab9269 1222 //fgK0SCode, fgGammaCode, fgPi0Code
1223 Int_t code = pdg->PdgCode();
0861cc1f 1224 if(code == fgK0SCode || code==fgKPlusCode || code==fgKMinusCode ||code==fgK0LCode || code==fgK0Code){//this is a kaon
1225 //cout<<"I am a kaon too! "<<stack->Particle(iPart)->GetName()<<" "<<code<<endl;
1226 Float_t pTk = stack->Particle(iPart)->Pt();
1227 if(TMath::Abs(stack->Particle(iPart)->Y())<0.5 && stack->IsPhysicalPrimary(iPart)){//these are particles which would be included in our spectra measurements
1228 fHistSimKaonsInAcceptance->Fill(pTk);
1229 if(code == fgK0SCode){fHistSimK0SInAcceptance->Fill(pTk);}
1230 if(code == fgK0LCode){fHistSimK0LInAcceptance->Fill(pTk);}
1231 if(code == fgKPlusCode){fHistSimKPlusInAcceptance->Fill(pTk);}
1232 if(code == fgKMinusCode){fHistSimKMinusInAcceptance->Fill(pTk);}
1233 if(code == fgK0Code){//Split K0's between the two
1234 fHistSimK0SInAcceptance->Fill(pTk,0.5);
1235 fHistSimK0LInAcceptance->Fill(pTk,0.5);
1236 }
1237 }
1238 else{
1239 fHistSimKaonsOutOfAcceptance->Fill(pTk);
1240 // if(!stack->IsPhysicalPrimary(iPart)){
1241 // PrintFamilyTree(iPart, stack);
1242 // }
1243 }
1244 Float_t totalGammaEts[11] = {0.0,0.0,0.0,0.0,0.0, 0.0,0.0,0.0,0.0,0.0, 0.0};
1245 Float_t totalClusterEts[11] = {0.0,0.0,0.0,0.0,0.0, 0.0,0.0,0.0,0.0,0.0, 0.0};
1246 for (int iCluster = 0; iCluster < nCluster; iCluster++ ){//if this cluster is from any of the decay daughters of any kaon... but there is no easy way to look at this so we loop over clusters...
1247 AliESDCaloCluster* caloCluster = ( AliESDCaloCluster* )caloClusters->At( iCluster );
5881f036 1248 if (!fSelector->CutGeometricalAcceptance(*caloCluster)) continue;
1249 const Int_t myPart = TMath::Abs(caloCluster->GetLabel());
0861cc1f 1250 //identify the primary particle which created this cluster
1251 int primIdx = myPart;
1252 if (!stack->IsPhysicalPrimary(myPart)){
1253 primIdx = GetPrimMother(iPart, stack);
1254 } // end of primary particle check
29b7ba7f 1255 TParticle *hitPart = stack->Particle(myPart);
1256 Bool_t hitsAsChargedKaon = kFALSE;
1257 if(hitPart->GetPdgCode()== fgKPlusCode || hitPart->GetPdgCode()== fgKPlusCode){
1258 if(myPart==primIdx){
1259 //The particle hits as a charged kaon and that kaon is a primary kaon - do not count because this is counted in the hadronic correction!
1260 hitsAsChargedKaon = kTRUE;
1261 //cout<<"Found primary charged kaon cluster!"<<endl;
1262 }
1263 }
1264 if(primIdx==iPart && primIdx>0 && !hitsAsChargedKaon){//This cluster is from our primary particle and our primary particle is a kaon
0861cc1f 1265 //cout<<"I have a particle match! prim code"<<code<<" id "<<primIdx <<endl;
1266 Float_t pos[3];
1267 caloCluster->GetPosition(pos);
1268 TVector3 cp(pos);
1269 Double_t clEt = caloCluster->E()*TMath::Sin(cp.Theta());
5881f036 1270 Double_t clEtCorr = CorrectForReconstructionEfficiency(*caloCluster,fCentClass);
2aab9269 1271 for(int l=0;l<nEtCuts;l++){//loop over cut values
0861cc1f 1272 if(clEt>=etCuts[l]){
1273 //cout<<", "<<clEt<<">="<<etCuts[l];
1274 totalClusterEts[l] += clEtCorr;//if cluster et is above the cut off energy add it
1275 totalGammaEts[l] += clEt;//if cluster et is above the cut off energy add it
2aab9269 1276 }
1277 }
2aab9269 1278 }
1279 }
0861cc1f 1280 // cout<<"Deposits: pT: "<<pTk;
1281 // for(int l=0;l<nEtCuts;l++){//loop over cut values
1282 // cout<<" "<<totalClusterEts[l];
1283 // }
1284 // cout<<endl;
1285 if(TMath::Abs(stack->Particle(iPart)->Y())<0.5 && stack->IsPhysicalPrimary(iPart)){//within the acceptance of our spectra and is a primary particle
1286 if(totalClusterEts[0]>0.0){fHistSimKaonsInAcceptanceWithDepositsPrimaries->Fill(pTk);}
1287 //cout<<"I have a particle match! prim code"<<code<<" id "<<iPart <<endl;
1288 for(int l=0;l<nEtCuts;l++){
d3ce32b8 1289 fHistK0EDepositsVsPtInAcceptance->Fill(pTk,totalClusterEts[l],etCuts[l]+0.001);
1290 fHistK0EGammaVsPtInAcceptance->Fill(pTk,totalGammaEts[l],etCuts[l]+0.001);
0861cc1f 1291 }
1292 }
1293 else{//outside the acceptance of our spectra
1294 if(totalClusterEts[0]>0.0){
1295 if(stack->IsPhysicalPrimary(iPart)){fHistSimKaonsOutOfAcceptanceWithDepositsPrimaries->Fill(pTk);}
1296 else{fHistSimKaonsOutOfAcceptanceWithDepositsSecondaries->Fill(pTk);}
1297 }
1298 for(int l=0;l<nEtCuts;l++){
d3ce32b8 1299 fHistK0EDepositsVsPtOutOfAcceptance->Fill(pTk,totalClusterEts[l],etCuts[l]+0.001);
1300 fHistK0EGammaVsPtOutOfAcceptance->Fill(pTk,totalGammaEts[l],etCuts[l]+0.001);
0861cc1f 1301 }
1302 }
1303
2aab9269 1304 }
1305 }
1306 }
9a365626 1307 fHistMultChVsSignalVsMult->Fill(fClusterMultChargedTracks,fClusterMultGammas,fNClusters);
1308 fHistNeutralRemovedSecondaryNumVsNCluster->Fill(nNeutralSecondariesRemoved,fNClusters);
1309 fHistChargedRemovedSecondaryNumVsNCluster->Fill(nChargedSecondariesRemoved,fNClusters);
1310 fHistNeutralNotRemovedSecondaryNumVsNCluster->Fill(nNeutralSecondariesNotRemoved,fNClusters);
1311 fHistChargedNotRemovedSecondaryNumVsNCluster->Fill(nChargedSecondariesNotRemoved,fNClusters);
1312 fHistNeutralRemovedSecondaryNumVsCent->Fill(nNeutralSecondariesRemoved,fCentClass);
1313 fHistChargedRemovedSecondaryNumVsCent->Fill(nChargedSecondariesRemoved,fCentClass);
1314 fHistNeutralNotRemovedSecondaryNumVsCent->Fill(nNeutralSecondariesNotRemoved,fCentClass);
1315 fHistChargedNotRemovedSecondaryNumVsCent->Fill(nChargedSecondariesNotRemoved,fCentClass);
1316 //cout<<"Secondaries not removed: "<<fSecondaryNotRemoved<<" neutral secondaries not removed "<<nNeutralSecondariesNotRemoved<<" cluster mult "<<fClusterMult<<endl;
e2ee5727 1317 FillHistograms();
1318 return 0;
1319}
2fbf38ac 1320
1321void AliAnalysisEtMonteCarlo::Init()
f61cec2f 1322{ // init
e2ee5727 1323 AliAnalysisEt::Init();
2fbf38ac 1324}
13b0d3c1 1325
ce546038 1326void AliAnalysisEtMonteCarlo::ResetEventValues()
f61cec2f 1327{ // reset event values
e2ee5727 1328 AliAnalysisEt::ResetEventValues();
c79c36cc 1329 if(!fIsMC) return;
e2ee5727 1330
f61cec2f 1331 fTotEtSecondary = 0;
1332 fTotEtSecondaryFromEmEtPrimary = 0;
1333 fTotEtWithSecondaryRemoved = 0;
1334
e2ee5727 1335 // collision geometry defaults for p+p:
1336 fImpactParameter = 0;
1337 fNcoll = 1;
1338 fNpart = 2;
1339
1340 fEtNonRemovedProtons = 0;
1341 fEtNonRemovedAntiProtons = 0;
1342 fEtNonRemovedPiPlus = 0;
1343 fEtNonRemovedPiMinus = 0;
1344 fEtNonRemovedKaonPlus = 0;
1345 fEtNonRemovedKaonMinus = 0;
ef647350 1346 fEtNonRemovedK0S = 0;
1347 fEtNonRemovedK0L = 0;
e2ee5727 1348 fEtNonRemovedLambdas = 0;
1349 fEtNonRemovedElectrons = 0;
1350 fEtNonRemovedPositrons = 0;
1351 fEtNonRemovedMuPlus = 0;
1352 fEtNonRemovedMuMinus = 0;
1353 fEtNonRemovedNeutrons = 0;
1354 fEtNonRemovedAntiNeutrons = 0;
1355 fEtNonRemovedGammas = 0;
1356 fEtNonRemovedGammasFromPi0 = 0;
1357
ef647350 1358 fEtRemovedProtons = 0;
1359 fEtRemovedAntiProtons = 0;
1360 fEtRemovedPiPlus = 0;
1361 fEtRemovedPiMinus = 0;
1362 fEtRemovedKaonPlus = 0;
1363 fEtRemovedKaonMinus = 0;
1364 fEtRemovedK0s = 0;
1365 fEtRemovedK0L = 0;
1366 fEtRemovedLambdas = 0;
1367 fEtRemovedElectrons = 0;
1368 fEtRemovedPositrons = 0;
1369 fEtRemovedMuPlus = 0;
1370 fEtRemovedMuMinus = 0;
1371 fEtRemovedNeutrons = 0;
1372
1373 fEtRemovedGammasFromPi0 = 0;
e2ee5727 1374 fEtRemovedGammas = 0;
1375 fEtRemovedNeutrons = 0;
1376 fEtRemovedAntiNeutrons = 0;
1377
1378 fMultNonRemovedProtons = 0;
1379 fMultNonRemovedAntiProtons = 0;
1380 fMultNonRemovedPiPlus = 0;
1381 fMultNonRemovedPiMinus = 0;
1382 fMultNonRemovedKaonPlus = 0;
1383 fMultNonRemovedKaonMinus = 0;
1384 fMultNonRemovedK0s = 0;
ef647350 1385 fMultNonRemovedK0L = 0;
e2ee5727 1386 fMultNonRemovedLambdas = 0;
1387 fMultNonRemovedElectrons = 0;
1388 fMultNonRemovedPositrons = 0;
1389 fMultNonRemovedMuPlus = 0;
1390 fMultNonRemovedMuMinus = 0;
1391 fMultNonRemovedNeutrons = 0;
1392 fMultNonRemovedAntiNeutrons = 0;
1393 fMultNonRemovedGammas = 0;
1394
ef647350 1395 fMultRemovedProtons = 0;
1396 fMultRemovedAntiProtons = 0;
1397 fMultRemovedPiPlus = 0;
1398 fMultRemovedPiMinus = 0;
1399 fMultRemovedKaonPlus = 0;
1400 fMultRemovedKaonMinus = 0;
1401 fMultRemovedK0s = 0;
1402 fMultRemovedK0L = 0;
1403 fMultRemovedLambdas = 0;
1404 fMultRemovedElectrons = 0;
1405 fMultRemovedPositrons = 0;
1406 fMultRemovedMuPlus = 0;
1407 fMultRemovedMuMinus = 0;
1408
e2ee5727 1409 fMultRemovedGammas = 0;
1410 fMultRemovedNeutrons = 0;
1411 fMultRemovedAntiNeutrons = 0;
1412
ef647350 1413 fEnergyChargedNotRemoved = 0;
1414 fEnergyChargedRemoved = 0;
1415 fEnergyNeutralNotRemoved = 0;
1416 fEnergyNeutralRemoved = 0;
f61cec2f 1417
ef647350 1418 fChargedNotRemoved = 0;
1419 fChargedRemoved = 0;
1420 fNeutralNotRemoved = 0;
1421 fNeutralRemoved = 0;
b2c10007 1422 fGammaRemoved = 0;
1423 fSecondaryNotRemoved = 0;
f61cec2f 1424
e2ee5727 1425 fTrackMultInAcc = 0;
1426
f61cec2f 1427 fTotNeutralEtAfterMinEnergyCut = 0;
b2c10007 1428
1429 fSecondaryNotRemoved = 0;
1430
1431 fTotPx = 0;
1432 fTotPy = 0;
1433 fTotPz = 0;
1434
1435
ce546038 1436}
1437
1438void AliAnalysisEtMonteCarlo::CreateHistograms()
f61cec2f 1439{ // histogram related additions
e2ee5727 1440 AliAnalysisEt::CreateHistograms();
c79c36cc 1441 if(!fIsMC) return;
f61cec2f 1442 if (fEventSummaryTree) {
1443 fEventSummaryTree->Branch("fImpactParameter",&fImpactParameter,"fImpactParameter/D");
1444 fEventSummaryTree->Branch("fNcoll",&fNcoll,"fNcoll/I");
1445 fEventSummaryTree->Branch("fNpart",&fNpart,"fNpart/I");
1446 fEventSummaryTree->Branch("fTotEtWithSecondaryRemoved", &fTotEtWithSecondaryRemoved, "fTotEtWithSecondaryRemoved/D");
1447 fEventSummaryTree->Branch("fTotEtSecondaryFromEmEtPrimary", &fTotEtSecondaryFromEmEtPrimary, "fTotEtSecondaryFromEmEtPrimary/D");
1448 fEventSummaryTree->Branch("fTotEtSecondary", &fTotEtSecondary, "fTotEtSecondary/D");
1449 fEventSummaryTree->Branch("fTotNeutralEtAfterMinEnergyCut", &fTotNeutralEtAfterMinEnergyCut, "fTotNeutralEtAfterMinEnergyCut/D");
b2c10007 1450 fEventSummaryTree->Branch("fSecondaryNotRemoved", &fSecondaryNotRemoved, "fSecondaryNotRemoved/I");
1451 fEventSummaryTree->Branch("fChargedNotRemoved", &fChargedNotRemoved, "fChargedNotRemoved/I");
1452 fEventSummaryTree->Branch("fNeutralNotRemoved", &fNeutralNotRemoved, "fNeutralNotRemoved/I");
1453 fEventSummaryTree->Branch("fChargedRemoved", &fChargedRemoved, "fChargedRemoved/I");
1454 fEventSummaryTree->Branch("fNeutralRemoved", &fNeutralRemoved, "fNeutralRemoved/I");
1455 fEventSummaryTree->Branch("fGammaRemoved", &fGammaRemoved, "fGammaRemoved/I");
1456 fEventSummaryTree->Branch("fTotPx", &fTotPx, "fTotPx/D");
1457 fEventSummaryTree->Branch("fTotPy", &fTotPy, "fTotPy/D");
1458 fEventSummaryTree->Branch("fTotPz", &fTotPz, "fTotPz/D");
1459// fEventSummaryTree->Branch("f
e2ee5727 1460 }
f61cec2f 1461
e2ee5727 1462 //fHistDecayVertexNonRemovedCharged = new TH3F("fHistDecayVertexNonRemovedCharged","fHistDecayVertexNonRemovedCharged", 500, -470, 30, 500, -300, 300, 40, -20, 20);
1463 //fHistDecayVertexRemovedCharged = new TH3F("fHistDecayVertexRemovedCharged","fHistDecayVertexRemovedCharged", 500, -470, 30, 500, -300, 300, 40, -20, 20);
1464 //fHistDecayVertexNonRemovedNeutral = new TH3F("fHistDecayVertexNonRemovedNeutral","fHistDecayVertexNonRemovedNeutral", 500, -470, 30, 500, -300, 300, 40, -20, 20);
1465 //fHistDecayVertexRemovedNeutral = new TH3F("fHistDecayVertexRemovedNeutral","fHistDecayVertexRemovedNeutral", 500, -470, 30, 500, -300, 300, 40, -20, 20);
1466
1467 fHistRemovedOrNot = new TH2F("fHistRemovedOrNot", "fHistRemovedOrNot", 4, -0.5, 3.5, 10, -0.5, 9.5);
1468
1469 fHistEtNonRemovedProtons = new TH2F("fHistEtNonRemovedProtons", "fHistEtNonRemovedProtons", 1500, 0, 30, 10, -0.5, 9.5);
1470 fHistEtNonRemovedAntiProtons = new TH2F("fHistEtNonRemovedAntiProtons", "fHistEtNonRemovedAntiProtons", 1500, 0, 30, 10, -0.5, 9.5);
1471 fHistEtNonRemovedPiPlus = new TH2F("fHistEtNonRemovedPiPlus", "fHistEtNonRemovedPiPlus", 1500, 0, 30, 10, -0.5, 9.5);
1472 fHistEtNonRemovedPiMinus = new TH2F("fHistEtNonRemovedPiMinus", "fHistEtNonRemovedPiMinus", 1500, 0, 30, 10, -0.5, 9.5);
1473 fHistEtNonRemovedKaonPlus = new TH2F("fHistEtNonRemovedKaonPlus", "fHistEtNonRemovedKaonPlus", 1500, 0, 30, 10, -0.5, 9.5);
1474 fHistEtNonRemovedKaonMinus = new TH2F("fHistEtNonRemovedKaonMinus", "fHistEtNonRemovedKaonMinus", 1500, 0, 30, 10, -0.5, 9.5);
1475 fHistEtNonRemovedK0s = new TH2F("fHistEtNonRemovedK0s", "fHistEtNonRemovedK0s", 1500, 0, 30, 10, -0.5, 9.5);
ef647350 1476 fHistEtNonRemovedK0L = new TH2F("fHistEtNonRemovedK0L", "fHistEtNonRemovedK0L", 1500, 0, 30, 10, -0.5, 9.5);
e2ee5727 1477 fHistEtNonRemovedLambdas = new TH2F("fHistEtNonRemovedLambdas", "fHistEtNonRemovedLambdas", 1500, 0, 30, 10, -0.5, 9.5);
1478 fHistEtNonRemovedElectrons = new TH2F("fHistEtNonRemovedElectrons", "fHistEtNonRemovedElectrons", 1500, 0, 30, 10, -0.5, 9.5);
1479 fHistEtNonRemovedPositrons = new TH2F("fHistEtNonRemovedPositrons", "fHistEtNonRemovedPositrons", 1500, 0, 30, 10, -0.5, 9.5);
1480 fHistEtNonRemovedMuPlus = new TH2F("fHistEtNonRemovedMuPlus", "fHistEtNonRemovedMuPlus", 1500, 0, 30, 10, -0.5, 9.5);
1481 fHistEtNonRemovedMuMinus = new TH2F("fHistEtNonRemovedMuMinus", "fHistEtNonRemovedMuMinus", 1500, 0, 30, 10, -0.5, 9.5);
1482 fHistEtNonRemovedNeutrons = new TH2F("fHistEtNonRemovedNeutrons", "fHistEtNonRemovedNeutrons", 1500, 0, 30, 10, -0.5, 9.5);
1483 fHistEtNonRemovedAntiNeutrons = new TH2F("fHistEtNonRemovedAntiNeutrons", "fHistEtNonRemovedAntiNeutrons", 1500, 0, 30, 10, -0.5, 9.5);
1484
1485 fHistEtNonRemovedGammas = new TH2F("fHistEtNonRemovedGammas", "fHistEtNonRemovedGammas", 1500, 0, 30, 10, -0.5, 9.5);
1486 fHistEtNonRemovedGammasFromPi0 = new TH2F("fHistEtNonRemovedGammasFromPi0", "fHistEtNonRemovedGammasFromPi0", 1500, 0, 30, 10, -0.5, 9.5);
1487
1488 fHistEtRemovedGammas = new TH2F("fHistEtRemovedGammas", "fHistEtRemovedGammas", 1500, 0, 30, 10, -0.5, 9.5);
1489 fHistEtRemovedNeutrons = new TH2F("fHistEtRemovedNeutrons", "fHistEtRemovedNeutrons", 1500, 0, 30, 10, -0.5, 9.5);
1490 fHistEtRemovedAntiNeutrons = new TH2F("fHistEtRemovedAntiNeutrons", "fHistEtRemovedAntiNeutrons", 1500, 0, 30, 10, -0.5, 9.5);
f61cec2f 1491
ef647350 1492 fHistEtRemovedCharged = new TH2F("fHistEtRemovedCharged", "fHistEtRemovedCharged", 1500, 0, 30, 10, -0.5, 9.5);
1493 fHistEtRemovedNeutrals = new TH2F("fHistEtRemovedNeutrals", "fHistEtRemovedNeutrals", 1500, 0, 30, 10, -0.5, 9.5);
e2ee5727 1494
ef647350 1495 fHistEtNonRemovedCharged = new TH2F("fHistEtNonRemovedCharged", "fHistEtNonRemovedCharged", 1500, 0, 30, 10, -0.5, 9.5);
1496 fHistEtNonRemovedNeutrals = new TH2F("fHistEtNonRemovedNeutrals", "fHistEtNonRemovedNeutrals", 1500, 0, 30, 10, -0.5, 9.5);
f61cec2f 1497
e2ee5727 1498 fHistMultNonRemovedProtons = new TH2F("fHistMultNonRemovedProtons", "fHistMultNonRemovedProtons", 100, -0.5, 99.5, 10, -0.5, 9.5);
1499 fHistMultNonRemovedAntiProtons = new TH2F("fHistMultNonRemovedAntiProtons", "fHistMultNonRemovedAntiProtons", 100, -0.5, 99.5, 10, -0.5, 9.5);
1500 fHistMultNonRemovedPiPlus = new TH2F("fHistMultNonRemovedPiPlus", "fHistMultNonRemovedPiPlus", 100, -0.5, 99.5, 10, -0.5, 9.5);
1501 fHistMultNonRemovedPiMinus = new TH2F("fHistMultNonRemovedPiMinus", "fHistMultNonRemovedPiMinus", 100, -0.5, 99.5, 10, -0.5, 9.5);
1502 fHistMultNonRemovedKaonPlus = new TH2F("fHistMultNonRemovedKaonPlus", "fHistMultNonRemovedKaonPlus", 100, -0.5, 99.5, 10, -0.5, 9.5);
1503 fHistMultNonRemovedKaonMinus = new TH2F("fHistMultNonRemovedKaonMinus", "fHistMultNonRemovedKaonMinus", 100, -0.5, 99.5, 10, -0.5, 9.5);
1504 fHistMultNonRemovedK0s = new TH2F("fHistMultNonRemovedK0s", "fHistMultNonRemovedK0s", 100, -0.5, 99.5, 10, -0.5, 9.5);
ef647350 1505 fHistMultNonRemovedK0L = new TH2F("fHistMultNonRemovedK0L", "fHistMultNonRemovedK0L", 100, -0.5, 99.5, 10, -0.5, 9.5);
e2ee5727 1506 fHistMultNonRemovedLambdas = new TH2F("fHistMultNonRemovedLambdas", "fHistMultNonRemovedLambdas", 100, -0.5, 99.5, 10, -0.5, 9.5);
1507 fHistMultNonRemovedElectrons = new TH2F("fHistMultNonRemovedElectrons", "fHistMultNonRemovedElectrons", 100, -0.5, 99.5, 10, -0.5, 9.5);
1508 fHistMultNonRemovedPositrons = new TH2F("fHistMultNonRemovedPositrons", "fHistMultNonRemovedPositrons", 100, -0.5, 99.5, 10, -0.5, 9.5);
1509 fHistMultNonRemovedMuPlus = new TH2F("fHistMultNonRemovedMuPlus", "fHistMultNonRemovedMuPlus", 100, -0.5, 99.5, 10, -0.5, 9.5);
1510 fHistMultNonRemovedMuMinus = new TH2F("fHistMultNonRemovedMuMinus", "fHistMultNonRemovedMuMinus", 100, -0.5, 99.5, 10, -0.5, 9.5);
1511 fHistMultNonRemovedNeutrons = new TH2F("fHistMultNonRemovedNeutrons", "fHistMultNonRemovedNeutrons", 100, -0.5, 99.5, 10, -0.5, 9.5);
1512 fHistMultNonRemovedAntiNeutrons = new TH2F("fHistMultNonRemovedAntiNeutrons", "fHistMultNonRemovedAntiNeutrons", 100, -0.5, 99.5, 10, -0.5, 9.5);
1513
ef647350 1514 fHistMultNonRemovedGammas = new TH2F("fHistMultNonRemovedGammas", "fHistMultNonRemovedGammas", 100, -0.5, 99.5, 100, -0.5, 99.5);
e2ee5727 1515
ef647350 1516 fHistMultRemovedGammas = new TH2F("fHistMultRemovedGammas", "fHistMultRemovedGammas", 100, -0.5, 99.5, 100, -0.5, 99.5);
e2ee5727 1517 fHistMultRemovedNeutrons = new TH2F("fHistMultRemovedNeutrons", "fHistMultRemovedNeutrons", 100, -0.5, 99.5, 10, -0.5, 9.5);
1518 fHistMultRemovedAntiNeutrons = new TH2F("fHistMultRemovedAntiNeutrons", "fHistMultRemovedAntiNeutrons", 100, -0.5, 99.5, 10, -0.5, 9.5);
f61cec2f 1519 /*
1520 fHistMultRemovedCharged = new TH2F("fHistMultRemovedCharged", "fHistMultRemovedCharged", 1500, 0, 30, 10, -0.5, 9.5);
1521 fHistMultRemovedNeutrals = new TH2F("fHistMultRemovedNeutrals", "fHistMultRemovedNeutrals", 1500, 0, 30, 10, -0.5, 9.5);
1522
1523 fHistMultNonRemovedCharged = new TH2F("fHistMultNonRemovedCharged", "fHistMultNonRemovedCharged", 1500, 0, 30, 10, -0.5, 9.5);
1524 fHistMultNonRemovedNeutrals = new TH2F("fHistMultNonRemovedNeutrals", "fHistMultNonRemovedNeutrals", 1500, 0, 30, 10, -0.5, 9.5);*/
ef647350 1525
ef647350 1526
ef647350 1527 fHistMultRemovedCharged = new TH2F("fHistMultRemovedCharged", "fHistMultRemovedCharged", 100, -0.5, 99.5, 100, -0.5, 99.5);
1528 fHistMultRemovedNeutrals = new TH2F("fHistMultRemovedNeutrals", "fHistMultRemovedNeutrals", 100, -0.5, 99.5, 100, -0.5, 99.5);
1529
1530 fHistMultNonRemovedCharged = new TH2F("fHistMultNonRemovedCharged", "fHistMultNonRemovedCharged", 100, -0.5, 99.5, 100, -0.5, 99.5);
1531 fHistMultNonRemovedNeutrals = new TH2F("fHistMultNonRemovedNeutrals", "fHistMultNonRemovedNeutrals", 100, -0.5, 99.5, 100, -0.5, 99.5);
e2ee5727 1532
1533 fHistTrackMultvsNonRemovedCharged = new TH2F("fHistTrackMultvsNonRemovedCharged", "fHistTrackMultvsNonRemovedCharged", 1000, -0.5, 999.5, 100, -0.5, 99.5);
1534 fHistTrackMultvsNonRemovedNeutral = new TH2F("fHistTrackMultvsNonRemovedNeutral", "fHistTrackMultvsNonRemovedNeutral", 1000, -0.5, 999.5, 100, -0.5, 99.5);
1535 fHistTrackMultvsRemovedGamma = new TH2F("fHistTrackMultvsRemovedGamma", "fHistTrackMultvsRemovedGamma", 1000, -0.5, 999.5, 100, -0.5, 99.5);
1536
1537 fHistClusterMultvsNonRemovedCharged = new TH2F("fHistClusterMultvsNonRemovedCharged", "fHistClusterMultvsNonRemovedCharged", 1000, -0.5, 999.5, 100, -0.5, 99.5);
1538 fHistClusterMultvsNonRemovedNeutral = new TH2F("fHistClusterMultvsNonRemovedNeutral", "fHistClusterMultvsNonRemovedNeutral", 1000, -0.5, 999.5, 100, -0.5, 99.5);
1539 fHistClusterMultvsRemovedGamma = new TH2F("fHistClusterMultvsRemovedGamma", "fHistClusterMultvsRemovedGamma", 1000, -0.5, 999.5, 100, -0.5, 99.5);
1540
1541 fHistDxDzNonRemovedCharged = new TH2F("fHistDxDzNonRemovedCharged", "fHistDxDzNonRemovedCharged", 800, -200, 200, 800, -200, 200);
1542 fHistDxDzRemovedCharged = new TH2F("fHistDxDzRemovedCharged", "fHistDxDzRemovedCharged", 800, -200, 200, 800, -200, 200);
1543 fHistDxDzNonRemovedNeutral = new TH2F("fHistDxDzNonRemovedNeutral", "fHistDxDzNonRemovedNeutral", 800, -200, 200, 800, -200, 200);
1544 fHistDxDzRemovedNeutral = new TH2F("fHistDxDzRemovedNeutral", "fHistDxDzRemovedNeutral", 800, -200, 200, 800, -200, 200);
1545
0861cc1f 1546 if(fCalcForKaonCorrection){
1547 Int_t nEtCut = 11;
1548 Float_t etCutAxis[12] = {0.00,0.05,0.10,0.15,0.20, 0.25,0.30,0.35,0.40,0.45, 0.50,0.55};
1549 fHistK0EDepositsVsPtInAcceptance = new TH3F("fHistK0EDepositsVsPtInAcceptance","Kaon deposits with corrections for kaons with y<0.5",fgNumOfPtBins,fgPtAxis,fgNumOfPtBins,fgPtAxis,nEtCut,etCutAxis);
1550 fHistK0EGammaVsPtInAcceptance = new TH3F("fHistK0EGammaVsPtInAcceptance","Kaon deposits without corrections for kaons with y<0.5",fgNumOfPtBins,fgPtAxis,fgNumOfPtBins,fgPtAxis,nEtCut,etCutAxis);
1551 fHistK0EDepositsVsPtOutOfAcceptance = new TH3F("fHistK0EDepositsVsPtOutOfAcceptance","Kaon deposits with corrections for kaons with y>0.5",fgNumOfPtBins,fgPtAxis,fgNumOfPtBins,fgPtAxis,nEtCut,etCutAxis);
1552 fHistK0EGammaVsPtOutOfAcceptance = new TH3F("fHistK0EGammaVsPtOutOfAcceptance","Kaon deposits without corrections for kaons with y>0.5",fgNumOfPtBins,fgPtAxis,fgNumOfPtBins,fgPtAxis,nEtCut,etCutAxis);
1553 fHistK0EDepositsVsPtInAcceptance->GetXaxis()->SetTitle("Kaon p_{T}");
1554 fHistK0EGammaVsPtInAcceptance->GetXaxis()->SetTitle("Kaon p_{T}");
1555 fHistK0EDepositsVsPtOutOfAcceptance->GetXaxis()->SetTitle("Kaon p_{T}");
1556 fHistK0EGammaVsPtOutOfAcceptance->GetXaxis()->SetTitle("Kaon p_{T}");
1557 fHistK0EDepositsVsPtInAcceptance->GetYaxis()->SetTitle("Deposited E_{T}");
1558 fHistK0EGammaVsPtInAcceptance->GetYaxis()->SetTitle("Deposited E_{T}");
1559 fHistK0EDepositsVsPtOutOfAcceptance->GetYaxis()->SetTitle("Deposited E_{T}");
1560 fHistK0EGammaVsPtOutOfAcceptance->GetYaxis()->SetTitle("Deposited E_{T}");
1561 fHistK0EDepositsVsPtInAcceptance->GetZaxis()->SetTitle("E_{T} cut");
1562 fHistK0EGammaVsPtInAcceptance->GetZaxis()->SetTitle("E_{T} cut");
1563 fHistK0EDepositsVsPtOutOfAcceptance->GetZaxis()->SetTitle("E_{T} cut");
1564 fHistK0EGammaVsPtOutOfAcceptance->GetZaxis()->SetTitle("E_{T} cut");
1565
1566 fHistSimKaonsInAcceptance = new TH1F("fHistSimKaonsInAcceptance","Kaons with y<0.5",fgNumOfPtBins,fgPtAxis);
1567 fHistSimK0SInAcceptance = new TH1F("fHistSimK0SInAcceptance","Kaons with y<0.5",fgNumOfPtBins,fgPtAxis);
1568 fHistSimK0LInAcceptance = new TH1F("fHistSimK0LInAcceptance","Kaons with y<0.5",fgNumOfPtBins,fgPtAxis);
1569 fHistSimKPlusInAcceptance = new TH1F("fHistSimKPlusInAcceptance","Kaons with y<0.5",fgNumOfPtBins,fgPtAxis);
1570 fHistSimKMinusInAcceptance = new TH1F("fHistSimKMinusInAcceptance","Kaons with y<0.5",fgNumOfPtBins,fgPtAxis);
1571 fHistSimKaonsOutOfAcceptance = new TH1F("fHistSimKaonsOutOfAcceptance","Kaons with y>0.5",fgNumOfPtBins,fgPtAxis);
1572 fHistSimKaonsInAcceptanceWithDepositsPrimaries = new TH1F("fHistSimKaonsInAcceptanceWithDepositsPrimaries","Primary Kaons which deposited energy in calorimeter with y>0.5",fgNumOfPtBins,fgPtAxis);
1573 fHistSimKaonsOutOfAcceptanceWithDepositsSecondaries = new TH1F("fHistSimKaonsOutOfAcceptanceWithDepositsSecondaries","Secondary Kaons which deposited energy in calorimeter with y>0.5",fgNumOfPtBins,fgPtAxis);
1574 fHistSimKaonsOutOfAcceptanceWithDepositsPrimaries = new TH1F("fHistSimKaonsOutOfAcceptanceWithDepositsPrimaries","Primary Kaons which deposited energy in calorimeter with y>0.5",fgNumOfPtBins,fgPtAxis);
1575 }
2aab9269 1576
e2ee5727 1577 fHistPiPlusMult = new TH1F("fHistPiPlusMult", "fHistPiPlusMult", 2000, -0.5, 1999.5);
1578 fHistPiMinusMult = new TH1F("fHistPiMinusMult", "fHistPiMinusMult", 2000, -0.5, 1999.5);
1579 fHistPiZeroMult = new TH1F("fHistPiZeroMult", "fHistPiZeroMult", 2000, -0.5, 1999.5);
1580
1581 fHistPiPlusMultAcc = new TH1F("fHistPiPlusMultAcc", "fHistPiPlusMultAcc", 2000, -0.5, 1999.5);
1582 fHistPiMinusMultAcc = new TH1F("fHistPiMinusMultAcc", "fHistPiMinusMultAcc", 2000, -0.5, 1999.5);
1583 fHistPiZeroMultAcc = new TH1F("fHistPiZeroMultAcc", "fHistPiZeroMultAcc", 2000, -0.5, 1999.5);
1584
f61cec2f 1585 if(fCuts->GetHistMakeTree())
1586 {
1587 TString treename = "fPrimaryTree" + fHistogramNameSuffix;
1588 fPrimaryTree = new TTree(treename, treename);
1589
1590 fPrimaryTree->Branch("fTotEt",&fTotEt,"fTotEt/D");
1591 fPrimaryTree->Branch("fNeutralMultiplicity", &fNeutralMultiplicity, "fNeutralMultiplicity/I");
1592 fPrimaryTree->Branch("fCentClass",&fCentClass,"fCentClass/I");
1593
1594 fPrimaryTree->Branch("fPrimaryCode", &fPrimaryCode, "fPrimaryCode/I");
1595 fPrimaryTree->Branch("fPrimaryCharge", &fPrimaryCharge, "fPrimaryCharge/I");
1596
1597 fPrimaryTree->Branch("fPrimaryE", &fPrimaryE, "fPrimaryE/D");
1598 fPrimaryTree->Branch("fPrimaryEt", &fPrimaryEt, "fPrimaryEt/D");
1599
1600 fPrimaryTree->Branch("fPrimaryPx", &fPrimaryPx, "fPrimaryPx/D");
1601 fPrimaryTree->Branch("fPrimaryPy", &fPrimaryPy, "fPrimaryPy/D");
1602 fPrimaryTree->Branch("fPrimaryPz", &fPrimaryPz, "fPrimaryPz/D");
1603
1604 fPrimaryTree->Branch("fPrimaryVx", &fPrimaryVx, "fPrimaryVx/D");
1605 fPrimaryTree->Branch("fPrimaryVy", &fPrimaryVy, "fPrimaryVy/D");
1606 fPrimaryTree->Branch("fPrimaryVz", &fPrimaryVz, "fPrimaryVz/D");
1607
1608 fPrimaryTree->Branch("fPrimaryAccepted", &fPrimaryAccepted, "fPrimaryAccepted/B");
b2c10007 1609 fPrimaryTree->Branch("fPrimaryMatched", &fPrimaryMatched, "fPrimaryMatched/B");
f61cec2f 1610
1611
1612 fPrimaryTree->Branch("fDepositedCode", &fDepositedCode, "fDepositedCode/I");
1613 fPrimaryTree->Branch("fDepositedCharge", &fDepositedCharge, "fDepositedCharge/I");
b2c10007 1614 fPrimaryTree->Branch("fDepositedE", &fDepositedE, "fDepositedE/D");
f61cec2f 1615 fPrimaryTree->Branch("fDepositedEt", &fDepositedEt, "fDepositedEt/D");
1616
1617 fPrimaryTree->Branch("fDepositedVx", &fDepositedVx, "fDepositedVx/D");
1618 fPrimaryTree->Branch("fDepositedVy", &fDepositedVy, "fDepositedVy/D");
1619 fPrimaryTree->Branch("fDepositedVz", &fDepositedVz, "fDepositedVz/D");
1620
b2c10007 1621 fPrimaryTree->Branch("fSecondary", &fSecondary, "fSecondary/I");
1622
1623
1624 fPrimaryTree->Branch("fReconstructedE", &fReconstructedE, "fReconstructedE/D");
1625 fPrimaryTree->Branch("fReconstructedEt", &fReconstructedEt, "fReconstructedEt/D");
1626
1627 fPrimaryTree->Branch("fClusterMult", &fClusterMult, "fClusterMult/I");
1628
1629
f61cec2f 1630 }
1631
9ef6f13f 1632 fHistGammasFound = new TH1F("fHistGammasFound", "fHistGammasFound",200, 0, 10);
1633 fHistGammasGenerated = new TH1F("fHistGammasGenerated", "fHistGammasGenerated",200, 0, 10);
9a365626 1634 fHistGammasFoundOutOfAccCent = new TH2F("fHistGammasFoundOutOfAccCent", "fHistGammasFoundOutOfAccCent",200, 0, 10,20,-0.5,19.5);
5881f036 1635 fHistGammasFoundCent = new TH2F("fHistGammasFoundCent", "fHistGammasFoundCent",200, 0, 10,20,-0.5,19.5);
1636 fHistGammasGeneratedCent = new TH2F("fHistGammasGeneratedCent", "fHistGammasGeneratedCent",200, 0, 10,20,-0.5,19.5);
9ef6f13f 1637 fHistChargedTracksCut = new TH1F("fHistChargedTracksCut", "fHistChargedTracksCut",100, 0, 5);
1638 fHistChargedTracksAccepted = new TH1F("fHistChargedTracksAccepted", "fHistChargedTracksAccepted",100, 0, 5);
1639 fHistGammasCut = new TH1F("fHistGammasTracksCut", "fHistGammasTracksCut",100, 0, 5);
1640 fHistGammasAccepted = new TH1F("fHistGammasTracksAccepted", "fHistGammasTracksAccepted",100, 0, 5);
0861cc1f 1641
1642 if(fCalcTrackMatchVsMult){
1643 fHistChargedTracksCutMult = new TH2F("fHistChargedTracksCutMult", "fHistChargedTracksCutMult",100, 0, 5,10,0,100);
1644 fHistChargedTracksAcceptedMult = new TH2F("fHistChargedTracksAcceptedMult", "fHistChargedTracksAcceptedMult",100, 0, 5,10,0,100);
5881f036 1645 fHistChargedTracksAcceptedLowPtCent = new TH2F("fHistChargedTracksAcceptedLowPtCent", "fHistChargedTracksAcceptedLowPtCent",100, 0, 5,20,-0.5,19.5);
1646 fHistChargedTracksAcceptedLowPtCent500MeV = new TH2F("fHistChargedTracksAcceptedLowPtCent500MeV", "fHistChargedTracksAcceptedLowPtCent500MeV",100, 0, 5,20,-0.5,19.5);
1647 fHistChargedTracksAcceptedLowPtCentNoAntiProtons = new TH2F("fHistChargedTracksAcceptedLowPtCentNoAntiProtons", "fHistChargedTracksAcceptedLowPtCentNoAntiProtons",100, 0, 5,20,-0.5,19.5);
1648 fHistChargedTracksAcceptedLowPtCentAntiProtons = new TH2F("fHistChargedTracksAcceptedLowPtCentAntiProtons", "fHistChargedTracksAcceptedLowPtCentAntiProtons",100, 0, 5,20,-0.5,19.5);
0861cc1f 1649 fHistGammasCutMult = new TH2F("fHistGammasTracksCutMult", "fHistGammasTracksCutMult",100, 0, 5,10,0,100);
1650 fHistGammasAcceptedMult = new TH2F("fHistGammasTracksAcceptedMult", "fHistGammasTracksAcceptedMult",100, 0, 5,10,0,100);
1651 }
1652
9ef6f13f 1653 fHistBadTrackMatches = new TH1F("fHistBadTrackMatches", "fHistBadTrackMatches",100, 0, 5);
1654 fHistMatchedTracksEvspTBkgd = new TH2F("fHistMatchedTracksEvspTBkgd", "fHistMatchedTracksEvspTBkgd",100, 0, 3,100,0,3);
1655 fHistMatchedTracksEvspTSignal = new TH2F("fHistMatchedTracksEvspTSignal", "fHistMatchedTracksEvspTSignal",100, 0, 3,100,0,3);
0861cc1f 1656 if(fCalcTrackMatchVsMult){
1657 fHistMatchedTracksEvspTBkgdPeripheral = new TH2F("fHistMatchedTracksEvspTBkgdPeripheral", "fHistMatchedTracksEvspTBkgd",100, 0, 3,100,0,3);
1658 fHistMatchedTracksEvspTSignalPeripheral = new TH2F("fHistMatchedTracksEvspTSignalPeripheral", "fHistMatchedTracksEvspTSignal",100, 0, 3,100,0,3);
1659
5881f036 1660 fHistMatchedTracksEvspTBkgdvsCent = new TH3F("fHistMatchedTracksEvspTBkgdvsCent", "fHistMatchedTracksEvspTBkgdvsCent",100, 0, 3,100,0,3,20,-0.5,19.5);
1661 fHistMatchedTracksEvspTSignalvsCent = new TH3F("fHistMatchedTracksEvspTSignalvsCent", "fHistMatchedTracksEvspTSignalvsCent",100, 0, 3,100,0,3,20,-0.5,19.5);
1662 fHistMatchedTracksEvspTBkgdvsCentEffCorr = new TH3F("fHistMatchedTracksEvspTBkgdvsCentEffCorr", "fHistMatchedTracksEvspTBkgdvsCent",100, 0, 3,100,0,3,20,-0.5,19.5);
1663 fHistMatchedTracksEvspTSignalvsCentEffCorr = new TH3F("fHistMatchedTracksEvspTSignalvsCentEffCorr", "fHistMatchedTracksEvspTSignalvsCent",100, 0, 3,100,0,3,20,-0.5,19.5);
0861cc1f 1664
1665
1666 fHistChargedTracksCutPeripheral = new TH1F("fHistChargedTracksCutPeripheral", "fHistChargedTracksCut",100, 0, 5);
1667 fHistChargedTracksAcceptedPeripheral = new TH1F("fHistChargedTracksAcceptedPeripheral", "fHistChargedTracksAccepted",100, 0, 5);
1668 fHistGammasCutPeripheral = new TH1F("fHistGammasTracksCutPeripheral", "fHistGammasTracksCut",100, 0, 5);
1669 fHistGammasAcceptedPeripheral = new TH1F("fHistGammasTracksAcceptedPeripheral", "fHistGammasTracksAccepted",100, 0, 5);
1670 }
9ef6f13f 1671 fHistBadTrackMatchesdPhidEta = new TH2F("fHistBadTrackMatchesdPhidEta", "fHistBadTrackMatchesdPhidEta",20, -0.1, 0.1,20,-.1,0.1);
1672 fHistGoodTrackMatchesdPhidEta = new TH2F("fHistGoodTrackMatchesdPhidEta", "fHistGoodTrackMatchesdPhidEta",20, -0.1, 0.1,20,-.1,0.1);
c79c36cc 1673
1674 fHistHadronDepositsAll = new TH1F("fHistHadronDepositsAll","All Hadrons which deposited energy in calorimeter",fgNumOfPtBins,fgPtAxis);
1675 fHistHadronDepositsReco = new TH1F("fHistHadronDepositsReco","Reconstructed Hadrons which deposited energy in calorimeter",fgNumOfPtBins,fgPtAxis);
1676 //,10,0,100
1677 Int_t nMult = 20;
1678 Float_t nMultCuts[21] = { 0, 5,10,15,20, 25,30,35,40,45,
1679 50,55,60,65,70, 75,80,85,90,95,
1680 100};
ac610b08 1681 Int_t nCent = 20;
1682 Float_t nCentCuts[21] = { 0, 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20};
c79c36cc 1683
ac610b08 1684 fHistHadronDepositsAllCent = new TH2F("fHistHadronDepositsAllCent","All Hadrons which deposited energy in calorimeter",fgNumOfPtBins,fgPtAxis,nCent,nCentCuts);
5881f036 1685 fHistHadronDepositsAllCent500MeV = new TH2F("fHistHadronDepositsAllCent500MeV","All Hadrons which deposited energy in calorimeter pT>500MeV",fgNumOfPtBins,fgPtAxis,nCent,nCentCuts);
ac610b08 1686 fHistHadronDepositsRecoCent = new TH2F("fHistHadronDepositsRecoCent","Reconstructed Hadrons which deposited energy in calorimeter",fgNumOfPtBins,fgPtAxis,nCent,nCentCuts);
d3ce32b8 1687
ac610b08 1688 fHistHadronsAllCent = new TH2F("fHistHadronsAllCent","All Hadrons vs cluster mult",fgNumOfPtBins,fgPtAxis,nCent,nCentCuts);
d3ce32b8 1689
1690 fHistMultChVsSignalVsMult = new TH3F("fHistMultChVsSignalVsMult","Charged particle Multiplicity vs Signal particle multiplicity vs Cluster Mult",nMult,nMultCuts,nMult,nMultCuts,nMult,nMultCuts);
9a365626 1691 fHistNeutralRemovedSecondaryEtVsCent = new TH2F("fHistNeutralRemovedSecondaryEtVsCent","Neutral Removed Secondaries E_{T} vs centrality",100,0.0,2.0,20,-0.5,19.5);
1692 fHistChargedRemovedSecondaryEtVsCent = new TH2F("fHistChargedRemovedSecondaryEtVsCent","Charged Removed Secondaries E_{T} vs centrality",100,0.0,2.0,20,-0.5,19.5);
1693 fHistNeutralNotRemovedSecondaryEtVsCent = new TH2F("fHistNeutralNotRemovedSecondaryEtVsCent","Neutral NotRemoved Secondaries E_{T} vs centrality",100,0.0,2.0,20,-0.5,19.5);
1694 fHistChargedNotRemovedSecondaryEtVsCent = new TH2F("fHistChargedNotRemovedSecondaryEtVsCent","Charged NotRemoved Secondaries E_{T} vs centrality",100,0.0,2.0,20,-0.5,19.5);
1695 fHistNeutralRemovedSecondaryNumVsNCluster = new TH2F("fHistNeutralRemovedSecondaryNumVsNCluster","Neutral Removed Secondaries Number vs N_{cluster}",20,-0.5,19.5,250,0,250);
1696 fHistChargedRemovedSecondaryNumVsNCluster = new TH2F("fHistChargedRemovedSecondaryNumVsNCluster","Charged Removed Secondaries Number vs N_{cluster}",20,-0.5,19.5,250,0,250);
1697 fHistNeutralNotRemovedSecondaryNumVsNCluster = new TH2F("fHistNeutralNotRemovedSecondaryNumVsNCluster","Neutral NotRemoved Secondaries Number vs N_{cluster}",20,-0.5,19.5,250,0,250);
1698 fHistChargedNotRemovedSecondaryNumVsNCluster = new TH2F("fHistChargedNotRemovedSecondaryNumVsNCluster","Charged NotRemoved Secondaries Number vs N_{cluster}",20,-0.5,19.5,250,0,250);
1699 fHistNeutralRemovedSecondaryNumVsCent = new TH2F("fHistNeutralRemovedSecondaryNumVsCent","Neutral Removed Secondaries Number vs N_{cluster}",20,-0.5,19.5,20,-0.5,19.5);
1700 fHistChargedRemovedSecondaryNumVsCent = new TH2F("fHistChargedRemovedSecondaryNumVsCent","Charged Removed Secondaries Number vs N_{cluster}",20,-0.5,19.5,20,-0.5,19.5);
1701 fHistNeutralNotRemovedSecondaryNumVsCent = new TH2F("fHistNeutralNotRemovedSecondaryNumVsCent","Neutral NotRemoved Secondaries Number vs N_{cluster}",20,-0.5,19.5,20,-0.5,19.5);
1702 fHistChargedNotRemovedSecondaryNumVsCent = new TH2F("fHistChargedNotRemovedSecondaryNumVsCent","Charged NotRemoved Secondaries Number vs N_{cluster}",20,-0.5,19.5,20,-0.5,19.5);
1703 fHistNeutronsEtVsCent = new TH2F("fHistNeutronsEtVsCent","Neutrons and anti-neutrons - deposited ET vs Centrality bin",100,0,4.0,20,-0.5,19.5);
1704 fHistNeutronsNumVsCent = new TH2F("fHistNeutronsNumVsCent","Neutrons and anti-neutrons - number vs Centrality bin",20,-0.5,19.5,20,-0.5,19.5);
1705 fHistNotNeutronsNumVsCent = new TH2F("fHistNotNeutronsNumVsCent","Neutral particles not otherwise classified - number vs Centrality bin",20,-0.5,19.5,20,-0.5,19.5);
1706 Int_t nbinsEt = 125;
1707 Float_t maxEtRange = 125;
1708 Float_t maxEtRangeShort = 25;
1709 Float_t minEtRange = 0;
1710 Int_t nbinsMult = 100;
1711 Float_t maxMult = 3000;
1712 Float_t minMult = 0;
03cff249 1713 Int_t nbinsCl = 175;
1714 Float_t maxCl = 350;
9a365626 1715 Float_t minCl = 0;
1716 fHistPiKPDepositedVsNch = new TH2F("fHistPiKPDepositedVsNch","#pi,K,p E_{T} deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRange,nbinsMult,minMult,maxMult);
1717 fHistPiKPNotTrackMatchedDepositedVsNch = new TH2F("fHistPiKPNotTrackMatchedDepositedVsNch","#pi,K,p E_{T} deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRange,nbinsMult,minMult,maxMult);
1718 fHistNeutronsDepositedVsNch = new TH2F("fHistNeutronsDepositedVsNch","n deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRangeShort,nbinsMult,minMult,maxMult);
1719 fHistAntiNeutronsDepositedVsNch = new TH2F("fHistAntiNeutronsDepositedVsNch","#bar{n} deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRangeShort,nbinsMult,minMult,maxMult);
1720 fHistProtonsDepositedVsNch = new TH2F("fHistProtonsDepositedVsNch","p deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRangeShort,nbinsMult,minMult,maxMult);
1721 fHistAntiProtonsDepositedVsNch = new TH2F("fHistAntiProtonsDepositedVsNch","#bar{p} deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRangeShort,nbinsMult,minMult,maxMult);
1722 fHistProtonsNotTrackMatchedDepositedVsNch = new TH2F("fHistProtonsNotTrackMatchedDepositedVsNch","p not track matched deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRangeShort,nbinsMult,minMult,maxMult);
1723 fHistAntiProtonsNotTrackMatchedDepositedVsNch = new TH2F("fHistAntiProtonsNotTrackMatchedDepositedVsNch","#bar{p} not track matched deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRangeShort,nbinsMult,minMult,maxMult);
1724 fHistSecondariesVsNch = new TH2F("fHistSecondariesVsNch","secondaries deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRangeShort,nbinsMult,minMult,maxMult);
1725 fHistSecondariesVsNcl = new TH2F("fHistSecondariesVsNcl","secondaries deposited in calorimeter vs number of clusters",nbinsEt,minEtRange,maxEtRangeShort,nbinsCl,minCl,maxCl);
1726 fHistSecondariesEffCorrVsNch = new TH2F("fHistSecondariesEffCorrVsNch","efficiency corrected secondaries deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRangeShort,nbinsMult,minMult,maxMult);
1727 fHistSecondariesEffCorrVsNcl = new TH2F("fHistSecondariesEffCorrVsNcl","efficiency corrected secondaries deposited in calorimeter vs number of clusters",nbinsEt,minEtRange,maxEtRangeShort,nbinsCl,minCl,maxCl);
1728 fHistCentVsNchVsNcl = new TH3F("fHistCentVsNchVsNcl","Cent bin vs Nch Vs NCl",20,-0.5,19.5,nbinsMult,minMult,maxMult,nbinsCl,minCl,maxCl);
03cff249 1729 float maxpos = 500;
1730 int nbinspos = 200;
1731 fHistSecondaryPositionInDetector = new TH3F("fHistSecondaryPositionInDetector","Position of secondaries",nbinspos,-maxpos,maxpos,nbinspos,-maxpos,maxpos,nbinspos,-maxpos,maxpos);
1732 fHistSecondaryPositionInDetector->GetXaxis()->SetTitle("X");
1733 fHistSecondaryPositionInDetector->GetYaxis()->SetTitle("Y");
1734 fHistSecondaryPositionInDetector->GetZaxis()->SetTitle("Z");
ce546038 1735}
1736
0651f6b4 1737void AliAnalysisEtMonteCarlo::FillOutputList(TList *list)
f61cec2f 1738{ //fill the output list
e2ee5727 1739 AliAnalysisEt::FillOutputList(list);
1740
c79c36cc 1741 if(!fIsMC) return;
f61cec2f 1742 if(fCuts->GetHistMakeTree())
1743 {
1744 list->Add(fPrimaryTree);
1745 }
1746
e2ee5727 1747 list->Add(fHistRemovedOrNot);
1748
1749 list->Add(fHistEtNonRemovedProtons);
1750 list->Add(fHistEtNonRemovedAntiProtons);
1751 list->Add(fHistEtNonRemovedPiPlus);
1752 list->Add(fHistEtNonRemovedPiMinus);
1753 list->Add(fHistEtNonRemovedKaonPlus);
1754 list->Add(fHistEtNonRemovedKaonMinus);
1755 list->Add(fHistEtNonRemovedK0s);
ef647350 1756 list->Add(fHistEtNonRemovedK0L);
e2ee5727 1757 list->Add(fHistEtNonRemovedLambdas);
1758 list->Add(fHistEtNonRemovedElectrons);
1759 list->Add(fHistEtNonRemovedPositrons);
1760 list->Add(fHistEtNonRemovedMuPlus);
1761 list->Add(fHistEtNonRemovedMuMinus);
1762 list->Add(fHistEtNonRemovedNeutrons);
1763 list->Add(fHistEtNonRemovedAntiNeutrons);
1764 list->Add(fHistEtNonRemovedGammas);
1765 list->Add(fHistEtNonRemovedGammasFromPi0);
1766
1767 list->Add(fHistEtRemovedGammas);
1768 list->Add(fHistEtRemovedNeutrons);
1769 list->Add(fHistEtRemovedAntiNeutrons);
1770
ef647350 1771 list->Add(fHistEtRemovedCharged);
1772 list->Add(fHistEtRemovedNeutrals);
1773
1774 list->Add(fHistEtNonRemovedCharged);
1775 list->Add(fHistEtNonRemovedNeutrals);
e2ee5727 1776
1777 list->Add(fHistMultNonRemovedProtons);
1778 list->Add(fHistMultNonRemovedAntiProtons);
1779 list->Add(fHistMultNonRemovedPiPlus);
1780 list->Add(fHistMultNonRemovedPiMinus);
1781 list->Add(fHistMultNonRemovedKaonPlus);
1782 list->Add(fHistMultNonRemovedKaonMinus);
1783 list->Add(fHistMultNonRemovedK0s);
ef647350 1784 list->Add(fHistMultNonRemovedK0L);
e2ee5727 1785 list->Add(fHistMultNonRemovedLambdas);
1786 list->Add(fHistMultNonRemovedElectrons);
1787 list->Add(fHistMultNonRemovedPositrons);
1788 list->Add(fHistMultNonRemovedMuPlus);
1789 list->Add(fHistMultNonRemovedMuMinus);
1790 list->Add(fHistMultNonRemovedNeutrons);
1791 list->Add(fHistMultNonRemovedAntiNeutrons);
1792 list->Add(fHistMultNonRemovedGammas);
1793
1794 list->Add(fHistMultRemovedGammas);
1795 list->Add(fHistMultRemovedNeutrons);
1796 list->Add(fHistMultRemovedAntiNeutrons);
1797
ef647350 1798 list->Add(fHistMultRemovedCharged);
1799 list->Add(fHistMultRemovedNeutrals);
1800
1801 list->Add(fHistMultNonRemovedCharged);
1802 list->Add(fHistMultNonRemovedNeutrals);
1803
e2ee5727 1804 list->Add(fHistTrackMultvsNonRemovedCharged);
1805 list->Add(fHistTrackMultvsNonRemovedNeutral);
1806 list->Add(fHistTrackMultvsRemovedGamma);
1807
1808 list->Add(fHistClusterMultvsNonRemovedCharged);
1809 list->Add(fHistClusterMultvsNonRemovedNeutral);
1810 list->Add(fHistClusterMultvsRemovedGamma);
1811
1812 //list->Add(fHistDecayVertexNonRemovedCharged);
1813 //list->Add(fHistDecayVertexNonRemovedNeutral);
1814 //list->Add(fHistDecayVertexRemovedCharged);
1815 //list->Add(fHistDecayVertexRemovedNeutral);
1816
1817 list->Add(fHistDxDzNonRemovedCharged);
1818 list->Add(fHistDxDzRemovedCharged);
1819 list->Add(fHistDxDzNonRemovedNeutral);
1820 list->Add(fHistDxDzRemovedNeutral);
1821
0861cc1f 1822 if(fCalcForKaonCorrection){
1823 list->Add(fHistK0EDepositsVsPtInAcceptance);
1824 list->Add(fHistK0EGammaVsPtInAcceptance);
1825 list->Add(fHistK0EDepositsVsPtOutOfAcceptance);
1826 list->Add(fHistK0EGammaVsPtOutOfAcceptance);
1827 list->Add(fHistSimKaonsInAcceptance);
1828 list->Add(fHistSimK0SInAcceptance);
1829 list->Add(fHistSimK0LInAcceptance);
1830 list->Add(fHistSimKPlusInAcceptance);
1831 list->Add(fHistSimKMinusInAcceptance);
1832 list->Add(fHistSimKaonsOutOfAcceptance);
1833 list->Add(fHistSimKaonsInAcceptanceWithDepositsPrimaries);
1834 list->Add(fHistSimKaonsOutOfAcceptanceWithDepositsSecondaries);
1835 list->Add(fHistSimKaonsOutOfAcceptanceWithDepositsPrimaries);
1836 }
2aab9269 1837
e2ee5727 1838 list->Add(fHistPiPlusMult);
1839 list->Add(fHistPiMinusMult);
1840 list->Add(fHistPiZeroMult);
1841 list->Add(fHistPiPlusMultAcc);
1842 list->Add(fHistPiMinusMultAcc);
1843 list->Add(fHistPiZeroMultAcc);
b2c10007 1844
1845 list->Add(fHistGammasFound);
1846 list->Add(fHistGammasGenerated);
9a365626 1847 list->Add(fHistGammasFoundOutOfAccCent);
5881f036 1848 list->Add(fHistGammasFoundCent);
1849 list->Add(fHistGammasGeneratedCent);
9ef6f13f 1850 list->Add(fHistChargedTracksCut);
1851 list->Add(fHistChargedTracksAccepted);
1852 list->Add(fHistGammasCut);
1853 list->Add(fHistGammasAccepted);
0861cc1f 1854 if(fCalcTrackMatchVsMult){
1855 list->Add(fHistChargedTracksCutMult);
1856 list->Add(fHistChargedTracksAcceptedMult);
ac610b08 1857 list->Add(fHistChargedTracksAcceptedLowPtCent);
5881f036 1858 list->Add(fHistChargedTracksAcceptedLowPtCent500MeV);
ac610b08 1859 list->Add(fHistChargedTracksAcceptedLowPtCentNoAntiProtons);
1860 list->Add(fHistChargedTracksAcceptedLowPtCentAntiProtons);
0861cc1f 1861 list->Add(fHistGammasCutMult);
1862 list->Add(fHistGammasAcceptedMult);
1863 }
9ef6f13f 1864 list->Add(fHistBadTrackMatches);
1865 list->Add(fHistMatchedTracksEvspTBkgd);
1866 list->Add(fHistMatchedTracksEvspTSignal);
0861cc1f 1867 if(fCalcTrackMatchVsMult){
1868 list->Add(fHistMatchedTracksEvspTBkgdPeripheral);
1869 list->Add(fHistMatchedTracksEvspTSignalPeripheral);
ac610b08 1870 list->Add(fHistMatchedTracksEvspTBkgdvsCent);
1871 list->Add(fHistMatchedTracksEvspTSignalvsCent);
1872 list->Add(fHistMatchedTracksEvspTBkgdvsCentEffCorr);
1873 list->Add(fHistMatchedTracksEvspTSignalvsCentEffCorr);
0861cc1f 1874 list->Add(fHistChargedTracksCutPeripheral);
1875 list->Add(fHistChargedTracksAcceptedPeripheral);
1876 list->Add(fHistGammasCutPeripheral);
1877 list->Add(fHistGammasAcceptedPeripheral);
1878 }
9ef6f13f 1879 list->Add(fHistBadTrackMatchesdPhidEta);
1880 list->Add(fHistGoodTrackMatchesdPhidEta);
c79c36cc 1881 list->Add(fHistHadronDepositsAll);
1882 list->Add(fHistHadronDepositsReco);
ac610b08 1883 list->Add(fHistHadronDepositsAllCent);
5881f036 1884 list->Add(fHistHadronDepositsAllCent500MeV);
ac610b08 1885 list->Add(fHistHadronDepositsRecoCent);
1886 list->Add(fHistHadronsAllCent);
d3ce32b8 1887 list->Add(fHistMultChVsSignalVsMult);
9a365626 1888 list->Add(fHistNeutralRemovedSecondaryEtVsCent);
1889 list->Add(fHistChargedRemovedSecondaryEtVsCent);
1890 list->Add(fHistNeutralNotRemovedSecondaryEtVsCent);
1891 list->Add(fHistChargedNotRemovedSecondaryEtVsCent);
1892 list->Add(fHistNeutralRemovedSecondaryNumVsNCluster);
1893 list->Add(fHistChargedRemovedSecondaryNumVsNCluster);
1894 list->Add(fHistNeutralNotRemovedSecondaryNumVsNCluster);
1895 list->Add(fHistChargedNotRemovedSecondaryNumVsNCluster);
1896 list->Add(fHistNeutralRemovedSecondaryNumVsCent);
1897 list->Add(fHistChargedRemovedSecondaryNumVsCent);
1898 list->Add(fHistNeutralNotRemovedSecondaryNumVsCent);
1899 list->Add(fHistChargedNotRemovedSecondaryNumVsCent);
1900 list->Add(fHistNeutronsEtVsCent);
1901 list->Add(fHistNeutronsNumVsCent);
1902 list->Add(fHistNotNeutronsNumVsCent);
1903 list->Add(fHistPiKPDepositedVsNch);
1904 list->Add(fHistPiKPNotTrackMatchedDepositedVsNch);
1905 list->Add(fHistNeutronsDepositedVsNch);
1906 list->Add(fHistAntiNeutronsDepositedVsNch);
1907 list->Add(fHistProtonsDepositedVsNch);
1908 list->Add(fHistAntiProtonsDepositedVsNch);
1909 list->Add(fHistProtonsNotTrackMatchedDepositedVsNch);
1910 list->Add(fHistAntiProtonsNotTrackMatchedDepositedVsNch);
1911 list->Add(fHistSecondariesVsNch);
1912 list->Add(fHistSecondariesVsNcl);
1913 list->Add(fHistSecondariesEffCorrVsNch);
1914 list->Add(fHistSecondariesEffCorrVsNcl);
1915 list->Add(fHistCentVsNchVsNcl);
03cff249 1916 list->Add(fHistSecondaryPositionInDetector);
9a365626 1917
e2ee5727 1918
0651f6b4 1919}
1920
1921
13b0d3c1 1922bool AliAnalysisEtMonteCarlo::TrackHitsCalorimeter(TParticle* part, Double_t magField)
1923{
e2ee5727 1924 // printf(" TrackHitsCalorimeter - magField %f\n", magField);
1925 AliESDtrack *esdTrack = new AliESDtrack(part);
1926 // Printf("MC Propagating track: eta: %f, phi: %f, pt: %f", esdTrack->Eta(), esdTrack->Phi(), esdTrack->Pt());
1927
1928 Bool_t prop = esdTrack->PropagateTo(fDetectorRadius, magField);
1929
1930 // if(prop) Printf("Track propagated, eta: %f, phi: %f, pt: %f", esdTrack->Eta(), esdTrack->Phi(), esdTrack->Pt());
1931
f61cec2f 1932 bool status = prop && fSelector->CutGeometricalAcceptance(*esdTrack);
e2ee5727 1933 delete esdTrack;
1934
1935 return status;
1936}
1937
1938void AliAnalysisEtMonteCarlo::FillHistograms()
f61cec2f 1939{ // let base class fill its histograms, and us fill the local ones
e2ee5727 1940 AliAnalysisEt::FillHistograms();
c79c36cc 1941 if(!fIsMC) return;
e2ee5727 1942 //std::cout << fEtNonRemovedPiPlus << " " << fCentClass << std::endl;
1943
1944 fHistEtNonRemovedProtons->Fill(fEtNonRemovedProtons, fCentClass);
1945 fHistEtNonRemovedAntiProtons->Fill(fEtNonRemovedAntiProtons, fCentClass);
1946 fHistEtNonRemovedKaonPlus->Fill(fEtNonRemovedKaonPlus, fCentClass);
1947 fHistEtNonRemovedKaonMinus->Fill(fEtNonRemovedKaonMinus, fCentClass);
ef647350 1948 fHistEtNonRemovedK0s->Fill(fEtNonRemovedK0S, fCentClass);
1949 fHistEtNonRemovedK0L->Fill(fEtNonRemovedK0L, fCentClass);
e2ee5727 1950 fHistEtNonRemovedLambdas->Fill(fEtNonRemovedLambdas, fCentClass);
1951 fHistEtNonRemovedPiPlus->Fill(fEtNonRemovedPiPlus, fCentClass);
1952 fHistEtNonRemovedPiMinus->Fill(fEtNonRemovedPiMinus, fCentClass);
1953 fHistEtNonRemovedElectrons->Fill(fEtNonRemovedElectrons, fCentClass);
1954 fHistEtNonRemovedPositrons->Fill(fEtNonRemovedPositrons, fCentClass);
1955 fHistEtNonRemovedMuPlus->Fill(fEtNonRemovedMuPlus, fCentClass);
1956 fHistEtNonRemovedMuMinus->Fill(fEtNonRemovedMuMinus, fCentClass);
1957 fHistEtNonRemovedNeutrons->Fill(fEtNonRemovedNeutrons, fCentClass);
1958 fHistEtNonRemovedAntiNeutrons->Fill(fEtNonRemovedAntiNeutrons, fCentClass);
1959 fHistEtNonRemovedGammas->Fill(fEtNonRemovedGammas, fCentClass);
1960 fHistEtNonRemovedGammasFromPi0->Fill(fEtNonRemovedGammasFromPi0, fCentClass);
1961
ef647350 1962 fHistEtRemovedGammas->Fill(fEtRemovedGammas, fNClusters);
e2ee5727 1963 fHistEtRemovedNeutrons->Fill(fEtRemovedNeutrons, fCentClass);
1964 fHistEtRemovedAntiNeutrons->Fill(fEtRemovedAntiNeutrons, fCentClass);
1965
ef647350 1966// fHistEtRemovedCharged->Fill(fEtRemovedAntiProtons+fEtRemovedElectrons+fEtRemovedKaonMinus+fEtRemovedKaonPlus
1967// +fEtRemovedMuMinus+fEtRemovedMuPlus+fEtRemovedPiMinus+fEtRemovedPiPlus+fEtRemovedPositrons
1968// +fEtRemovedProtons.
1969// fCentClass);
1970// fHistEtRemovedNeutrals->Fill(fEtRemovedNeutrons+fEtRemovedAntiNeutrons, fCentClass);
f61cec2f 1971//
ef647350 1972// fHistEtNonRemovedCharged->Fill(fEtNonRemovedAntiProtons+fEtNonRemovedElectrons+fEtNonRemovedKaonMinus+fEtNonRemovedKaonPlus
1973// +fEtNonRemovedMuMinus+fEtNonRemovedMuPlus+fEtNonRemovedPiMinus+fEtNonRemovedPiPlus+fEtNonRemovedPositrons
1974// +fEtNonRemovedProtons,
1975// fCentClass);
1976// fHistEtRemovedNeutrals->Fill(fEtNonRemovedNeutrons+fEtNonRemovedAntiNeutrons, fCentClass);
1977
1978 fHistEtRemovedCharged->Fill(fEnergyChargedRemoved, fNClusters);
1979 fHistEtRemovedNeutrals->Fill(fEnergyNeutralRemoved, fNClusters);
1980 fHistEtNonRemovedCharged->Fill(fEnergyChargedNotRemoved, fNClusters);
1981 fHistEtNonRemovedNeutrals->Fill(fEnergyNeutralNotRemoved, fNClusters);
f61cec2f 1982
ef647350 1983 fHistMultRemovedCharged->Fill(fChargedRemoved, fNClusters);
1984 fHistMultRemovedNeutrals->Fill(fNeutralRemoved, fNClusters);
1985 fHistMultNonRemovedCharged->Fill(fChargedNotRemoved, fNClusters);
1986 fHistMultNonRemovedNeutrals->Fill(fNeutralNotRemoved, fNClusters);
f61cec2f 1987
1988
e2ee5727 1989 fHistMultNonRemovedProtons->Fill(fMultNonRemovedProtons, fCentClass);
1990 fHistMultNonRemovedAntiProtons->Fill(fMultNonRemovedAntiProtons, fCentClass);
1991 fHistMultNonRemovedKaonPlus->Fill(fMultNonRemovedKaonPlus, fCentClass);
1992 fHistMultNonRemovedKaonMinus->Fill(fMultNonRemovedKaonMinus, fCentClass);
1993 fHistMultNonRemovedK0s->Fill(fMultNonRemovedK0s, fCentClass);
ef647350 1994 fHistMultNonRemovedK0L->Fill(fMultNonRemovedK0L, fCentClass);
e2ee5727 1995 fHistMultNonRemovedLambdas->Fill(fMultNonRemovedLambdas, fCentClass);
1996 fHistMultNonRemovedPiPlus->Fill(fMultNonRemovedPiPlus, fCentClass);
1997 fHistMultNonRemovedPiMinus->Fill(fMultNonRemovedPiMinus, fCentClass);
1998 fHistMultNonRemovedElectrons->Fill(fMultNonRemovedElectrons, fCentClass);
1999 fHistMultNonRemovedPositrons->Fill(fMultNonRemovedPositrons, fCentClass);
2000 fHistMultNonRemovedMuPlus->Fill(fMultNonRemovedMuPlus, fCentClass);
2001 fHistMultNonRemovedMuMinus->Fill(fMultNonRemovedMuMinus, fCentClass);
2002 fHistMultNonRemovedNeutrons->Fill(fMultNonRemovedNeutrons, fCentClass);
2003 fHistMultNonRemovedAntiNeutrons->Fill(fMultNonRemovedAntiNeutrons, fCentClass);
2004 fHistMultNonRemovedGammas->Fill(fMultNonRemovedGammas, fCentClass);
2005
2006 fHistMultRemovedGammas->Fill(fMultRemovedGammas, fCentClass);
2007 fHistMultRemovedNeutrons->Fill(fMultRemovedNeutrons, fCentClass);
2008 fHistMultRemovedAntiNeutrons->Fill(fMultRemovedAntiNeutrons, fCentClass);
2009
2010 fHistTrackMultvsNonRemovedCharged->Fill(fTrackMultInAcc,
2011 fMultNonRemovedAntiProtons+fMultNonRemovedElectrons+fMultNonRemovedKaonMinus+fMultNonRemovedKaonPlus
2012 +fMultNonRemovedMuMinus+fMultNonRemovedMuPlus+fMultNonRemovedPiMinus+fMultNonRemovedPiPlus+fMultNonRemovedPositrons
2013 +fMultNonRemovedProtons);
2014
2015 fHistTrackMultvsNonRemovedNeutral->Fill(fTrackMultInAcc,
b2c10007 2016 fMultNonRemovedNeutrons+fMultNonRemovedAntiNeutrons+fMultNonRemovedK0s+fMultNonRemovedK0L+fMultNonRemovedLambdas+fK0sMult);
e2ee5727 2017
2018 fHistTrackMultvsRemovedGamma->Fill(fTrackMultInAcc,
2019 fMultRemovedGammas);
2020
ef647350 2021 fHistClusterMultvsNonRemovedCharged->Fill(fNClusters,
e2ee5727 2022 fMultNonRemovedAntiProtons+fMultNonRemovedElectrons+fMultNonRemovedKaonMinus
2023 +fMultNonRemovedKaonPlus+fMultNonRemovedMuMinus+fMultNonRemovedMuPlus
2024 +fMultNonRemovedPiMinus+fMultNonRemovedPiPlus+fMultNonRemovedPositrons+fMultNonRemovedProtons);
2025
ef647350 2026 fHistClusterMultvsNonRemovedNeutral->Fill(fNClusters,
b2c10007 2027 fMultNonRemovedNeutrons+fMultNonRemovedAntiNeutrons+fMultNonRemovedK0s+fMultNonRemovedK0L+fMultNonRemovedLambdas+fK0sMult);
e2ee5727 2028
ef647350 2029 fHistClusterMultvsRemovedGamma->Fill(fNClusters,
e2ee5727 2030 fMultRemovedGammas);
2031
13b0d3c1 2032}
2033
e2ee5727 2034
2035
2036
ef647350 2037Int_t AliAnalysisEtMonteCarlo::PrintFamilyTree(Int_t partIdx, AliStack* stack)
4d376d01 2038{ // print family tree
f61cec2f 2039 TParticle *part = stack->Particle(partIdx);
b2c10007 2040// if(part->GetPdgCode() == fgK0SCode)
f61cec2f 2041 {
2042 std::cout << "This is index: " << partIdx << " (" << stack->Particle(partIdx)->GetName() <<") , is it primary: " << stack->IsPhysicalPrimary(partIdx)<< std::endl;
2043 std::cout << "PID: " << part->GetPdgCode() << "/" << part->GetName() << std::endl;
2044 std::cout << "Energy: " << part->Energy() << std::endl;
03cff249 2045 Float_t vtx = TMath::Sqrt( TMath::Power(part->Vx(),2) + TMath::Power(part->Vy(),2) + TMath::Power(part->Vz(),2) );
2046 std::cout << "Vertex: " << part->Vx() << ", " << part->Vy() << ", " << part->Vz() <<"|Vtx| "<<vtx << std::endl;
f61cec2f 2047 }
2048 return PrintMothers(partIdx, stack, 1);
ef647350 2049}
2050
2051Int_t AliAnalysisEtMonteCarlo::PrintMothers(Int_t partIdx, AliStack* stack, Int_t gen)
4d376d01 2052{ // print mothers
f61cec2f 2053 char *tabs = new char[gen+1];
2054 for(Int_t i = 0; i < gen; ++i)
2055 {
2056 //std::cout << i << std::endl;
2057 tabs[i] = '\t';
2058 }
2059 tabs[gen] = '\0';
2060 Int_t mothIdx = stack->Particle(partIdx)->GetMother(0);
2061 if(mothIdx < 0)
2062 {
2063 delete [] tabs;
2064 return 0;
2065 }
2066 TParticle *mother = stack->Particle(mothIdx);
b2c10007 2067// if(mother->GetPdgCode() == fgK0SCode)
f61cec2f 2068 {
b2c10007 2069 //std::cout << tabs << "Mother of index: " << partIdx << " (" << stack->Particle(partIdx)->GetName() <<") is: " << mothIdx << ", is it primary: " << stack->IsPhysicalPrimary(mothIdx)<< std::endl;
2070 std::cout << tabs << "Index: " << mothIdx << std::endl;
2071 std::cout << tabs << "Primary: " << stack->IsPhysicalPrimary(mothIdx) << std::endl;
f61cec2f 2072 std::cout << tabs << "PID: " << mother->GetPdgCode() << "/" << mother->GetName() << std::endl;
2073 std::cout << tabs << "Energy: " << mother->Energy() << std::endl;
b2c10007 2074 if(mother->GetFirstMother() >= 0)
2075 {
2076 std::cout << tabs << "Mother(s): " << stack->Particle(mother->GetFirstMother())->GetPdgCode();
2077 if(mother->GetSecondMother() >= 0) std::cout << ", " << stack->Particle(mother->GetSecondMother())->GetPdgCode();
2078 std::cout << std::endl;
2079 }
03cff249 2080 Float_t vtx = TMath::Sqrt( TMath::Power(mother->Vx(),2) + TMath::Power(mother->Vy(),2) + TMath::Power(mother->Vz(),2) );
2081 std::cout<<tabs << "Vertex: " << mother->Vx() << ", " << mother->Vy() << ", " << mother->Vz() <<"|Vtx| "<<vtx << std::endl;
f61cec2f 2082 }
2083 if(mother->GetPdgCode() == fgK0SCode)
2084 {
ef647350 2085// std::cout << "K0S!!!!!!!!!!!!!11111!!!!!" << std::endl;
f61cec2f 2086 }
ef647350 2087// std::cout << "Mother of index: " << partIdx << " (" << stack->Particle(partIdx)->GetName() <<") is: " << mothIdx << std::endl;
2088// std::cout << "PID: " << mother->GetPdgCode() << "/" << mother->GetName() << std::endl;
2089// std::cout << "Energy: " << mother->Energy() << std::endl;
2090// std::cout << "Vertex: " << mother->Vx() << ", " << mother->Vy() << ", " << mother->Vz() << std::endl;
f61cec2f 2091
2092 delete [] tabs;
2093 return PrintMothers(mothIdx, stack, gen+1) + 1;
ef647350 2094}
2095
2096Int_t AliAnalysisEtMonteCarlo::GetPrimMother(Int_t partIdx, AliStack *stack)
4d376d01 2097{ // get primary mother
f61cec2f 2098 if(partIdx >= 0)
ef647350 2099 {
b2c10007 2100 //return stack->GetPrimary(partIdx);
2101
f61cec2f 2102 Int_t mothIdx = stack->Particle(partIdx)->GetMother(0);
2103 if(mothIdx < 0) return -1;
2104 TParticle *mother = stack->Particle(mothIdx);
2105 if(mother)
2106 {
f61cec2f 2107 if(stack->IsPhysicalPrimary(mothIdx)) return mothIdx;
2108 else return GetPrimMother(mothIdx, stack);
2109 }
2110 else
2111 {
2112 return -1;
2113 }
ef647350 2114 }
f61cec2f 2115 return -1;
ef647350 2116}
2117
2118Int_t AliAnalysisEtMonteCarlo::GetK0InFamily(Int_t partIdx, AliStack* stack)
4d376d01 2119{ // get K0 in family
f61cec2f 2120 if(partIdx >= 0)
ef647350 2121 {
2aab9269 2122 if(stack->Particle(partIdx)->GetPdgCode() == fgK0SCode) return partIdx;
f61cec2f 2123 Int_t mothIdx = stack->Particle(partIdx)->GetMother(0);
2124 if(mothIdx < 0) return -1;
2125 TParticle *mother = stack->Particle(mothIdx);
2126 if(mother)
ef647350 2127 {
2aab9269 2128 if(mother->GetPdgCode() == fgK0SCode)
ef647350 2129 {
f61cec2f 2130 return mothIdx;
ef647350 2131 }
f61cec2f 2132 return GetK0InFamily(mothIdx, stack);
2133 }
2134 else
2135 {
2136 return -1;
ef647350 2137 }
2138 }
f61cec2f 2139 return -1;
ef647350 2140}
e2ee5727 2141