fix crash on HIJING with added signals
[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()
866b6d2b 40 ,nChargedHadronsMeasured(0)
41 ,nChargedHadronsTotal(0)
c79c36cc 42 ,fIsMC(kTRUE)
f61cec2f 43 ,fImpactParameter(0)
44 ,fNcoll(0)
45 ,fNpart(0)
46 ,fPrimaryTree(0)
47 ,fTotEtWithSecondaryRemoved(0)
48 ,fTotEtSecondaryFromEmEtPrimary(0)
49 ,fTotEtSecondary(0)
50 ,fPrimaryCode(0)
51 ,fPrimaryCharge(0)
52 ,fPrimaryE(0)
53 ,fPrimaryEt(0)
54 ,fPrimaryPx(0)
55 ,fPrimaryPy(0)
56 ,fPrimaryPz(0)
57 ,fPrimaryVx(0)
58 ,fPrimaryVy(0)
59 ,fPrimaryVz(0)
60 ,fPrimaryAccepted(0)
b2c10007 61 ,fPrimaryMatched(0)
f61cec2f 62 ,fDepositedCode(0)
b2c10007 63 ,fDepositedE(0)
f61cec2f 64 ,fDepositedEt(0)
65 ,fDepositedCharge(0)
66 ,fDepositedVx(0)
67 ,fDepositedVy(0)
68 ,fDepositedVz(0)
b2c10007 69 ,fSecondary(kFALSE)
70 ,fReconstructedE(0)
71 ,fReconstructedEt(0)
72 ,fTotPx(0)
73 ,fTotPy(0)
74 ,fTotPz(0)
75 ,fClusterMult(0)
f61cec2f 76 ,fHistDecayVertexNonRemovedCharged(0)
77 ,fHistDecayVertexRemovedCharged(0)
78 ,fHistDecayVertexNonRemovedNeutral(0)
79 ,fHistDecayVertexRemovedNeutral(0)
80
81 ,fHistRemovedOrNot(0)
82 ,fHistEtNonRemovedProtons(0)
83 ,fHistEtNonRemovedAntiProtons(0)
84 ,fHistEtNonRemovedPiPlus(0)
85 ,fHistEtNonRemovedPiMinus(0)
86 ,fHistEtNonRemovedKaonPlus(0)
87 ,fHistEtNonRemovedKaonMinus(0)
88 ,fHistEtNonRemovedK0s(0)
89 ,fHistEtNonRemovedK0L(0)
90 ,fHistEtNonRemovedLambdas(0)
91 ,fHistEtNonRemovedElectrons(0)
92 ,fHistEtNonRemovedPositrons(0)
93 ,fHistEtNonRemovedMuPlus(0)
94 ,fHistEtNonRemovedMuMinus(0)
95 ,fHistEtNonRemovedNeutrons(0)
96 ,fHistEtNonRemovedAntiNeutrons(0)
97 ,fHistEtNonRemovedGammas(0)
98 ,fHistEtNonRemovedGammasFromPi0(0)
99 ,fHistEtRemovedGammas(0)
100 ,fHistEtRemovedNeutrons(0)
101 ,fHistEtRemovedAntiNeutrons(0)
102 ,fHistEtRemovedCharged(0)
103 ,fHistEtRemovedNeutrals(0)
104 ,fHistEtNonRemovedCharged(0)
105 ,fHistEtNonRemovedNeutrals(0)
106 ,fHistMultNonRemovedProtons(0)
107 ,fHistMultNonRemovedAntiProtons(0)
108 ,fHistMultNonRemovedPiPlus(0)
109 ,fHistMultNonRemovedPiMinus(0)
110 ,fHistMultNonRemovedKaonPlus(0)
111 ,fHistMultNonRemovedKaonMinus(0)
112 ,fHistMultNonRemovedK0s(0)
113 ,fHistMultNonRemovedK0L(0)
114 ,fHistMultNonRemovedLambdas(0)
115 ,fHistMultNonRemovedElectrons(0)
116 ,fHistMultNonRemovedPositrons(0)
117 ,fHistMultNonRemovedMuPlus(0)
118 ,fHistMultNonRemovedMuMinus(0)
119 ,fHistMultNonRemovedNeutrons(0)
120 ,fHistMultNonRemovedAntiNeutrons(0)
121 ,fHistMultNonRemovedGammas(0)
122 ,fHistMultRemovedGammas(0)
123 ,fHistMultRemovedNeutrons(0)
124 ,fHistMultRemovedAntiNeutrons(0)
125 ,fHistMultRemovedCharged(0)
126 ,fHistMultRemovedNeutrals(0)
127 ,fHistMultNonRemovedCharged(0)
128 ,fHistMultNonRemovedNeutrals(0)
129 ,fHistTrackMultvsNonRemovedCharged(0)
130 ,fHistTrackMultvsNonRemovedNeutral(0)
131 ,fHistTrackMultvsRemovedGamma(0)
132 ,fHistClusterMultvsNonRemovedCharged(0)
133 ,fHistClusterMultvsNonRemovedNeutral(0)
134 ,fHistClusterMultvsRemovedGamma(0)
135 ,fHistMultvsNonRemovedChargedE(0)
136 ,fHistMultvsNonRemovedNeutralE(0)
03bfd268 137 ,fHistMultvsRemovedGammaE(0)
0861cc1f 138 ,fCalcForKaonCorrection(kFALSE)
139 ,fHistK0EDepositsVsPtInAcceptance(0)
140 ,fHistK0EGammaVsPtInAcceptance(0)
141 ,fHistK0EDepositsVsPtOutOfAcceptance(0)
142 ,fHistK0EGammaVsPtOutOfAcceptance(0)
143 ,fHistSimKaonsInAcceptance(0)
144 ,fHistSimK0SInAcceptance(0)
145 ,fHistSimKPlusInAcceptance(0)
146 ,fHistSimKMinusInAcceptance(0)
147 ,fHistSimK0LInAcceptance(0)
148 ,fHistSimKaonsOutOfAcceptance(0)
149 ,fHistSimKaonsInAcceptanceWithDepositsPrimaries(0)
150 ,fHistSimKaonsOutOfAcceptanceWithDepositsSecondaries(0)
151 ,fHistSimKaonsOutOfAcceptanceWithDepositsPrimaries(0)
f61cec2f 152 ,fEtNonRemovedProtons(0)
153 ,fEtNonRemovedAntiProtons(0)
154 ,fEtNonRemovedPiPlus(0)
155 ,fEtNonRemovedPiMinus(0)
156 ,fEtNonRemovedKaonPlus(0)
157 ,fEtNonRemovedKaonMinus(0)
158 ,fEtNonRemovedK0S(0)
159 ,fEtNonRemovedK0L(0)
160 ,fEtNonRemovedLambdas(0)
161 ,fEtNonRemovedElectrons(0)
162 ,fEtNonRemovedPositrons(0)
163 ,fEtNonRemovedMuMinus(0)
164 ,fEtNonRemovedMuPlus(0)
165 ,fEtNonRemovedGammas(0)
166 ,fEtNonRemovedGammasFromPi0(0)
167 ,fEtNonRemovedNeutrons(0)
168 ,fEtNonRemovedAntiNeutrons(0)
169 ,fEtRemovedProtons(0)
170 ,fEtRemovedAntiProtons(0)
171 ,fEtRemovedPiPlus(0)
172 ,fEtRemovedPiMinus(0)
173 ,fEtRemovedKaonPlus(0)
174 ,fEtRemovedKaonMinus(0)
175 ,fEtRemovedK0s(0)
176 ,fEtRemovedK0L(0)
177 ,fEtRemovedLambdas(0)
178 ,fEtRemovedElectrons(0)
179 ,fEtRemovedPositrons(0)
180 ,fEtRemovedMuMinus(0)
181 ,fEtRemovedMuPlus(0)
182 ,fEtRemovedGammasFromPi0(0)
183 ,fEtRemovedGammas(0)
184 ,fEtRemovedNeutrons(0)
185 ,fEtRemovedAntiNeutrons(0)
186 ,fMultNonRemovedProtons(0)
187 ,fMultNonRemovedAntiProtons(0)
188 ,fMultNonRemovedPiPlus(0)
189 ,fMultNonRemovedPiMinus(0)
190 ,fMultNonRemovedKaonPlus(0)
191 ,fMultNonRemovedKaonMinus(0)
192 ,fMultNonRemovedK0s(0)
193 ,fMultNonRemovedK0L(0)
194 ,fMultNonRemovedLambdas(0)
195 ,fMultNonRemovedElectrons(0)
196 ,fMultNonRemovedPositrons(0)
197 ,fMultNonRemovedMuMinus(0)
198 ,fMultNonRemovedMuPlus(0)
199 ,fMultNonRemovedGammas(0)
200 ,fMultNonRemovedNeutrons(0)
201 ,fMultNonRemovedAntiNeutrons(0)
202 ,fMultRemovedProtons(0)
203 ,fMultRemovedAntiProtons(0)
204 ,fMultRemovedPiPlus(0)
205 ,fMultRemovedPiMinus(0)
206 ,fMultRemovedKaonPlus(0)
207 ,fMultRemovedKaonMinus(0)
208 ,fMultRemovedK0s(0)
209 ,fMultRemovedK0L(0)
210 ,fMultRemovedLambdas(0)
211 ,fMultRemovedElectrons(0)
212 ,fMultRemovedPositrons(0)
213 ,fMultRemovedMuMinus(0)
214 ,fMultRemovedMuPlus(0)
215 ,fMultRemovedGammas(0)
216 ,fMultRemovedNeutrons(0)
217 ,fMultRemovedAntiNeutrons(0)
218 ,fTrackMultInAcc(0)
219 ,fHistDxDzNonRemovedCharged(0)
220 ,fHistDxDzRemovedCharged(0)
221 ,fHistDxDzNonRemovedNeutral(0)
222 ,fHistDxDzRemovedNeutral(0)
223 ,fHistPiPlusMult(0)
224 ,fHistPiMinusMult(0)
225 ,fHistPiZeroMult(0)
226 ,fHistPiPlusMultAcc(0)
227 ,fHistPiMinusMultAcc(0)
228 ,fHistPiZeroMultAcc(0)
b2c10007 229// ,fPiPlusMult(0)
230// ,fPiMinusMult(0)
f61cec2f 231 ,fPiZeroMult(0)
232 ,fPiPlusMultAcc(0)
233 ,fPiMinusMultAcc(0)
234 ,fPiZeroMultAcc(0)
235 ,fNeutralRemoved(0)
236 ,fChargedRemoved(0)
237 ,fChargedNotRemoved(0)
238 ,fNeutralNotRemoved(0)
b2c10007 239 ,fGammaRemoved(0)
240 ,fSecondaryNotRemoved(0)
f61cec2f 241 ,fEnergyNeutralRemoved(0)
242 ,fEnergyChargedRemoved(0)
243 ,fEnergyChargedNotRemoved(0)
244 ,fEnergyNeutralNotRemoved(0)
b2c10007 245 ,fEnergyGammaRemoved(0)
f61cec2f 246 ,fNClusters(0)
247 ,fTotNeutralEtAfterMinEnergyCut(0)
0861cc1f 248 ,fCalcTrackMatchVsMult(kFALSE)
249 ,fHistGammasFound(0)
9ef6f13f 250 ,fHistGammasGenerated(0)
5881f036 251 ,fHistGammasFoundCent(0)
9a365626 252 ,fHistGammasFoundOutOfAccCent(0)
866b6d2b 253 ,fHistGammasFoundAltCent(0)
254 ,fHistGammasFoundOutOfAccAltCent(0)
5881f036 255 ,fHistGammasGeneratedCent(0)
866b6d2b 256 ,fHistGammasFoundRecoEnergyCent(0)
257 ,fHistGammasFoundOutOfAccRecoEnergyCent(0)
9ef6f13f 258 ,fHistChargedTracksCut(0)
259 ,fHistChargedTracksAccepted(0)
260 ,fHistGammasCut(0)
261 ,fHistGammasAccepted(0)
866b6d2b 262 ,fHistChargedTrackDepositsAcceptedVsPt(0)
263 ,fHistChargedTrackDepositsAllVsPt(0)
264 ,fHistChargedTrackDepositsAcceptedVsPtEffCorr(0)
265 ,fHistChargedTrackDepositsAllVsPtEffCorr(0)
0861cc1f 266 ,fHistChargedTracksCutMult(0)
267 ,fHistChargedTracksAcceptedMult(0)
866b6d2b 268 ,fHistChargedTracksAcceptedLowPtCentEffCorr(0)
ac610b08 269 ,fHistChargedTracksAcceptedLowPtCent(0)
5881f036 270 ,fHistChargedTracksAcceptedLowPtCent500MeV(0)
ac610b08 271 ,fHistChargedTracksAcceptedLowPtCentNoAntiProtons(0)
272 ,fHistChargedTracksAcceptedLowPtCentAntiProtons(0)
0861cc1f 273 ,fHistGammasCutMult(0)
274 ,fHistGammasAcceptedMult(0)
9ef6f13f 275 ,fHistBadTrackMatches(0)
276 ,fHistMatchedTracksEvspTBkgd(0)
277 ,fHistMatchedTracksEvspTSignal(0)
278 ,fHistMatchedTracksEvspTBkgdPeripheral(0)
279 ,fHistMatchedTracksEvspTSignalPeripheral(0)
ac610b08 280 ,fHistMatchedTracksEvspTBkgdvsCent(0)
281 ,fHistMatchedTracksEvspTSignalvsCent(0)
282 ,fHistMatchedTracksEvspTBkgdvsCentEffCorr(0)
283 ,fHistMatchedTracksEvspTSignalvsCentEffCorr(0)
0861cc1f 284
9ef6f13f 285 ,fHistChargedTracksCutPeripheral(0)
286 ,fHistChargedTracksAcceptedPeripheral(0)
287 ,fHistGammasCutPeripheral(0)
288 ,fHistGammasAcceptedPeripheral(0)
289 ,fHistBadTrackMatchesdPhidEta(0)
290 ,fHistGoodTrackMatchesdPhidEta(0)
c79c36cc 291 ,fHistHadronDepositsAll(0)
292 ,fHistHadronDepositsReco(0)
ac610b08 293 ,fHistHadronDepositsAllCent(0)
5881f036 294 ,fHistHadronDepositsAllCent500MeV(0)
ac610b08 295 ,fHistHadronDepositsRecoCent(0)
866b6d2b 296 ,fHistHadronDepositsAllvsECent(0)
297 ,fHistHadronDepositsRecovsECent(0)
ac610b08 298 ,fHistHadronsAllCent(0)
d3ce32b8 299 ,fHistMultChVsSignalVsMult(0)
9a365626 300 ,fHistNeutralRemovedSecondaryEtVsCent(0)
301 ,fHistChargedRemovedSecondaryEtVsCent(0)
302 ,fHistNeutralNotRemovedSecondaryEtVsCent(0)
303 ,fHistChargedNotRemovedSecondaryEtVsCent(0)
304 ,fHistNeutralRemovedSecondaryNumVsNCluster(0)
305 ,fHistChargedRemovedSecondaryNumVsNCluster(0)
306 ,fHistNeutralNotRemovedSecondaryNumVsNCluster(0)
307 ,fHistChargedNotRemovedSecondaryNumVsNCluster(0)
308 ,fHistNeutralRemovedSecondaryNumVsCent(0)
309 ,fHistChargedRemovedSecondaryNumVsCent(0)
310 ,fHistNeutralNotRemovedSecondaryNumVsCent(0)
311 ,fHistChargedNotRemovedSecondaryNumVsCent(0)
312 ,fHistNeutronsEtVsCent(0)
313 ,fHistNeutronsNumVsCent(0)
314 ,fHistNotNeutronsNumVsCent(0)
315 ,fHistPiKPDepositedVsNch(0)
316 ,fHistPiKPNotTrackMatchedDepositedVsNch(0)
866b6d2b 317 ,fHistNeutronsDepositedVsNch(0)//start
9a365626 318 ,fHistAntiNeutronsDepositedVsNch(0)
319 ,fHistProtonsDepositedVsNch(0)
320 ,fHistAntiProtonsDepositedVsNch(0)
321 ,fHistProtonsNotTrackMatchedDepositedVsNch(0)
322 ,fHistAntiProtonsNotTrackMatchedDepositedVsNch(0)
866b6d2b 323 ,fHistNeutronsDepositedVsNcl(0)
324 ,fHistAntiNeutronsDepositedVsNcl(0)
325 ,fHistProtonsDepositedVsNcl(0)
326 ,fHistAntiProtonsDepositedVsNcl(0)
327 ,fHistProtonsNotTrackMatchedDepositedVsNcl(0)
328 ,fHistAntiProtonsNotTrackMatchedDepositedVsNcl(0)
9a365626 329 ,fHistSecondariesVsNch(0)
330 ,fHistSecondariesVsNcl(0)
331 ,fHistSecondariesEffCorrVsNch(0)
332 ,fHistSecondariesEffCorrVsNcl(0)
b986cebe 333 ,fHistSecondariesOutOfAccEffCorrVsNch(0)
866b6d2b 334 ,fHistSecondariesDetectorCoverEffCorrVsNch(0)//end
335 ,fHistNeutronsDepositedVsNchNoEffCorr(0)//start
336 ,fHistAntiNeutronsDepositedVsNchNoEffCorr(0)
337 ,fHistProtonsDepositedVsNchNoEffCorr(0)
338 ,fHistAntiProtonsDepositedVsNchNoEffCorr(0)
339 ,fHistProtonsNotTrackMatchedDepositedVsNchNoEffCorr(0)
340 ,fHistAntiProtonsNotTrackMatchedDepositedVsNchNoEffCorr(0)
341 ,fHistNeutronsDepositedVsNclNoEffCorr(0)
342 ,fHistAntiNeutronsDepositedVsNclNoEffCorr(0)
343 ,fHistProtonsDepositedVsNclNoEffCorr(0)
344 ,fHistAntiProtonsDepositedVsNclNoEffCorr(0)
345 ,fHistProtonsNotTrackMatchedDepositedVsNclNoEffCorr(0)
346 ,fHistAntiProtonsNotTrackMatchedDepositedVsNclNoEffCorr(0)//end
9a365626 347 ,fHistCentVsNchVsNcl(0)
866b6d2b 348 ,fHistSecondaryPositionInDetector(0)
32503dac 349 ,fClusterPositionWeird(0)
b986cebe 350 //,fHistSecondaryPositionInDetectorMultiple(0)
351 ,fSecondaryClusterEnergy(0)
866b6d2b 352 ,fHistGammaCrossCheck(0)
353 ,fHistGammaCrossCheckAlt(0)
354 ,fHistGammaEnergyCrossCheck(0)
355 ,fHistGammaEnergyCrossCheckAlt(0)
356 ,fHistNeutronCrossCheck(0)
357 ,fHistSecondaryCrossCheck(0)
358 ,fHistHadronCrossCheck(0)
359 ,fHistKaonCrossCheck(0)
360 ,fHistAllEnergy(0)
361 ,fHistSignalEnergy(0)
362 ,fHistNeutronEnergy(0)
363 ,fHistKaonEnergy(0)
364 ,fHistHadronEnergy(0)
365 ,fHistSecondaryEnergy(0)
366 ,fHistSecondaryChargedEnergy(0)
367 ,fHistSecondaryNeutronEnergy(0)
368 ,fHistSecondaryGammaEnergy(0)
369 ,fHistSecondaryElectronEnergy(0)
370 ,fHistSecondaryOtherEnergy(0)
371 ,fHistSimulatedGammaEnergy(0)
372 ,fHistReconstructedGammaEnergy(0)
373 ,fHistSimulatedGammaEnergyAboveThreshold(0)
374 ,fHistReconstructedSignalEnergy(0)
375 ,fHistFracSignalVsNClusters(0)
376 ,fHistFracHadronsVsNClusters(0)
377 ,fHistFracNeutronsVsNClusters(0)
378 ,fHistFracKaonsVsNClusters(0)
379 ,fHistFracSecondariesVsNClusters(0)
380 ,fHistFracSignalVsNMultiplicity(0)
381 ,fHistFracHadronsVsNMultiplicity(0)
382 ,fHistFracNeutronsVsNMultiplicity(0)
383 ,fHistFracKaonsVsNMultiplicity(0)
384 ,fHistFracSecondariesVsNMultiplicity(0)
385 ,fHistFracSignalVsNMatchedTracks(0)
386 ,fHistFracHadronsVsNMatchedTracks(0)
387 ,fHistFracNeutronsVsNMatchedTracks(0)
388 ,fHistFracKaonsVsNMatchedTracks(0)
389 ,fHistFracSecondariesVsNMatchedTracks(0)
390 ,fHistFracSignalVsNTotalTracks(0)
391 ,fHistFracHadronsVsNTotalTracks(0)
392 ,fHistFracNeutronsVsNTotalTracks(0)
393 ,fHistFracKaonsVsNTotalTracks(0)
394 ,fHistFracSecondariesVsNTotalTracks(0)
ce546038 395{
396}
397
398// dtor
e2ee5727 399AliAnalysisEtMonteCarlo::~AliAnalysisEtMonteCarlo()
f61cec2f 400{ //Destructor
311c6540 401
402 if(fPrimaryTree){
403 fPrimaryTree->Clear();
404 delete fPrimaryTree;
405 }
f61cec2f 406 delete fHistDecayVertexNonRemovedCharged; // Decay vertex for non-removed charged particles
407 delete fHistDecayVertexRemovedCharged; // Decay vertex for non-removed charged particles
408 delete fHistDecayVertexNonRemovedNeutral; // Decay vertex for non-removed charged particles
409 delete fHistDecayVertexRemovedNeutral; // Decay vertex for non-removed charged particles
410
411 delete fHistRemovedOrNot; // If charged/neutral particles were removed or not
412
413 delete fHistEtNonRemovedProtons; // enter comment here
414 delete fHistEtNonRemovedAntiProtons; // enter comment here
415 delete fHistEtNonRemovedPiPlus; // enter comment here
416 delete fHistEtNonRemovedPiMinus; // enter comment here
417 delete fHistEtNonRemovedKaonPlus; // enter comment here
418 delete fHistEtNonRemovedKaonMinus; // enter comment here
419 delete fHistEtNonRemovedK0s; // enter comment here
420 delete fHistEtNonRemovedK0L; // enter comment here
421 delete fHistEtNonRemovedLambdas; // enter comment here
422 delete fHistEtNonRemovedElectrons; // enter comment here
423 delete fHistEtNonRemovedPositrons; // enter comment here
424 delete fHistEtNonRemovedMuPlus; // enter comment here
425 delete fHistEtNonRemovedMuMinus; // enter comment here
426 delete fHistEtNonRemovedNeutrons; // enter comment here
427 delete fHistEtNonRemovedAntiNeutrons; // enter comment here
428 delete fHistEtNonRemovedGammas; // enter comment here
429 delete fHistEtNonRemovedGammasFromPi0; // enter comment here
430
431 delete fHistEtRemovedGammas; // enter comment here
432 delete fHistEtRemovedNeutrons; // enter comment here
433 delete fHistEtRemovedAntiNeutrons; // enter comment here
434
435
436 delete fHistMultNonRemovedProtons; // enter comment here
437 delete fHistMultNonRemovedAntiProtons; // enter comment here
438 delete fHistMultNonRemovedPiPlus; // enter comment here
439 delete fHistMultNonRemovedPiMinus; // enter comment here
440 delete fHistMultNonRemovedKaonPlus; // enter comment here
441 delete fHistMultNonRemovedKaonMinus; // enter comment here
442 delete fHistMultNonRemovedK0s; // enter comment here
443 delete fHistMultNonRemovedK0L; // enter comment here
444 delete fHistMultNonRemovedLambdas; // enter comment here
445 delete fHistMultNonRemovedElectrons; // enter comment here
446 delete fHistMultNonRemovedPositrons; // enter comment here
447 delete fHistMultNonRemovedMuPlus; // enter comment here
448 delete fHistMultNonRemovedMuMinus; // enter comment here
449 delete fHistMultNonRemovedNeutrons; // enter comment here
450 delete fHistMultNonRemovedAntiNeutrons; // enter comment here
451 delete fHistMultNonRemovedGammas; // enter comment here
452
453 delete fHistMultRemovedGammas; // enter comment here
454 delete fHistMultRemovedNeutrons; // enter comment here
455 delete fHistMultRemovedAntiNeutrons; // enter comment here
456
457 delete fHistTrackMultvsNonRemovedCharged; // enter comment here
458 delete fHistTrackMultvsNonRemovedNeutral; // enter comment here
459 delete fHistTrackMultvsRemovedGamma; // enter comment here
460
461 delete fHistClusterMultvsNonRemovedCharged; // enter comment here
462 delete fHistClusterMultvsNonRemovedNeutral; // enter comment here
463 delete fHistClusterMultvsRemovedGamma; // enter comment here
464
465 delete fHistMultvsNonRemovedChargedE; // enter comment here
466 delete fHistMultvsNonRemovedNeutralE; // enter comment here
467 delete fHistMultvsRemovedGammaE; // enter comment here
0861cc1f 468 delete fHistK0EDepositsVsPtInAcceptance;//enter comment here
469 delete fHistK0EGammaVsPtInAcceptance;//enter comment here
470 delete fHistK0EDepositsVsPtOutOfAcceptance;
471 delete fHistK0EGammaVsPtOutOfAcceptance;
472
473 delete fHistSimKaonsInAcceptance;
474 delete fHistSimK0SInAcceptance;
475 delete fHistSimKPlusInAcceptance;
476 delete fHistSimKMinusInAcceptance;
477 delete fHistSimK0LInAcceptance;
478 delete fHistSimKaonsOutOfAcceptance;
479 delete fHistSimKaonsInAcceptanceWithDepositsPrimaries;
480 delete fHistSimKaonsOutOfAcceptanceWithDepositsSecondaries;
481 delete fHistSimKaonsOutOfAcceptanceWithDepositsPrimaries;
2aab9269 482
f61cec2f 483 delete fHistDxDzNonRemovedCharged; // enter comment here
484 delete fHistDxDzRemovedCharged; // enter comment here
485 delete fHistDxDzNonRemovedNeutral; // enter comment here
486 delete fHistDxDzRemovedNeutral; // enter comment here
487
488 delete fHistPiPlusMult; // enter comment here
489 delete fHistPiMinusMult; // enter comment here
490 delete fHistPiZeroMult; // enter comment here
491
492 delete fHistPiPlusMultAcc; // enter comment here
493 delete fHistPiMinusMultAcc; // enter comment here
494 delete fHistPiZeroMultAcc; // enter comment here
4503e29d 495 delete fHistGammasFound; // enter comment here
496 delete fHistGammasGenerated; // enter comment here
9a365626 497 delete fHistGammasFoundOutOfAccCent; // enter comment here
5881f036 498 delete fHistGammasFoundCent; // enter comment here
866b6d2b 499 delete fHistGammasFoundOutOfAccAltCent; // enter comment here
500 delete fHistGammasFoundAltCent; // enter comment here
5881f036 501 delete fHistGammasGeneratedCent; // enter comment here
866b6d2b 502 delete fHistGammasFoundRecoEnergyCent;
503 delete fHistGammasFoundOutOfAccRecoEnergyCent;
9ef6f13f 504 delete fHistChargedTracksCut;
505 delete fHistChargedTracksAccepted;
506 delete fHistGammasCut;
507 delete fHistGammasAccepted;
0861cc1f 508 delete fHistChargedTracksCutMult;
866b6d2b 509 delete fHistChargedTrackDepositsAcceptedVsPt;
510 delete fHistChargedTrackDepositsAllVsPt;
511 delete fHistChargedTrackDepositsAcceptedVsPtEffCorr;
512 delete fHistChargedTrackDepositsAllVsPtEffCorr;
0861cc1f 513 delete fHistChargedTracksAcceptedMult;
866b6d2b 514 delete fHistChargedTracksAcceptedLowPtCentEffCorr;
ac610b08 515 delete fHistChargedTracksAcceptedLowPtCent;
5881f036 516 delete fHistChargedTracksAcceptedLowPtCent500MeV;
ac610b08 517 delete fHistChargedTracksAcceptedLowPtCentNoAntiProtons;
518 delete fHistChargedTracksAcceptedLowPtCentAntiProtons;
0861cc1f 519 delete fHistGammasCutMult;
520 delete fHistGammasAcceptedMult;
9ef6f13f 521 delete fHistBadTrackMatches;
522 delete fHistMatchedTracksEvspTBkgd;
523 delete fHistMatchedTracksEvspTSignal;
524 delete fHistMatchedTracksEvspTBkgdPeripheral;
525 delete fHistMatchedTracksEvspTSignalPeripheral;
ac610b08 526 delete fHistMatchedTracksEvspTBkgdvsCent;
527 delete fHistMatchedTracksEvspTSignalvsCent;
528 delete fHistMatchedTracksEvspTBkgdvsCentEffCorr;
529 delete fHistMatchedTracksEvspTSignalvsCentEffCorr;
9ef6f13f 530 delete fHistChargedTracksCutPeripheral;
531 delete fHistChargedTracksAcceptedPeripheral;
532 delete fHistGammasCutPeripheral;
533 delete fHistGammasAcceptedPeripheral;
534 delete fHistBadTrackMatchesdPhidEta;
535 delete fHistGoodTrackMatchesdPhidEta;
c79c36cc 536 delete fHistHadronDepositsAll;
537 delete fHistHadronDepositsReco;
ac610b08 538 delete fHistHadronDepositsAllCent;
5881f036 539 delete fHistHadronDepositsAllCent500MeV;
ac610b08 540 delete fHistHadronDepositsRecoCent;
866b6d2b 541 delete fHistHadronDepositsAllvsECent;
542 delete fHistHadronDepositsRecovsECent;
ac610b08 543 delete fHistHadronsAllCent;
d3ce32b8 544 delete fHistMultChVsSignalVsMult;
9a365626 545 delete fHistNeutralRemovedSecondaryEtVsCent;
546 delete fHistChargedRemovedSecondaryEtVsCent;
547 delete fHistNeutralNotRemovedSecondaryEtVsCent;
548 delete fHistChargedNotRemovedSecondaryEtVsCent;
549 delete fHistNeutralRemovedSecondaryNumVsNCluster;
550 delete fHistChargedRemovedSecondaryNumVsNCluster;
551 delete fHistNeutralNotRemovedSecondaryNumVsNCluster;
552 delete fHistChargedNotRemovedSecondaryNumVsNCluster;
553 delete fHistNeutralRemovedSecondaryNumVsCent;
554 delete fHistChargedRemovedSecondaryNumVsCent;
555 delete fHistNeutralNotRemovedSecondaryNumVsCent;
556 delete fHistChargedNotRemovedSecondaryNumVsCent;
557 delete fHistNeutronsEtVsCent;
558 delete fHistNeutronsNumVsCent;
559 delete fHistNotNeutronsNumVsCent;
560 delete fHistPiKPDepositedVsNch;
561 delete fHistPiKPNotTrackMatchedDepositedVsNch;
866b6d2b 562
9a365626 563 delete fHistNeutronsDepositedVsNch;
564 delete fHistAntiNeutronsDepositedVsNch;
565 delete fHistProtonsDepositedVsNch;
566 delete fHistAntiProtonsDepositedVsNch;
567 delete fHistProtonsNotTrackMatchedDepositedVsNch;
568 delete fHistAntiProtonsNotTrackMatchedDepositedVsNch;
866b6d2b 569 delete fHistNeutronsDepositedVsNcl;
570 delete fHistAntiNeutronsDepositedVsNcl;
571 delete fHistProtonsDepositedVsNcl;
572 delete fHistAntiProtonsDepositedVsNcl;
573 delete fHistProtonsNotTrackMatchedDepositedVsNcl;
574 delete fHistAntiProtonsNotTrackMatchedDepositedVsNcl;
9a365626 575 delete fHistSecondariesVsNch;
576 delete fHistSecondariesVsNcl;
577 delete fHistSecondariesEffCorrVsNch;
578 delete fHistSecondariesEffCorrVsNcl;
b986cebe 579 delete fHistSecondariesOutOfAccEffCorrVsNch;
580 delete fHistSecondariesDetectorCoverEffCorrVsNch;
866b6d2b 581
582
583 delete fHistNeutronsDepositedVsNchNoEffCorr;
584 delete fHistAntiNeutronsDepositedVsNchNoEffCorr;
585 delete fHistProtonsDepositedVsNchNoEffCorr;
586 delete fHistAntiProtonsDepositedVsNchNoEffCorr;
587 delete fHistProtonsNotTrackMatchedDepositedVsNchNoEffCorr;
588 delete fHistAntiProtonsNotTrackMatchedDepositedVsNchNoEffCorr;
589 delete fHistNeutronsDepositedVsNclNoEffCorr;
590 delete fHistAntiNeutronsDepositedVsNclNoEffCorr;
591 delete fHistProtonsDepositedVsNclNoEffCorr;
592 delete fHistAntiProtonsDepositedVsNclNoEffCorr;
593 delete fHistProtonsNotTrackMatchedDepositedVsNclNoEffCorr;
594 delete fHistAntiProtonsNotTrackMatchedDepositedVsNclNoEffCorr;
595
9a365626 596 delete fHistCentVsNchVsNcl;
866b6d2b 597 delete fHistSecondaryPositionInDetector;
32503dac 598 delete fClusterPositionWeird;
b986cebe 599 //delete fHistSecondaryPositionInDetectorMultiple;
600 delete fSecondaryClusterEnergy;
866b6d2b 601 delete fHistGammaCrossCheck;
602 delete fHistGammaCrossCheckAlt;
603 delete fHistGammaEnergyCrossCheck;
604 delete fHistGammaEnergyCrossCheckAlt;
605 delete fHistNeutronCrossCheck;
606 delete fHistSecondaryCrossCheck;
607 delete fHistHadronCrossCheck;
608 delete fHistKaonCrossCheck;
609
610 delete fHistAllEnergy;
611 delete fHistSignalEnergy;
612 delete fHistNeutronEnergy;
613 delete fHistKaonEnergy;
614 delete fHistHadronEnergy;
615 delete fHistSecondaryEnergy;
616 delete fHistSecondaryChargedEnergy;
617 delete fHistSecondaryNeutronEnergy;
618 delete fHistSecondaryGammaEnergy;
619 delete fHistSecondaryElectronEnergy;
620 delete fHistSecondaryOtherEnergy;
621 delete fHistSimulatedGammaEnergy;
622 delete fHistReconstructedGammaEnergy;
623 delete fHistSimulatedGammaEnergyAboveThreshold;
624 delete fHistReconstructedSignalEnergy;
625 delete fHistFracSignalVsNClusters;
626 delete fHistFracHadronsVsNClusters;
627 delete fHistFracNeutronsVsNClusters;
628 delete fHistFracKaonsVsNClusters;
629 delete fHistFracSecondariesVsNClusters;
630 delete fHistFracSignalVsNMultiplicity;
631 delete fHistFracHadronsVsNMultiplicity;
632 delete fHistFracNeutronsVsNMultiplicity;
633 delete fHistFracKaonsVsNMultiplicity;
634 delete fHistFracSecondariesVsNMultiplicity;
635 delete fHistFracSignalVsNMatchedTracks;
636 delete fHistFracHadronsVsNMatchedTracks;
637 delete fHistFracNeutronsVsNMatchedTracks;
638 delete fHistFracKaonsVsNMatchedTracks;
639 delete fHistFracSecondariesVsNMatchedTracks;
640 delete fHistFracSignalVsNTotalTracks;
641 delete fHistFracHadronsVsNTotalTracks;
642 delete fHistFracNeutronsVsNTotalTracks;
643 delete fHistFracKaonsVsNTotalTracks;
644 delete fHistFracSecondariesVsNTotalTracks;
ce546038 645}
2fbf38ac 646
647Int_t AliAnalysisEtMonteCarlo::AnalyseEvent(AliVEvent* ev)
f61cec2f 648{ // analyse MC event
c79c36cc 649 if(!fIsMC) return 0;
e2ee5727 650 ResetEventValues();
651
b2c10007 652
e2ee5727 653 fPiPlusMult = 0;
654 fPiMinusMult = 0;
655 fPiZeroMult = 0;
656 if (fCentrality)
657 {
ac610b08 658 fCentClass = fCentrality->GetCentralityClass5(fCentralityMethod);
e2ee5727 659
660 }
e2ee5727 661
662 // Get us an mc event
663 if (!ev) {
664 AliFatal("ERROR: Event does not exist");
665 return 0;
666 }
667 AliMCEvent *event = dynamic_cast<AliMCEvent*>(ev);
668 if (!event) {
669 AliFatal("ERROR: MC Event does not exist");
670 return 0;
671 }
672
673 Double_t protonMass =fgProtonMass;
674
675 // Hijing header
676 AliGenEventHeader* genHeader = event->GenEventHeader();
677 if (!genHeader) {
678 Printf("ERROR: Event generation header does not exist");
679 return 0;
680 }
681 AliGenHijingEventHeader* hijingGenHeader = dynamic_cast<AliGenHijingEventHeader*>(genHeader);
682 if (hijingGenHeader) {
683 fImpactParameter = hijingGenHeader->ImpactParameter();
684 fNcoll = hijingGenHeader->HardScatters(); // or should this be some combination of NN() NNw() NwN() NwNw() ?
685 fNpart = hijingGenHeader->ProjectileParticipants() + hijingGenHeader->TargetParticipants();
f61cec2f 686 }
687
e2ee5727 688 // Let's play with the stack!
689 AliStack *stack = event->Stack();
690
691 Int_t nPrim = stack->GetNtrack();
866b6d2b 692 //cout<<endl<<endl<<"new event simulated nPrim "<<nPrim<<endl;
e2ee5727 693
694 Int_t partCount = 0;
695 for (Int_t iPart = 0; iPart < nPrim; iPart++)
2fbf38ac 696 {
e2ee5727 697
698 TParticle *part = stack->Particle(iPart);
b2c10007 699
700
e2ee5727 701
702 if (!part)
703 {
704 Printf("ERROR: Could not get particle %d", iPart);
705 continue;
706 }
e2ee5727 707 TParticlePDG *pdg = part->GetPDG(0);
e2ee5727 708
f61cec2f 709 if (!pdg)
2fbf38ac 710 {
f61cec2f 711 Printf("ERROR: Could not get particle PDG %d", iPart);
e2ee5727 712 continue;
2fbf38ac 713 }
714
e2ee5727 715 Double_t particleMassPart = 0; //The mass part in the Et calculation for this particle
f61cec2f 716 Int_t code = pdg->PdgCode();
b2c10007 717
718 if(stack->IsPhysicalPrimary(iPart))
719 {
720 fTotPx += part->Px();
721 fTotPy += part->Py();
722 fTotPz += part->Pz();
723 }
724
e2ee5727 725 // Check for reasonable (for now neutral and singly charged) charge on the particle
86e7d5db 726 if (fSelector->IsNeutralMcParticle(iPart,*stack,*pdg))
e2ee5727 727 {
728
729 fMultiplicity++;
866b6d2b 730 //PrintFamilyTreeShort(iPart, stack);
f61cec2f 731//
e2ee5727 732 if (TMath::Abs(part->Eta()) < fCuts->GetCommonEtaCut())
2fbf38ac 733 {
f61cec2f 734 //Printf("Particle with eta: %f, pid: %d", part->Eta(), code);
e2ee5727 735 // calculate E_T
736 if (
ef647350 737 TMath::Abs(code) == fgProtonCode ||
738 TMath::Abs(code) == fgNeutronCode ||
739 TMath::Abs(code) == fgLambdaCode ||
740 TMath::Abs(code) == fgXiCode ||
741 TMath::Abs(code) == fgXi0Code ||
742 TMath::Abs(code) == fgOmegaCode
e2ee5727 743 )
744 {
ef647350 745 if (code > 0) {
e2ee5727 746 particleMassPart = - protonMass;
747 }
ef647350 748 if (code < 0) {
e2ee5727 749 particleMassPart = protonMass;
750 }
751 }
752 Double_t et = part->Energy() * TMath::Sin(part->Theta()) + particleMassPart;
753
e2ee5727 754
ef647350 755 if(code == fgGammaCode || code == fgPi0Code || code == fgEtaCode)
e2ee5727 756 {
f61cec2f 757
b2c10007 758 if(fSelector->CutGeometricalAcceptance(*part) )
e2ee5727 759 {
760 fNeutralMultiplicity++;
f61cec2f 761 fTotNeutralEt += et;
86e7d5db 762 if(fSelector->PassMinEnergyCut(*part))
f61cec2f 763 {
764 fTotNeutralEtAfterMinEnergyCut += et;
765 }
e2ee5727 766 if (part->Energy() > 0.05) partCount++;
e2ee5727 767 }
768 }
769 //Charged particles
770 else if (TMath::Abs( pdg->Charge() - fCuts->GetMonteCarloNeutralParticle())>1e-3 )
771 {
e2ee5727 772
773 // inside EMCal acceptance
f61cec2f 774 if (fSelector->CutGeometricalAcceptance(*part))
e2ee5727 775 {
f61cec2f 776
777 fChargedMultiplicity++;
778
779 fTotChargedEt += et;
e2ee5727 780
ef647350 781 if (code == fgProtonCode || code == fgAntiProtonCode)
e2ee5727 782 {
e2ee5727 783 }
ef647350 784 if (code == fgPiPlusCode || code == fgPiMinusCode)
e2ee5727 785 {
e2ee5727 786 }
ef647350 787 if (code == fgKPlusCode || code == fgKMinusCode)
e2ee5727 788 {
e2ee5727 789 }
ef647350 790 if (code == fgMuPlusCode || code == fgMuMinusCode)
e2ee5727 791 {
e2ee5727 792 }
f61cec2f 793
ef647350 794 if (code == fgEPlusCode || code == fgEMinusCode)
e2ee5727 795 {
f61cec2f 796 fTotNeutralEt += et; // calling electrons neutral
797 fTotChargedEt -= et;
e1fa1966 798 }
e2ee5727 799 } // inside EMCal acceptance
800
e2ee5727 801 if (TrackHitsCalorimeter(part)) // magnetic field info not filled?
802 {
803 if (pdg->Charge() > 0) fHistPhivsPtPos->Fill(part->Phi(),part->Pt());
804 else fHistPhivsPtNeg->Fill(part->Phi(), part->Pt());
805 }
806 }
807 }
808
809 }
2fbf38ac 810 }
b2c10007 811 // std::cout << "Total: p_x = " << fTotPx << ", p_y = " << fTotPy << ", p_z = " << fTotPz << std::endl;
e2ee5727 812 fTotEt = fTotChargedEt + fTotNeutralEt;
f61cec2f 813 //fTotEtAcc = fTotChargedEtAcc + fTotNeutralEtAcc;//
e2ee5727 814 //std::cout << "Event done! # of particles: " << partCount << std::endl;
815 return 0;
2fbf38ac 816}
0651f6b4 817Int_t AliAnalysisEtMonteCarlo::AnalyseEvent(AliVEvent* ev,AliVEvent* ev2)
f61cec2f 818{ // analyse MC and real event info
e2ee5727 819 //if(!mcEvent || !realEvent){
c79c36cc 820 if(!fIsMC) return 0;
e2ee5727 821 if (!ev || !ev2) {
822 AliFatal("ERROR: Event does not exist");
823 return 0;
824 }
f61cec2f 825 AliAnalysisEt::AnalyseEvent(ev);
e2ee5727 826 AliMCEvent *mcEvent = dynamic_cast<AliMCEvent*>(ev);
827 AliESDEvent *realEvent = dynamic_cast<AliESDEvent*>(ev2);
828 if (!mcEvent || !realEvent) {
829 AliFatal("ERROR: mcEvent or realEvent does not exist");
b2c10007 830
e2ee5727 831 }
832
b2c10007 833 std::vector<Int_t> foundGammas;
834
f61cec2f 835 fSelector->SetEvent(realEvent);
836
837 AnalyseEvent(ev);
838
e2ee5727 839 AliStack *stack = mcEvent->Stack();
840
866b6d2b 841 TObjArray* list = fEsdtrackCutsTPC->GetAcceptedTracks(realEvent);
842 Int_t nGoodTracks = list->GetEntries();
f61cec2f 843
866b6d2b 844 //Note that this only returns clusters for the selected detector. fSelector actually calls the right GetClusters... for the detector
845 //It does not apply any cuts on these clusters
f61cec2f 846 TRefArray *caloClusters = fSelector->GetClusters();
e2ee5727 847
e2ee5727 848 Int_t nCluster = caloClusters->GetEntries();
b2c10007 849 fClusterMult = nCluster;
866b6d2b 850
851 //cout<<endl<<"new event reconstructed nclusters "<<nCluster<<endl;
ef647350 852 fNClusters = 0;
d3ce32b8 853 Int_t fClusterMultChargedTracks = 0;
854 Int_t fClusterMultGammas = 0;
9a365626 855 Int_t nChargedSecondariesRemoved = 0;
856 Int_t nChargedSecondariesNotRemoved = 0;
857 Int_t nNeutralSecondariesRemoved = 0;
858 Int_t nNeutralSecondariesNotRemoved = 0;
859 Int_t nNeutrons = 0;
860 Int_t nNotNeutrons = 0;
861 //All efficiency corrected except etSecondaries -->
862 Float_t etPiKPDeposited = 0.0;//
863 Float_t etPiKPDepositedNotTrackMatched = 0.0;//
864 Float_t etProtonDepositedNotTrackMatched = 0.0;//
865 Float_t etAntiProtonDepositedNotTrackMatched = 0.0;//
866b6d2b 866 Float_t etProtonDepositedNotTrackMatchedNoEffCorr = 0.0;//
867 Float_t etAntiProtonDepositedNotTrackMatchedNoEffCorr = 0.0;//
9a365626 868 //Float_t etPIDProtonDepositedNotTrackMatched = 0.0;//Still has to be filled!
03cff249 869 //1Float_t etPIDAntiProtonDepositedNotTrackMatched = 0.0;//Still has to be filled
9a365626 870 Float_t etProtonDeposited = 0.0;//
871 Float_t etAntiProtonDeposited = 0.0;//
872 Float_t etNeutronDeposited = 0.0;
873 Float_t etAntiNeutronDeposited = 0.0;
874 Float_t etSecondaries = 0.0;
875 Float_t etSecondariesEffCorr = 0.0;
b986cebe 876 Float_t etSecondariesOutOfAccEffCorr = 0.0;
877 Float_t etSecondariesDetectorCoverEffCorr = 0.0;
866b6d2b 878 Float_t etProtonDepositedNoEffCorr = 0.0;//
879 Float_t etAntiProtonDepositedNoEffCorr = 0.0;//
880 Float_t etNeutronDepositedNoEffCorr = 0.0;
881 Float_t etAntiNeutronDepositedNoEffCorr = 0.0;
882 Float_t etGammaCrossCheck = 0.0;
883 Float_t etGammaCrossCheckAlt = 0.0;
884// Float_t etNeutronCrossCheck = 0.0;
885// Float_t etSecondaryCrossCheck = 0.0;
886// Float_t etHadronCrossCheck = 0.0;
887// Float_t etKaonCrossCheck = 0.0;
888 Float_t etGammaCrossCheckTrue = 0.0;//--
889 Float_t etNeutronCrossCheckTrue = 0.0;//--
890 Float_t etSecondaryCrossCheckTrue = 0.0;//--
891 Float_t etHadronCrossCheckTrue = 0.0;//--
892 Float_t etKaonCrossCheckTrue = 0.0;//
9a365626 893 Float_t multiplicity = fEsdtrackCutsTPC->GetReferenceMultiplicity(realEvent,kTRUE);
866b6d2b 894
895 Float_t subtotalAllEnergy = 0.0;//energy of all clusters passing cuts vs centrality
896 Float_t subtotalSignalEnergy = 0.0;//signal of signal clusters passing cuts vs centrality
897 Float_t subtotalNeutronEnergy = 0.0;//signal of neutron clusters passing cuts vs centrality
898 Float_t subtotalKaonEnergy = 0.0;//signal of kaon clusters passing cuts vs centrality
899 Float_t subtotalHadronEnergy = 0.0;//signal of hadron clusters passing cuts vs centrality
900 Float_t subtotalSecondaryEnergy = 0.0;//signal of secondary clusters passing cuts vs centrality
901 Float_t subtotalSecondaryChargedEnergy = 0.0;//signal of secondary clusters passing cuts vs centrality
902 Float_t subtotalSecondaryNeutronEnergy = 0.0;//signal of secondary clusters passing cuts vs centrality
903 Float_t subtotalSecondaryGammaEnergy = 0.0;//signal of secondary clusters passing cuts vs centrality
904 Float_t subtotalSecondaryElectronEnergy = 0.0;//signal of secondary clusters passing cuts vs centrality
905 Float_t subtotalSecondaryOtherEnergy = 0.0;//signal of secondary clusters passing cuts vs centrality
906 Float_t subtotalSimulatedGammaEnergy = 0.0;//signal of signal clusters passing cuts vs centrality
907 Float_t subtotalSimulatedGammaEnergyAboveThreshold = 0.0;//signal of signal clusters passing cuts vs centrality
908 Float_t subtotalReconstructedGammaEnergy = 0.0;//signal of signal clusters passing cuts vs centrality
909 Float_t subtotalReconstructedSignalEnergy = 0.0;//signal of signal clusters passing cuts vs centrality
910
e2ee5727 911 // loop the clusters
912 for (int iCluster = 0; iCluster < nCluster; iCluster++ )
913 {
f61cec2f 914 Int_t cf = 0;
e2ee5727 915 AliESDCaloCluster* caloCluster = ( AliESDCaloCluster* )caloClusters->At( iCluster );
2aab9269 916 //Float_t caloE = caloCluster->E()
5881f036 917 if (!fSelector->CutGeometricalAcceptance(*caloCluster)) continue;
f61cec2f 918 fNClusters++;
32503dac 919 //const UInt_t iPart = (UInt_t)TMath::Abs(fSelector->GetLabel(caloCluster));//->GetLabel());
920 const UInt_t iPart = fSelector->GetLabel(caloCluster,stack);
921 //const UInt_t iPart = (UInt_t)TMath::Abs(caloCluster->GetLabel());
ef647350 922 TParticle *part = stack->Particle(iPart);
e2ee5727 923
924 if (!part)
0651f6b4 925 {
e2ee5727 926 Printf("No MC particle %d", iCluster);
927 continue;
928 }
9ef6f13f 929
f61cec2f 930 int primIdx = iPart;
e2ee5727 931 if (!stack->IsPhysicalPrimary(iPart)) // check whether particle is primary. we keep secondary electron and gamma for testing.
932 {
f61cec2f 933 primIdx = GetPrimMother(iPart, stack);
b2c10007 934 if(primIdx != stack->GetPrimary(iPart))
935 {
936 //std::cout << primIdx << " = " << stack->GetPrimary(iPart) << std::endl;
937 //PrintFamilyTree(iPart, stack);
938 }
2aab9269 939 //if it is from a K0S
f61cec2f 940 if(primIdx < 0)
941 {
ac610b08 942 //std::cout << "What!? No primary?" << std::endl;
943 //PrintFamilyTree(iPart, stack);
9ef6f13f 944 //continue;
945 //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.
946 primIdx = iPart;
f61cec2f 947 }
948
e2ee5727 949 } // end of primary particle check
a0dcb3c1 950 //const int primCode = stack->Particle(primIdx)->GetPdgCode();
ef647350 951 TParticlePDG *pdg = part->GetPDG();
f61cec2f 952 if (!pdg)
ef647350 953 {
954 Printf("ERROR: Could not get particle PDG %d", iPart);
955 continue;
f61cec2f 956 }
e2ee5727 957
a0dcb3c1 958 //Int_t code = pdg->PdgCode();
53ad5ec1 959// if(primCode == fgGammaCode)
960// {
961
d3ce32b8 962
963
964 Bool_t nottrackmatched = kTRUE;//default to no track matched
6a152780 965 Float_t matchedTrackp = 0.0;
966 Float_t matchedTrackpt = 0.0;
d3ce32b8 967 nottrackmatched = fSelector->PassTrackMatchingCut(*caloCluster);
968 //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 969 if(!nottrackmatched){//if the track is trackmatched
d3ce32b8 970 Int_t trackMatchedIndex = caloCluster->GetTrackMatchedIndex();
971 if(trackMatchedIndex < 0) nottrackmatched=kTRUE;
972 AliESDtrack *track = realEvent->GetTrack(trackMatchedIndex);
6a152780 973 matchedTrackp = track->P();
974 matchedTrackpt = track->Pt();
d3ce32b8 975 //if this is a good track, accept track will return true. The track matched is good, so not track matched is false
584f2478 976 nottrackmatched = !(fEsdtrackCutsTPC->AcceptTrack(track));//if the track is bad, this is track matched
6a152780 977 //if(!nottrackmatched) cout<<"Matched track p: "<<matchedTrackp<<" sim "<<part->P()<<endl;
d3ce32b8 978 }
979
866b6d2b 980 Bool_t containsGamma = kFALSE;
981 //Int_t gammaCode = -1;
982 Float_t gammaEnergy = 0.0;
a0dcb3c1 983 for(UInt_t i = 0; i < caloCluster->GetNLabels(); i++)
b2c10007 984 {
53ad5ec1 985 Int_t pIdx = caloCluster->GetLabelAt(i);
866b6d2b 986 //Int_t initialLabel = pIdx;
0861cc1f 987 //TParticle *p = stack->Particle(pIdx);
988
53ad5ec1 989 if(!stack->IsPhysicalPrimary(pIdx))
866b6d2b 990 {//This should count gammas as reconstructed if we found even part of them
991 pIdx = GetPrimMother(pIdx, stack);
992 //TParticle *part2 = stack->Particle(initialLabel);
993// TParticle *part2 = stack->Particle(pIdx);
994// if(part2){
995// TParticlePDG *pdg2 = part2->GetPDG();
996// if(pdg2){
997// Int_t code2 = pdg2->PdgCode();
998// if(code2 == fgGammaCode){
999// cout<<"Relabeling primary index initial label "<<initialLabel<<" final label "<<pIdx<<endl;
1000// PrintFamilyTree(initialLabel, stack);
1001// }
1002// }
1003// }
1004 }
0861cc1f 1005 if(fSelector->PassDistanceToBadChannelCut(*caloCluster))//&&fSelector->CutGeometricalAcceptance(*(stack->Particle(primIdx))))
1006 {
866b6d2b 1007 //if this contained a gamma...
1008 if(pIdx>0){
1009 TParticle *part2 = stack->Particle(pIdx);
1010 if(part2){
1011 TParticlePDG *pdg2 = part2->GetPDG();
1012 if(pdg2){
1013 Int_t code2 = pdg2->PdgCode();
1014 if(code2 == fgGammaCode){//if this is counted as a reconstructed gamma, we want to know what was reconstructed about it
1015 //gammaCode = pIdx;
1016 containsGamma = kTRUE;
1017 gammaEnergy += part2->Energy();//do += because if we have multiple gammas we want to add that to our reconstructed gamma energy, even if we didn't separat them
1018 }
1019 }
1020 }
1021 // std::cout << "Gamma primary: " << primIdx << std::endl;
1022 // foundGammas.push_back(primIdx);
1023 if(nottrackmatched){
1024 foundGammas.push_back(pIdx);
1025 }
d3ce32b8 1026 }
0861cc1f 1027 }
b2c10007 1028 }
53ad5ec1 1029 fCutFlow->Fill(cf++);
86e7d5db 1030 if(!fSelector->PassDistanceToBadChannelCut(*caloCluster)) continue;
5881f036 1031 Double_t clEt = CorrectForReconstructionEfficiency(*caloCluster,fCentClass);
ef647350 1032// if(code == fgK0SCode) std::cout << "K0 energy: " << caloCluster->E() << std::endl;
86e7d5db 1033 if(!fSelector->PassMinEnergyCut(*caloCluster)) continue;
53ad5ec1 1034
1035
f61cec2f 1036 fCutFlow->Fill(cf++);
0861cc1f 1037 Float_t pos[3];
1038 //PrintFamilyTree(
1039 caloCluster->GetPosition(pos);
1040 TVector3 cp(pos);
1041
f61cec2f 1042 TParticle *primPart = stack->Particle(primIdx);
1043 fPrimaryCode = primPart->GetPdgCode();
549c95b0 1044 if(primPart->GetPDG()) fPrimaryCharge = (Int_t) primPart->GetPDG()->Charge();
f61cec2f 1045
1046 fPrimaryE = primPart->Energy();
1047 fPrimaryEt = primPart->Energy()*TMath::Sin(primPart->Theta());
f61cec2f 1048 fPrimaryPx = primPart->Px();
1049 fPrimaryPy = primPart->Py();
1050 fPrimaryPz = primPart->Pz();
cfe23ff0 1051 //cout<<"I have a cluster and it's good energy "<<caloCluster->E()<<" simulated "<<fPrimaryE<<endl;
f61cec2f 1052 fPrimaryVx = primPart->Vx();
1053 fPrimaryVy = primPart->Vy();
1054 fPrimaryVz = primPart->Vz();
1055
1056 fPrimaryAccepted = false;
b2c10007 1057 fPrimaryMatched = false;
f61cec2f 1058
1059 fDepositedCode = part->GetPdgCode();
b2c10007 1060 fDepositedE = part->Energy();
1061 fDepositedEt = part->Energy()*TMath::Sin(part->Theta());
549c95b0 1062 if(part->GetPDG()) fDepositedCharge = (Int_t) part->GetPDG()->Charge();
f61cec2f 1063
1064 fDepositedVx = part->Vx();
1065 fDepositedVy = part->Vy();
1066 fDepositedVz = part->Vz();
b986cebe 1067 fReconstructedE = caloCluster->E();
1068 fReconstructedEt = caloCluster->E()*TMath::Sin(cp.Theta());
b2c10007 1069
866b6d2b 1070 if(nottrackmatched) subtotalAllEnergy += fReconstructedEt;
1071
b2c10007 1072 //fSecondary = fSelector->FromSecondaryInteraction(*primPart, *stack);
866b6d2b 1073 fSecondary =fSelector->FromSecondaryInteraction(iPart, *stack);
b986cebe 1074 //if(fSecondary && fReconstructedEt<0.3) fSecondary = kFALSE;//patch to do quick cross check THIS SHOULD NOT GET COMMITTED!!! IF IT DID YELL AT CHRISTINE ASAP
9ef6f13f 1075// if(fSecondary)
1076// {
1077// //std::cout << "Have secondary!" << std::endl;
1078// //PrintFamilyTree(iPart, stack);
1079// }
b2c10007 1080
1081 pdg = primPart->GetPDG(0);
2ed3c93c 1082 if (!pdg)
1083 {
1084 Printf("ERROR: Could not get particle PDG %d", iPart);
1085 continue;
1086 }
a0dcb3c1 1087 //Int_t code = primPart->GetPdgCode();
e2ee5727 1088
9ef6f13f 1089 Bool_t written = kFALSE;
1090
d3ce32b8 1091// Bool_t nottrackmatched = kTRUE;//default to no track matched
1092// nottrackmatched = fSelector->PassTrackMatchingCut(*caloCluster);
1093// //by default ALL matched tracks are accepted, whether or not the match is good. So we check to see if the track is good.
1094// if(!nottrackmatched){
1095// Int_t trackMatchedIndex = caloCluster->GetTrackMatchedIndex();
1096// if(trackMatchedIndex < 0) nottrackmatched=kTRUE;
1097// AliESDtrack *track = realEvent->GetTrack(trackMatchedIndex);
1098// //if this is a good track, accept track will return true. The track matched is good, so not track matched is false
1099// nottrackmatched = !(fEsdtrackCutsTPC->AcceptTrack(track));
1100// }
9ef6f13f 1101
1102 if(fSecondary){//all particles from secondary interactions
866b6d2b 1103 //===================================BEGIN SECONDARIES==================================================
9ef6f13f 1104 written = kTRUE;
b986cebe 1105
866b6d2b 1106 if (fDepositedCharge != 0 && fDepositedCode!=fgEMinusCode && fDepositedCode!=fgEPlusCode){//if the particle hitting the calorimeter is pi/k/p/mu
1107 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%BEGIN CHARGED SECONDARIES%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1108 fHistChargedTrackDepositsAllVsPt->Fill(part->Pt(), fCentClass,fReconstructedEt);
1109 fHistChargedTrackDepositsAllVsPtEffCorr->Fill(part->Pt(), fCentClass,clEt);
1110 if(!nottrackmatched){//if it is track matched
1111// cout<<"Charged Secondary ";
1112// PrintFamilyTreeShort(iPart, stack);
1113 fHistChargedTrackDepositsAcceptedVsPt->Fill(part->Pt(), fCentClass,fReconstructedEt);
1114 fHistChargedTrackDepositsAcceptedVsPtEffCorr->Fill(part->Pt(), fCentClass,fReconstructedEt);
1115 fHistHadronDepositsReco->Fill(part->Pt());
1116 fHistHadronDepositsRecoCent->Fill(part->Pt(), fCentClass);
1117 fHistHadronDepositsRecovsECent->Fill(fReconstructedE, fCentClass);
9ef6f13f 1118 fChargedRemoved++;
1119 fEnergyChargedRemoved += clEt;
1120 fHistRemovedOrNot->Fill(0.0, fCentClass);
1121 fHistDxDzRemovedCharged->Fill(caloCluster->GetTrackDx(), caloCluster->GetTrackDz());
9a365626 1122 fHistChargedRemovedSecondaryEtVsCent->Fill(fReconstructedEt,fCentClass);
1123 nChargedSecondariesRemoved++;
866b6d2b 1124 fHistChargedTracksCut->Fill(fReconstructedEt);
0861cc1f 1125 if(fCalcTrackMatchVsMult){
866b6d2b 1126 fHistChargedTracksCutMult->Fill(fReconstructedEt,fClusterMult);
1127 if(fClusterMult<25){fHistChargedTracksCutPeripheral->Fill(fReconstructedEt);}
0861cc1f 1128 }
6a152780 1129 fHistMatchedTracksEvspTBkgd->Fill(matchedTrackp,fReconstructedE);
0861cc1f 1130 if(fCalcTrackMatchVsMult){
866b6d2b 1131 if(fClusterMult<25){fHistMatchedTracksEvspTBkgdPeripheral->Fill(matchedTrackp,fReconstructedEt);}
1132 fHistMatchedTracksEvspTBkgdvsCent->Fill(matchedTrackp,fReconstructedEt, fCentClass);
1133 fHistMatchedTracksEvspTBkgdvsCentEffCorr->Fill(matchedTrackp,clEt, fCentClass);//Fill with the efficiency corrected energy
0861cc1f 1134 }
32503dac 1135 //Int_t trackindex = (caloCluster->GetLabelsArray())->At(1);
1136 UInt_t trackindex = fSelector->GetLabel(caloCluster,stack);//(caloCluster->GetLabelsArray())->At(1);
1137 if(((UInt_t)caloCluster->GetLabel())!=trackindex){
866b6d2b 1138 //if(fSelector->GetLabel(caloCluster,stack) !=trackindex){
9ef6f13f 1139 fHistBadTrackMatches->Fill(part->Pt(),fReconstructedE);
1140 fHistBadTrackMatchesdPhidEta->Fill(caloCluster->GetTrackDx(),caloCluster->GetTrackDz());
1141 //cout<<"Track matched, label cluster "<<caloCluster->GetLabel()<<" track "<<trackindex<<endl;
1142 }
1143 else{
1144 fHistGoodTrackMatchesdPhidEta->Fill(caloCluster->GetTrackDx(),caloCluster->GetTrackDz());
1145 }
1146 }
866b6d2b 1147 else{
1148 fChargedNotRemoved++;
1149 fEnergyChargedNotRemoved += clEt;
1150 fHistRemovedOrNot->Fill(2.0, fCentClass);
1151 fHistDxDzNonRemovedCharged->Fill(caloCluster->GetTrackDx(), caloCluster->GetTrackDz());
1152 fHistChargedNotRemovedSecondaryEtVsCent->Fill(fReconstructedEt,fCentClass);
1153 nChargedSecondariesNotRemoved++;
9ef6f13f 1154 }
866b6d2b 1155 fHistHadronDepositsAll->Fill(part->Pt());
1156 fHistHadronDepositsAllCent->Fill(part->Pt(), fCentClass);
1157 fHistHadronDepositsAllvsECent->Fill(fReconstructedE, fCentClass);
1158 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%END CHARGED SECONDARIES%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9ef6f13f 1159 }
866b6d2b 1160 else{
1161 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%BEGIN NEUTRAL SECONDARIES%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1162 if(nottrackmatched){//secondaries not removed
1163// cout<<"Neutral Secondary ";
1164// PrintFamilyTreeShort(iPart, stack);
1165
1166 subtotalSecondaryEnergy += fReconstructedEt;
1167 Bool_t tmpIsWritten = kFALSE;
1168 if(fDepositedCode==fgProtonCode || fDepositedCode==fgAntiProtonCode || fDepositedCode==fgPiPlusCode || fDepositedCode==fgPiMinusCode || fDepositedCode==fgKPlusCode || fDepositedCode==fgKMinusCode){
1169 subtotalSecondaryChargedEnergy += fReconstructedEt;
1170 tmpIsWritten = kTRUE;
1171 }
1172 if(fDepositedCode==fgNeutronCode || fDepositedCode==fgAntiNeutronCode){
1173 subtotalSecondaryNeutronEnergy += fReconstructedEt;
1174 tmpIsWritten = kTRUE;
1175 }
1176 if(fDepositedCode==fgGammaCode){
1177 subtotalSecondaryNeutronEnergy += fReconstructedEt;
1178 tmpIsWritten = kTRUE;
1179 }
1180 if(fDepositedCode==fgEPlusCode || fDepositedCode==fgEMinusCode){
1181 subtotalSecondaryElectronEnergy += fReconstructedEt;
1182 tmpIsWritten = kTRUE;
1183 }
1184 if(!tmpIsWritten){
1185 subtotalSecondaryOtherEnergy += fReconstructedEt;
1186 }
1187
1188 if(!fSelector->CutGeometricalAcceptance(*part)){
1189 if(TMath::Sqrt(part->Vx() * part->Vx() + part->Vy() * part->Vy() + part->Vz()* part->Vz())>100){
1190 etSecondariesOutOfAccEffCorr += clEt;
1191 }
1192 }
1193 else{
1194 if(TMath::Sqrt(part->Vx() * part->Vx() + part->Vy() * part->Vy() + part->Vz()* part->Vz())>430){
1195 //clusters which are in the cover of the PHOS/EMCal
1196 etSecondariesDetectorCoverEffCorr += clEt;
1197 }
1198 }
1199 fSecondaryClusterEnergy->Fill(fReconstructedEt);
1200 fHistSecondaryPositionInDetector->Fill(part->Vx(),part->Vy(),part->Vz());
1201 fSecondaryNotRemoved++;
1202 etSecondaries += fReconstructedEt;
1203 etSecondariesEffCorr += clEt;
1204 fHistNeutralNotRemovedSecondaryEtVsCent->Fill(fReconstructedEt,fCentClass);
1205 nNeutralSecondariesNotRemoved++;
1206 }
1207 else{//secondaries removed
1208 fNeutralRemoved++;
1209 fEnergyNeutralRemoved += clEt;
1210 fHistRemovedOrNot->Fill(1.0, fCentClass);
1211 fHistDxDzRemovedNeutral->Fill(caloCluster->GetTrackDx(), caloCluster->GetTrackDz());
1212 fHistNeutralRemovedSecondaryEtVsCent->Fill(fReconstructedEt,fCentClass);
1213
1214 nNeutralSecondariesRemoved++;
1215 }
1216 }//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%END NEUTRAL SECONDARIES%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1217 }//===================================END SECONDARIES==================================================
9a365626 1218 else{//not a secondary
866b6d2b 1219 //===================================BEGIN CHARGED TRACKS==================================================
9ef6f13f 1220 if (fDepositedCharge != 0 && fDepositedCode!=fgEMinusCode && fDepositedCode!=fgEPlusCode){//if the particle hitting the calorimeter is pi/k/p/mu
866b6d2b 1221// cout<<"Hadron ";
1222// PrintFamilyTreeShort(iPart, stack);
1223 fHistChargedTrackDepositsAllVsPt->Fill(part->Pt(), fCentClass,fReconstructedEt);
1224 fHistChargedTrackDepositsAllVsPtEffCorr->Fill(part->Pt(), fCentClass,clEt);
1225
9ef6f13f 1226 written = kTRUE;
d3ce32b8 1227 fClusterMultChargedTracks++;
9a365626 1228 etPiKPDeposited += clEt;
1229 if(fDepositedCode==fgProtonCode){
1230 etProtonDeposited += clEt;
866b6d2b 1231 etProtonDepositedNoEffCorr += fReconstructedEt;
9a365626 1232 }
1233 if(fDepositedCode==fgAntiProtonCode){
1234 etAntiProtonDeposited += clEt;
866b6d2b 1235 etAntiProtonDepositedNoEffCorr += fReconstructedEt;
9a365626 1236 }
9ef6f13f 1237 if(nottrackmatched){//not removed but should be
866b6d2b 1238 subtotalHadronEnergy += fReconstructedEt;
1239 etHadronCrossCheckTrue += clEt;
9a365626 1240 etPiKPDepositedNotTrackMatched += clEt;
1241 if(fDepositedCode==fgProtonCode){
1242 etProtonDepositedNotTrackMatched += clEt;
866b6d2b 1243 etProtonDepositedNotTrackMatchedNoEffCorr += fReconstructedEt;
9a365626 1244 }
1245 if(fDepositedCode==fgAntiProtonCode){
1246 etAntiProtonDepositedNotTrackMatched += clEt;
866b6d2b 1247 etAntiProtonDepositedNotTrackMatchedNoEffCorr += fReconstructedEt;
9a365626 1248 }
c79c36cc 1249 fHistHadronDepositsAll->Fill(part->Pt());
866b6d2b 1250 fHistHadronDepositsAllCent->Fill(part->Pt(), fCentClass);//denominator in track matching efficiency
1251 //we want this to be all hadrons where we actually reconstructed and would accept the track
1252
1253 for (Int_t iTrack = 0; iTrack < nGoodTracks; iTrack++){
1254 AliESDtrack *track = dynamic_cast<AliESDtrack*> (list->At(iTrack));
1255 if (!track){
1256 Printf("ERROR: Could not get track %d", iTrack);
1257 continue;
1258 }
1259 else{
1260 if((Int_t)fSelector->GetLabel(caloCluster,stack)==track->GetLabel()){//then we found the track from the particle that created this
1261 fHistHadronDepositsAllvsECent->Fill(fReconstructedE, fCentClass);
1262 }
1263 }
1264 }
5881f036 1265 if(fReconstructedEt>0.5) fHistHadronDepositsAllCent500MeV->Fill(part->Pt(), fCentClass);
9ef6f13f 1266 fChargedNotRemoved++;
1267 fEnergyChargedNotRemoved += clEt;
1268 fHistRemovedOrNot->Fill(2.0, fCentClass);
1269 fHistDxDzNonRemovedCharged->Fill(caloCluster->GetTrackDx(), caloCluster->GetTrackDz());
866b6d2b 1270 fHistChargedTracksAccepted->Fill(fReconstructedEt);
0861cc1f 1271 if(fCalcTrackMatchVsMult){
6a152780 1272 if(matchedTrackpt<0.5){//if we could never have matched this because of its pt, how much energy did it deposit?
866b6d2b 1273 fHistChargedTracksAcceptedLowPtCent->Fill(fReconstructedEt, fCentClass);
1274 fHistChargedTracksAcceptedLowPtCentEffCorr->Fill(clEt, fCentClass);
1275 if(fReconstructedEt>=0.5) fHistChargedTracksAcceptedLowPtCent500MeV->Fill(fReconstructedEt, fCentClass);
2ed3c93c 1276 if(pdg && pdg->PdgCode()!=fgAntiProtonCode){
866b6d2b 1277 fHistChargedTracksAcceptedLowPtCentNoAntiProtons->Fill(fReconstructedEt, fCentClass);
ac610b08 1278 }
1279 else{
866b6d2b 1280 fHistChargedTracksAcceptedLowPtCentAntiProtons->Fill(fReconstructedEt, fCentClass);
ac610b08 1281 }
6a152780 1282 }
866b6d2b 1283 fHistChargedTracksAcceptedMult->Fill(fReconstructedEt,fClusterMult);
1284 if(fClusterMult<25){fHistChargedTracksAcceptedPeripheral->Fill(fReconstructedEt);}
0861cc1f 1285 }
9ef6f13f 1286 }
1287 else{//removed and should have been
866b6d2b 1288 //cout<<" t.m. primary"<<endl;
32503dac 1289 Int_t trackindex = fSelector->GetLabel(caloCluster,stack);// (caloCluster->GetLabelsArray())->At(0);
866b6d2b 1290 fHistChargedTrackDepositsAcceptedVsPt->Fill(part->Pt(), fCentClass,fReconstructedEt);
1291 fHistChargedTrackDepositsAcceptedVsPtEffCorr->Fill(part->Pt(), fCentClass,clEt);
c79c36cc 1292 fHistHadronDepositsReco->Fill(part->Pt());
ac610b08 1293 fHistHadronDepositsRecoCent->Fill(part->Pt(), fCentClass);
866b6d2b 1294 fHistHadronDepositsRecovsECent->Fill(fReconstructedE, fCentClass);
c79c36cc 1295 fHistHadronDepositsAll->Fill(part->Pt());
ac610b08 1296 fHistHadronDepositsAllCent->Fill(part->Pt(), fCentClass);
866b6d2b 1297 for (Int_t iTrack = 0; iTrack < nGoodTracks; iTrack++){
1298 AliESDtrack *track = dynamic_cast<AliESDtrack*> (list->At(iTrack));
1299 if (!track){
1300 Printf("ERROR: Could not get track %d", iTrack);
1301 continue;
1302 }
1303 else{
1304 if((Int_t) fSelector->GetLabel(caloCluster,stack)==track->GetLabel()){//then we found the track from the particle that created this
1305 fHistHadronDepositsAllvsECent->Fill(fReconstructedE, fCentClass);
1306 }
1307 }
1308 }
5881f036 1309 if(fReconstructedEt>0.5) fHistHadronDepositsAllCent500MeV->Fill(part->Pt(), fCentClass);
866b6d2b 1310 if((Int_t)fSelector->GetLabel(caloCluster,stack)!= trackindex){
9ef6f13f 1311 fHistBadTrackMatches->Fill(part->Pt(),fReconstructedE);
1312 fHistBadTrackMatchesdPhidEta->Fill(caloCluster->GetTrackDx(),caloCluster->GetTrackDz());
1313 //cout<<"Track matched, label cluster "<<caloCluster->GetLabel()<<" track "<<trackindex<<endl;
1314 }
1315 else{
1316 fHistGoodTrackMatchesdPhidEta->Fill(caloCluster->GetTrackDx(),caloCluster->GetTrackDz());
1317 }
1318 fChargedRemoved++;
1319 fEnergyChargedRemoved += clEt;
1320 fHistRemovedOrNot->Fill(0.0, fCentClass);
1321 fHistDxDzRemovedCharged->Fill(caloCluster->GetTrackDx(), caloCluster->GetTrackDz());
866b6d2b 1322 fHistChargedTracksCut->Fill(fReconstructedEt);
0861cc1f 1323 if(fCalcTrackMatchVsMult){
866b6d2b 1324 fHistChargedTracksCutMult->Fill(fReconstructedEt,fClusterMult);
1325 if(fClusterMult<25){fHistChargedTracksCutPeripheral->Fill(fReconstructedEt);}
0861cc1f 1326 }
6a152780 1327 fHistMatchedTracksEvspTBkgd->Fill(matchedTrackp,fReconstructedE);
0861cc1f 1328 if(fCalcTrackMatchVsMult){
6a152780 1329 if(fClusterMult<25){fHistMatchedTracksEvspTBkgdPeripheral->Fill(matchedTrackp,fReconstructedEt);}
ac610b08 1330 fHistMatchedTracksEvspTBkgdvsCent->Fill(matchedTrackp,fReconstructedEt, fCentClass);
1331 fHistMatchedTracksEvspTBkgdvsCentEffCorr->Fill(matchedTrackp,clEt, fCentClass);//fill with the efficiency corrected energy
0861cc1f 1332 }
9ef6f13f 1333 }
1334 }
866b6d2b 1335 //===================================END CHARGED TRACKS==================================================
1336 //===================================BEGIN KAONS==================================================
9ef6f13f 1337 //K0L and any neutral particles from the decay of K+/- or K0S
866b6d2b 1338 if(!written && (fPrimaryCode==fgKPlusCode || fPrimaryCode==fgKMinusCode || fPrimaryCode==fgK0SCode ||fPrimaryCode==fgK0LCode) && nottrackmatched){
1339// cout<<"Kaon ";
1340// PrintFamilyTreeShort(iPart, stack);
1341
1342 etKaonCrossCheckTrue += clEt;
1343 subtotalKaonEnergy += fReconstructedEt;
1344 //etKaonCrossCheckTrue += fReconstructedEt;
9ef6f13f 1345 written = kTRUE;//At this point we are not tracking them but we don't count them as neutrals accidentally removed
cfe23ff0 1346 }
866b6d2b 1347 //===================================END KAONS==================================================
1348 //===================================BEGIN SIGNAL==================================================
9ef6f13f 1349 if(!written && (fDepositedCode==fgGammaCode || fDepositedCode==fgEMinusCode || fDepositedCode ==fgEPlusCode)){//if the particle hitting the calorimeter is gamma, electron and not from a kaon
866b6d2b 1350// cout<<"Signal ";
1351// PrintFamilyTreeShort(iPart, stack);
1352
d3ce32b8 1353 fClusterMultGammas++;
9ef6f13f 1354 written = kTRUE;
1355 if(nottrackmatched){//Not removed and not supposed to be removed - signal
866b6d2b 1356 subtotalSignalEnergy += fReconstructedEt;
1357 subtotalReconstructedSignalEnergy += fReconstructedEt;
1358 if(fPrimaryCode==fgGammaCode){//if this comes from a primary electron - this is for reconstruction efficiency
1359 subtotalReconstructedGammaEnergy += fReconstructedEt;
1360 }
1361// else{
1362// if(fPrimaryCode!=fgEMinusCode && fPrimaryCode !=fgEPlusCode){
1363// PrintFamilyTreeShort(iPart, stack);
1364// }
1365// }
9ef6f13f 1366 fEtNonRemovedGammas += clEt;
1367 fMultNonRemovedGammas++;
1368 fNeutralNotRemoved--;
1369 fEnergyNeutralNotRemoved -= clEt;
1370 fHistGammasAccepted->Fill(fDepositedEt);
0861cc1f 1371 if(fCalcTrackMatchVsMult){
1372 fHistGammasAcceptedMult->Fill(fDepositedEt,fClusterMult);
1373 if(fClusterMult<25){fHistGammasAcceptedPeripheral->Fill(fDepositedEt);}
1374 }
866b6d2b 1375 if(containsGamma){
1376 if(!fSelector->CutGeometricalAcceptance(*primPart)){
1377 fHistGammasFoundOutOfAccRecoEnergyCent->Fill(fReconstructedE,fCentClass);
1378 }
1379 else{
1380 if(gammaEnergy>0) fHistGammaEnergyCrossCheckAlt->Fill(gammaEnergy,(fReconstructedEt-gammaEnergy)/fReconstructedEt);
1381 fHistGammasFoundRecoEnergyCent->Fill(fReconstructedE,fCentClass);
1382 etGammaCrossCheckAlt += clEt;
1383 }
1384 }
1385 if(fDepositedCode==fgGammaCode){
1386 if(!fSelector->CutGeometricalAcceptance(*primPart)){
1387 fHistGammasFoundOutOfAccCent->Fill(fReconstructedE,fCentClass);
1388 }
1389 else{
1390 etGammaCrossCheck += clEt;
1391 // cout<<"Found gamma et "<<fReconstructedEt<<" sim et "<< fPrimaryEt<<endl;
1392 if(fPrimaryEt>0) fHistGammaEnergyCrossCheck->Fill(fPrimaryEt,(fReconstructedEt-fPrimaryEt)/fReconstructedEt);
1393 fHistGammasFoundAltCent->Fill(fReconstructedE,fCentClass);
1394 }
1395 }
9ef6f13f 1396 }
1397 else{//removed but shouldn't have been
32503dac 1398 Int_t trackindex = fSelector->GetLabel(caloCluster,stack);// (caloCluster->GetLabelsArray())->At(1);
9ef6f13f 1399 if(caloCluster->GetLabel()!=trackindex){
1400 fHistBadTrackMatches->Fill(part->Pt(),fReconstructedE);
1401 fHistBadTrackMatchesdPhidEta->Fill(caloCluster->GetTrackDx(),caloCluster->GetTrackDz());
1402// cout<<"Track matched, label cluster "<<caloCluster->GetLabel()<<" track "<<trackindex<<endl;
866b6d2b 1403// PrintFamilyTreeShort(trackindex, stack);
9ef6f13f 1404// cout<<"Cluster"<<endl;
1405 }
1406 fGammaRemoved++;
1407 fGammaRemovedEt+=clEt;
1408 fHistGammasCut->Fill(fDepositedEt);
0861cc1f 1409 if(fCalcTrackMatchVsMult){
1410 fHistGammasCutMult->Fill(fDepositedEt,fClusterMult);
1411 if(fClusterMult<25){fHistGammasCutPeripheral->Fill(fDepositedEt);}
1412 }
6a152780 1413 fHistMatchedTracksEvspTSignal->Fill(matchedTrackp,fReconstructedE);
0861cc1f 1414 if(fCalcTrackMatchVsMult){
6a152780 1415 if(fClusterMult<25){fHistMatchedTracksEvspTSignalPeripheral->Fill(matchedTrackp,fReconstructedEt);}
ac610b08 1416 fHistMatchedTracksEvspTSignalvsCent->Fill(matchedTrackp,fReconstructedEt, fCentClass);
1417 fHistMatchedTracksEvspTSignalvsCentEffCorr->Fill(matchedTrackp,clEt, fCentClass);
0861cc1f 1418 }
9ef6f13f 1419 }
1420 }
866b6d2b 1421 //===================================END SIGNAL==================================================
1422 //===================================BEGIN NEUTRONS==================================================
9ef6f13f 1423 //all other cases - neutron, anti-neutron, not aware of other cases
1424 if(!written){
866b6d2b 1425// cout<<"Neutron ";
1426// PrintFamilyTreeShort(iPart, stack);
9ef6f13f 1427 fNeutralNotRemoved++;
9a365626 1428 fEnergyNeutralNotRemoved += clEt;//this is the efficiency corrected energy
9ef6f13f 1429 fHistRemovedOrNot->Fill(3.0, fCentClass);
866b6d2b 1430 if ((fDepositedCode == fgNeutronCode || fDepositedCode == fgAntiNeutronCode) && nottrackmatched){
1431 etNeutronCrossCheckTrue += clEt;
1432 subtotalNeutronEnergy += fReconstructedEt;
9a365626 1433 fHistDxDzNonRemovedNeutral->Fill(caloCluster->GetTrackDx(), caloCluster->GetTrackDz());
1434 fHistNeutronsEtVsCent->Fill(clEt,fCentClass);
1435 nNeutrons++;
1436 if(fDepositedCode == fgNeutronCode){
1437 etNeutronDeposited += clEt;
866b6d2b 1438 etNeutronDeposited += fReconstructedEt;
9a365626 1439 }
1440 if(fDepositedCode == fgAntiNeutronCode){
1441 etAntiNeutronDeposited += clEt;
866b6d2b 1442 etAntiNeutronDeposited += fReconstructedEt;
9a365626 1443 }
1444 //cout<<"I am a";
1445 //if(fDepositedCode == fgAntiNeutronCode) cout<<"n anti-";
1446 //else{cout<<" ";}
1447 //cout<<"neutron!! pt "<<part->Pt()<<" eta "<<part->Eta()<<" phi "<<part->Phi()<<" Et "<<clEt<<endl;
866b6d2b 1448 //PrintFamilyTreeShort(iPart, stack);
9a365626 1449 }
1450 else{
1451 nNotNeutrons++;
1452// cout<<"I am a";
1453// if(fDepositedCode == fgAntiNeutronCode) cout<<"n anti-";
1454// else{cout<<" ";}
1455// cout<<"neutron!! pt "<<part->Pt()<<" eta "<<part->Eta()<<" phi "<<part->Phi()<<" Et "<<clEt<<endl;
866b6d2b 1456// PrintFamilyTreeShort(iPart, stack);
9a365626 1457// cout<<"I am not a neutron!!"<<endl;
866b6d2b 1458// PrintFamilyTreeShort(iPart, stack);
9a365626 1459 }
9ef6f13f 1460 }
866b6d2b 1461 //===================================END NEUTRONS==================================================
9ef6f13f 1462 }
f61cec2f 1463 fPrimaryTree->Fill();
9ef6f13f 1464 } // end of loop over clusters
866b6d2b 1465
1466
1467 fHistAllEnergy->Fill(fCentClass,subtotalAllEnergy);
1468 fHistSignalEnergy->Fill(fCentClass,subtotalSignalEnergy);
1469 fHistNeutronEnergy->Fill(fCentClass,subtotalNeutronEnergy);
1470 fHistKaonEnergy->Fill(fCentClass,subtotalKaonEnergy);
1471 fHistHadronEnergy->Fill(fCentClass,subtotalHadronEnergy);
1472 fHistSecondaryEnergy->Fill(fCentClass,subtotalSecondaryEnergy);
1473 fHistSecondaryChargedEnergy->Fill(fCentClass,subtotalSecondaryChargedEnergy);
1474 fHistSecondaryNeutronEnergy->Fill(fCentClass,subtotalSecondaryNeutronEnergy);
1475 fHistSecondaryGammaEnergy->Fill(fCentClass,subtotalSecondaryGammaEnergy);
1476 fHistSecondaryElectronEnergy->Fill(fCentClass,subtotalSecondaryElectronEnergy);
1477 fHistSecondaryOtherEnergy->Fill(fCentClass,subtotalSecondaryOtherEnergy);
1478 fHistReconstructedGammaEnergy->Fill(fCentClass,subtotalReconstructedGammaEnergy);
1479 fHistReconstructedSignalEnergy->Fill(fCentClass,subtotalReconstructedSignalEnergy);
1480 Float_t fracSignal =0;
1481 Float_t fracHadron = 0;
1482 Float_t fracKaon = 0;
1483 Float_t fracNeutron = 0;
1484 Float_t fracSecondary = 0;
1485 if(subtotalAllEnergy>0){
1486 fracSignal = subtotalReconstructedSignalEnergy/subtotalAllEnergy;
1487 fracHadron = subtotalHadronEnergy/subtotalAllEnergy;
1488 fracKaon = subtotalKaonEnergy/subtotalAllEnergy;
1489 fracNeutron = subtotalNeutronEnergy/subtotalAllEnergy;
1490 fracSecondary = subtotalSecondaryEnergy/subtotalAllEnergy;
1491 }
1492 fHistFracSignalVsNClusters->Fill(fClusterMult,fracSignal);
1493 fHistFracHadronsVsNClusters->Fill(fClusterMult,fracHadron);
1494 fHistFracKaonsVsNClusters->Fill(fClusterMult,fracKaon);
1495 fHistFracNeutronsVsNClusters->Fill(fClusterMult,fracNeutron);
1496 fHistFracSecondariesVsNClusters->Fill(fClusterMult,fracSecondary);
1497 fHistFracSignalVsNMultiplicity->Fill(multiplicity,fracSignal);
1498 fHistFracHadronsVsNMultiplicity->Fill(multiplicity,fracHadron);
1499 fHistFracKaonsVsNMultiplicity->Fill(multiplicity,fracKaon);
1500 fHistFracNeutronsVsNMultiplicity->Fill(multiplicity,fracNeutron);
1501 fHistFracSecondariesVsNMultiplicity->Fill(multiplicity,fracSecondary);
1502 fHistFracSignalVsNMatchedTracks->Fill(nChargedHadronsMeasured,fracSignal);
1503 fHistFracHadronsVsNMatchedTracks->Fill(nChargedHadronsMeasured,fracHadron);
1504 fHistFracKaonsVsNMatchedTracks->Fill(nChargedHadronsMeasured,fracKaon);
1505 fHistFracNeutronsVsNMatchedTracks->Fill(nChargedHadronsMeasured,fracNeutron);
1506 fHistFracSecondariesVsNMatchedTracks->Fill(nChargedHadronsMeasured,fracSecondary);
1507 fHistFracSignalVsNTotalTracks->Fill(nChargedHadronsTotal,fracSignal);
1508 fHistFracHadronsVsNTotalTracks->Fill(nChargedHadronsTotal,fracHadron);
1509 fHistFracKaonsVsNTotalTracks->Fill(nChargedHadronsTotal,fracKaon);
1510 fHistFracNeutronsVsNTotalTracks->Fill(nChargedHadronsTotal,fracNeutron);
1511 fHistFracSecondariesVsNTotalTracks->Fill(nChargedHadronsTotal,fracSecondary);
1512
1513
1514
9a365626 1515 fHistPiKPNotTrackMatchedDepositedVsNch->Fill(etPiKPDepositedNotTrackMatched,multiplicity);
1516 fHistPiKPDepositedVsNch->Fill(etPiKPDeposited,multiplicity);
866b6d2b 1517
9a365626 1518 fHistNeutronsDepositedVsNch->Fill(etNeutronDeposited,multiplicity);
1519 fHistAntiNeutronsDepositedVsNch->Fill(etAntiNeutronDeposited,multiplicity);
1520 fHistProtonsDepositedVsNch->Fill(etProtonDeposited,multiplicity);
1521 fHistAntiProtonsDepositedVsNch->Fill(etAntiProtonDeposited,multiplicity);
1522 fHistProtonsNotTrackMatchedDepositedVsNch->Fill(etProtonDepositedNotTrackMatched,multiplicity);
1523 fHistAntiProtonsNotTrackMatchedDepositedVsNch->Fill(etAntiProtonDepositedNotTrackMatched,multiplicity);
866b6d2b 1524
1525 fHistNeutronsDepositedVsNcl->Fill(etNeutronDeposited,fClusterMult);
1526 fHistAntiNeutronsDepositedVsNcl->Fill(etAntiNeutronDeposited,fClusterMult);
1527 fHistProtonsDepositedVsNcl->Fill(etProtonDeposited,fClusterMult);
1528 fHistAntiProtonsDepositedVsNcl->Fill(etAntiProtonDeposited,fClusterMult);
1529 fHistProtonsNotTrackMatchedDepositedVsNcl->Fill(etProtonDepositedNotTrackMatched,fClusterMult);
1530 fHistAntiProtonsNotTrackMatchedDepositedVsNcl->Fill(etAntiProtonDepositedNotTrackMatched,fClusterMult);
1531
9a365626 1532 fHistSecondariesVsNch->Fill(etSecondaries,multiplicity);
866b6d2b 1533 fHistSecondariesVsNcl->Fill(etSecondaries,fClusterMult);
9a365626 1534 fHistSecondariesEffCorrVsNch->Fill(etSecondariesEffCorr,multiplicity);
866b6d2b 1535 fHistSecondariesEffCorrVsNcl->Fill(etSecondariesEffCorr,fClusterMult);
b986cebe 1536 fHistSecondariesOutOfAccEffCorrVsNch->Fill(etSecondariesOutOfAccEffCorr,multiplicity);
1537 fHistSecondariesDetectorCoverEffCorrVsNch->Fill(etSecondariesDetectorCoverEffCorr,multiplicity);
866b6d2b 1538 fHistCentVsNchVsNcl->Fill(fCentClass,multiplicity, fClusterMult);
1539
1540 fHistNeutronsDepositedVsNchNoEffCorr->Fill(etNeutronDepositedNoEffCorr,multiplicity);
1541 fHistAntiNeutronsDepositedVsNchNoEffCorr->Fill(etAntiNeutronDepositedNoEffCorr,multiplicity);
1542 fHistNeutronsDepositedVsNclNoEffCorr->Fill(etNeutronDepositedNoEffCorr,fClusterMult);
1543 fHistAntiNeutronsDepositedVsNclNoEffCorr->Fill(etAntiNeutronDepositedNoEffCorr,fClusterMult);
1544
1545 fHistProtonsDepositedVsNchNoEffCorr->Fill(etProtonDepositedNoEffCorr,multiplicity);
1546 fHistAntiProtonsDepositedVsNchNoEffCorr->Fill(etAntiProtonDepositedNoEffCorr,multiplicity);
1547 fHistProtonsNotTrackMatchedDepositedVsNchNoEffCorr->Fill(etProtonDepositedNotTrackMatchedNoEffCorr,multiplicity);
1548 fHistAntiProtonsNotTrackMatchedDepositedVsNchNoEffCorr->Fill(etAntiProtonDepositedNotTrackMatchedNoEffCorr,multiplicity);
1549 fHistProtonsDepositedVsNclNoEffCorr->Fill(etProtonDepositedNoEffCorr,fClusterMult);
1550 fHistAntiProtonsDepositedVsNclNoEffCorr->Fill(etAntiProtonDepositedNoEffCorr,fClusterMult);
1551 fHistProtonsNotTrackMatchedDepositedVsNclNoEffCorr->Fill(etProtonDepositedNotTrackMatchedNoEffCorr,fClusterMult);
1552 fHistAntiProtonsNotTrackMatchedDepositedVsNclNoEffCorr->Fill(etAntiProtonDepositedNotTrackMatchedNoEffCorr,fClusterMult);
1553
9a365626 1554
1555 fHistNeutronsNumVsCent->Fill(nNeutrons,fCentClass);
1556 fHistNotNeutronsNumVsCent->Fill(nNotNeutrons,fCentClass);
b2c10007 1557
1558 std::sort(foundGammas.begin(), foundGammas.end());
1559 for (Int_t iPart = 0; iPart < stack->GetNtrack(); iPart++)
1560 {
1561
1562 if(!stack->IsPhysicalPrimary(iPart)) continue;
1563
1564 TParticle *part = stack->Particle(iPart);
1565
1566 if (!part)
1567 {
1568 Printf("ERROR: Could not get particle %d", iPart);
1569 continue;
1570 }
1571 TParticlePDG *pdg = part->GetPDG(0);
1572
1573 if (!pdg)
1574 {
1575 Printf("ERROR: Could not get particle PDG %d", iPart);
1576 continue;
1577 }
1578
9a365626 1579 if(pdg->PdgCode()==fgGammaCode)// TMath::Abs(part->Eta()) < 0.12)
b2c10007 1580 {
9a365626 1581 if(fSelector->CutGeometricalAcceptance(*part)){
866b6d2b 1582 subtotalSimulatedGammaEnergy += part->Energy()*TMath::Sin(part->Theta());
1583 if(fSelector->PassMinEnergyCut(*part)){
1584 //cout<<"Sim gamma et "<< part->Energy()*TMath::Sin(part->Theta())<<endl;
1585 etGammaCrossCheckTrue += part->Energy()*TMath::Sin(part->Theta());
1586 subtotalSimulatedGammaEnergyAboveThreshold += part->Energy()*TMath::Sin(part->Theta());
1587 }
9a365626 1588 fHistGammasGenerated->Fill(part->Energy());
1589 fHistGammasGeneratedCent->Fill(part->Energy(),fCentClass);
1590 }
b2c10007 1591 if(std::binary_search(foundGammas.begin(),foundGammas.end(),iPart))
1592 {
9a365626 1593 if(!fSelector->CutGeometricalAcceptance(*part)){
1594 //cout<<"Gamma NOT in acceptance"<<endl;
1595 fHistGammasFoundOutOfAccCent->Fill(part->Energy(),fCentClass);
1596 }
1597 else{
1598 fHistGammasFound->Fill(part->Energy());
1599 fHistGammasFoundCent->Fill(part->Energy(),fCentClass);
1600 //cout<<"Gamma IN acceptance"<<endl;
1601 }
b2c10007 1602 }
b2c10007 1603 }
6a152780 1604 if(pdg->PdgCode()==fgPiPlusCode || pdg->PdgCode()==fgPiMinusCode || pdg->PdgCode()==fgProtonCode || pdg->PdgCode()==fgAntiProtonCode){//section here for all hadrons generated
866b6d2b 1605 //if(fSelector->CutGeometricalAcceptance(*part)){
1606 fHistHadronsAllCent->Fill(part->Pt(), fCentClass);
1607 //}
6a152780 1608 }
1609
b2c10007 1610
1611 }
0861cc1f 1612 if(fCalcForKaonCorrection){
1613 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};
1614 Int_t nEtCuts = 11;
1615 //loop over simulated particles in order to find K0S
1616 for (Int_t iPart = 0; iPart < stack->GetNtrack(); iPart++){
1617 TParticle *part = stack->Particle(iPart);
1618 if (!part){
1619 //Printf("ERROR: Could not get particle %d", iPart);
1620 continue;
1621 }
1622 TParticlePDG *pdg = part->GetPDG(0);
1623 if (!pdg){
1624 //Printf("ERROR: Could not get particle PDG %d", iPart);
1625 continue;
1626 }
1627 //if(stack->IsPhysicalPrimary(iPart)){//if it is a K0 it might have decayed into four pions
2aab9269 1628 //fgK0SCode, fgGammaCode, fgPi0Code
1629 Int_t code = pdg->PdgCode();
0861cc1f 1630 if(code == fgK0SCode || code==fgKPlusCode || code==fgKMinusCode ||code==fgK0LCode || code==fgK0Code){//this is a kaon
1631 //cout<<"I am a kaon too! "<<stack->Particle(iPart)->GetName()<<" "<<code<<endl;
1632 Float_t pTk = stack->Particle(iPart)->Pt();
1633 if(TMath::Abs(stack->Particle(iPart)->Y())<0.5 && stack->IsPhysicalPrimary(iPart)){//these are particles which would be included in our spectra measurements
1634 fHistSimKaonsInAcceptance->Fill(pTk);
1635 if(code == fgK0SCode){fHistSimK0SInAcceptance->Fill(pTk);}
1636 if(code == fgK0LCode){fHistSimK0LInAcceptance->Fill(pTk);}
1637 if(code == fgKPlusCode){fHistSimKPlusInAcceptance->Fill(pTk);}
1638 if(code == fgKMinusCode){fHistSimKMinusInAcceptance->Fill(pTk);}
1639 if(code == fgK0Code){//Split K0's between the two
1640 fHistSimK0SInAcceptance->Fill(pTk,0.5);
1641 fHistSimK0LInAcceptance->Fill(pTk,0.5);
1642 }
1643 }
1644 else{
1645 fHistSimKaonsOutOfAcceptance->Fill(pTk);
1646 // if(!stack->IsPhysicalPrimary(iPart)){
1647 // PrintFamilyTree(iPart, stack);
1648 // }
1649 }
1650 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};
1651 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};
1652 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...
1653 AliESDCaloCluster* caloCluster = ( AliESDCaloCluster* )caloClusters->At( iCluster );
5881f036 1654 if (!fSelector->CutGeometricalAcceptance(*caloCluster)) continue;
32503dac 1655 const Int_t myPart = fSelector->GetLabel(caloCluster,stack);
1656 //const Int_t myPart = TMath::Abs(caloCluster->GetLabel());
0861cc1f 1657 //identify the primary particle which created this cluster
1658 int primIdx = myPart;
1659 if (!stack->IsPhysicalPrimary(myPart)){
1660 primIdx = GetPrimMother(iPart, stack);
1661 } // end of primary particle check
29b7ba7f 1662 TParticle *hitPart = stack->Particle(myPart);
1663 Bool_t hitsAsChargedKaon = kFALSE;
1664 if(hitPart->GetPdgCode()== fgKPlusCode || hitPart->GetPdgCode()== fgKPlusCode){
1665 if(myPart==primIdx){
1666 //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!
1667 hitsAsChargedKaon = kTRUE;
1668 //cout<<"Found primary charged kaon cluster!"<<endl;
1669 }
1670 }
1671 if(primIdx==iPart && primIdx>0 && !hitsAsChargedKaon){//This cluster is from our primary particle and our primary particle is a kaon
0861cc1f 1672 //cout<<"I have a particle match! prim code"<<code<<" id "<<primIdx <<endl;
1673 Float_t pos[3];
1674 caloCluster->GetPosition(pos);
1675 TVector3 cp(pos);
1676 Double_t clEt = caloCluster->E()*TMath::Sin(cp.Theta());
5881f036 1677 Double_t clEtCorr = CorrectForReconstructionEfficiency(*caloCluster,fCentClass);
2aab9269 1678 for(int l=0;l<nEtCuts;l++){//loop over cut values
0861cc1f 1679 if(clEt>=etCuts[l]){
1680 //cout<<", "<<clEt<<">="<<etCuts[l];
1681 totalClusterEts[l] += clEtCorr;//if cluster et is above the cut off energy add it
1682 totalGammaEts[l] += clEt;//if cluster et is above the cut off energy add it
2aab9269 1683 }
1684 }
2aab9269 1685 }
1686 }
0861cc1f 1687 // cout<<"Deposits: pT: "<<pTk;
1688 // for(int l=0;l<nEtCuts;l++){//loop over cut values
1689 // cout<<" "<<totalClusterEts[l];
1690 // }
1691 // cout<<endl;
1692 if(TMath::Abs(stack->Particle(iPart)->Y())<0.5 && stack->IsPhysicalPrimary(iPart)){//within the acceptance of our spectra and is a primary particle
1693 if(totalClusterEts[0]>0.0){fHistSimKaonsInAcceptanceWithDepositsPrimaries->Fill(pTk);}
1694 //cout<<"I have a particle match! prim code"<<code<<" id "<<iPart <<endl;
1695 for(int l=0;l<nEtCuts;l++){
d3ce32b8 1696 fHistK0EDepositsVsPtInAcceptance->Fill(pTk,totalClusterEts[l],etCuts[l]+0.001);
1697 fHistK0EGammaVsPtInAcceptance->Fill(pTk,totalGammaEts[l],etCuts[l]+0.001);
0861cc1f 1698 }
1699 }
1700 else{//outside the acceptance of our spectra
1701 if(totalClusterEts[0]>0.0){
1702 if(stack->IsPhysicalPrimary(iPart)){fHistSimKaonsOutOfAcceptanceWithDepositsPrimaries->Fill(pTk);}
1703 else{fHistSimKaonsOutOfAcceptanceWithDepositsSecondaries->Fill(pTk);}
1704 }
1705 for(int l=0;l<nEtCuts;l++){
d3ce32b8 1706 fHistK0EDepositsVsPtOutOfAcceptance->Fill(pTk,totalClusterEts[l],etCuts[l]+0.001);
1707 fHistK0EGammaVsPtOutOfAcceptance->Fill(pTk,totalGammaEts[l],etCuts[l]+0.001);
0861cc1f 1708 }
1709 }
1710
2aab9269 1711 }
1712 }
1713 }
866b6d2b 1714
1715 fHistSimulatedGammaEnergy->Fill(fCentClass,subtotalSimulatedGammaEnergy);
1716 fHistSimulatedGammaEnergyAboveThreshold->Fill(fCentClass,subtotalSimulatedGammaEnergyAboveThreshold);
1717
1718 fHistMultChVsSignalVsMult->Fill(fClusterMultChargedTracks,fClusterMultGammas,fClusterMult);
1719 fHistNeutralRemovedSecondaryNumVsNCluster->Fill(nNeutralSecondariesRemoved,fClusterMult);
1720 fHistChargedRemovedSecondaryNumVsNCluster->Fill(nChargedSecondariesRemoved,fClusterMult);
1721 fHistNeutralNotRemovedSecondaryNumVsNCluster->Fill(nNeutralSecondariesNotRemoved,fClusterMult);
1722 fHistChargedNotRemovedSecondaryNumVsNCluster->Fill(nChargedSecondariesNotRemoved,fClusterMult);
9a365626 1723 fHistNeutralRemovedSecondaryNumVsCent->Fill(nNeutralSecondariesRemoved,fCentClass);
1724 fHistChargedRemovedSecondaryNumVsCent->Fill(nChargedSecondariesRemoved,fCentClass);
1725 fHistNeutralNotRemovedSecondaryNumVsCent->Fill(nNeutralSecondariesNotRemoved,fCentClass);
1726 fHistChargedNotRemovedSecondaryNumVsCent->Fill(nChargedSecondariesNotRemoved,fCentClass);
866b6d2b 1727 if(etGammaCrossCheckTrue>0)fHistGammaCrossCheck->Fill(fCentClass,(etGammaCrossCheck-etGammaCrossCheckTrue)/etGammaCrossCheckTrue);
1728 if(etGammaCrossCheckTrue>0)fHistGammaCrossCheckAlt->Fill(fCentClass,(etGammaCrossCheckAlt-etGammaCrossCheckTrue)/etGammaCrossCheckTrue);
1729 if(fTmCorrections->GetNeutronCorrection(fCentClass)>0)fHistNeutronCrossCheck->Fill(fCentClass,(fTmCorrections->GetNeutronCorrection(fCentClass)-etNeutronCrossCheckTrue)/fTmCorrections->GetNeutronCorrection(fCentClass));
1730 if(fTmCorrections->GetSecondaryCorrection(fCentClass)>0)fHistSecondaryCrossCheck->Fill(fCentClass,(fTmCorrections->GetSecondaryCorrection(fCentClass)-etSecondaryCrossCheckTrue)/fTmCorrections->GetSecondaryCorrection(fCentClass));
1731 if(fTmCorrections->GetHadronCorrection(fCentClass)>0)fHistHadronCrossCheck->Fill(fCentClass,(fTmCorrections->GetHadronCorrection(fCentClass)-etHadronCrossCheckTrue)/fTmCorrections->GetHadronCorrection(fCentClass));
1732 if(fTmCorrections->GetKaonCorrection(fCentClass)>0)fHistKaonCrossCheck->Fill(fCentClass,(fTmCorrections->GetKaonCorrection(fCentClass)-etKaonCrossCheckTrue)/fTmCorrections->GetKaonCorrection(fCentClass));
9a365626 1733 //cout<<"Secondaries not removed: "<<fSecondaryNotRemoved<<" neutral secondaries not removed "<<nNeutralSecondariesNotRemoved<<" cluster mult "<<fClusterMult<<endl;
e2ee5727 1734 FillHistograms();
1735 return 0;
1736}
2fbf38ac 1737
1738void AliAnalysisEtMonteCarlo::Init()
f61cec2f 1739{ // init
e2ee5727 1740 AliAnalysisEt::Init();
2fbf38ac 1741}
13b0d3c1 1742
ce546038 1743void AliAnalysisEtMonteCarlo::ResetEventValues()
f61cec2f 1744{ // reset event values
e2ee5727 1745 AliAnalysisEt::ResetEventValues();
c79c36cc 1746 if(!fIsMC) return;
e2ee5727 1747
f61cec2f 1748 fTotEtSecondary = 0;
1749 fTotEtSecondaryFromEmEtPrimary = 0;
1750 fTotEtWithSecondaryRemoved = 0;
1751
e2ee5727 1752 // collision geometry defaults for p+p:
1753 fImpactParameter = 0;
1754 fNcoll = 1;
1755 fNpart = 2;
1756
1757 fEtNonRemovedProtons = 0;
1758 fEtNonRemovedAntiProtons = 0;
1759 fEtNonRemovedPiPlus = 0;
1760 fEtNonRemovedPiMinus = 0;
1761 fEtNonRemovedKaonPlus = 0;
1762 fEtNonRemovedKaonMinus = 0;
ef647350 1763 fEtNonRemovedK0S = 0;
1764 fEtNonRemovedK0L = 0;
e2ee5727 1765 fEtNonRemovedLambdas = 0;
1766 fEtNonRemovedElectrons = 0;
1767 fEtNonRemovedPositrons = 0;
1768 fEtNonRemovedMuPlus = 0;
1769 fEtNonRemovedMuMinus = 0;
1770 fEtNonRemovedNeutrons = 0;
1771 fEtNonRemovedAntiNeutrons = 0;
1772 fEtNonRemovedGammas = 0;
1773 fEtNonRemovedGammasFromPi0 = 0;
1774
ef647350 1775 fEtRemovedProtons = 0;
1776 fEtRemovedAntiProtons = 0;
1777 fEtRemovedPiPlus = 0;
1778 fEtRemovedPiMinus = 0;
1779 fEtRemovedKaonPlus = 0;
1780 fEtRemovedKaonMinus = 0;
1781 fEtRemovedK0s = 0;
1782 fEtRemovedK0L = 0;
1783 fEtRemovedLambdas = 0;
1784 fEtRemovedElectrons = 0;
1785 fEtRemovedPositrons = 0;
1786 fEtRemovedMuPlus = 0;
1787 fEtRemovedMuMinus = 0;
1788 fEtRemovedNeutrons = 0;
1789
1790 fEtRemovedGammasFromPi0 = 0;
e2ee5727 1791 fEtRemovedGammas = 0;
1792 fEtRemovedNeutrons = 0;
1793 fEtRemovedAntiNeutrons = 0;
1794
1795 fMultNonRemovedProtons = 0;
1796 fMultNonRemovedAntiProtons = 0;
1797 fMultNonRemovedPiPlus = 0;
1798 fMultNonRemovedPiMinus = 0;
1799 fMultNonRemovedKaonPlus = 0;
1800 fMultNonRemovedKaonMinus = 0;
1801 fMultNonRemovedK0s = 0;
ef647350 1802 fMultNonRemovedK0L = 0;
e2ee5727 1803 fMultNonRemovedLambdas = 0;
1804 fMultNonRemovedElectrons = 0;
1805 fMultNonRemovedPositrons = 0;
1806 fMultNonRemovedMuPlus = 0;
1807 fMultNonRemovedMuMinus = 0;
1808 fMultNonRemovedNeutrons = 0;
1809 fMultNonRemovedAntiNeutrons = 0;
1810 fMultNonRemovedGammas = 0;
1811
ef647350 1812 fMultRemovedProtons = 0;
1813 fMultRemovedAntiProtons = 0;
1814 fMultRemovedPiPlus = 0;
1815 fMultRemovedPiMinus = 0;
1816 fMultRemovedKaonPlus = 0;
1817 fMultRemovedKaonMinus = 0;
1818 fMultRemovedK0s = 0;
1819 fMultRemovedK0L = 0;
1820 fMultRemovedLambdas = 0;
1821 fMultRemovedElectrons = 0;
1822 fMultRemovedPositrons = 0;
1823 fMultRemovedMuPlus = 0;
1824 fMultRemovedMuMinus = 0;
1825
e2ee5727 1826 fMultRemovedGammas = 0;
1827 fMultRemovedNeutrons = 0;
1828 fMultRemovedAntiNeutrons = 0;
1829
ef647350 1830 fEnergyChargedNotRemoved = 0;
1831 fEnergyChargedRemoved = 0;
1832 fEnergyNeutralNotRemoved = 0;
1833 fEnergyNeutralRemoved = 0;
f61cec2f 1834
ef647350 1835 fChargedNotRemoved = 0;
1836 fChargedRemoved = 0;
1837 fNeutralNotRemoved = 0;
1838 fNeutralRemoved = 0;
b2c10007 1839 fGammaRemoved = 0;
1840 fSecondaryNotRemoved = 0;
f61cec2f 1841
e2ee5727 1842 fTrackMultInAcc = 0;
1843
f61cec2f 1844 fTotNeutralEtAfterMinEnergyCut = 0;
b2c10007 1845
1846 fSecondaryNotRemoved = 0;
1847
1848 fTotPx = 0;
1849 fTotPy = 0;
1850 fTotPz = 0;
1851
1852
ce546038 1853}
1854
1855void AliAnalysisEtMonteCarlo::CreateHistograms()
f61cec2f 1856{ // histogram related additions
e2ee5727 1857 AliAnalysisEt::CreateHistograms();
c79c36cc 1858 if(!fIsMC) return;
f61cec2f 1859 if (fEventSummaryTree) {
1860 fEventSummaryTree->Branch("fImpactParameter",&fImpactParameter,"fImpactParameter/D");
1861 fEventSummaryTree->Branch("fNcoll",&fNcoll,"fNcoll/I");
1862 fEventSummaryTree->Branch("fNpart",&fNpart,"fNpart/I");
1863 fEventSummaryTree->Branch("fTotEtWithSecondaryRemoved", &fTotEtWithSecondaryRemoved, "fTotEtWithSecondaryRemoved/D");
1864 fEventSummaryTree->Branch("fTotEtSecondaryFromEmEtPrimary", &fTotEtSecondaryFromEmEtPrimary, "fTotEtSecondaryFromEmEtPrimary/D");
1865 fEventSummaryTree->Branch("fTotEtSecondary", &fTotEtSecondary, "fTotEtSecondary/D");
1866 fEventSummaryTree->Branch("fTotNeutralEtAfterMinEnergyCut", &fTotNeutralEtAfterMinEnergyCut, "fTotNeutralEtAfterMinEnergyCut/D");
b2c10007 1867 fEventSummaryTree->Branch("fSecondaryNotRemoved", &fSecondaryNotRemoved, "fSecondaryNotRemoved/I");
1868 fEventSummaryTree->Branch("fChargedNotRemoved", &fChargedNotRemoved, "fChargedNotRemoved/I");
1869 fEventSummaryTree->Branch("fNeutralNotRemoved", &fNeutralNotRemoved, "fNeutralNotRemoved/I");
1870 fEventSummaryTree->Branch("fChargedRemoved", &fChargedRemoved, "fChargedRemoved/I");
1871 fEventSummaryTree->Branch("fNeutralRemoved", &fNeutralRemoved, "fNeutralRemoved/I");
1872 fEventSummaryTree->Branch("fGammaRemoved", &fGammaRemoved, "fGammaRemoved/I");
1873 fEventSummaryTree->Branch("fTotPx", &fTotPx, "fTotPx/D");
1874 fEventSummaryTree->Branch("fTotPy", &fTotPy, "fTotPy/D");
1875 fEventSummaryTree->Branch("fTotPz", &fTotPz, "fTotPz/D");
1876// fEventSummaryTree->Branch("f
e2ee5727 1877 }
f61cec2f 1878
e2ee5727 1879 //fHistDecayVertexNonRemovedCharged = new TH3F("fHistDecayVertexNonRemovedCharged","fHistDecayVertexNonRemovedCharged", 500, -470, 30, 500, -300, 300, 40, -20, 20);
1880 //fHistDecayVertexRemovedCharged = new TH3F("fHistDecayVertexRemovedCharged","fHistDecayVertexRemovedCharged", 500, -470, 30, 500, -300, 300, 40, -20, 20);
1881 //fHistDecayVertexNonRemovedNeutral = new TH3F("fHistDecayVertexNonRemovedNeutral","fHistDecayVertexNonRemovedNeutral", 500, -470, 30, 500, -300, 300, 40, -20, 20);
1882 //fHistDecayVertexRemovedNeutral = new TH3F("fHistDecayVertexRemovedNeutral","fHistDecayVertexRemovedNeutral", 500, -470, 30, 500, -300, 300, 40, -20, 20);
1883
1884 fHistRemovedOrNot = new TH2F("fHistRemovedOrNot", "fHistRemovedOrNot", 4, -0.5, 3.5, 10, -0.5, 9.5);
1885
1886 fHistEtNonRemovedProtons = new TH2F("fHistEtNonRemovedProtons", "fHistEtNonRemovedProtons", 1500, 0, 30, 10, -0.5, 9.5);
1887 fHistEtNonRemovedAntiProtons = new TH2F("fHistEtNonRemovedAntiProtons", "fHistEtNonRemovedAntiProtons", 1500, 0, 30, 10, -0.5, 9.5);
1888 fHistEtNonRemovedPiPlus = new TH2F("fHistEtNonRemovedPiPlus", "fHistEtNonRemovedPiPlus", 1500, 0, 30, 10, -0.5, 9.5);
1889 fHistEtNonRemovedPiMinus = new TH2F("fHistEtNonRemovedPiMinus", "fHistEtNonRemovedPiMinus", 1500, 0, 30, 10, -0.5, 9.5);
1890 fHistEtNonRemovedKaonPlus = new TH2F("fHistEtNonRemovedKaonPlus", "fHistEtNonRemovedKaonPlus", 1500, 0, 30, 10, -0.5, 9.5);
1891 fHistEtNonRemovedKaonMinus = new TH2F("fHistEtNonRemovedKaonMinus", "fHistEtNonRemovedKaonMinus", 1500, 0, 30, 10, -0.5, 9.5);
1892 fHistEtNonRemovedK0s = new TH2F("fHistEtNonRemovedK0s", "fHistEtNonRemovedK0s", 1500, 0, 30, 10, -0.5, 9.5);
ef647350 1893 fHistEtNonRemovedK0L = new TH2F("fHistEtNonRemovedK0L", "fHistEtNonRemovedK0L", 1500, 0, 30, 10, -0.5, 9.5);
e2ee5727 1894 fHistEtNonRemovedLambdas = new TH2F("fHistEtNonRemovedLambdas", "fHistEtNonRemovedLambdas", 1500, 0, 30, 10, -0.5, 9.5);
1895 fHistEtNonRemovedElectrons = new TH2F("fHistEtNonRemovedElectrons", "fHistEtNonRemovedElectrons", 1500, 0, 30, 10, -0.5, 9.5);
1896 fHistEtNonRemovedPositrons = new TH2F("fHistEtNonRemovedPositrons", "fHistEtNonRemovedPositrons", 1500, 0, 30, 10, -0.5, 9.5);
1897 fHistEtNonRemovedMuPlus = new TH2F("fHistEtNonRemovedMuPlus", "fHistEtNonRemovedMuPlus", 1500, 0, 30, 10, -0.5, 9.5);
1898 fHistEtNonRemovedMuMinus = new TH2F("fHistEtNonRemovedMuMinus", "fHistEtNonRemovedMuMinus", 1500, 0, 30, 10, -0.5, 9.5);
1899 fHistEtNonRemovedNeutrons = new TH2F("fHistEtNonRemovedNeutrons", "fHistEtNonRemovedNeutrons", 1500, 0, 30, 10, -0.5, 9.5);
1900 fHistEtNonRemovedAntiNeutrons = new TH2F("fHistEtNonRemovedAntiNeutrons", "fHistEtNonRemovedAntiNeutrons", 1500, 0, 30, 10, -0.5, 9.5);
1901
1902 fHistEtNonRemovedGammas = new TH2F("fHistEtNonRemovedGammas", "fHistEtNonRemovedGammas", 1500, 0, 30, 10, -0.5, 9.5);
1903 fHistEtNonRemovedGammasFromPi0 = new TH2F("fHistEtNonRemovedGammasFromPi0", "fHistEtNonRemovedGammasFromPi0", 1500, 0, 30, 10, -0.5, 9.5);
1904
1905 fHistEtRemovedGammas = new TH2F("fHistEtRemovedGammas", "fHistEtRemovedGammas", 1500, 0, 30, 10, -0.5, 9.5);
1906 fHistEtRemovedNeutrons = new TH2F("fHistEtRemovedNeutrons", "fHistEtRemovedNeutrons", 1500, 0, 30, 10, -0.5, 9.5);
1907 fHistEtRemovedAntiNeutrons = new TH2F("fHistEtRemovedAntiNeutrons", "fHistEtRemovedAntiNeutrons", 1500, 0, 30, 10, -0.5, 9.5);
f61cec2f 1908
ef647350 1909 fHistEtRemovedCharged = new TH2F("fHistEtRemovedCharged", "fHistEtRemovedCharged", 1500, 0, 30, 10, -0.5, 9.5);
1910 fHistEtRemovedNeutrals = new TH2F("fHistEtRemovedNeutrals", "fHistEtRemovedNeutrals", 1500, 0, 30, 10, -0.5, 9.5);
e2ee5727 1911
ef647350 1912 fHistEtNonRemovedCharged = new TH2F("fHistEtNonRemovedCharged", "fHistEtNonRemovedCharged", 1500, 0, 30, 10, -0.5, 9.5);
1913 fHistEtNonRemovedNeutrals = new TH2F("fHistEtNonRemovedNeutrals", "fHistEtNonRemovedNeutrals", 1500, 0, 30, 10, -0.5, 9.5);
f61cec2f 1914
e2ee5727 1915 fHistMultNonRemovedProtons = new TH2F("fHistMultNonRemovedProtons", "fHistMultNonRemovedProtons", 100, -0.5, 99.5, 10, -0.5, 9.5);
1916 fHistMultNonRemovedAntiProtons = new TH2F("fHistMultNonRemovedAntiProtons", "fHistMultNonRemovedAntiProtons", 100, -0.5, 99.5, 10, -0.5, 9.5);
1917 fHistMultNonRemovedPiPlus = new TH2F("fHistMultNonRemovedPiPlus", "fHistMultNonRemovedPiPlus", 100, -0.5, 99.5, 10, -0.5, 9.5);
1918 fHistMultNonRemovedPiMinus = new TH2F("fHistMultNonRemovedPiMinus", "fHistMultNonRemovedPiMinus", 100, -0.5, 99.5, 10, -0.5, 9.5);
1919 fHistMultNonRemovedKaonPlus = new TH2F("fHistMultNonRemovedKaonPlus", "fHistMultNonRemovedKaonPlus", 100, -0.5, 99.5, 10, -0.5, 9.5);
1920 fHistMultNonRemovedKaonMinus = new TH2F("fHistMultNonRemovedKaonMinus", "fHistMultNonRemovedKaonMinus", 100, -0.5, 99.5, 10, -0.5, 9.5);
1921 fHistMultNonRemovedK0s = new TH2F("fHistMultNonRemovedK0s", "fHistMultNonRemovedK0s", 100, -0.5, 99.5, 10, -0.5, 9.5);
ef647350 1922 fHistMultNonRemovedK0L = new TH2F("fHistMultNonRemovedK0L", "fHistMultNonRemovedK0L", 100, -0.5, 99.5, 10, -0.5, 9.5);
e2ee5727 1923 fHistMultNonRemovedLambdas = new TH2F("fHistMultNonRemovedLambdas", "fHistMultNonRemovedLambdas", 100, -0.5, 99.5, 10, -0.5, 9.5);
1924 fHistMultNonRemovedElectrons = new TH2F("fHistMultNonRemovedElectrons", "fHistMultNonRemovedElectrons", 100, -0.5, 99.5, 10, -0.5, 9.5);
1925 fHistMultNonRemovedPositrons = new TH2F("fHistMultNonRemovedPositrons", "fHistMultNonRemovedPositrons", 100, -0.5, 99.5, 10, -0.5, 9.5);
1926 fHistMultNonRemovedMuPlus = new TH2F("fHistMultNonRemovedMuPlus", "fHistMultNonRemovedMuPlus", 100, -0.5, 99.5, 10, -0.5, 9.5);
1927 fHistMultNonRemovedMuMinus = new TH2F("fHistMultNonRemovedMuMinus", "fHistMultNonRemovedMuMinus", 100, -0.5, 99.5, 10, -0.5, 9.5);
1928 fHistMultNonRemovedNeutrons = new TH2F("fHistMultNonRemovedNeutrons", "fHistMultNonRemovedNeutrons", 100, -0.5, 99.5, 10, -0.5, 9.5);
1929 fHistMultNonRemovedAntiNeutrons = new TH2F("fHistMultNonRemovedAntiNeutrons", "fHistMultNonRemovedAntiNeutrons", 100, -0.5, 99.5, 10, -0.5, 9.5);
1930
ef647350 1931 fHistMultNonRemovedGammas = new TH2F("fHistMultNonRemovedGammas", "fHistMultNonRemovedGammas", 100, -0.5, 99.5, 100, -0.5, 99.5);
e2ee5727 1932
ef647350 1933 fHistMultRemovedGammas = new TH2F("fHistMultRemovedGammas", "fHistMultRemovedGammas", 100, -0.5, 99.5, 100, -0.5, 99.5);
e2ee5727 1934 fHistMultRemovedNeutrons = new TH2F("fHistMultRemovedNeutrons", "fHistMultRemovedNeutrons", 100, -0.5, 99.5, 10, -0.5, 9.5);
1935 fHistMultRemovedAntiNeutrons = new TH2F("fHistMultRemovedAntiNeutrons", "fHistMultRemovedAntiNeutrons", 100, -0.5, 99.5, 10, -0.5, 9.5);
f61cec2f 1936 /*
1937 fHistMultRemovedCharged = new TH2F("fHistMultRemovedCharged", "fHistMultRemovedCharged", 1500, 0, 30, 10, -0.5, 9.5);
1938 fHistMultRemovedNeutrals = new TH2F("fHistMultRemovedNeutrals", "fHistMultRemovedNeutrals", 1500, 0, 30, 10, -0.5, 9.5);
1939
1940 fHistMultNonRemovedCharged = new TH2F("fHistMultNonRemovedCharged", "fHistMultNonRemovedCharged", 1500, 0, 30, 10, -0.5, 9.5);
1941 fHistMultNonRemovedNeutrals = new TH2F("fHistMultNonRemovedNeutrals", "fHistMultNonRemovedNeutrals", 1500, 0, 30, 10, -0.5, 9.5);*/
ef647350 1942
ef647350 1943
ef647350 1944 fHistMultRemovedCharged = new TH2F("fHistMultRemovedCharged", "fHistMultRemovedCharged", 100, -0.5, 99.5, 100, -0.5, 99.5);
1945 fHistMultRemovedNeutrals = new TH2F("fHistMultRemovedNeutrals", "fHistMultRemovedNeutrals", 100, -0.5, 99.5, 100, -0.5, 99.5);
1946
1947 fHistMultNonRemovedCharged = new TH2F("fHistMultNonRemovedCharged", "fHistMultNonRemovedCharged", 100, -0.5, 99.5, 100, -0.5, 99.5);
1948 fHistMultNonRemovedNeutrals = new TH2F("fHistMultNonRemovedNeutrals", "fHistMultNonRemovedNeutrals", 100, -0.5, 99.5, 100, -0.5, 99.5);
e2ee5727 1949
1950 fHistTrackMultvsNonRemovedCharged = new TH2F("fHistTrackMultvsNonRemovedCharged", "fHistTrackMultvsNonRemovedCharged", 1000, -0.5, 999.5, 100, -0.5, 99.5);
1951 fHistTrackMultvsNonRemovedNeutral = new TH2F("fHistTrackMultvsNonRemovedNeutral", "fHistTrackMultvsNonRemovedNeutral", 1000, -0.5, 999.5, 100, -0.5, 99.5);
1952 fHistTrackMultvsRemovedGamma = new TH2F("fHistTrackMultvsRemovedGamma", "fHistTrackMultvsRemovedGamma", 1000, -0.5, 999.5, 100, -0.5, 99.5);
1953
1954 fHistClusterMultvsNonRemovedCharged = new TH2F("fHistClusterMultvsNonRemovedCharged", "fHistClusterMultvsNonRemovedCharged", 1000, -0.5, 999.5, 100, -0.5, 99.5);
1955 fHistClusterMultvsNonRemovedNeutral = new TH2F("fHistClusterMultvsNonRemovedNeutral", "fHistClusterMultvsNonRemovedNeutral", 1000, -0.5, 999.5, 100, -0.5, 99.5);
1956 fHistClusterMultvsRemovedGamma = new TH2F("fHistClusterMultvsRemovedGamma", "fHistClusterMultvsRemovedGamma", 1000, -0.5, 999.5, 100, -0.5, 99.5);
1957
1958 fHistDxDzNonRemovedCharged = new TH2F("fHistDxDzNonRemovedCharged", "fHistDxDzNonRemovedCharged", 800, -200, 200, 800, -200, 200);
1959 fHistDxDzRemovedCharged = new TH2F("fHistDxDzRemovedCharged", "fHistDxDzRemovedCharged", 800, -200, 200, 800, -200, 200);
1960 fHistDxDzNonRemovedNeutral = new TH2F("fHistDxDzNonRemovedNeutral", "fHistDxDzNonRemovedNeutral", 800, -200, 200, 800, -200, 200);
1961 fHistDxDzRemovedNeutral = new TH2F("fHistDxDzRemovedNeutral", "fHistDxDzRemovedNeutral", 800, -200, 200, 800, -200, 200);
1962
0861cc1f 1963 if(fCalcForKaonCorrection){
1964 Int_t nEtCut = 11;
1965 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};
1966 fHistK0EDepositsVsPtInAcceptance = new TH3F("fHistK0EDepositsVsPtInAcceptance","Kaon deposits with corrections for kaons with y<0.5",fgNumOfPtBins,fgPtAxis,fgNumOfPtBins,fgPtAxis,nEtCut,etCutAxis);
1967 fHistK0EGammaVsPtInAcceptance = new TH3F("fHistK0EGammaVsPtInAcceptance","Kaon deposits without corrections for kaons with y<0.5",fgNumOfPtBins,fgPtAxis,fgNumOfPtBins,fgPtAxis,nEtCut,etCutAxis);
1968 fHistK0EDepositsVsPtOutOfAcceptance = new TH3F("fHistK0EDepositsVsPtOutOfAcceptance","Kaon deposits with corrections for kaons with y>0.5",fgNumOfPtBins,fgPtAxis,fgNumOfPtBins,fgPtAxis,nEtCut,etCutAxis);
1969 fHistK0EGammaVsPtOutOfAcceptance = new TH3F("fHistK0EGammaVsPtOutOfAcceptance","Kaon deposits without corrections for kaons with y>0.5",fgNumOfPtBins,fgPtAxis,fgNumOfPtBins,fgPtAxis,nEtCut,etCutAxis);
1970 fHistK0EDepositsVsPtInAcceptance->GetXaxis()->SetTitle("Kaon p_{T}");
1971 fHistK0EGammaVsPtInAcceptance->GetXaxis()->SetTitle("Kaon p_{T}");
1972 fHistK0EDepositsVsPtOutOfAcceptance->GetXaxis()->SetTitle("Kaon p_{T}");
1973 fHistK0EGammaVsPtOutOfAcceptance->GetXaxis()->SetTitle("Kaon p_{T}");
1974 fHistK0EDepositsVsPtInAcceptance->GetYaxis()->SetTitle("Deposited E_{T}");
1975 fHistK0EGammaVsPtInAcceptance->GetYaxis()->SetTitle("Deposited E_{T}");
1976 fHistK0EDepositsVsPtOutOfAcceptance->GetYaxis()->SetTitle("Deposited E_{T}");
1977 fHistK0EGammaVsPtOutOfAcceptance->GetYaxis()->SetTitle("Deposited E_{T}");
1978 fHistK0EDepositsVsPtInAcceptance->GetZaxis()->SetTitle("E_{T} cut");
1979 fHistK0EGammaVsPtInAcceptance->GetZaxis()->SetTitle("E_{T} cut");
1980 fHistK0EDepositsVsPtOutOfAcceptance->GetZaxis()->SetTitle("E_{T} cut");
1981 fHistK0EGammaVsPtOutOfAcceptance->GetZaxis()->SetTitle("E_{T} cut");
1982
1983 fHistSimKaonsInAcceptance = new TH1F("fHistSimKaonsInAcceptance","Kaons with y<0.5",fgNumOfPtBins,fgPtAxis);
1984 fHistSimK0SInAcceptance = new TH1F("fHistSimK0SInAcceptance","Kaons with y<0.5",fgNumOfPtBins,fgPtAxis);
1985 fHistSimK0LInAcceptance = new TH1F("fHistSimK0LInAcceptance","Kaons with y<0.5",fgNumOfPtBins,fgPtAxis);
1986 fHistSimKPlusInAcceptance = new TH1F("fHistSimKPlusInAcceptance","Kaons with y<0.5",fgNumOfPtBins,fgPtAxis);
1987 fHistSimKMinusInAcceptance = new TH1F("fHistSimKMinusInAcceptance","Kaons with y<0.5",fgNumOfPtBins,fgPtAxis);
1988 fHistSimKaonsOutOfAcceptance = new TH1F("fHistSimKaonsOutOfAcceptance","Kaons with y>0.5",fgNumOfPtBins,fgPtAxis);
1989 fHistSimKaonsInAcceptanceWithDepositsPrimaries = new TH1F("fHistSimKaonsInAcceptanceWithDepositsPrimaries","Primary Kaons which deposited energy in calorimeter with y>0.5",fgNumOfPtBins,fgPtAxis);
1990 fHistSimKaonsOutOfAcceptanceWithDepositsSecondaries = new TH1F("fHistSimKaonsOutOfAcceptanceWithDepositsSecondaries","Secondary Kaons which deposited energy in calorimeter with y>0.5",fgNumOfPtBins,fgPtAxis);
1991 fHistSimKaonsOutOfAcceptanceWithDepositsPrimaries = new TH1F("fHistSimKaonsOutOfAcceptanceWithDepositsPrimaries","Primary Kaons which deposited energy in calorimeter with y>0.5",fgNumOfPtBins,fgPtAxis);
1992 }
2aab9269 1993
e2ee5727 1994 fHistPiPlusMult = new TH1F("fHistPiPlusMult", "fHistPiPlusMult", 2000, -0.5, 1999.5);
1995 fHistPiMinusMult = new TH1F("fHistPiMinusMult", "fHistPiMinusMult", 2000, -0.5, 1999.5);
1996 fHistPiZeroMult = new TH1F("fHistPiZeroMult", "fHistPiZeroMult", 2000, -0.5, 1999.5);
1997
1998 fHistPiPlusMultAcc = new TH1F("fHistPiPlusMultAcc", "fHistPiPlusMultAcc", 2000, -0.5, 1999.5);
1999 fHistPiMinusMultAcc = new TH1F("fHistPiMinusMultAcc", "fHistPiMinusMultAcc", 2000, -0.5, 1999.5);
2000 fHistPiZeroMultAcc = new TH1F("fHistPiZeroMultAcc", "fHistPiZeroMultAcc", 2000, -0.5, 1999.5);
2001
f61cec2f 2002 if(fCuts->GetHistMakeTree())
2003 {
2004 TString treename = "fPrimaryTree" + fHistogramNameSuffix;
2005 fPrimaryTree = new TTree(treename, treename);
2006
2007 fPrimaryTree->Branch("fTotEt",&fTotEt,"fTotEt/D");
2008 fPrimaryTree->Branch("fNeutralMultiplicity", &fNeutralMultiplicity, "fNeutralMultiplicity/I");
2009 fPrimaryTree->Branch("fCentClass",&fCentClass,"fCentClass/I");
2010
2011 fPrimaryTree->Branch("fPrimaryCode", &fPrimaryCode, "fPrimaryCode/I");
2012 fPrimaryTree->Branch("fPrimaryCharge", &fPrimaryCharge, "fPrimaryCharge/I");
2013
2014 fPrimaryTree->Branch("fPrimaryE", &fPrimaryE, "fPrimaryE/D");
2015 fPrimaryTree->Branch("fPrimaryEt", &fPrimaryEt, "fPrimaryEt/D");
2016
2017 fPrimaryTree->Branch("fPrimaryPx", &fPrimaryPx, "fPrimaryPx/D");
2018 fPrimaryTree->Branch("fPrimaryPy", &fPrimaryPy, "fPrimaryPy/D");
2019 fPrimaryTree->Branch("fPrimaryPz", &fPrimaryPz, "fPrimaryPz/D");
2020
2021 fPrimaryTree->Branch("fPrimaryVx", &fPrimaryVx, "fPrimaryVx/D");
2022 fPrimaryTree->Branch("fPrimaryVy", &fPrimaryVy, "fPrimaryVy/D");
2023 fPrimaryTree->Branch("fPrimaryVz", &fPrimaryVz, "fPrimaryVz/D");
2024
2025 fPrimaryTree->Branch("fPrimaryAccepted", &fPrimaryAccepted, "fPrimaryAccepted/B");
b2c10007 2026 fPrimaryTree->Branch("fPrimaryMatched", &fPrimaryMatched, "fPrimaryMatched/B");
f61cec2f 2027
2028
2029 fPrimaryTree->Branch("fDepositedCode", &fDepositedCode, "fDepositedCode/I");
2030 fPrimaryTree->Branch("fDepositedCharge", &fDepositedCharge, "fDepositedCharge/I");
b2c10007 2031 fPrimaryTree->Branch("fDepositedE", &fDepositedE, "fDepositedE/D");
f61cec2f 2032 fPrimaryTree->Branch("fDepositedEt", &fDepositedEt, "fDepositedEt/D");
2033
2034 fPrimaryTree->Branch("fDepositedVx", &fDepositedVx, "fDepositedVx/D");
2035 fPrimaryTree->Branch("fDepositedVy", &fDepositedVy, "fDepositedVy/D");
2036 fPrimaryTree->Branch("fDepositedVz", &fDepositedVz, "fDepositedVz/D");
2037
b2c10007 2038 fPrimaryTree->Branch("fSecondary", &fSecondary, "fSecondary/I");
2039
2040
2041 fPrimaryTree->Branch("fReconstructedE", &fReconstructedE, "fReconstructedE/D");
2042 fPrimaryTree->Branch("fReconstructedEt", &fReconstructedEt, "fReconstructedEt/D");
2043
2044 fPrimaryTree->Branch("fClusterMult", &fClusterMult, "fClusterMult/I");
2045
2046
f61cec2f 2047 }
2048
9ef6f13f 2049 fHistGammasFound = new TH1F("fHistGammasFound", "fHistGammasFound",200, 0, 10);
2050 fHistGammasGenerated = new TH1F("fHistGammasGenerated", "fHistGammasGenerated",200, 0, 10);
9a365626 2051 fHistGammasFoundOutOfAccCent = new TH2F("fHistGammasFoundOutOfAccCent", "fHistGammasFoundOutOfAccCent",200, 0, 10,20,-0.5,19.5);
5881f036 2052 fHistGammasFoundCent = new TH2F("fHistGammasFoundCent", "fHistGammasFoundCent",200, 0, 10,20,-0.5,19.5);
866b6d2b 2053 fHistGammasFoundOutOfAccAltCent = new TH2F("fHistGammasFoundOutOfAccAltCent", "fHistGammasFoundOutOfAccCent",200, 0, 10,20,-0.5,19.5);
2054 fHistGammasFoundRecoEnergyCent = new TH2F("fHistGammasFoundRecoEnergyCent", "fHistGammasFoundRecoEnergyCent",200, 0, 10,20,-0.5,19.5);
2055 fHistGammasFoundOutOfAccRecoEnergyCent = new TH2F("fHistGammasFoundOutOfAccRecoEnergyCent", "fHistGammasFoundOutOfAccRecoEnergyCent",200, 0, 10,20,-0.5,19.5);
2056 fHistGammasFoundAltCent = new TH2F("fHistGammasFoundAltCent", "fHistGammasFoundAltCent",200, 0, 10,20,-0.5,19.5);
5881f036 2057 fHistGammasGeneratedCent = new TH2F("fHistGammasGeneratedCent", "fHistGammasGeneratedCent",200, 0, 10,20,-0.5,19.5);
9ef6f13f 2058 fHistChargedTracksCut = new TH1F("fHistChargedTracksCut", "fHistChargedTracksCut",100, 0, 5);
2059 fHistChargedTracksAccepted = new TH1F("fHistChargedTracksAccepted", "fHistChargedTracksAccepted",100, 0, 5);
2060 fHistGammasCut = new TH1F("fHistGammasTracksCut", "fHistGammasTracksCut",100, 0, 5);
2061 fHistGammasAccepted = new TH1F("fHistGammasTracksAccepted", "fHistGammasTracksAccepted",100, 0, 5);
0861cc1f 2062
2063 if(fCalcTrackMatchVsMult){
2064 fHistChargedTracksCutMult = new TH2F("fHistChargedTracksCutMult", "fHistChargedTracksCutMult",100, 0, 5,10,0,100);
2065 fHistChargedTracksAcceptedMult = new TH2F("fHistChargedTracksAcceptedMult", "fHistChargedTracksAcceptedMult",100, 0, 5,10,0,100);
866b6d2b 2066 fHistChargedTrackDepositsAcceptedVsPt = new TH2F("fHistChargedTrackDepositsAcceptedVsPt", "fHistChargedTrackDepositsAcceptedVsPt",100, 0, 5,20,-0.5,19.5);
2067 fHistChargedTrackDepositsAllVsPt = new TH2F("fHistChargedTrackDepositsAllVsPt", "fHistChargedTrackDepositsAllVsPt",100, 0, 5,20,-0.5,19.5);
2068 fHistChargedTrackDepositsAcceptedVsPtEffCorr = new TH2F("fHistChargedTrackDepositsAcceptedVsPtEffCorr", "fHistChargedTrackDepositsAcceptedVsPtEffCorr",100, 0, 5,20,-0.5,19.5);
2069 fHistChargedTrackDepositsAllVsPtEffCorr = new TH2F("fHistChargedTrackDepositsAllVsPtEffCorr", "fHistChargedTrackDepositsAllVsPtEffCorr",100, 0, 5,20,-0.5,19.5);
2070 fHistChargedTracksAcceptedLowPtCentEffCorr = new TH2F("fHistChargedTracksAcceptedLowPtCentEffCorr", "fHistChargedTracksAcceptedLowPtCentEffCorr",100, 0, 5,20,-0.5,19.5);
5881f036 2071 fHistChargedTracksAcceptedLowPtCent = new TH2F("fHistChargedTracksAcceptedLowPtCent", "fHistChargedTracksAcceptedLowPtCent",100, 0, 5,20,-0.5,19.5);
2072 fHistChargedTracksAcceptedLowPtCent500MeV = new TH2F("fHistChargedTracksAcceptedLowPtCent500MeV", "fHistChargedTracksAcceptedLowPtCent500MeV",100, 0, 5,20,-0.5,19.5);
2073 fHistChargedTracksAcceptedLowPtCentNoAntiProtons = new TH2F("fHistChargedTracksAcceptedLowPtCentNoAntiProtons", "fHistChargedTracksAcceptedLowPtCentNoAntiProtons",100, 0, 5,20,-0.5,19.5);
2074 fHistChargedTracksAcceptedLowPtCentAntiProtons = new TH2F("fHistChargedTracksAcceptedLowPtCentAntiProtons", "fHistChargedTracksAcceptedLowPtCentAntiProtons",100, 0, 5,20,-0.5,19.5);
0861cc1f 2075 fHistGammasCutMult = new TH2F("fHistGammasTracksCutMult", "fHistGammasTracksCutMult",100, 0, 5,10,0,100);
2076 fHistGammasAcceptedMult = new TH2F("fHistGammasTracksAcceptedMult", "fHistGammasTracksAcceptedMult",100, 0, 5,10,0,100);
2077 }
2078
9ef6f13f 2079 fHistBadTrackMatches = new TH1F("fHistBadTrackMatches", "fHistBadTrackMatches",100, 0, 5);
2080 fHistMatchedTracksEvspTBkgd = new TH2F("fHistMatchedTracksEvspTBkgd", "fHistMatchedTracksEvspTBkgd",100, 0, 3,100,0,3);
2081 fHistMatchedTracksEvspTSignal = new TH2F("fHistMatchedTracksEvspTSignal", "fHistMatchedTracksEvspTSignal",100, 0, 3,100,0,3);
0861cc1f 2082 if(fCalcTrackMatchVsMult){
2083 fHistMatchedTracksEvspTBkgdPeripheral = new TH2F("fHistMatchedTracksEvspTBkgdPeripheral", "fHistMatchedTracksEvspTBkgd",100, 0, 3,100,0,3);
2084 fHistMatchedTracksEvspTSignalPeripheral = new TH2F("fHistMatchedTracksEvspTSignalPeripheral", "fHistMatchedTracksEvspTSignal",100, 0, 3,100,0,3);
2085
5881f036 2086 fHistMatchedTracksEvspTBkgdvsCent = new TH3F("fHistMatchedTracksEvspTBkgdvsCent", "fHistMatchedTracksEvspTBkgdvsCent",100, 0, 3,100,0,3,20,-0.5,19.5);
2087 fHistMatchedTracksEvspTSignalvsCent = new TH3F("fHistMatchedTracksEvspTSignalvsCent", "fHistMatchedTracksEvspTSignalvsCent",100, 0, 3,100,0,3,20,-0.5,19.5);
2088 fHistMatchedTracksEvspTBkgdvsCentEffCorr = new TH3F("fHistMatchedTracksEvspTBkgdvsCentEffCorr", "fHistMatchedTracksEvspTBkgdvsCent",100, 0, 3,100,0,3,20,-0.5,19.5);
2089 fHistMatchedTracksEvspTSignalvsCentEffCorr = new TH3F("fHistMatchedTracksEvspTSignalvsCentEffCorr", "fHistMatchedTracksEvspTSignalvsCent",100, 0, 3,100,0,3,20,-0.5,19.5);
0861cc1f 2090
2091
2092 fHistChargedTracksCutPeripheral = new TH1F("fHistChargedTracksCutPeripheral", "fHistChargedTracksCut",100, 0, 5);
2093 fHistChargedTracksAcceptedPeripheral = new TH1F("fHistChargedTracksAcceptedPeripheral", "fHistChargedTracksAccepted",100, 0, 5);
2094 fHistGammasCutPeripheral = new TH1F("fHistGammasTracksCutPeripheral", "fHistGammasTracksCut",100, 0, 5);
2095 fHistGammasAcceptedPeripheral = new TH1F("fHistGammasTracksAcceptedPeripheral", "fHistGammasTracksAccepted",100, 0, 5);
2096 }
9ef6f13f 2097 fHistBadTrackMatchesdPhidEta = new TH2F("fHistBadTrackMatchesdPhidEta", "fHistBadTrackMatchesdPhidEta",20, -0.1, 0.1,20,-.1,0.1);
2098 fHistGoodTrackMatchesdPhidEta = new TH2F("fHistGoodTrackMatchesdPhidEta", "fHistGoodTrackMatchesdPhidEta",20, -0.1, 0.1,20,-.1,0.1);
c79c36cc 2099
2100 fHistHadronDepositsAll = new TH1F("fHistHadronDepositsAll","All Hadrons which deposited energy in calorimeter",fgNumOfPtBins,fgPtAxis);
2101 fHistHadronDepositsReco = new TH1F("fHistHadronDepositsReco","Reconstructed Hadrons which deposited energy in calorimeter",fgNumOfPtBins,fgPtAxis);
2102 //,10,0,100
2103 Int_t nMult = 20;
2104 Float_t nMultCuts[21] = { 0, 5,10,15,20, 25,30,35,40,45,
2105 50,55,60,65,70, 75,80,85,90,95,
2106 100};
ac610b08 2107 Int_t nCent = 20;
2108 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 2109
ac610b08 2110 fHistHadronDepositsAllCent = new TH2F("fHistHadronDepositsAllCent","All Hadrons which deposited energy in calorimeter",fgNumOfPtBins,fgPtAxis,nCent,nCentCuts);
5881f036 2111 fHistHadronDepositsAllCent500MeV = new TH2F("fHistHadronDepositsAllCent500MeV","All Hadrons which deposited energy in calorimeter pT>500MeV",fgNumOfPtBins,fgPtAxis,nCent,nCentCuts);
ac610b08 2112 fHistHadronDepositsRecoCent = new TH2F("fHistHadronDepositsRecoCent","Reconstructed Hadrons which deposited energy in calorimeter",fgNumOfPtBins,fgPtAxis,nCent,nCentCuts);
d3ce32b8 2113
866b6d2b 2114 fHistHadronDepositsAllvsECent = new TH2F("fHistHadronDepositsAllvsECent","All Hadrons which deposited energy in calorimeter",fgNumOfPtBins,fgPtAxis,nCent,nCentCuts);
2115 fHistHadronDepositsRecovsECent = new TH2F("fHistHadronDepositsRecovsECent","Reconstructed Hadrons which deposited energy in calorimeter",fgNumOfPtBins,fgPtAxis,nCent,nCentCuts);
2116
ac610b08 2117 fHistHadronsAllCent = new TH2F("fHistHadronsAllCent","All Hadrons vs cluster mult",fgNumOfPtBins,fgPtAxis,nCent,nCentCuts);
d3ce32b8 2118
2119 fHistMultChVsSignalVsMult = new TH3F("fHistMultChVsSignalVsMult","Charged particle Multiplicity vs Signal particle multiplicity vs Cluster Mult",nMult,nMultCuts,nMult,nMultCuts,nMult,nMultCuts);
9a365626 2120 fHistNeutralRemovedSecondaryEtVsCent = new TH2F("fHistNeutralRemovedSecondaryEtVsCent","Neutral Removed Secondaries E_{T} vs centrality",100,0.0,2.0,20,-0.5,19.5);
2121 fHistChargedRemovedSecondaryEtVsCent = new TH2F("fHistChargedRemovedSecondaryEtVsCent","Charged Removed Secondaries E_{T} vs centrality",100,0.0,2.0,20,-0.5,19.5);
2122 fHistNeutralNotRemovedSecondaryEtVsCent = new TH2F("fHistNeutralNotRemovedSecondaryEtVsCent","Neutral NotRemoved Secondaries E_{T} vs centrality",100,0.0,2.0,20,-0.5,19.5);
2123 fHistChargedNotRemovedSecondaryEtVsCent = new TH2F("fHistChargedNotRemovedSecondaryEtVsCent","Charged NotRemoved Secondaries E_{T} vs centrality",100,0.0,2.0,20,-0.5,19.5);
2124 fHistNeutralRemovedSecondaryNumVsNCluster = new TH2F("fHistNeutralRemovedSecondaryNumVsNCluster","Neutral Removed Secondaries Number vs N_{cluster}",20,-0.5,19.5,250,0,250);
2125 fHistChargedRemovedSecondaryNumVsNCluster = new TH2F("fHistChargedRemovedSecondaryNumVsNCluster","Charged Removed Secondaries Number vs N_{cluster}",20,-0.5,19.5,250,0,250);
2126 fHistNeutralNotRemovedSecondaryNumVsNCluster = new TH2F("fHistNeutralNotRemovedSecondaryNumVsNCluster","Neutral NotRemoved Secondaries Number vs N_{cluster}",20,-0.5,19.5,250,0,250);
2127 fHistChargedNotRemovedSecondaryNumVsNCluster = new TH2F("fHistChargedNotRemovedSecondaryNumVsNCluster","Charged NotRemoved Secondaries Number vs N_{cluster}",20,-0.5,19.5,250,0,250);
2128 fHistNeutralRemovedSecondaryNumVsCent = new TH2F("fHistNeutralRemovedSecondaryNumVsCent","Neutral Removed Secondaries Number vs N_{cluster}",20,-0.5,19.5,20,-0.5,19.5);
2129 fHistChargedRemovedSecondaryNumVsCent = new TH2F("fHistChargedRemovedSecondaryNumVsCent","Charged Removed Secondaries Number vs N_{cluster}",20,-0.5,19.5,20,-0.5,19.5);
2130 fHistNeutralNotRemovedSecondaryNumVsCent = new TH2F("fHistNeutralNotRemovedSecondaryNumVsCent","Neutral NotRemoved Secondaries Number vs N_{cluster}",20,-0.5,19.5,20,-0.5,19.5);
2131 fHistChargedNotRemovedSecondaryNumVsCent = new TH2F("fHistChargedNotRemovedSecondaryNumVsCent","Charged NotRemoved Secondaries Number vs N_{cluster}",20,-0.5,19.5,20,-0.5,19.5);
2132 fHistNeutronsEtVsCent = new TH2F("fHistNeutronsEtVsCent","Neutrons and anti-neutrons - deposited ET vs Centrality bin",100,0,4.0,20,-0.5,19.5);
2133 fHistNeutronsNumVsCent = new TH2F("fHistNeutronsNumVsCent","Neutrons and anti-neutrons - number vs Centrality bin",20,-0.5,19.5,20,-0.5,19.5);
2134 fHistNotNeutronsNumVsCent = new TH2F("fHistNotNeutronsNumVsCent","Neutral particles not otherwise classified - number vs Centrality bin",20,-0.5,19.5,20,-0.5,19.5);
2135 Int_t nbinsEt = 125;
2136 Float_t maxEtRange = 125;
866b6d2b 2137 Float_t maxEtRangeShort = 50;
9a365626 2138 Float_t minEtRange = 0;
2139 Int_t nbinsMult = 100;
2140 Float_t maxMult = 3000;
2141 Float_t minMult = 0;
866b6d2b 2142 Int_t nbinsCl = 250;
2143 Float_t maxCl = 500;
9a365626 2144 Float_t minCl = 0;
2145 fHistPiKPDepositedVsNch = new TH2F("fHistPiKPDepositedVsNch","#pi,K,p E_{T} deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRange,nbinsMult,minMult,maxMult);
2146 fHistPiKPNotTrackMatchedDepositedVsNch = new TH2F("fHistPiKPNotTrackMatchedDepositedVsNch","#pi,K,p E_{T} deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRange,nbinsMult,minMult,maxMult);
866b6d2b 2147
9a365626 2148 fHistNeutronsDepositedVsNch = new TH2F("fHistNeutronsDepositedVsNch","n deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRangeShort,nbinsMult,minMult,maxMult);
2149 fHistAntiNeutronsDepositedVsNch = new TH2F("fHistAntiNeutronsDepositedVsNch","#bar{n} deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRangeShort,nbinsMult,minMult,maxMult);
2150 fHistProtonsDepositedVsNch = new TH2F("fHistProtonsDepositedVsNch","p deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRangeShort,nbinsMult,minMult,maxMult);
2151 fHistAntiProtonsDepositedVsNch = new TH2F("fHistAntiProtonsDepositedVsNch","#bar{p} deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRangeShort,nbinsMult,minMult,maxMult);
2152 fHistProtonsNotTrackMatchedDepositedVsNch = new TH2F("fHistProtonsNotTrackMatchedDepositedVsNch","p not track matched deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRangeShort,nbinsMult,minMult,maxMult);
2153 fHistAntiProtonsNotTrackMatchedDepositedVsNch = new TH2F("fHistAntiProtonsNotTrackMatchedDepositedVsNch","#bar{p} not track matched deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRangeShort,nbinsMult,minMult,maxMult);
866b6d2b 2154
2155
2156
2157 fHistNeutronsDepositedVsNcl = new TH2F("fHistNeutronsDepositedVsNcl","n deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRangeShort,nbinsCl,minCl,maxCl);
2158 fHistAntiNeutronsDepositedVsNcl = new TH2F("fHistAntiNeutronsDepositedVsNcl","#bar{n} deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRangeShort,nbinsCl,minCl,maxCl);
2159 fHistProtonsDepositedVsNcl = new TH2F("fHistProtonsDepositedVsNcl","p deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRangeShort,nbinsCl,minCl,maxCl);
2160 fHistAntiProtonsDepositedVsNcl = new TH2F("fHistAntiProtonsDepositedVsNcl","#bar{p} deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRangeShort,nbinsCl,minCl,maxCl);
2161 fHistProtonsNotTrackMatchedDepositedVsNcl = new TH2F("fHistProtonsNotTrackMatchedDepositedVsNcl","p not track matched deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRangeShort,nbinsCl,minCl,maxCl);
2162 fHistAntiProtonsNotTrackMatchedDepositedVsNcl = new TH2F("fHistAntiProtonsNotTrackMatchedDepositedVsNcl","#bar{p} not track matched deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRangeShort,nbinsCl,minCl,maxCl);
2163
9a365626 2164 fHistSecondariesVsNch = new TH2F("fHistSecondariesVsNch","secondaries deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRangeShort,nbinsMult,minMult,maxMult);
2165 fHistSecondariesVsNcl = new TH2F("fHistSecondariesVsNcl","secondaries deposited in calorimeter vs number of clusters",nbinsEt,minEtRange,maxEtRangeShort,nbinsCl,minCl,maxCl);
2166 fHistSecondariesEffCorrVsNch = new TH2F("fHistSecondariesEffCorrVsNch","efficiency corrected secondaries deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRangeShort,nbinsMult,minMult,maxMult);
2167 fHistSecondariesEffCorrVsNcl = new TH2F("fHistSecondariesEffCorrVsNcl","efficiency corrected secondaries deposited in calorimeter vs number of clusters",nbinsEt,minEtRange,maxEtRangeShort,nbinsCl,minCl,maxCl);
0c7f27cb 2168
2169 fHistSecondariesOutOfAccEffCorrVsNch = new TH2F("fHistSecondariesOutOfAccEffCorrVsNch","efficiency corrected secondaries deposited in calorimeter vs number of clusters for secondary particles out of detector acceptance",nbinsEt,minEtRange,maxEtRangeShort/10.0,nbinsMult,minMult,maxMult);
2170 fHistSecondariesDetectorCoverEffCorrVsNch = new TH2F("fHistSecondariesDetectorCoverEffCorrVsNch","efficiency corrected secondaries deposited in calorimeter vs number of clusters for secondaries from the detector cover",nbinsEt,minEtRange,maxEtRangeShort/10.0,nbinsMult,minMult,maxMult);
866b6d2b 2171 //start
2172 fHistNeutronsDepositedVsNchNoEffCorr = new TH2F("fHistNeutronsDepositedVsNchNoEffCorr","n deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRangeShort,nbinsMult,minMult,maxMult);
2173 fHistAntiNeutronsDepositedVsNchNoEffCorr = new TH2F("fHistAntiNeutronsDepositedVsNchNoEffCorr","#bar{n} deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRangeShort,nbinsMult,minMult,maxMult);
2174 fHistProtonsDepositedVsNchNoEffCorr = new TH2F("fHistProtonsDepositedVsNchNoEffCorr","p deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRangeShort,nbinsMult,minMult,maxMult);
2175 fHistAntiProtonsDepositedVsNchNoEffCorr = new TH2F("fHistAntiProtonsDepositedVsNchNoEffCorr","#bar{p} deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRangeShort,nbinsMult,minMult,maxMult);
2176 fHistProtonsNotTrackMatchedDepositedVsNchNoEffCorr = new TH2F("fHistProtonsNotTrackMatchedDepositedVsNchNoEffCorr","p not track matched deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRangeShort,nbinsMult,minMult,maxMult);
2177 fHistAntiProtonsNotTrackMatchedDepositedVsNchNoEffCorr = new TH2F("fHistAntiProtonsNotTrackMatchedDepositedVsNchNoEffCorr","#bar{p} not track matched deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRangeShort,nbinsMult,minMult,maxMult);
2178
2179
2180
2181 fHistNeutronsDepositedVsNclNoEffCorr = new TH2F("fHistNeutronsDepositedVsNclNoEffCorr","n deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRangeShort,nbinsCl,minCl,maxCl);
2182 fHistAntiNeutronsDepositedVsNclNoEffCorr = new TH2F("fHistAntiNeutronsDepositedVsNclNoEffCorr","#bar{n} deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRangeShort,nbinsCl,minCl,maxCl);
2183 fHistProtonsDepositedVsNclNoEffCorr = new TH2F("fHistProtonsDepositedVsNclNoEffCorr","p deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRangeShort,nbinsCl,minCl,maxCl);
2184 fHistAntiProtonsDepositedVsNclNoEffCorr = new TH2F("fHistAntiProtonsDepositedVsNclNoEffCorr","#bar{p} deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRangeShort,nbinsCl,minCl,maxCl);
2185 fHistProtonsNotTrackMatchedDepositedVsNclNoEffCorr = new TH2F("fHistProtonsNotTrackMatchedDepositedVsNclNoEffCorr","p not track matched deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRangeShort,nbinsCl,minCl,maxCl);
2186 fHistAntiProtonsNotTrackMatchedDepositedVsNclNoEffCorr = new TH2F("fHistAntiProtonsNotTrackMatchedDepositedVsNclNoEffCorr","#bar{p} not track matched deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRangeShort,nbinsCl,minCl,maxCl);
2187
2188 //end
2189
9a365626 2190 fHistCentVsNchVsNcl = new TH3F("fHistCentVsNchVsNcl","Cent bin vs Nch Vs NCl",20,-0.5,19.5,nbinsMult,minMult,maxMult,nbinsCl,minCl,maxCl);
866b6d2b 2191 float maxpos = 500;
2192 int nbinspos = 50;
2193 fHistSecondaryPositionInDetector = new TH3F("fHistSecondaryPositionInDetector","Position of secondaries",nbinspos,-maxpos,maxpos,nbinspos,-maxpos,maxpos,nbinspos,-maxpos,maxpos);
2194 fHistSecondaryPositionInDetector->GetXaxis()->SetTitle("X");
2195 fHistSecondaryPositionInDetector->GetYaxis()->SetTitle("Y");
2196 fHistSecondaryPositionInDetector->GetZaxis()->SetTitle("Z");
b986cebe 2197// fHistSecondaryPositionInDetectorMultiple = new TH3F("fHistSecondaryPositionInDetectorMultiple","Position of secondaries",nbinspos,-maxpos,maxpos,nbinspos,-maxpos,maxpos,nbinspos,-maxpos,maxpos);
2198// fHistSecondaryPositionInDetectorMultiple->GetXaxis()->SetTitle("X");
2199// fHistSecondaryPositionInDetectorMultiple->GetYaxis()->SetTitle("Y");
2200// fHistSecondaryPositionInDetectorMultiple->GetZaxis()->SetTitle("Z");
32503dac 2201 fClusterPositionWeird = new TH2F("fClusterPositionWeird", "Position of weird secondary clusters",300, -TMath::Pi(),TMath::Pi(), 100, -0.7 , 0.7);
b986cebe 2202
2203 fSecondaryClusterEnergy = new TH1F("fSecondaryClusterEnergy","fSecondaryClusterEnergy", 100, 0, 5);
866b6d2b 2204 fHistGammaCrossCheck = new TH2F("fHistGammaCrossCheck", "(E_{T}^{#gamma,rec}-E_{T}^{#gamma,sim})/E_{T}^{#gamma,rec}",20,-0.5,19.5,100,-1.5,4);
2205 fHistGammaCrossCheckAlt = new TH2F("fHistGammaCrossCheckAlt", "(E_{T}^{#gamma,rec}-E_{T}^{#gamma,sim})/E_{T}^{#gamma,rec}",20,-0.5,19.5,100,-1.5,4);
2206 fHistGammaEnergyCrossCheck = new TH2F("fHistGammaEnergyCrossCheck", "(E_{T}^{#gamma,rec}-E_{T}^{#gamma,sim})/E_{T}^{#gamma,rec}",100,0.0,10.0,100,-2,2);
2207 fHistGammaEnergyCrossCheckAlt = new TH2F("fHistGammaEnergyCrossCheckAlt", "(E_{T}^{#gamma,rec}-E_{T}^{#gamma,sim})/E_{T}^{#gamma,rec}",100,0.0,10.0,100,-2,2);
2208 fHistNeutronCrossCheck = new TH2F("fHistNeutronCrossCheck", "(E_{T}^{n,rec}-E_{T}^{n,sim})/E_{T}^{n,rec}",20,-0.5,19.5,100,-14.8,1.2);
2209 fHistSecondaryCrossCheck = new TH2F("fHistSecondaryCrossCheck", "(E_{T}^{sec,rec}-E_{T}^{sec,sim})/E_{T}^{sec,rec}",20,-0.5,19.5,100,-14.8,1.2);
2210 fHistHadronCrossCheck = new TH2F("fHistHadronCrossCheck", "(E_{T}^{h,rec}-E_{T}^{h,sim})/E_{T}^{h,rec}",20,-0.5,19.5,100,-7.8,1.2);
2211 fHistKaonCrossCheck = new TH2F("fHistKaonCrossCheck", "(E_{T}^{K,rec}-E_{T}^{K,sim})/E_{T}^{K,rec}",20,-0.5,19.5,100,-7.8,1.2);
2212
2213 fHistAllEnergy = new TH1F("fHistAllEnergy","fHistAllEnergy",20,-0.5,19.5);
2214 fHistSignalEnergy = new TH1F("fHistSignalEnergy","fHistSignalEnergy",20,-0.5,19.5);
2215 fHistNeutronEnergy = new TH1F("fHistNeutronEnergy","fHistNeutronEnergy",20,-0.5,19.5);
2216 fHistKaonEnergy = new TH1F("fHistKaonEnergy","fHistKaonEnergy",20,-0.5,19.5);
2217 fHistHadronEnergy = new TH1F("fHistHadronEnergy","fHistHadronEnergy",20,-0.5,19.5);
2218 fHistSecondaryEnergy = new TH1F("fHistSecondaryEnergy","fHistSecondaryEnergy",20,-0.5,19.5);
2219 fHistSecondaryChargedEnergy = new TH1F("fHistSecondaryChargedEnergy","fHistSecondaryChargedEnergy",20,-0.5,19.5);
2220 fHistSecondaryNeutronEnergy = new TH1F("fHistSecondaryNeutronEnergy","fHistSecondaryNeutronEnergy",20,-0.5,19.5);
2221 fHistSecondaryGammaEnergy = new TH1F("fHistSecondaryGammaEnergy","fHistSecondaryGammaEnergy",20,-0.5,19.5);
2222 fHistSecondaryElectronEnergy = new TH1F("fHistSecondaryElectronEnergy","fHistSecondaryElectronEnergy",20,-0.5,19.5);
2223 fHistSecondaryOtherEnergy = new TH1F("fHistSecondaryOtherEnergy","fHistSecondaryOtherEnergy",20,-0.5,19.5);
2224 fHistSimulatedGammaEnergy = new TH1F("fHistSimulatedGammaEnergy","fHistSimulatedGammaEnergy",20,-0.5,19.5);
2225 fHistReconstructedGammaEnergy = new TH1F("fHistReconstructedGammaEnergy","fHistReconstructedGammaEnergy",20,-0.5,19.5);
2226 fHistSimulatedGammaEnergyAboveThreshold = new TH1F("fHistSimulatedGammaEnergyAboveThreshold","fHistSimulatedGammaEnergyAboveThreshold",20,-0.5,19.5);
2227 fHistReconstructedSignalEnergy = new TH1F("fHistReconstructedSignalEnergy","fHistReconstructedSignalEnergy",20,-0.5,19.5);
2228
2229 Float_t fracMin = 0.0;
2230 Float_t fracMax = 1.0;
2231 Float_t fracMaxLow = 0.2;
2232 Float_t nBinsFrac = 50;
2233 fHistFracSignalVsNClusters = new TH2F("fHistFracSignalVsNClusters","fHistFracSignalVsNClusters",nbinsCl,minCl,maxCl,nBinsFrac,fracMin,fracMax);
2234 fHistFracHadronsVsNClusters = new TH2F("fHistFracHadronsVsNClusters","fHistFracHadronsVsNClusters",nbinsCl,minCl,maxCl,nBinsFrac,fracMin,fracMax);
2235 fHistFracNeutronsVsNClusters = new TH2F("fHistFracNeutronsVsNClusters","fHistFracNeutronsVsNClusters",nbinsCl,minCl,maxCl,nBinsFrac,fracMin,fracMaxLow);
2236 fHistFracKaonsVsNClusters = new TH2F("fHistFracKaonsVsNClusters","fHistFracKaonsVsNClusters",nbinsCl,minCl,maxCl,nBinsFrac,fracMin,fracMaxLow);
2237 fHistFracSecondariesVsNClusters = new TH2F("fHistFracSecondariesVsNClusters","fHistFracSecondariesVsNClusters",nbinsCl,minCl,maxCl,nBinsFrac,fracMin,fracMax);
2238 fHistFracSignalVsNMultiplicity = new TH2F("fHistFracSignalVsNMultiplicity","fHistFracSignalVsNMultiplicity",nbinsMult,minMult,maxMult,nBinsFrac,fracMin,fracMax);
2239 fHistFracHadronsVsNMultiplicity = new TH2F("fHistFracHadronsVsNMultiplicity","fHistFracHadronsVsNMultiplicity",nbinsMult,minMult,maxMult,nBinsFrac,fracMin,fracMax);
2240 fHistFracNeutronsVsNMultiplicity = new TH2F("fHistFracNeutronsVsNMultiplicity","fHistFracNeutronsVsNMultiplicity",nbinsMult,minMult,maxMult,nBinsFrac,fracMin,fracMaxLow);
2241 fHistFracKaonsVsNMultiplicity = new TH2F("fHistFracKaonsVsNMultiplicity","fHistFracKaonsVsNMultiplicity",nbinsMult,minMult,maxMult,nBinsFrac,fracMin,fracMaxLow);
2242 fHistFracSecondariesVsNMultiplicity = new TH2F("fHistFracSecondariesVsNMultiplicity","fHistFracSecondariesVsNMultiplicity",nbinsMult,minMult,maxMult,nBinsFrac,fracMin,fracMax);
2243 Int_t nBinsMatchedTracks = 100;
2244 Float_t lowMatchedTracks = 0;
2245 Float_t highMatchedTracks = 100;
2246 fHistFracSignalVsNMatchedTracks = new TH2F("fHistFracSignalVsNMatchedTracks","fHistFracSignalVsNMatchedTracks",nBinsMatchedTracks,lowMatchedTracks,highMatchedTracks,nBinsFrac,fracMin,fracMax);
2247 fHistFracHadronsVsNMatchedTracks = new TH2F("fHistFracHadronsVsNMatchedTracks","fHistFracHadronsVsNMatchedTracks",nBinsMatchedTracks,lowMatchedTracks,highMatchedTracks,nBinsFrac,fracMin,fracMax);
2248 fHistFracNeutronsVsNMatchedTracks = new TH2F("fHistFracNeutronsVsNMatchedTracks","fHistFracNeutronsVsNMatchedTracks",nBinsMatchedTracks,lowMatchedTracks,highMatchedTracks,nBinsFrac,fracMin,fracMaxLow);
2249 fHistFracKaonsVsNMatchedTracks = new TH2F("fHistFracKaonsVsNMatchedTracks","fHistFracKaonsVsNMatchedTracks",nBinsMatchedTracks,lowMatchedTracks,highMatchedTracks,nBinsFrac,fracMin,fracMaxLow);
2250 fHistFracSecondariesVsNMatchedTracks = new TH2F("fHistFracSecondariesVsNMatchedTracks","fHistFracSecondariesVsNMatchedTracks",nBinsMatchedTracks,lowMatchedTracks,highMatchedTracks,nBinsFrac,fracMin,fracMax);
2251 fHistFracSignalVsNTotalTracks = new TH2F("fHistFracSignalVsNTotalTracks","fHistFracSignalVsNTotalTracks",nBinsMatchedTracks,lowMatchedTracks,highMatchedTracks,nBinsFrac,fracMin,fracMax);
2252 fHistFracHadronsVsNTotalTracks = new TH2F("fHistFracHadronsVsNTotalTracks","fHistFracHadronsVsNTotalTracks",nBinsMatchedTracks,lowMatchedTracks,highMatchedTracks,nBinsFrac,fracMin,fracMax);
2253 fHistFracNeutronsVsNTotalTracks = new TH2F("fHistFracNeutronsVsNTotalTracks","fHistFracNeutronsVsNTotalTracks",nBinsMatchedTracks,lowMatchedTracks,highMatchedTracks,nBinsFrac,fracMin,fracMaxLow);
2254 fHistFracKaonsVsNTotalTracks = new TH2F("fHistFracKaonsVsNTotalTracks","fHistFracKaonsVsNTotalTracks",nBinsMatchedTracks,lowMatchedTracks,highMatchedTracks,nBinsFrac,fracMin,fracMaxLow);
2255 fHistFracSecondariesVsNTotalTracks = new TH2F("fHistFracSecondariesVsNTotalTracks","fHistFracSecondariesVsNTotalTracks",nBinsMatchedTracks,lowMatchedTracks,highMatchedTracks,nBinsFrac,fracMin,fracMax);
2256 //NClusters
ce546038 2257}
2258
0651f6b4 2259void AliAnalysisEtMonteCarlo::FillOutputList(TList *list)
f61cec2f 2260{ //fill the output list
e2ee5727 2261 AliAnalysisEt::FillOutputList(list);
2262
c79c36cc 2263 if(!fIsMC) return;
f61cec2f 2264 if(fCuts->GetHistMakeTree())
2265 {
2266 list->Add(fPrimaryTree);
2267 }
2268
e2ee5727 2269 list->Add(fHistRemovedOrNot);
2270
2271 list->Add(fHistEtNonRemovedProtons);
2272 list->Add(fHistEtNonRemovedAntiProtons);
2273 list->Add(fHistEtNonRemovedPiPlus);
2274 list->Add(fHistEtNonRemovedPiMinus);
2275 list->Add(fHistEtNonRemovedKaonPlus);
2276 list->Add(fHistEtNonRemovedKaonMinus);
2277 list->Add(fHistEtNonRemovedK0s);
ef647350 2278 list->Add(fHistEtNonRemovedK0L);
e2ee5727 2279 list->Add(fHistEtNonRemovedLambdas);
2280 list->Add(fHistEtNonRemovedElectrons);
2281 list->Add(fHistEtNonRemovedPositrons);
2282 list->Add(fHistEtNonRemovedMuPlus);
2283 list->Add(fHistEtNonRemovedMuMinus);
2284 list->Add(fHistEtNonRemovedNeutrons);
2285 list->Add(fHistEtNonRemovedAntiNeutrons);
2286 list->Add(fHistEtNonRemovedGammas);
2287 list->Add(fHistEtNonRemovedGammasFromPi0);
2288
2289 list->Add(fHistEtRemovedGammas);
2290 list->Add(fHistEtRemovedNeutrons);
2291 list->Add(fHistEtRemovedAntiNeutrons);
2292
ef647350 2293 list->Add(fHistEtRemovedCharged);
2294 list->Add(fHistEtRemovedNeutrals);
2295
2296 list->Add(fHistEtNonRemovedCharged);
2297 list->Add(fHistEtNonRemovedNeutrals);
e2ee5727 2298
2299 list->Add(fHistMultNonRemovedProtons);
2300 list->Add(fHistMultNonRemovedAntiProtons);
2301 list->Add(fHistMultNonRemovedPiPlus);
2302 list->Add(fHistMultNonRemovedPiMinus);
2303 list->Add(fHistMultNonRemovedKaonPlus);
2304 list->Add(fHistMultNonRemovedKaonMinus);
2305 list->Add(fHistMultNonRemovedK0s);
ef647350 2306 list->Add(fHistMultNonRemovedK0L);
e2ee5727 2307 list->Add(fHistMultNonRemovedLambdas);
2308 list->Add(fHistMultNonRemovedElectrons);
2309 list->Add(fHistMultNonRemovedPositrons);
2310 list->Add(fHistMultNonRemovedMuPlus);
2311 list->Add(fHistMultNonRemovedMuMinus);
2312 list->Add(fHistMultNonRemovedNeutrons);
2313 list->Add(fHistMultNonRemovedAntiNeutrons);
2314 list->Add(fHistMultNonRemovedGammas);
2315
2316 list->Add(fHistMultRemovedGammas);
2317 list->Add(fHistMultRemovedNeutrons);
2318 list->Add(fHistMultRemovedAntiNeutrons);
2319
ef647350 2320 list->Add(fHistMultRemovedCharged);
2321 list->Add(fHistMultRemovedNeutrals);
2322
2323 list->Add(fHistMultNonRemovedCharged);
2324 list->Add(fHistMultNonRemovedNeutrals);
2325
e2ee5727 2326 list->Add(fHistTrackMultvsNonRemovedCharged);
2327 list->Add(fHistTrackMultvsNonRemovedNeutral);
2328 list->Add(fHistTrackMultvsRemovedGamma);
2329
2330 list->Add(fHistClusterMultvsNonRemovedCharged);
2331 list->Add(fHistClusterMultvsNonRemovedNeutral);
2332 list->Add(fHistClusterMultvsRemovedGamma);
2333
2334 //list->Add(fHistDecayVertexNonRemovedCharged);
2335 //list->Add(fHistDecayVertexNonRemovedNeutral);
2336 //list->Add(fHistDecayVertexRemovedCharged);
2337 //list->Add(fHistDecayVertexRemovedNeutral);
2338
2339 list->Add(fHistDxDzNonRemovedCharged);
2340 list->Add(fHistDxDzRemovedCharged);
2341 list->Add(fHistDxDzNonRemovedNeutral);
2342 list->Add(fHistDxDzRemovedNeutral);
2343
0861cc1f 2344 if(fCalcForKaonCorrection){
2345 list->Add(fHistK0EDepositsVsPtInAcceptance);
2346 list->Add(fHistK0EGammaVsPtInAcceptance);
2347 list->Add(fHistK0EDepositsVsPtOutOfAcceptance);
2348 list->Add(fHistK0EGammaVsPtOutOfAcceptance);
2349 list->Add(fHistSimKaonsInAcceptance);
2350 list->Add(fHistSimK0SInAcceptance);
2351 list->Add(fHistSimK0LInAcceptance);
2352 list->Add(fHistSimKPlusInAcceptance);
2353 list->Add(fHistSimKMinusInAcceptance);
2354 list->Add(fHistSimKaonsOutOfAcceptance);
2355 list->Add(fHistSimKaonsInAcceptanceWithDepositsPrimaries);
2356 list->Add(fHistSimKaonsOutOfAcceptanceWithDepositsSecondaries);
2357 list->Add(fHistSimKaonsOutOfAcceptanceWithDepositsPrimaries);
2358 }
2aab9269 2359
e2ee5727 2360 list->Add(fHistPiPlusMult);
2361 list->Add(fHistPiMinusMult);
2362 list->Add(fHistPiZeroMult);
2363 list->Add(fHistPiPlusMultAcc);
2364 list->Add(fHistPiMinusMultAcc);
2365 list->Add(fHistPiZeroMultAcc);
b2c10007 2366
2367 list->Add(fHistGammasFound);
2368 list->Add(fHistGammasGenerated);
9a365626 2369 list->Add(fHistGammasFoundOutOfAccCent);
5881f036 2370 list->Add(fHistGammasFoundCent);
866b6d2b 2371 list->Add(fHistGammasFoundOutOfAccAltCent);
2372 list->Add(fHistGammasFoundAltCent);
5881f036 2373 list->Add(fHistGammasGeneratedCent);
866b6d2b 2374 list->Add(fHistGammasFoundRecoEnergyCent);
2375 list->Add(fHistGammasFoundOutOfAccRecoEnergyCent);
9ef6f13f 2376 list->Add(fHistChargedTracksCut);
2377 list->Add(fHistChargedTracksAccepted);
2378 list->Add(fHistGammasCut);
2379 list->Add(fHistGammasAccepted);
0861cc1f 2380 if(fCalcTrackMatchVsMult){
2381 list->Add(fHistChargedTracksCutMult);
866b6d2b 2382 list->Add(fHistChargedTrackDepositsAcceptedVsPt);
2383 list->Add(fHistChargedTrackDepositsAllVsPt);
2384 list->Add(fHistChargedTrackDepositsAcceptedVsPtEffCorr);
2385 list->Add(fHistChargedTrackDepositsAllVsPtEffCorr);
0861cc1f 2386 list->Add(fHistChargedTracksAcceptedMult);
866b6d2b 2387 list->Add(fHistChargedTracksAcceptedLowPtCentEffCorr);
ac610b08 2388 list->Add(fHistChargedTracksAcceptedLowPtCent);
5881f036 2389 list->Add(fHistChargedTracksAcceptedLowPtCent500MeV);
ac610b08 2390 list->Add(fHistChargedTracksAcceptedLowPtCentNoAntiProtons);
2391 list->Add(fHistChargedTracksAcceptedLowPtCentAntiProtons);
0861cc1f 2392 list->Add(fHistGammasCutMult);
2393 list->Add(fHistGammasAcceptedMult);
2394 }
9ef6f13f 2395 list->Add(fHistBadTrackMatches);
2396 list->Add(fHistMatchedTracksEvspTBkgd);
2397 list->Add(fHistMatchedTracksEvspTSignal);
0861cc1f 2398 if(fCalcTrackMatchVsMult){
2399 list->Add(fHistMatchedTracksEvspTBkgdPeripheral);
2400 list->Add(fHistMatchedTracksEvspTSignalPeripheral);
ac610b08 2401 list->Add(fHistMatchedTracksEvspTBkgdvsCent);
2402 list->Add(fHistMatchedTracksEvspTSignalvsCent);
2403 list->Add(fHistMatchedTracksEvspTBkgdvsCentEffCorr);
2404 list->Add(fHistMatchedTracksEvspTSignalvsCentEffCorr);
0861cc1f 2405 list->Add(fHistChargedTracksCutPeripheral);
2406 list->Add(fHistChargedTracksAcceptedPeripheral);
2407 list->Add(fHistGammasCutPeripheral);
2408 list->Add(fHistGammasAcceptedPeripheral);
2409 }
9ef6f13f 2410 list->Add(fHistBadTrackMatchesdPhidEta);
2411 list->Add(fHistGoodTrackMatchesdPhidEta);
c79c36cc 2412 list->Add(fHistHadronDepositsAll);
2413 list->Add(fHistHadronDepositsReco);
ac610b08 2414 list->Add(fHistHadronDepositsAllCent);
5881f036 2415 list->Add(fHistHadronDepositsAllCent500MeV);
ac610b08 2416 list->Add(fHistHadronDepositsRecoCent);
866b6d2b 2417 list->Add(fHistHadronDepositsAllvsECent);
2418 list->Add(fHistHadronDepositsRecovsECent);
ac610b08 2419 list->Add(fHistHadronsAllCent);
d3ce32b8 2420 list->Add(fHistMultChVsSignalVsMult);
9a365626 2421 list->Add(fHistNeutralRemovedSecondaryEtVsCent);
2422 list->Add(fHistChargedRemovedSecondaryEtVsCent);
2423 list->Add(fHistNeutralNotRemovedSecondaryEtVsCent);
2424 list->Add(fHistChargedNotRemovedSecondaryEtVsCent);
2425 list->Add(fHistNeutralRemovedSecondaryNumVsNCluster);
2426 list->Add(fHistChargedRemovedSecondaryNumVsNCluster);
2427 list->Add(fHistNeutralNotRemovedSecondaryNumVsNCluster);
2428 list->Add(fHistChargedNotRemovedSecondaryNumVsNCluster);
2429 list->Add(fHistNeutralRemovedSecondaryNumVsCent);
2430 list->Add(fHistChargedRemovedSecondaryNumVsCent);
2431 list->Add(fHistNeutralNotRemovedSecondaryNumVsCent);
2432 list->Add(fHistChargedNotRemovedSecondaryNumVsCent);
2433 list->Add(fHistNeutronsEtVsCent);
2434 list->Add(fHistNeutronsNumVsCent);
2435 list->Add(fHistNotNeutronsNumVsCent);
2436 list->Add(fHistPiKPDepositedVsNch);
2437 list->Add(fHistPiKPNotTrackMatchedDepositedVsNch);
866b6d2b 2438
9a365626 2439 list->Add(fHistNeutronsDepositedVsNch);
2440 list->Add(fHistAntiNeutronsDepositedVsNch);
2441 list->Add(fHistProtonsDepositedVsNch);
2442 list->Add(fHistAntiProtonsDepositedVsNch);
2443 list->Add(fHistProtonsNotTrackMatchedDepositedVsNch);
2444 list->Add(fHistAntiProtonsNotTrackMatchedDepositedVsNch);
866b6d2b 2445 list->Add(fHistNeutronsDepositedVsNcl);
2446 list->Add(fHistAntiNeutronsDepositedVsNcl);
2447 list->Add(fHistProtonsDepositedVsNcl);
2448 list->Add(fHistAntiProtonsDepositedVsNcl);
2449 list->Add(fHistProtonsNotTrackMatchedDepositedVsNcl);
2450 list->Add(fHistAntiProtonsNotTrackMatchedDepositedVsNcl);
9a365626 2451 list->Add(fHistSecondariesVsNch);
2452 list->Add(fHistSecondariesVsNcl);
2453 list->Add(fHistSecondariesEffCorrVsNch);
f4d97f7c 2454 list->Add(fHistSecondariesEffCorrVsNcl);
b986cebe 2455 list->Add(fHistSecondariesOutOfAccEffCorrVsNch);
2456 list->Add(fHistSecondariesDetectorCoverEffCorrVsNch);
866b6d2b 2457 //start
2458
2459 list->Add(fHistNeutronsDepositedVsNchNoEffCorr);
2460 list->Add(fHistAntiNeutronsDepositedVsNchNoEffCorr);
2461 list->Add(fHistProtonsDepositedVsNchNoEffCorr);
2462 list->Add(fHistAntiProtonsDepositedVsNchNoEffCorr);
2463 list->Add(fHistProtonsNotTrackMatchedDepositedVsNchNoEffCorr);
2464 list->Add(fHistAntiProtonsNotTrackMatchedDepositedVsNchNoEffCorr);
2465 list->Add(fHistNeutronsDepositedVsNclNoEffCorr);
2466 list->Add(fHistAntiNeutronsDepositedVsNclNoEffCorr);
2467 list->Add(fHistProtonsDepositedVsNclNoEffCorr);
2468 list->Add(fHistAntiProtonsDepositedVsNclNoEffCorr);
2469 list->Add(fHistProtonsNotTrackMatchedDepositedVsNclNoEffCorr);
2470 list->Add(fHistAntiProtonsNotTrackMatchedDepositedVsNclNoEffCorr);
2471
2472 //end
2473
9a365626 2474 list->Add(fHistCentVsNchVsNcl);
866b6d2b 2475 list->Add(fHistSecondaryPositionInDetector);
32503dac 2476 list->Add(fClusterPositionWeird);
b986cebe 2477 //list->Add(fHistSecondaryPositionInDetectorMultiple);
2478 list->Add(fSecondaryClusterEnergy);
866b6d2b 2479 list->Add(fHistGammaCrossCheck);
2480 list->Add(fHistGammaCrossCheckAlt);
2481 list->Add(fHistGammaEnergyCrossCheck);
2482 list->Add(fHistGammaEnergyCrossCheckAlt);
2483 list->Add(fHistNeutronCrossCheck);
2484 list->Add(fHistSecondaryCrossCheck);
2485 list->Add(fHistHadronCrossCheck);
2486 list->Add(fHistKaonCrossCheck);
2487
2488
2489 list->Add(fHistAllEnergy);
2490 list->Add(fHistSignalEnergy);
2491 list->Add(fHistNeutronEnergy);
2492 list->Add(fHistKaonEnergy);
2493 list->Add(fHistHadronEnergy);
2494 list->Add(fHistSecondaryEnergy);
2495 list->Add(fHistSecondaryChargedEnergy);
2496 list->Add(fHistSecondaryNeutronEnergy);
2497 list->Add(fHistSecondaryGammaEnergy);
2498 list->Add(fHistSecondaryElectronEnergy);
2499 list->Add(fHistSecondaryOtherEnergy);
2500 list->Add(fHistSimulatedGammaEnergy);
2501 list->Add(fHistReconstructedGammaEnergy);
2502 list->Add(fHistSimulatedGammaEnergyAboveThreshold);
2503 list->Add(fHistReconstructedSignalEnergy);
2504
2505
2506 list->Add(fHistFracSignalVsNClusters);
2507 list->Add(fHistFracHadronsVsNClusters);
2508 list->Add(fHistFracNeutronsVsNClusters);
2509 list->Add(fHistFracKaonsVsNClusters);
2510 list->Add(fHistFracSecondariesVsNClusters);
2511 list->Add(fHistFracSignalVsNMultiplicity);
2512 list->Add(fHistFracHadronsVsNMultiplicity);
2513 list->Add(fHistFracNeutronsVsNMultiplicity);
2514 list->Add(fHistFracKaonsVsNMultiplicity);
2515 list->Add(fHistFracSecondariesVsNMultiplicity);
2516 list->Add(fHistFracSignalVsNMatchedTracks);
2517 list->Add(fHistFracHadronsVsNMatchedTracks);
2518 list->Add(fHistFracNeutronsVsNMatchedTracks);
2519 list->Add(fHistFracKaonsVsNMatchedTracks);
2520 list->Add(fHistFracSecondariesVsNMatchedTracks);
2521 list->Add(fHistFracSignalVsNTotalTracks);
2522 list->Add(fHistFracHadronsVsNTotalTracks);
2523 list->Add(fHistFracNeutronsVsNTotalTracks);
2524 list->Add(fHistFracKaonsVsNTotalTracks);
2525 list->Add(fHistFracSecondariesVsNTotalTracks);
e2ee5727 2526
0651f6b4 2527}
2528
2529
13b0d3c1 2530bool AliAnalysisEtMonteCarlo::TrackHitsCalorimeter(TParticle* part, Double_t magField)
2531{
e2ee5727 2532 // printf(" TrackHitsCalorimeter - magField %f\n", magField);
2533 AliESDtrack *esdTrack = new AliESDtrack(part);
2534 // Printf("MC Propagating track: eta: %f, phi: %f, pt: %f", esdTrack->Eta(), esdTrack->Phi(), esdTrack->Pt());
2535
2536 Bool_t prop = esdTrack->PropagateTo(fDetectorRadius, magField);
2537
2538 // if(prop) Printf("Track propagated, eta: %f, phi: %f, pt: %f", esdTrack->Eta(), esdTrack->Phi(), esdTrack->Pt());
2539
f61cec2f 2540 bool status = prop && fSelector->CutGeometricalAcceptance(*esdTrack);
e2ee5727 2541 delete esdTrack;
2542
2543 return status;
2544}
2545
2546void AliAnalysisEtMonteCarlo::FillHistograms()
f61cec2f 2547{ // let base class fill its histograms, and us fill the local ones
e2ee5727 2548 AliAnalysisEt::FillHistograms();
c79c36cc 2549 if(!fIsMC) return;
e2ee5727 2550 //std::cout << fEtNonRemovedPiPlus << " " << fCentClass << std::endl;
2551
2552 fHistEtNonRemovedProtons->Fill(fEtNonRemovedProtons, fCentClass);
2553 fHistEtNonRemovedAntiProtons->Fill(fEtNonRemovedAntiProtons, fCentClass);
2554 fHistEtNonRemovedKaonPlus->Fill(fEtNonRemovedKaonPlus, fCentClass);
2555 fHistEtNonRemovedKaonMinus->Fill(fEtNonRemovedKaonMinus, fCentClass);
ef647350 2556 fHistEtNonRemovedK0s->Fill(fEtNonRemovedK0S, fCentClass);
2557 fHistEtNonRemovedK0L->Fill(fEtNonRemovedK0L, fCentClass);
e2ee5727 2558 fHistEtNonRemovedLambdas->Fill(fEtNonRemovedLambdas, fCentClass);
2559 fHistEtNonRemovedPiPlus->Fill(fEtNonRemovedPiPlus, fCentClass);
2560 fHistEtNonRemovedPiMinus->Fill(fEtNonRemovedPiMinus, fCentClass);
2561 fHistEtNonRemovedElectrons->Fill(fEtNonRemovedElectrons, fCentClass);
2562 fHistEtNonRemovedPositrons->Fill(fEtNonRemovedPositrons, fCentClass);
2563 fHistEtNonRemovedMuPlus->Fill(fEtNonRemovedMuPlus, fCentClass);
2564 fHistEtNonRemovedMuMinus->Fill(fEtNonRemovedMuMinus, fCentClass);
2565 fHistEtNonRemovedNeutrons->Fill(fEtNonRemovedNeutrons, fCentClass);
2566 fHistEtNonRemovedAntiNeutrons->Fill(fEtNonRemovedAntiNeutrons, fCentClass);
2567 fHistEtNonRemovedGammas->Fill(fEtNonRemovedGammas, fCentClass);
2568 fHistEtNonRemovedGammasFromPi0->Fill(fEtNonRemovedGammasFromPi0, fCentClass);
2569
866b6d2b 2570 fHistEtRemovedGammas->Fill(fEtRemovedGammas, fClusterMult);
e2ee5727 2571 fHistEtRemovedNeutrons->Fill(fEtRemovedNeutrons, fCentClass);
2572 fHistEtRemovedAntiNeutrons->Fill(fEtRemovedAntiNeutrons, fCentClass);
2573
ef647350 2574// fHistEtRemovedCharged->Fill(fEtRemovedAntiProtons+fEtRemovedElectrons+fEtRemovedKaonMinus+fEtRemovedKaonPlus
2575// +fEtRemovedMuMinus+fEtRemovedMuPlus+fEtRemovedPiMinus+fEtRemovedPiPlus+fEtRemovedPositrons
2576// +fEtRemovedProtons.
2577// fCentClass);
2578// fHistEtRemovedNeutrals->Fill(fEtRemovedNeutrons+fEtRemovedAntiNeutrons, fCentClass);
f61cec2f 2579//
ef647350 2580// fHistEtNonRemovedCharged->Fill(fEtNonRemovedAntiProtons+fEtNonRemovedElectrons+fEtNonRemovedKaonMinus+fEtNonRemovedKaonPlus
2581// +fEtNonRemovedMuMinus+fEtNonRemovedMuPlus+fEtNonRemovedPiMinus+fEtNonRemovedPiPlus+fEtNonRemovedPositrons
2582// +fEtNonRemovedProtons,
2583// fCentClass);
2584// fHistEtRemovedNeutrals->Fill(fEtNonRemovedNeutrons+fEtNonRemovedAntiNeutrons, fCentClass);
2585
866b6d2b 2586 fHistEtRemovedCharged->Fill(fEnergyChargedRemoved, fClusterMult);
2587 fHistEtRemovedNeutrals->Fill(fEnergyNeutralRemoved, fClusterMult);
2588 fHistEtNonRemovedCharged->Fill(fEnergyChargedNotRemoved, fClusterMult);
2589 fHistEtNonRemovedNeutrals->Fill(fEnergyNeutralNotRemoved, fClusterMult);
f61cec2f 2590
866b6d2b 2591 fHistMultRemovedCharged->Fill(fChargedRemoved, fClusterMult);
2592 fHistMultRemovedNeutrals->Fill(fNeutralRemoved, fClusterMult);
2593 fHistMultNonRemovedCharged->Fill(fChargedNotRemoved, fClusterMult);
2594 fHistMultNonRemovedNeutrals->Fill(fNeutralNotRemoved, fClusterMult);
f61cec2f 2595
2596
e2ee5727 2597 fHistMultNonRemovedProtons->Fill(fMultNonRemovedProtons, fCentClass);
2598 fHistMultNonRemovedAntiProtons->Fill(fMultNonRemovedAntiProtons, fCentClass);
2599 fHistMultNonRemovedKaonPlus->Fill(fMultNonRemovedKaonPlus, fCentClass);
2600 fHistMultNonRemovedKaonMinus->Fill(fMultNonRemovedKaonMinus, fCentClass);
2601 fHistMultNonRemovedK0s->Fill(fMultNonRemovedK0s, fCentClass);
ef647350 2602 fHistMultNonRemovedK0L->Fill(fMultNonRemovedK0L, fCentClass);
e2ee5727 2603 fHistMultNonRemovedLambdas->Fill(fMultNonRemovedLambdas, fCentClass);
2604 fHistMultNonRemovedPiPlus->Fill(fMultNonRemovedPiPlus, fCentClass);
2605 fHistMultNonRemovedPiMinus->Fill(fMultNonRemovedPiMinus, fCentClass);
2606 fHistMultNonRemovedElectrons->Fill(fMultNonRemovedElectrons, fCentClass);
2607 fHistMultNonRemovedPositrons->Fill(fMultNonRemovedPositrons, fCentClass);
2608 fHistMultNonRemovedMuPlus->Fill(fMultNonRemovedMuPlus, fCentClass);
2609 fHistMultNonRemovedMuMinus->Fill(fMultNonRemovedMuMinus, fCentClass);
2610 fHistMultNonRemovedNeutrons->Fill(fMultNonRemovedNeutrons, fCentClass);
2611 fHistMultNonRemovedAntiNeutrons->Fill(fMultNonRemovedAntiNeutrons, fCentClass);
2612 fHistMultNonRemovedGammas->Fill(fMultNonRemovedGammas, fCentClass);
2613
2614 fHistMultRemovedGammas->Fill(fMultRemovedGammas, fCentClass);
2615 fHistMultRemovedNeutrons->Fill(fMultRemovedNeutrons, fCentClass);
2616 fHistMultRemovedAntiNeutrons->Fill(fMultRemovedAntiNeutrons, fCentClass);
2617
2618 fHistTrackMultvsNonRemovedCharged->Fill(fTrackMultInAcc,
2619 fMultNonRemovedAntiProtons+fMultNonRemovedElectrons+fMultNonRemovedKaonMinus+fMultNonRemovedKaonPlus
2620 +fMultNonRemovedMuMinus+fMultNonRemovedMuPlus+fMultNonRemovedPiMinus+fMultNonRemovedPiPlus+fMultNonRemovedPositrons
2621 +fMultNonRemovedProtons);
2622
2623 fHistTrackMultvsNonRemovedNeutral->Fill(fTrackMultInAcc,
b2c10007 2624 fMultNonRemovedNeutrons+fMultNonRemovedAntiNeutrons+fMultNonRemovedK0s+fMultNonRemovedK0L+fMultNonRemovedLambdas+fK0sMult);
e2ee5727 2625
2626 fHistTrackMultvsRemovedGamma->Fill(fTrackMultInAcc,
2627 fMultRemovedGammas);
2628
866b6d2b 2629 fHistClusterMultvsNonRemovedCharged->Fill(fClusterMult,
e2ee5727 2630 fMultNonRemovedAntiProtons+fMultNonRemovedElectrons+fMultNonRemovedKaonMinus
2631 +fMultNonRemovedKaonPlus+fMultNonRemovedMuMinus+fMultNonRemovedMuPlus
2632 +fMultNonRemovedPiMinus+fMultNonRemovedPiPlus+fMultNonRemovedPositrons+fMultNonRemovedProtons);
2633
866b6d2b 2634 fHistClusterMultvsNonRemovedNeutral->Fill(fClusterMult,
b2c10007 2635 fMultNonRemovedNeutrons+fMultNonRemovedAntiNeutrons+fMultNonRemovedK0s+fMultNonRemovedK0L+fMultNonRemovedLambdas+fK0sMult);
e2ee5727 2636
866b6d2b 2637 fHistClusterMultvsRemovedGamma->Fill(fClusterMult,
e2ee5727 2638 fMultRemovedGammas);
2639
13b0d3c1 2640}
2641
e2ee5727 2642
2643
2644
ef647350 2645Int_t AliAnalysisEtMonteCarlo::PrintFamilyTree(Int_t partIdx, AliStack* stack)
4d376d01 2646{ // print family tree
f61cec2f 2647 TParticle *part = stack->Particle(partIdx);
b2c10007 2648// if(part->GetPdgCode() == fgK0SCode)
f61cec2f 2649 {
866b6d2b 2650 std::cout << "This is index: " << partIdx << " (" << stack->Particle(partIdx)->GetName() <<") , is it primary: " << stack->IsPhysicalPrimary(partIdx)<<" is it from secondary interaction "<<fSelector->FromSecondaryInteraction(partIdx, *stack)<< std::endl;
f61cec2f 2651 std::cout << "PID: " << part->GetPdgCode() << "/" << part->GetName() << std::endl;
2652 std::cout << "Energy: " << part->Energy() << std::endl;
03cff249 2653 Float_t vtx = TMath::Sqrt( TMath::Power(part->Vx(),2) + TMath::Power(part->Vy(),2) + TMath::Power(part->Vz(),2) );
866b6d2b 2654 Float_t vtxy = TMath::Sqrt( TMath::Power(part->Vx(),2) + TMath::Power(part->Vy(),2) );
2655 std::cout << "Vertex: " << part->Vx() << ", " << part->Vy() << ", " << part->Vz() <<" |Vtx| "<<vtx <<" |Vtxy| "<<vtxy << std::endl;
f61cec2f 2656 }
2657 return PrintMothers(partIdx, stack, 1);
ef647350 2658}
2659
2660Int_t AliAnalysisEtMonteCarlo::PrintMothers(Int_t partIdx, AliStack* stack, Int_t gen)
4d376d01 2661{ // print mothers
f61cec2f 2662 char *tabs = new char[gen+1];
2663 for(Int_t i = 0; i < gen; ++i)
2664 {
2665 //std::cout << i << std::endl;
2666 tabs[i] = '\t';
2667 }
2668 tabs[gen] = '\0';
2669 Int_t mothIdx = stack->Particle(partIdx)->GetMother(0);
2670 if(mothIdx < 0)
2671 {
2672 delete [] tabs;
2673 return 0;
2674 }
2675 TParticle *mother = stack->Particle(mothIdx);
b2c10007 2676// if(mother->GetPdgCode() == fgK0SCode)
f61cec2f 2677 {
b2c10007 2678 //std::cout << tabs << "Mother of index: " << partIdx << " (" << stack->Particle(partIdx)->GetName() <<") is: " << mothIdx << ", is it primary: " << stack->IsPhysicalPrimary(mothIdx)<< std::endl;
2679 std::cout << tabs << "Index: " << mothIdx << std::endl;
866b6d2b 2680 std::cout << tabs << "Primary: " << stack->IsPhysicalPrimary(mothIdx)<<" is it from secondary interaction "<<fSelector->FromSecondaryInteraction(partIdx, *stack) << std::endl;
f61cec2f 2681 std::cout << tabs << "PID: " << mother->GetPdgCode() << "/" << mother->GetName() << std::endl;
2682 std::cout << tabs << "Energy: " << mother->Energy() << std::endl;
b2c10007 2683 if(mother->GetFirstMother() >= 0)
2684 {
2685 std::cout << tabs << "Mother(s): " << stack->Particle(mother->GetFirstMother())->GetPdgCode();
2686 if(mother->GetSecondMother() >= 0) std::cout << ", " << stack->Particle(mother->GetSecondMother())->GetPdgCode();
2687 std::cout << std::endl;
2688 }
03cff249 2689 Float_t vtx = TMath::Sqrt( TMath::Power(mother->Vx(),2) + TMath::Power(mother->Vy(),2) + TMath::Power(mother->Vz(),2) );
866b6d2b 2690 Float_t vtxy = TMath::Sqrt( TMath::Power(mother->Vx(),2) + TMath::Power(mother->Vy(),2) );
2691 std::cout<<tabs << "Vertex: " << mother->Vx() << ", " << mother->Vy() << ", " << mother->Vz() <<"|Vtx| "<<vtx<<" |Vtxy| "<<vtxy << std::endl;
f61cec2f 2692 }
2693 if(mother->GetPdgCode() == fgK0SCode)
2694 {
ef647350 2695// std::cout << "K0S!!!!!!!!!!!!!11111!!!!!" << std::endl;
f61cec2f 2696 }
ef647350 2697// std::cout << "Mother of index: " << partIdx << " (" << stack->Particle(partIdx)->GetName() <<") is: " << mothIdx << std::endl;
2698// std::cout << "PID: " << mother->GetPdgCode() << "/" << mother->GetName() << std::endl;
2699// std::cout << "Energy: " << mother->Energy() << std::endl;
2700// std::cout << "Vertex: " << mother->Vx() << ", " << mother->Vy() << ", " << mother->Vz() << std::endl;
f61cec2f 2701
2702 delete [] tabs;
2703 return PrintMothers(mothIdx, stack, gen+1) + 1;
ef647350 2704}
2705
2706Int_t AliAnalysisEtMonteCarlo::GetPrimMother(Int_t partIdx, AliStack *stack)
4d376d01 2707{ // get primary mother
f61cec2f 2708 if(partIdx >= 0)
ef647350 2709 {
b2c10007 2710 //return stack->GetPrimary(partIdx);
2711
f61cec2f 2712 Int_t mothIdx = stack->Particle(partIdx)->GetMother(0);
2713 if(mothIdx < 0) return -1;
2714 TParticle *mother = stack->Particle(mothIdx);
2715 if(mother)
2716 {
f61cec2f 2717 if(stack->IsPhysicalPrimary(mothIdx)) return mothIdx;
2718 else return GetPrimMother(mothIdx, stack);
2719 }
2720 else
2721 {
2722 return -1;
2723 }
ef647350 2724 }
f61cec2f 2725 return -1;
ef647350 2726}
2727
2728Int_t AliAnalysisEtMonteCarlo::GetK0InFamily(Int_t partIdx, AliStack* stack)
4d376d01 2729{ // get K0 in family
f61cec2f 2730 if(partIdx >= 0)
ef647350 2731 {
2aab9269 2732 if(stack->Particle(partIdx)->GetPdgCode() == fgK0SCode) return partIdx;
f61cec2f 2733 Int_t mothIdx = stack->Particle(partIdx)->GetMother(0);
2734 if(mothIdx < 0) return -1;
2735 TParticle *mother = stack->Particle(mothIdx);
2736 if(mother)
ef647350 2737 {
2aab9269 2738 if(mother->GetPdgCode() == fgK0SCode)
ef647350 2739 {
f61cec2f 2740 return mothIdx;
ef647350 2741 }
f61cec2f 2742 return GetK0InFamily(mothIdx, stack);
2743 }
2744 else
2745 {
2746 return -1;
ef647350 2747 }
2748 }
f61cec2f 2749 return -1;
ef647350 2750}
866b6d2b 2751Int_t AliAnalysisEtMonteCarlo::PrintFamilyTreeShort(Int_t partIdx, AliStack* stack)
2752{ // print family tree
2753 TParticle *part = stack->Particle(partIdx);
2754 if(part){
2755 Float_t vtxy = TMath::Sqrt( TMath::Power(part->Vx(),2) + TMath::Power(part->Vy(),2) );
2756 cout<<part->GetName()<<"( is scondary "<<fSelector->FromSecondaryInteraction(partIdx, *stack)<<", vtx "<<vtxy <<", index "<<partIdx<<")";
2757 //cout<<"<-"<<part->GetName()<<"("<<fSelector->FromSecondaryInteraction(partIdx, *stack)<<","<<vtxy <<")";
2758 }
2759 else{return 0;}
2760 Int_t value = PrintMothersShort(partIdx, stack, 1);
2761 cout<<endl;
2762 return value;
2763}
2764
2765Int_t AliAnalysisEtMonteCarlo::PrintMothersShort(Int_t partIdx, AliStack* stack, Int_t gen)
2766{ // print mothers
2767 Int_t mothIdx = stack->Particle(partIdx)->GetMother(0);
2768 if(mothIdx < 0)
2769 {
2770 return 0;
2771 }
2772 TParticle *mother = stack->Particle(mothIdx);
2773 if(mother){
2774 //Float_t vtx = TMath::Sqrt( TMath::Power(mother->Vx(),2) + TMath::Power(mother->Vy(),2) + TMath::Power(mother->Vz(),2) );
2775 Float_t vtxy = TMath::Sqrt( TMath::Power(mother->Vx(),2) + TMath::Power(mother->Vy(),2) );
2776 cout<<"<-"<<mother->GetName()<<"( is scondary "<<fSelector->FromSecondaryInteraction(mothIdx, *stack)<<", vtx "<<vtxy <<", index "<<mothIdx<<")";
2777 //std::cout<<tabs << "Vertex: " << mother->Vx() << ", " << mother->Vy() << ", " << mother->Vz() <<"|Vtx| "<<vtx<<" |Vtxy| "<<vtxy << std::endl;
2778 }
2779 else{return 0;}
2780 return PrintMothersShort(mothIdx, stack, gen+1) + 1;
2781}
e2ee5727 2782