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