1 //_________________________________________________________________________
2 // Utility Class for transverse energy studies
3 // Base class for MC analysis
7 //*-- Authors: Oystein Djuvsland (Bergen), David Silvermyr (ORNL)
8 //_________________________________________________________________________
10 #include "AliAnalysisEtMonteCarlo.h"
11 #include "AliAnalysisEtCuts.h"
12 #include "AliAnalysisEtSelector.h"
13 #include "AliAnalysisEtSelector.h"
14 #include "AliESDtrack.h"
16 #include "AliVEvent.h"
17 #include "AliMCEvent.h"
18 #include "AliESDEvent.h"
21 #include "TParticle.h"
22 #include "AliGenHijingEventHeader.h"
23 #include "AliGenPythiaEventHeader.h"
25 #include "AliESDCaloCluster.h"
28 #include <AliCentrality.h>
29 #include "AliPHOSGeoUtils.h"
30 #include "AliPHOSGeometry.h"
32 #include "AliESDtrackCuts.h"
35 ClassImp(AliAnalysisEtMonteCarlo);
39 AliAnalysisEtMonteCarlo::AliAnalysisEtMonteCarlo():AliAnalysisEt()
45 ,fTotEtWithSecondaryRemoved(0)
46 ,fTotEtSecondaryFromEmEtPrimary(0)
74 ,fHistDecayVertexNonRemovedCharged(0)
75 ,fHistDecayVertexRemovedCharged(0)
76 ,fHistDecayVertexNonRemovedNeutral(0)
77 ,fHistDecayVertexRemovedNeutral(0)
80 ,fHistEtNonRemovedProtons(0)
81 ,fHistEtNonRemovedAntiProtons(0)
82 ,fHistEtNonRemovedPiPlus(0)
83 ,fHistEtNonRemovedPiMinus(0)
84 ,fHistEtNonRemovedKaonPlus(0)
85 ,fHistEtNonRemovedKaonMinus(0)
86 ,fHistEtNonRemovedK0s(0)
87 ,fHistEtNonRemovedK0L(0)
88 ,fHistEtNonRemovedLambdas(0)
89 ,fHistEtNonRemovedElectrons(0)
90 ,fHistEtNonRemovedPositrons(0)
91 ,fHistEtNonRemovedMuPlus(0)
92 ,fHistEtNonRemovedMuMinus(0)
93 ,fHistEtNonRemovedNeutrons(0)
94 ,fHistEtNonRemovedAntiNeutrons(0)
95 ,fHistEtNonRemovedGammas(0)
96 ,fHistEtNonRemovedGammasFromPi0(0)
97 ,fHistEtRemovedGammas(0)
98 ,fHistEtRemovedNeutrons(0)
99 ,fHistEtRemovedAntiNeutrons(0)
100 ,fHistEtRemovedCharged(0)
101 ,fHistEtRemovedNeutrals(0)
102 ,fHistEtNonRemovedCharged(0)
103 ,fHistEtNonRemovedNeutrals(0)
104 ,fHistMultNonRemovedProtons(0)
105 ,fHistMultNonRemovedAntiProtons(0)
106 ,fHistMultNonRemovedPiPlus(0)
107 ,fHistMultNonRemovedPiMinus(0)
108 ,fHistMultNonRemovedKaonPlus(0)
109 ,fHistMultNonRemovedKaonMinus(0)
110 ,fHistMultNonRemovedK0s(0)
111 ,fHistMultNonRemovedK0L(0)
112 ,fHistMultNonRemovedLambdas(0)
113 ,fHistMultNonRemovedElectrons(0)
114 ,fHistMultNonRemovedPositrons(0)
115 ,fHistMultNonRemovedMuPlus(0)
116 ,fHistMultNonRemovedMuMinus(0)
117 ,fHistMultNonRemovedNeutrons(0)
118 ,fHistMultNonRemovedAntiNeutrons(0)
119 ,fHistMultNonRemovedGammas(0)
120 ,fHistMultRemovedGammas(0)
121 ,fHistMultRemovedNeutrons(0)
122 ,fHistMultRemovedAntiNeutrons(0)
123 ,fHistMultRemovedCharged(0)
124 ,fHistMultRemovedNeutrals(0)
125 ,fHistMultNonRemovedCharged(0)
126 ,fHistMultNonRemovedNeutrals(0)
127 ,fHistTrackMultvsNonRemovedCharged(0)
128 ,fHistTrackMultvsNonRemovedNeutral(0)
129 ,fHistTrackMultvsRemovedGamma(0)
130 ,fHistClusterMultvsNonRemovedCharged(0)
131 ,fHistClusterMultvsNonRemovedNeutral(0)
132 ,fHistClusterMultvsRemovedGamma(0)
133 ,fHistMultvsNonRemovedChargedE(0)
134 ,fHistMultvsNonRemovedNeutralE(0)
135 ,fHistMultvsRemovedGammaE(0)
136 ,fCalcForKaonCorrection(kFALSE)
137 ,fHistK0EDepositsVsPtInAcceptance(0)
138 ,fHistK0EGammaVsPtInAcceptance(0)
139 ,fHistK0EDepositsVsPtOutOfAcceptance(0)
140 ,fHistK0EGammaVsPtOutOfAcceptance(0)
141 ,fHistSimKaonsInAcceptance(0)
142 ,fHistSimK0SInAcceptance(0)
143 ,fHistSimKPlusInAcceptance(0)
144 ,fHistSimKMinusInAcceptance(0)
145 ,fHistSimK0LInAcceptance(0)
146 ,fHistSimKaonsOutOfAcceptance(0)
147 ,fHistSimKaonsInAcceptanceWithDepositsPrimaries(0)
148 ,fHistSimKaonsOutOfAcceptanceWithDepositsSecondaries(0)
149 ,fHistSimKaonsOutOfAcceptanceWithDepositsPrimaries(0)
150 ,fEtNonRemovedProtons(0)
151 ,fEtNonRemovedAntiProtons(0)
152 ,fEtNonRemovedPiPlus(0)
153 ,fEtNonRemovedPiMinus(0)
154 ,fEtNonRemovedKaonPlus(0)
155 ,fEtNonRemovedKaonMinus(0)
158 ,fEtNonRemovedLambdas(0)
159 ,fEtNonRemovedElectrons(0)
160 ,fEtNonRemovedPositrons(0)
161 ,fEtNonRemovedMuMinus(0)
162 ,fEtNonRemovedMuPlus(0)
163 ,fEtNonRemovedGammas(0)
164 ,fEtNonRemovedGammasFromPi0(0)
165 ,fEtNonRemovedNeutrons(0)
166 ,fEtNonRemovedAntiNeutrons(0)
167 ,fEtRemovedProtons(0)
168 ,fEtRemovedAntiProtons(0)
170 ,fEtRemovedPiMinus(0)
171 ,fEtRemovedKaonPlus(0)
172 ,fEtRemovedKaonMinus(0)
175 ,fEtRemovedLambdas(0)
176 ,fEtRemovedElectrons(0)
177 ,fEtRemovedPositrons(0)
178 ,fEtRemovedMuMinus(0)
180 ,fEtRemovedGammasFromPi0(0)
182 ,fEtRemovedNeutrons(0)
183 ,fEtRemovedAntiNeutrons(0)
184 ,fMultNonRemovedProtons(0)
185 ,fMultNonRemovedAntiProtons(0)
186 ,fMultNonRemovedPiPlus(0)
187 ,fMultNonRemovedPiMinus(0)
188 ,fMultNonRemovedKaonPlus(0)
189 ,fMultNonRemovedKaonMinus(0)
190 ,fMultNonRemovedK0s(0)
191 ,fMultNonRemovedK0L(0)
192 ,fMultNonRemovedLambdas(0)
193 ,fMultNonRemovedElectrons(0)
194 ,fMultNonRemovedPositrons(0)
195 ,fMultNonRemovedMuMinus(0)
196 ,fMultNonRemovedMuPlus(0)
197 ,fMultNonRemovedGammas(0)
198 ,fMultNonRemovedNeutrons(0)
199 ,fMultNonRemovedAntiNeutrons(0)
200 ,fMultRemovedProtons(0)
201 ,fMultRemovedAntiProtons(0)
202 ,fMultRemovedPiPlus(0)
203 ,fMultRemovedPiMinus(0)
204 ,fMultRemovedKaonPlus(0)
205 ,fMultRemovedKaonMinus(0)
208 ,fMultRemovedLambdas(0)
209 ,fMultRemovedElectrons(0)
210 ,fMultRemovedPositrons(0)
211 ,fMultRemovedMuMinus(0)
212 ,fMultRemovedMuPlus(0)
213 ,fMultRemovedGammas(0)
214 ,fMultRemovedNeutrons(0)
215 ,fMultRemovedAntiNeutrons(0)
217 ,fHistDxDzNonRemovedCharged(0)
218 ,fHistDxDzRemovedCharged(0)
219 ,fHistDxDzNonRemovedNeutral(0)
220 ,fHistDxDzRemovedNeutral(0)
224 ,fHistPiPlusMultAcc(0)
225 ,fHistPiMinusMultAcc(0)
226 ,fHistPiZeroMultAcc(0)
235 ,fChargedNotRemoved(0)
236 ,fNeutralNotRemoved(0)
238 ,fSecondaryNotRemoved(0)
239 ,fEnergyNeutralRemoved(0)
240 ,fEnergyChargedRemoved(0)
241 ,fEnergyChargedNotRemoved(0)
242 ,fEnergyNeutralNotRemoved(0)
243 ,fEnergyGammaRemoved(0)
245 ,fTotNeutralEtAfterMinEnergyCut(0)
246 ,fCalcTrackMatchVsMult(kFALSE)
248 ,fHistGammasGenerated(0)
249 ,fHistGammasFoundCent(0)
250 ,fHistGammasFoundOutOfAccCent(0)
251 ,fHistGammasGeneratedCent(0)
252 ,fHistChargedTracksCut(0)
253 ,fHistChargedTracksAccepted(0)
255 ,fHistGammasAccepted(0)
256 ,fHistChargedTracksCutMult(0)
257 ,fHistChargedTracksAcceptedMult(0)
258 ,fHistChargedTracksAcceptedLowPtCent(0)
259 ,fHistChargedTracksAcceptedLowPtCent500MeV(0)
260 ,fHistChargedTracksAcceptedLowPtCentNoAntiProtons(0)
261 ,fHistChargedTracksAcceptedLowPtCentAntiProtons(0)
262 ,fHistGammasCutMult(0)
263 ,fHistGammasAcceptedMult(0)
264 ,fHistBadTrackMatches(0)
265 ,fHistMatchedTracksEvspTBkgd(0)
266 ,fHistMatchedTracksEvspTSignal(0)
267 ,fHistMatchedTracksEvspTBkgdPeripheral(0)
268 ,fHistMatchedTracksEvspTSignalPeripheral(0)
269 ,fHistMatchedTracksEvspTBkgdvsCent(0)
270 ,fHistMatchedTracksEvspTSignalvsCent(0)
271 ,fHistMatchedTracksEvspTBkgdvsCentEffCorr(0)
272 ,fHistMatchedTracksEvspTSignalvsCentEffCorr(0)
274 ,fHistChargedTracksCutPeripheral(0)
275 ,fHistChargedTracksAcceptedPeripheral(0)
276 ,fHistGammasCutPeripheral(0)
277 ,fHistGammasAcceptedPeripheral(0)
278 ,fHistBadTrackMatchesdPhidEta(0)
279 ,fHistGoodTrackMatchesdPhidEta(0)
280 ,fHistHadronDepositsAll(0)
281 ,fHistHadronDepositsReco(0)
282 ,fHistHadronDepositsAllCent(0)
283 ,fHistHadronDepositsAllCent500MeV(0)
284 ,fHistHadronDepositsRecoCent(0)
285 ,fHistHadronsAllCent(0)
286 ,fHistMultChVsSignalVsMult(0)
287 ,fHistNeutralRemovedSecondaryEtVsCent(0)
288 ,fHistChargedRemovedSecondaryEtVsCent(0)
289 ,fHistNeutralNotRemovedSecondaryEtVsCent(0)
290 ,fHistChargedNotRemovedSecondaryEtVsCent(0)
291 ,fHistNeutralRemovedSecondaryNumVsNCluster(0)
292 ,fHistChargedRemovedSecondaryNumVsNCluster(0)
293 ,fHistNeutralNotRemovedSecondaryNumVsNCluster(0)
294 ,fHistChargedNotRemovedSecondaryNumVsNCluster(0)
295 ,fHistNeutralRemovedSecondaryNumVsCent(0)
296 ,fHistChargedRemovedSecondaryNumVsCent(0)
297 ,fHistNeutralNotRemovedSecondaryNumVsCent(0)
298 ,fHistChargedNotRemovedSecondaryNumVsCent(0)
299 ,fHistNeutronsEtVsCent(0)
300 ,fHistNeutronsNumVsCent(0)
301 ,fHistNotNeutronsNumVsCent(0)
302 ,fHistPiKPDepositedVsNch(0)
303 ,fHistPiKPNotTrackMatchedDepositedVsNch(0)
304 ,fHistNeutronsDepositedVsNch(0)
305 ,fHistAntiNeutronsDepositedVsNch(0)
306 ,fHistProtonsDepositedVsNch(0)
307 ,fHistAntiProtonsDepositedVsNch(0)
308 ,fHistProtonsNotTrackMatchedDepositedVsNch(0)
309 ,fHistAntiProtonsNotTrackMatchedDepositedVsNch(0)
310 ,fHistSecondariesVsNch(0)
311 ,fHistSecondariesVsNcl(0)
312 ,fHistSecondariesEffCorrVsNch(0)
313 ,fHistSecondariesEffCorrVsNcl(0)
314 ,fHistSecondariesOutOfAccEffCorrVsNch(0)
315 ,fHistSecondariesDetectorCoverEffCorrVsNch(0)
316 ,fHistCentVsNchVsNcl(0)
317 //,fHistSecondaryPositionInDetector(0)
318 ,fClusterPositionWeird(0)
319 //,fHistSecondaryPositionInDetectorMultiple(0)
320 ,fSecondaryClusterEnergy(0)
325 AliAnalysisEtMonteCarlo::~AliAnalysisEtMonteCarlo()
329 fPrimaryTree->Clear();
332 delete fHistDecayVertexNonRemovedCharged; // Decay vertex for non-removed charged particles
333 delete fHistDecayVertexRemovedCharged; // Decay vertex for non-removed charged particles
334 delete fHistDecayVertexNonRemovedNeutral; // Decay vertex for non-removed charged particles
335 delete fHistDecayVertexRemovedNeutral; // Decay vertex for non-removed charged particles
337 delete fHistRemovedOrNot; // If charged/neutral particles were removed or not
339 delete fHistEtNonRemovedProtons; // enter comment here
340 delete fHistEtNonRemovedAntiProtons; // enter comment here
341 delete fHistEtNonRemovedPiPlus; // enter comment here
342 delete fHistEtNonRemovedPiMinus; // enter comment here
343 delete fHistEtNonRemovedKaonPlus; // enter comment here
344 delete fHistEtNonRemovedKaonMinus; // enter comment here
345 delete fHistEtNonRemovedK0s; // enter comment here
346 delete fHistEtNonRemovedK0L; // enter comment here
347 delete fHistEtNonRemovedLambdas; // enter comment here
348 delete fHistEtNonRemovedElectrons; // enter comment here
349 delete fHistEtNonRemovedPositrons; // enter comment here
350 delete fHistEtNonRemovedMuPlus; // enter comment here
351 delete fHistEtNonRemovedMuMinus; // enter comment here
352 delete fHistEtNonRemovedNeutrons; // enter comment here
353 delete fHistEtNonRemovedAntiNeutrons; // enter comment here
354 delete fHistEtNonRemovedGammas; // enter comment here
355 delete fHistEtNonRemovedGammasFromPi0; // enter comment here
357 delete fHistEtRemovedGammas; // enter comment here
358 delete fHistEtRemovedNeutrons; // enter comment here
359 delete fHistEtRemovedAntiNeutrons; // enter comment here
362 delete fHistMultNonRemovedProtons; // enter comment here
363 delete fHistMultNonRemovedAntiProtons; // enter comment here
364 delete fHistMultNonRemovedPiPlus; // enter comment here
365 delete fHistMultNonRemovedPiMinus; // enter comment here
366 delete fHistMultNonRemovedKaonPlus; // enter comment here
367 delete fHistMultNonRemovedKaonMinus; // enter comment here
368 delete fHistMultNonRemovedK0s; // enter comment here
369 delete fHistMultNonRemovedK0L; // enter comment here
370 delete fHistMultNonRemovedLambdas; // enter comment here
371 delete fHistMultNonRemovedElectrons; // enter comment here
372 delete fHistMultNonRemovedPositrons; // enter comment here
373 delete fHistMultNonRemovedMuPlus; // enter comment here
374 delete fHistMultNonRemovedMuMinus; // enter comment here
375 delete fHistMultNonRemovedNeutrons; // enter comment here
376 delete fHistMultNonRemovedAntiNeutrons; // enter comment here
377 delete fHistMultNonRemovedGammas; // enter comment here
379 delete fHistMultRemovedGammas; // enter comment here
380 delete fHistMultRemovedNeutrons; // enter comment here
381 delete fHistMultRemovedAntiNeutrons; // enter comment here
383 delete fHistTrackMultvsNonRemovedCharged; // enter comment here
384 delete fHistTrackMultvsNonRemovedNeutral; // enter comment here
385 delete fHistTrackMultvsRemovedGamma; // enter comment here
387 delete fHistClusterMultvsNonRemovedCharged; // enter comment here
388 delete fHistClusterMultvsNonRemovedNeutral; // enter comment here
389 delete fHistClusterMultvsRemovedGamma; // enter comment here
391 delete fHistMultvsNonRemovedChargedE; // enter comment here
392 delete fHistMultvsNonRemovedNeutralE; // enter comment here
393 delete fHistMultvsRemovedGammaE; // enter comment here
394 delete fHistK0EDepositsVsPtInAcceptance;//enter comment here
395 delete fHistK0EGammaVsPtInAcceptance;//enter comment here
396 delete fHistK0EDepositsVsPtOutOfAcceptance;
397 delete fHistK0EGammaVsPtOutOfAcceptance;
399 delete fHistSimKaonsInAcceptance;
400 delete fHistSimK0SInAcceptance;
401 delete fHistSimKPlusInAcceptance;
402 delete fHistSimKMinusInAcceptance;
403 delete fHistSimK0LInAcceptance;
404 delete fHistSimKaonsOutOfAcceptance;
405 delete fHistSimKaonsInAcceptanceWithDepositsPrimaries;
406 delete fHistSimKaonsOutOfAcceptanceWithDepositsSecondaries;
407 delete fHistSimKaonsOutOfAcceptanceWithDepositsPrimaries;
409 delete fHistDxDzNonRemovedCharged; // enter comment here
410 delete fHistDxDzRemovedCharged; // enter comment here
411 delete fHistDxDzNonRemovedNeutral; // enter comment here
412 delete fHistDxDzRemovedNeutral; // enter comment here
414 delete fHistPiPlusMult; // enter comment here
415 delete fHistPiMinusMult; // enter comment here
416 delete fHistPiZeroMult; // enter comment here
418 delete fHistPiPlusMultAcc; // enter comment here
419 delete fHistPiMinusMultAcc; // enter comment here
420 delete fHistPiZeroMultAcc; // enter comment here
421 delete fHistGammasFound; // enter comment here
422 delete fHistGammasGenerated; // enter comment here
423 delete fHistGammasFoundOutOfAccCent; // enter comment here
424 delete fHistGammasFoundCent; // enter comment here
425 delete fHistGammasGeneratedCent; // enter comment here
426 delete fHistChargedTracksCut;
427 delete fHistChargedTracksAccepted;
428 delete fHistGammasCut;
429 delete fHistGammasAccepted;
430 delete fHistChargedTracksCutMult;
431 delete fHistChargedTracksAcceptedMult;
432 delete fHistChargedTracksAcceptedLowPtCent;
433 delete fHistChargedTracksAcceptedLowPtCent500MeV;
434 delete fHistChargedTracksAcceptedLowPtCentNoAntiProtons;
435 delete fHistChargedTracksAcceptedLowPtCentAntiProtons;
436 delete fHistGammasCutMult;
437 delete fHistGammasAcceptedMult;
438 delete fHistBadTrackMatches;
439 delete fHistMatchedTracksEvspTBkgd;
440 delete fHistMatchedTracksEvspTSignal;
441 delete fHistMatchedTracksEvspTBkgdPeripheral;
442 delete fHistMatchedTracksEvspTSignalPeripheral;
443 delete fHistMatchedTracksEvspTBkgdvsCent;
444 delete fHistMatchedTracksEvspTSignalvsCent;
445 delete fHistMatchedTracksEvspTBkgdvsCentEffCorr;
446 delete fHistMatchedTracksEvspTSignalvsCentEffCorr;
447 delete fHistChargedTracksCutPeripheral;
448 delete fHistChargedTracksAcceptedPeripheral;
449 delete fHistGammasCutPeripheral;
450 delete fHistGammasAcceptedPeripheral;
451 delete fHistBadTrackMatchesdPhidEta;
452 delete fHistGoodTrackMatchesdPhidEta;
453 delete fHistHadronDepositsAll;
454 delete fHistHadronDepositsReco;
455 delete fHistHadronDepositsAllCent;
456 delete fHistHadronDepositsAllCent500MeV;
457 delete fHistHadronDepositsRecoCent;
458 delete fHistHadronsAllCent;
459 delete fHistMultChVsSignalVsMult;
460 delete fHistNeutralRemovedSecondaryEtVsCent;
461 delete fHistChargedRemovedSecondaryEtVsCent;
462 delete fHistNeutralNotRemovedSecondaryEtVsCent;
463 delete fHistChargedNotRemovedSecondaryEtVsCent;
464 delete fHistNeutralRemovedSecondaryNumVsNCluster;
465 delete fHistChargedRemovedSecondaryNumVsNCluster;
466 delete fHistNeutralNotRemovedSecondaryNumVsNCluster;
467 delete fHistChargedNotRemovedSecondaryNumVsNCluster;
468 delete fHistNeutralRemovedSecondaryNumVsCent;
469 delete fHistChargedRemovedSecondaryNumVsCent;
470 delete fHistNeutralNotRemovedSecondaryNumVsCent;
471 delete fHistChargedNotRemovedSecondaryNumVsCent;
472 delete fHistNeutronsEtVsCent;
473 delete fHistNeutronsNumVsCent;
474 delete fHistNotNeutronsNumVsCent;
475 delete fHistPiKPDepositedVsNch;
476 delete fHistPiKPNotTrackMatchedDepositedVsNch;
477 delete fHistNeutronsDepositedVsNch;
478 delete fHistAntiNeutronsDepositedVsNch;
479 delete fHistProtonsDepositedVsNch;
480 delete fHistAntiProtonsDepositedVsNch;
481 delete fHistProtonsNotTrackMatchedDepositedVsNch;
482 delete fHistAntiProtonsNotTrackMatchedDepositedVsNch;
483 delete fHistSecondariesVsNch;
484 delete fHistSecondariesVsNcl;
485 delete fHistSecondariesEffCorrVsNch;
486 delete fHistSecondariesEffCorrVsNcl;
487 delete fHistSecondariesOutOfAccEffCorrVsNch;
488 delete fHistSecondariesDetectorCoverEffCorrVsNch;
489 delete fHistCentVsNchVsNcl;
490 //delete fHistSecondaryPositionInDetector;
491 delete fClusterPositionWeird;
492 //delete fHistSecondaryPositionInDetectorMultiple;
493 delete fSecondaryClusterEnergy;
496 Int_t AliAnalysisEtMonteCarlo::AnalyseEvent(AliVEvent* ev)
497 { // analyse MC event
507 fCentClass = fCentrality->GetCentralityClass5(fCentralityMethod);
511 // Get us an mc event
513 AliFatal("ERROR: Event does not exist");
516 AliMCEvent *event = dynamic_cast<AliMCEvent*>(ev);
518 AliFatal("ERROR: MC Event does not exist");
522 Double_t protonMass =fgProtonMass;
525 AliGenEventHeader* genHeader = event->GenEventHeader();
527 Printf("ERROR: Event generation header does not exist");
530 AliGenHijingEventHeader* hijingGenHeader = dynamic_cast<AliGenHijingEventHeader*>(genHeader);
531 if (hijingGenHeader) {
532 fImpactParameter = hijingGenHeader->ImpactParameter();
533 fNcoll = hijingGenHeader->HardScatters(); // or should this be some combination of NN() NNw() NwN() NwNw() ?
534 fNpart = hijingGenHeader->ProjectileParticipants() + hijingGenHeader->TargetParticipants();
537 // Let's play with the stack!
538 AliStack *stack = event->Stack();
540 Int_t nPrim = stack->GetNtrack();
543 for (Int_t iPart = 0; iPart < nPrim; iPart++)
546 TParticle *part = stack->Particle(iPart);
552 Printf("ERROR: Could not get particle %d", iPart);
555 TParticlePDG *pdg = part->GetPDG(0);
559 Printf("ERROR: Could not get particle PDG %d", iPart);
563 Double_t particleMassPart = 0; //The mass part in the Et calculation for this particle
564 Int_t code = pdg->PdgCode();
566 if(stack->IsPhysicalPrimary(iPart))
568 fTotPx += part->Px();
569 fTotPy += part->Py();
570 fTotPz += part->Pz();
573 // Check for reasonable (for now neutral and singly charged) charge on the particle
574 if (fSelector->IsNeutralMcParticle(iPart,*stack,*pdg))
578 // PrintFamilyTree(iPart, stack);
580 if (TMath::Abs(part->Eta()) < fCuts->GetCommonEtaCut())
582 //Printf("Particle with eta: %f, pid: %d", part->Eta(), code);
585 TMath::Abs(code) == fgProtonCode ||
586 TMath::Abs(code) == fgNeutronCode ||
587 TMath::Abs(code) == fgLambdaCode ||
588 TMath::Abs(code) == fgXiCode ||
589 TMath::Abs(code) == fgXi0Code ||
590 TMath::Abs(code) == fgOmegaCode
594 particleMassPart = - protonMass;
597 particleMassPart = protonMass;
600 Double_t et = part->Energy() * TMath::Sin(part->Theta()) + particleMassPart;
603 // // Fill up total E_T counters for each particle species
604 // if (code == fgProtonCode || code == fgAntiProtonCode)
607 // if (code == fgPiPlusCode || code == fgPiMinusCode)
609 // if (code == fgPiPlusCode)
616 // if (code == fgGammaCode)
619 // if (code == fgKPlusCode)
622 // if(code == fgKMinusCode)
625 // if (code == fgMuPlusCode || code == fgMuMinusCode)
628 // if (code == fgEPlusCode || code == fgEMinusCode)
631 // // some neutrals also
632 // if (code == fgNeutronCode)
635 // if (code == fgAntiNeutronCode)
638 // if (code == fgGammaCode)
643 //if (TMath::Abs(pdg->Charge() - fCuts->GetMonteCarloNeutralParticle()) <1e-3 )
645 if(code == fgGammaCode || code == fgPi0Code || code == fgEtaCode)
647 // PrintFamilyTree(iPart,stack);
648 //Printf("Gamma, phi: %f, eta: %f, phi cut min: %f, phi cut max: %f, eta cut: %f", part->Phi(), part->Eta(), fPhiMinCutAcc, fPhiMaxCutAcc, fEtaCutAcc);
649 //if (et > fCuts->GetCommonClusterEnergyCut()) fTotNeutralEt += et;
651 // inside EMCal acceptance
653 //if (TMath::Abs(part->Eta()) < fEtaCutAcc && part->Phi() < fPhiMaxCutAcc && part->Phi() > fPhiMinCutAcc)
655 if(fSelector->CutGeometricalAcceptance(*part) )
657 fNeutralMultiplicity++;
659 if(fSelector->PassMinEnergyCut(*part))
661 fTotNeutralEtAfterMinEnergyCut += et;
663 if (part->Energy() > 0.05) partCount++;
667 else if (TMath::Abs( pdg->Charge() - fCuts->GetMonteCarloNeutralParticle())>1e-3 )
670 // inside EMCal acceptance
671 if (fSelector->CutGeometricalAcceptance(*part))
674 fChargedMultiplicity++;
678 if (code == fgProtonCode || code == fgAntiProtonCode)
681 if (code == fgPiPlusCode || code == fgPiMinusCode)
684 if (code == fgKPlusCode || code == fgKMinusCode)
687 if (code == fgMuPlusCode || code == fgMuMinusCode)
691 if (code == fgEPlusCode || code == fgEMinusCode)
693 fTotNeutralEt += et; // calling electrons neutral
696 } // inside EMCal acceptance
698 if (TrackHitsCalorimeter(part)) // magnetic field info not filled?
700 if (pdg->Charge() > 0) fHistPhivsPtPos->Fill(part->Phi(),part->Pt());
701 else fHistPhivsPtNeg->Fill(part->Phi(), part->Pt());
708 // std::cout << "Total: p_x = " << fTotPx << ", p_y = " << fTotPy << ", p_z = " << fTotPz << std::endl;
709 fTotEt = fTotChargedEt + fTotNeutralEt;
710 //fTotEtAcc = fTotChargedEtAcc + fTotNeutralEtAcc;//
711 //std::cout << "Event done! # of particles: " << partCount << std::endl;
714 //Int_t AliAnalysisEtMonteCarlo::AnalyseEvent(AliMCEvent* mcEvent,AliESDEvent* realEvent)
715 Int_t AliAnalysisEtMonteCarlo::AnalyseEvent(AliVEvent* ev,AliVEvent* ev2)
716 { // analyse MC and real event info
717 //if(!mcEvent || !realEvent){
720 AliFatal("ERROR: Event does not exist");
723 AliAnalysisEt::AnalyseEvent(ev);
724 AliMCEvent *mcEvent = dynamic_cast<AliMCEvent*>(ev);
725 AliESDEvent *realEvent = dynamic_cast<AliESDEvent*>(ev2);
726 if (!mcEvent || !realEvent) {
727 AliFatal("ERROR: mcEvent or realEvent does not exist");
731 std::vector<Int_t> foundGammas;
733 fSelector->SetEvent(realEvent);
737 AliStack *stack = mcEvent->Stack();
739 // get all detector clusters
740 // TRefArray* caloClusters = new TRefArray();
742 // if (fDetector == fCuts->GetDetectorEmcal()) realEvent->GetEMCALClusters( caloClusters );
743 //else if (fDetector == fCuts->GetDetectorPhos()) realEvent->GetPHOSClusters( caloClusters );
745 //AliFatal("Detector ID has not been specified");
749 //Note that this only returns clusters for the selected detector. fSelector actually calls the right GetClusters... for the detector
750 //It does not apply any cuts on these clusters
751 TRefArray *caloClusters = fSelector->GetClusters();
753 Int_t nCluster = caloClusters->GetEntries();
754 fClusterMult = nCluster;
756 Int_t fClusterMultChargedTracks = 0;
757 Int_t fClusterMultGammas = 0;
758 Int_t nChargedSecondariesRemoved = 0;
759 Int_t nChargedSecondariesNotRemoved = 0;
760 Int_t nNeutralSecondariesRemoved = 0;
761 Int_t nNeutralSecondariesNotRemoved = 0;
763 Int_t nNotNeutrons = 0;
764 //All efficiency corrected except etSecondaries -->
765 Float_t etPiKPDeposited = 0.0;//
766 Float_t etPiKPDepositedNotTrackMatched = 0.0;//
767 Float_t etProtonDepositedNotTrackMatched = 0.0;//
768 Float_t etAntiProtonDepositedNotTrackMatched = 0.0;//
769 //Float_t etPIDProtonDepositedNotTrackMatched = 0.0;//Still has to be filled!
770 //1Float_t etPIDAntiProtonDepositedNotTrackMatched = 0.0;//Still has to be filled
771 Float_t etProtonDeposited = 0.0;//
772 Float_t etAntiProtonDeposited = 0.0;//
773 Float_t etNeutronDeposited = 0.0;
774 Float_t etAntiNeutronDeposited = 0.0;
775 Float_t etSecondaries = 0.0;
776 Float_t etSecondariesEffCorr = 0.0;
777 Float_t etSecondariesOutOfAccEffCorr = 0.0;
778 Float_t etSecondariesDetectorCoverEffCorr = 0.0;
779 Float_t multiplicity = fEsdtrackCutsTPC->GetReferenceMultiplicity(realEvent,kTRUE);
781 for (int iCluster = 0; iCluster < nCluster; iCluster++ )
784 AliESDCaloCluster* caloCluster = ( AliESDCaloCluster* )caloClusters->At( iCluster );
785 //Float_t caloE = caloCluster->E()
786 if (!fSelector->CutGeometricalAcceptance(*caloCluster)) continue;
788 //const UInt_t iPart = (UInt_t)TMath::Abs(fSelector->GetLabel(caloCluster));//->GetLabel());
789 const UInt_t iPart = fSelector->GetLabel(caloCluster,stack);
790 //const UInt_t iPart = (UInt_t)TMath::Abs(caloCluster->GetLabel());
791 TParticle *part = stack->Particle(iPart);
795 Printf("No MC particle %d", iCluster);
800 if (!stack->IsPhysicalPrimary(iPart)) // check whether particle is primary. we keep secondary electron and gamma for testing.
802 primIdx = GetPrimMother(iPart, stack);
803 if(primIdx != stack->GetPrimary(iPart))
805 //std::cout << primIdx << " = " << stack->GetPrimary(iPart) << std::endl;
806 //PrintFamilyTree(iPart, stack);
808 //if it is from a K0S
811 //std::cout << "What!? No primary?" << std::endl;
812 //PrintFamilyTree(iPart, stack);
814 //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.
818 } // end of primary particle check
819 //const int primCode = stack->Particle(primIdx)->GetPdgCode();
820 TParticlePDG *pdg = part->GetPDG();
823 Printf("ERROR: Could not get particle PDG %d", iPart);
827 //Int_t code = pdg->PdgCode();
828 // if(primCode == fgGammaCode)
833 Bool_t nottrackmatched = kTRUE;//default to no track matched
834 Float_t matchedTrackp = 0.0;
835 Float_t matchedTrackpt = 0.0;
836 nottrackmatched = fSelector->PassTrackMatchingCut(*caloCluster);
837 //by default ALL matched tracks are accepted, whether or not the match is good. So we check to see if the track is good.
838 if(!nottrackmatched){//if the track is trackmatched
839 Int_t trackMatchedIndex = caloCluster->GetTrackMatchedIndex();
840 if(trackMatchedIndex < 0) nottrackmatched=kTRUE;
841 AliESDtrack *track = realEvent->GetTrack(trackMatchedIndex);
842 matchedTrackp = track->P();
843 matchedTrackpt = track->Pt();
844 //if this is a good track, accept track will return true. The track matched is good, so not track matched is false
845 nottrackmatched = !(fEsdtrackCutsTPC->AcceptTrack(track));//if the track is bad, this is track matched
846 //if(!nottrackmatched) cout<<"Matched track p: "<<matchedTrackp<<" sim "<<part->P()<<endl;
850 for(UInt_t i = 0; i < caloCluster->GetNLabels(); i++)
852 Int_t pIdx = caloCluster->GetLabelAt(i);
854 //TParticle *p = stack->Particle(pIdx);
856 if(!stack->IsPhysicalPrimary(pIdx))
858 // PrintFamilyTree(pIdx, stack);
859 pIdx = GetPrimMother(pIdx, stack);
861 if(fSelector->PassDistanceToBadChannelCut(*caloCluster))//&&fSelector->CutGeometricalAcceptance(*(stack->Particle(primIdx))))
864 // std::cout << "Gamma primary: " << primIdx << std::endl;
865 // foundGammas.push_back(primIdx);
867 foundGammas.push_back(pIdx);
871 fCutFlow->Fill(cf++);
872 if(!fSelector->PassDistanceToBadChannelCut(*caloCluster)) continue;
873 Double_t clEt = CorrectForReconstructionEfficiency(*caloCluster,fCentClass);
874 // if(code == fgK0SCode) std::cout << "K0 energy: " << caloCluster->E() << std::endl;
875 if(!fSelector->PassMinEnergyCut(*caloCluster)) continue;
878 fCutFlow->Fill(cf++);
881 caloCluster->GetPosition(pos);
884 TParticle *primPart = stack->Particle(primIdx);
885 fPrimaryCode = primPart->GetPdgCode();
886 fPrimaryCharge = (Int_t) primPart->GetPDG()->Charge();
888 fPrimaryE = primPart->Energy();
889 fPrimaryEt = primPart->Energy()*TMath::Sin(primPart->Theta());
890 fPrimaryPx = primPart->Px();
891 fPrimaryPy = primPart->Py();
892 fPrimaryPz = primPart->Pz();
893 //cout<<"I have a cluster and it's good energy "<<caloCluster->E()<<" simulated "<<fPrimaryE<<endl;
894 fPrimaryVx = primPart->Vx();
895 fPrimaryVy = primPart->Vy();
896 fPrimaryVz = primPart->Vz();
898 fPrimaryAccepted = false;
899 fPrimaryMatched = false;
901 fDepositedCode = part->GetPdgCode();
902 fDepositedE = part->Energy();
903 fDepositedEt = part->Energy()*TMath::Sin(part->Theta());
904 fDepositedCharge = (Int_t) part->GetPDG()->Charge();
906 fDepositedVx = part->Vx();
907 fDepositedVy = part->Vy();
908 fDepositedVz = part->Vz();
909 fReconstructedE = caloCluster->E();
910 fReconstructedEt = caloCluster->E()*TMath::Sin(cp.Theta());
912 //fSecondary = fSelector->FromSecondaryInteraction(*primPart, *stack);
913 fSecondary =fSelector->FromSecondaryInteraction(*part, *stack);
914 //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
917 // //std::cout << "Have secondary!" << std::endl;
918 // //PrintFamilyTree(iPart, stack);
921 pdg = primPart->GetPDG(0);
922 //Int_t code = primPart->GetPdgCode();
924 Bool_t written = kFALSE;
926 // Bool_t nottrackmatched = kTRUE;//default to no track matched
927 // nottrackmatched = fSelector->PassTrackMatchingCut(*caloCluster);
928 // //by default ALL matched tracks are accepted, whether or not the match is good. So we check to see if the track is good.
929 // if(!nottrackmatched){
930 // Int_t trackMatchedIndex = caloCluster->GetTrackMatchedIndex();
931 // if(trackMatchedIndex < 0) nottrackmatched=kTRUE;
932 // AliESDtrack *track = realEvent->GetTrack(trackMatchedIndex);
933 // //if this is a good track, accept track will return true. The track matched is good, so not track matched is false
934 // nottrackmatched = !(fEsdtrackCutsTPC->AcceptTrack(track));
937 if(fSecondary){//all particles from secondary interactions
939 if(nottrackmatched){//secondaries not removed
940 // Float_t vtx = TMath::Sqrt( TMath::Power(part->Vx(),2) + TMath::Power(part->Vy(),2) + TMath::Power(part->Vz(),2) );
944 if(!fSelector->CutGeometricalAcceptance(*part)){
945 if(TMath::Sqrt(part->Vx() * part->Vx() + part->Vy() * part->Vy() + part->Vz()* part->Vz())>100){
946 // fClusterPositionWeird->Fill(cp.Phi(), cp.PseudoRapidity());
947 // //Principal arc tangent of x, in the interval [-pi/2,+pi/2] radians
948 // float phiVertex = TMath::ATan(part->Vy()/part->Vx());
949 // //PHOS acceptance is -0.222 pi to -0.555 pi
950 // //but tan(phi) = tan(phi+pi)
951 // if(part->Vx()<0) phiVertex + TMath::Pi();
952 // //maximum angular distance from PHOS
953 // float dphi1 = phiVertex +40.0/180.0*TMath::Pi();
954 // float dphi2 = phiVertex +100.0/180.0*TMath::Pi();
955 // float dphi = dphi1;
956 // if(TMath::Abs(dphi1)>TMath::Abs(dphi2)) dphi= dphi2;
957 // cout<<"DPhi: "<<dphi<<" phi "<<phiVertex<<" dphi1 "<<dphi1<<" dphi2 "<<dphi2<<endl;
958 // //cout<<"dphi "<<dphi1/TMath::Pi()<<"pi "<<dphi2/TMath::Pi()<<"pi phi "<<phiVertex/TMath::Pi()<<endl;
959 // PrintFamilyTree(iPart, stack);
960 //out of acceptance clusters
962 etSecondariesOutOfAccEffCorr += clEt;
966 if(TMath::Sqrt(part->Vx() * part->Vx() + part->Vy() * part->Vy() + part->Vz()* part->Vz())>430){
967 //clusters which are in the cover of the PHOS/EMCal
968 etSecondariesDetectorCoverEffCorr += clEt;
973 fSecondaryClusterEnergy->Fill(fReconstructedEt);
974 //if(fReconstructedEt>0.3){//patch to do quick cross check THIS SHOULD NOT GET COMMITTED!!! IF IT DID YELL AT CHRISTINE ASAP
975 // fHistSecondaryPositionInDetector->Fill(part->Vx(),part->Vy(),part->Vz());
976 // if(caloCluster->GetNLabels()>1){
977 // fHistSecondaryPositionInDetectorMultiple->Fill(part->Vx(),part->Vy(),part->Vz());
981 // //cout<<"Vtx "<<vtx<<endl;
982 // if(fPrimaryCode==fgProtonCode || fPrimaryCode==fgAntiProtonCode || fPrimaryCode==fgPiPlusCode || fPrimaryCode==fgPiMinusCode || fPrimaryCode==fgKPlusCode || fPrimaryCode==fgKMinusCode){
983 // cout<<"I think I am really a charged hadron!"<<endl;
985 // //PrintFamilyTree(iPart, stack);
987 fSecondaryNotRemoved++;
988 etSecondaries += fReconstructedEt;
989 etSecondariesEffCorr += clEt;
990 if (fDepositedCharge != 0){//charged track not removed
991 fChargedNotRemoved++;
992 fEnergyChargedNotRemoved += clEt;
993 fHistRemovedOrNot->Fill(2.0, fCentClass);
994 fHistDxDzNonRemovedCharged->Fill(caloCluster->GetTrackDx(), caloCluster->GetTrackDz());
995 fHistChargedNotRemovedSecondaryEtVsCent->Fill(fReconstructedEt,fCentClass);
996 nChargedSecondariesNotRemoved++;
999 fHistNeutralNotRemovedSecondaryEtVsCent->Fill(fReconstructedEt,fCentClass);
1000 nNeutralSecondariesNotRemoved++;
1003 else{//secondaries removed
1004 if (fDepositedCharge != 0){
1006 fEnergyChargedRemoved += clEt;
1007 fHistRemovedOrNot->Fill(0.0, fCentClass);
1008 fHistDxDzRemovedCharged->Fill(caloCluster->GetTrackDx(), caloCluster->GetTrackDz());
1009 fHistChargedRemovedSecondaryEtVsCent->Fill(fReconstructedEt,fCentClass);
1010 nChargedSecondariesRemoved++;
1011 fHistChargedTracksCut->Fill(fDepositedEt);
1012 if(fCalcTrackMatchVsMult){
1013 fHistChargedTracksCutMult->Fill(fDepositedEt,fClusterMult);
1014 if(fClusterMult<25){fHistChargedTracksCutPeripheral->Fill(fDepositedEt);}
1016 fHistMatchedTracksEvspTBkgd->Fill(matchedTrackp,fReconstructedE);
1017 if(fCalcTrackMatchVsMult){
1018 if(fClusterMult<25){fHistMatchedTracksEvspTBkgdPeripheral->Fill(matchedTrackp,fReconstructedEt);}
1019 fHistMatchedTracksEvspTBkgdvsCent->Fill(matchedTrackp,fReconstructedEt, fCentClass);
1020 fHistMatchedTracksEvspTBkgdvsCentEffCorr->Fill(matchedTrackp,clEt, fCentClass);//Fill with the efficiency corrected energy
1022 //Int_t trackindex = (caloCluster->GetLabelsArray())->At(1);
1023 UInt_t trackindex = fSelector->GetLabel(caloCluster,stack);//(caloCluster->GetLabelsArray())->At(1);
1024 if(((UInt_t)caloCluster->GetLabel())!=trackindex){
1025 //if(fSelector->GetLabel(caloCluster,stack) !=trackindex){
1026 fHistBadTrackMatches->Fill(part->Pt(),fReconstructedE);
1027 fHistBadTrackMatchesdPhidEta->Fill(caloCluster->GetTrackDx(),caloCluster->GetTrackDz());
1028 //cout<<"Track matched, label cluster "<<caloCluster->GetLabel()<<" track "<<trackindex<<endl;
1031 fHistGoodTrackMatchesdPhidEta->Fill(caloCluster->GetTrackDx(),caloCluster->GetTrackDz());
1034 else{//neutral energy removed
1036 fEnergyNeutralRemoved += clEt;
1037 fHistRemovedOrNot->Fill(1.0, fCentClass);
1038 fHistDxDzRemovedNeutral->Fill(caloCluster->GetTrackDx(), caloCluster->GetTrackDz());
1039 fHistNeutralRemovedSecondaryEtVsCent->Fill(fReconstructedEt,fCentClass);
1041 nNeutralSecondariesRemoved++;
1045 else{//not a secondary
1047 if (fDepositedCharge != 0 && fDepositedCode!=fgEMinusCode && fDepositedCode!=fgEPlusCode){//if the particle hitting the calorimeter is pi/k/p/mu
1049 fClusterMultChargedTracks++;
1050 etPiKPDeposited += clEt;
1051 if(fDepositedCode==fgProtonCode){
1052 etProtonDeposited += clEt;
1054 if(fDepositedCode==fgAntiProtonCode){
1055 etAntiProtonDeposited += clEt;
1057 if(nottrackmatched){//not removed but should be
1058 etPiKPDepositedNotTrackMatched += clEt;
1059 if(fDepositedCode==fgProtonCode){
1060 etProtonDepositedNotTrackMatched += clEt;
1062 if(fDepositedCode==fgAntiProtonCode){
1063 etAntiProtonDepositedNotTrackMatched += clEt;
1065 fHistHadronDepositsAll->Fill(part->Pt());
1066 fHistHadronDepositsAllCent->Fill(part->Pt(), fCentClass);
1067 if(fReconstructedEt>0.5) fHistHadronDepositsAllCent500MeV->Fill(part->Pt(), fCentClass);
1068 fChargedNotRemoved++;
1069 fEnergyChargedNotRemoved += clEt;
1070 fHistRemovedOrNot->Fill(2.0, fCentClass);
1071 fHistDxDzNonRemovedCharged->Fill(caloCluster->GetTrackDx(), caloCluster->GetTrackDz());
1072 fHistChargedTracksAccepted->Fill(fDepositedEt);
1073 if(fCalcTrackMatchVsMult){
1074 if(matchedTrackpt<0.5){//if we could never have matched this because of its pt, how much energy did it deposit?
1075 fHistChargedTracksAcceptedLowPtCent->Fill(fDepositedEt, fCentClass);
1076 if(fDepositedEt>=0.5) fHistChargedTracksAcceptedLowPtCent500MeV->Fill(fDepositedEt, fCentClass);
1077 if(pdg->PdgCode()!=fgAntiProtonCode){
1078 fHistChargedTracksAcceptedLowPtCentNoAntiProtons->Fill(fDepositedEt, fCentClass);
1081 fHistChargedTracksAcceptedLowPtCentAntiProtons->Fill(fDepositedEt, fCentClass);
1084 fHistChargedTracksAcceptedMult->Fill(fDepositedEt,fClusterMult);
1085 if(fClusterMult<25){fHistChargedTracksAcceptedPeripheral->Fill(fDepositedEt);}
1088 else{//removed and should have been
1089 Int_t trackindex = fSelector->GetLabel(caloCluster,stack);// (caloCluster->GetLabelsArray())->At(0);
1090 fHistHadronDepositsReco->Fill(part->Pt());
1091 fHistHadronDepositsRecoCent->Fill(part->Pt(), fCentClass);
1092 fHistHadronDepositsAll->Fill(part->Pt());
1093 fHistHadronDepositsAllCent->Fill(part->Pt(), fCentClass);
1094 if(fReconstructedEt>0.5) fHistHadronDepositsAllCent500MeV->Fill(part->Pt(), fCentClass);
1095 if(caloCluster->GetLabel()!=trackindex){
1096 fHistBadTrackMatches->Fill(part->Pt(),fReconstructedE);
1097 fHistBadTrackMatchesdPhidEta->Fill(caloCluster->GetTrackDx(),caloCluster->GetTrackDz());
1098 //cout<<"Track matched, label cluster "<<caloCluster->GetLabel()<<" track "<<trackindex<<endl;
1101 fHistGoodTrackMatchesdPhidEta->Fill(caloCluster->GetTrackDx(),caloCluster->GetTrackDz());
1104 fEnergyChargedRemoved += clEt;
1105 fHistRemovedOrNot->Fill(0.0, fCentClass);
1106 fHistDxDzRemovedCharged->Fill(caloCluster->GetTrackDx(), caloCluster->GetTrackDz());
1107 fHistChargedTracksCut->Fill(fDepositedEt);
1108 if(fCalcTrackMatchVsMult){
1109 fHistChargedTracksCutMult->Fill(fDepositedEt,fClusterMult);
1110 if(fClusterMult<25){fHistChargedTracksCutPeripheral->Fill(fDepositedEt);}
1112 fHistMatchedTracksEvspTBkgd->Fill(matchedTrackp,fReconstructedE);
1113 if(fCalcTrackMatchVsMult){
1114 if(fClusterMult<25){fHistMatchedTracksEvspTBkgdPeripheral->Fill(matchedTrackp,fReconstructedEt);}
1115 fHistMatchedTracksEvspTBkgdvsCent->Fill(matchedTrackp,fReconstructedEt, fCentClass);
1116 fHistMatchedTracksEvspTBkgdvsCentEffCorr->Fill(matchedTrackp,clEt, fCentClass);//fill with the efficiency corrected energy
1120 //K0L and any neutral particles from the decay of K+/- or K0S
1121 if(!written && (fPrimaryCode==fgKPlusCode || fPrimaryCode==fgKMinusCode || fPrimaryCode==fgK0SCode ||fPrimaryCode==fgK0LCode)){
1122 written = kTRUE;//At this point we are not tracking them but we don't count them as neutrals accidentally removed
1125 if(!written && (fDepositedCode==fgGammaCode || fDepositedCode==fgEMinusCode || fDepositedCode ==fgEPlusCode)){//if the particle hitting the calorimeter is gamma, electron and not from a kaon
1126 fClusterMultGammas++;
1128 if(nottrackmatched){//Not removed and not supposed to be removed - signal
1129 fEtNonRemovedGammas += clEt;
1130 fMultNonRemovedGammas++;
1131 fNeutralNotRemoved--;
1132 fEnergyNeutralNotRemoved -= clEt;
1133 fHistGammasAccepted->Fill(fDepositedEt);
1134 if(fCalcTrackMatchVsMult){
1135 fHistGammasAcceptedMult->Fill(fDepositedEt,fClusterMult);
1136 if(fClusterMult<25){fHistGammasAcceptedPeripheral->Fill(fDepositedEt);}
1139 else{//removed but shouldn't have been
1140 Int_t trackindex = fSelector->GetLabel(caloCluster,stack);// (caloCluster->GetLabelsArray())->At(1);
1141 if(caloCluster->GetLabel()!=trackindex){
1142 fHistBadTrackMatches->Fill(part->Pt(),fReconstructedE);
1143 fHistBadTrackMatchesdPhidEta->Fill(caloCluster->GetTrackDx(),caloCluster->GetTrackDz());
1144 // cout<<"Track matched, label cluster "<<caloCluster->GetLabel()<<" track "<<trackindex<<endl;
1145 // PrintFamilyTree(trackindex, stack);
1146 // cout<<"Cluster"<<endl;
1149 fGammaRemovedEt+=clEt;
1150 fHistGammasCut->Fill(fDepositedEt);
1151 if(fCalcTrackMatchVsMult){
1152 fHistGammasCutMult->Fill(fDepositedEt,fClusterMult);
1153 if(fClusterMult<25){fHistGammasCutPeripheral->Fill(fDepositedEt);}
1155 fHistMatchedTracksEvspTSignal->Fill(matchedTrackp,fReconstructedE);
1156 if(fCalcTrackMatchVsMult){
1157 if(fClusterMult<25){fHistMatchedTracksEvspTSignalPeripheral->Fill(matchedTrackp,fReconstructedEt);}
1158 fHistMatchedTracksEvspTSignalvsCent->Fill(matchedTrackp,fReconstructedEt, fCentClass);
1159 fHistMatchedTracksEvspTSignalvsCentEffCorr->Fill(matchedTrackp,clEt, fCentClass);
1163 //all other cases - neutron, anti-neutron, not aware of other cases
1165 fNeutralNotRemoved++;
1166 fEnergyNeutralNotRemoved += clEt;//this is the efficiency corrected energy
1167 fHistRemovedOrNot->Fill(3.0, fCentClass);
1168 if (fDepositedCode == fgNeutronCode || fDepositedCode == fgAntiNeutronCode){
1169 fHistDxDzNonRemovedNeutral->Fill(caloCluster->GetTrackDx(), caloCluster->GetTrackDz());
1170 fHistNeutronsEtVsCent->Fill(clEt,fCentClass);
1172 if(fDepositedCode == fgNeutronCode){
1173 etNeutronDeposited += clEt;
1175 if(fDepositedCode == fgAntiNeutronCode){
1176 etAntiNeutronDeposited += clEt;
1179 //if(fDepositedCode == fgAntiNeutronCode) cout<<"n anti-";
1181 //cout<<"neutron!! pt "<<part->Pt()<<" eta "<<part->Eta()<<" phi "<<part->Phi()<<" Et "<<clEt<<endl;
1182 //PrintFamilyTree(iPart, stack);
1187 // if(fDepositedCode == fgAntiNeutronCode) cout<<"n anti-";
1189 // cout<<"neutron!! pt "<<part->Pt()<<" eta "<<part->Eta()<<" phi "<<part->Phi()<<" Et "<<clEt<<endl;
1190 // PrintFamilyTree(iPart, stack);
1191 // cout<<"I am not a neutron!!"<<endl;
1192 // PrintFamilyTree(iPart, stack);
1196 fPrimaryTree->Fill();
1197 } // end of loop over clusters
1198 fHistPiKPNotTrackMatchedDepositedVsNch->Fill(etPiKPDepositedNotTrackMatched,multiplicity);
1199 fHistPiKPDepositedVsNch->Fill(etPiKPDeposited,multiplicity);
1200 fHistNeutronsDepositedVsNch->Fill(etNeutronDeposited,multiplicity);
1201 fHistAntiNeutronsDepositedVsNch->Fill(etAntiNeutronDeposited,multiplicity);
1202 fHistProtonsDepositedVsNch->Fill(etProtonDeposited,multiplicity);
1203 fHistAntiProtonsDepositedVsNch->Fill(etAntiProtonDeposited,multiplicity);
1204 fHistProtonsNotTrackMatchedDepositedVsNch->Fill(etProtonDepositedNotTrackMatched,multiplicity);
1205 fHistAntiProtonsNotTrackMatchedDepositedVsNch->Fill(etAntiProtonDepositedNotTrackMatched,multiplicity);
1206 fHistSecondariesVsNch->Fill(etSecondaries,multiplicity);
1207 fHistSecondariesVsNcl->Fill(etSecondaries,fNClusters);
1208 fHistSecondariesEffCorrVsNch->Fill(etSecondariesEffCorr,multiplicity);
1209 fHistSecondariesEffCorrVsNcl->Fill(etSecondariesEffCorr,fNClusters);
1210 fHistSecondariesOutOfAccEffCorrVsNch->Fill(etSecondariesOutOfAccEffCorr,multiplicity);
1211 fHistSecondariesDetectorCoverEffCorrVsNch->Fill(etSecondariesDetectorCoverEffCorr,multiplicity);
1212 fHistCentVsNchVsNcl->Fill(fCentClass,multiplicity, fNClusters);
1214 fHistNeutronsNumVsCent->Fill(nNeutrons,fCentClass);
1215 fHistNotNeutronsNumVsCent->Fill(nNotNeutrons,fCentClass);
1217 std::sort(foundGammas.begin(), foundGammas.end());
1218 for (Int_t iPart = 0; iPart < stack->GetNtrack(); iPart++)
1221 if(!stack->IsPhysicalPrimary(iPart)) continue;
1223 TParticle *part = stack->Particle(iPart);
1227 Printf("ERROR: Could not get particle %d", iPart);
1230 TParticlePDG *pdg = part->GetPDG(0);
1234 Printf("ERROR: Could not get particle PDG %d", iPart);
1238 if(pdg->PdgCode()==fgGammaCode)// TMath::Abs(part->Eta()) < 0.12)
1240 if(fSelector->CutGeometricalAcceptance(*part)){
1241 fHistGammasGenerated->Fill(part->Energy());
1242 fHistGammasGeneratedCent->Fill(part->Energy(),fCentClass);
1244 if(std::binary_search(foundGammas.begin(),foundGammas.end(),iPart))
1246 if(!fSelector->CutGeometricalAcceptance(*part)){
1247 //cout<<"Gamma NOT in acceptance"<<endl;
1248 fHistGammasFoundOutOfAccCent->Fill(part->Energy(),fCentClass);
1251 fHistGammasFound->Fill(part->Energy());
1252 fHistGammasFoundCent->Fill(part->Energy(),fCentClass);
1253 //cout<<"Gamma IN acceptance"<<endl;
1257 if(pdg->PdgCode()==fgPiPlusCode || pdg->PdgCode()==fgPiMinusCode || pdg->PdgCode()==fgProtonCode || pdg->PdgCode()==fgAntiProtonCode){//section here for all hadrons generated
1258 fHistHadronsAllCent->Fill(part->Pt(), fCentClass);
1263 if(fCalcForKaonCorrection){
1264 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};
1266 //loop over simulated particles in order to find K0S
1267 for (Int_t iPart = 0; iPart < stack->GetNtrack(); iPart++){
1268 TParticle *part = stack->Particle(iPart);
1270 //Printf("ERROR: Could not get particle %d", iPart);
1273 TParticlePDG *pdg = part->GetPDG(0);
1275 //Printf("ERROR: Could not get particle PDG %d", iPart);
1278 //if(stack->IsPhysicalPrimary(iPart)){//if it is a K0 it might have decayed into four pions
1279 //fgK0SCode, fgGammaCode, fgPi0Code
1280 Int_t code = pdg->PdgCode();
1281 if(code == fgK0SCode || code==fgKPlusCode || code==fgKMinusCode ||code==fgK0LCode || code==fgK0Code){//this is a kaon
1282 //cout<<"I am a kaon too! "<<stack->Particle(iPart)->GetName()<<" "<<code<<endl;
1283 Float_t pTk = stack->Particle(iPart)->Pt();
1284 if(TMath::Abs(stack->Particle(iPart)->Y())<0.5 && stack->IsPhysicalPrimary(iPart)){//these are particles which would be included in our spectra measurements
1285 fHistSimKaonsInAcceptance->Fill(pTk);
1286 if(code == fgK0SCode){fHistSimK0SInAcceptance->Fill(pTk);}
1287 if(code == fgK0LCode){fHistSimK0LInAcceptance->Fill(pTk);}
1288 if(code == fgKPlusCode){fHistSimKPlusInAcceptance->Fill(pTk);}
1289 if(code == fgKMinusCode){fHistSimKMinusInAcceptance->Fill(pTk);}
1290 if(code == fgK0Code){//Split K0's between the two
1291 fHistSimK0SInAcceptance->Fill(pTk,0.5);
1292 fHistSimK0LInAcceptance->Fill(pTk,0.5);
1296 fHistSimKaonsOutOfAcceptance->Fill(pTk);
1297 // if(!stack->IsPhysicalPrimary(iPart)){
1298 // PrintFamilyTree(iPart, stack);
1301 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};
1302 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};
1303 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...
1304 AliESDCaloCluster* caloCluster = ( AliESDCaloCluster* )caloClusters->At( iCluster );
1305 if (!fSelector->CutGeometricalAcceptance(*caloCluster)) continue;
1306 const Int_t myPart = fSelector->GetLabel(caloCluster,stack);
1307 //const Int_t myPart = TMath::Abs(caloCluster->GetLabel());
1308 //identify the primary particle which created this cluster
1309 int primIdx = myPart;
1310 if (!stack->IsPhysicalPrimary(myPart)){
1311 primIdx = GetPrimMother(iPart, stack);
1312 } // end of primary particle check
1313 TParticle *hitPart = stack->Particle(myPart);
1314 Bool_t hitsAsChargedKaon = kFALSE;
1315 if(hitPart->GetPdgCode()== fgKPlusCode || hitPart->GetPdgCode()== fgKPlusCode){
1316 if(myPart==primIdx){
1317 //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!
1318 hitsAsChargedKaon = kTRUE;
1319 //cout<<"Found primary charged kaon cluster!"<<endl;
1322 if(primIdx==iPart && primIdx>0 && !hitsAsChargedKaon){//This cluster is from our primary particle and our primary particle is a kaon
1323 //cout<<"I have a particle match! prim code"<<code<<" id "<<primIdx <<endl;
1325 caloCluster->GetPosition(pos);
1327 Double_t clEt = caloCluster->E()*TMath::Sin(cp.Theta());
1328 Double_t clEtCorr = CorrectForReconstructionEfficiency(*caloCluster,fCentClass);
1329 for(int l=0;l<nEtCuts;l++){//loop over cut values
1330 if(clEt>=etCuts[l]){
1331 //cout<<", "<<clEt<<">="<<etCuts[l];
1332 totalClusterEts[l] += clEtCorr;//if cluster et is above the cut off energy add it
1333 totalGammaEts[l] += clEt;//if cluster et is above the cut off energy add it
1338 // cout<<"Deposits: pT: "<<pTk;
1339 // for(int l=0;l<nEtCuts;l++){//loop over cut values
1340 // cout<<" "<<totalClusterEts[l];
1343 if(TMath::Abs(stack->Particle(iPart)->Y())<0.5 && stack->IsPhysicalPrimary(iPart)){//within the acceptance of our spectra and is a primary particle
1344 if(totalClusterEts[0]>0.0){fHistSimKaonsInAcceptanceWithDepositsPrimaries->Fill(pTk);}
1345 //cout<<"I have a particle match! prim code"<<code<<" id "<<iPart <<endl;
1346 for(int l=0;l<nEtCuts;l++){
1347 fHistK0EDepositsVsPtInAcceptance->Fill(pTk,totalClusterEts[l],etCuts[l]+0.001);
1348 fHistK0EGammaVsPtInAcceptance->Fill(pTk,totalGammaEts[l],etCuts[l]+0.001);
1351 else{//outside the acceptance of our spectra
1352 if(totalClusterEts[0]>0.0){
1353 if(stack->IsPhysicalPrimary(iPart)){fHistSimKaonsOutOfAcceptanceWithDepositsPrimaries->Fill(pTk);}
1354 else{fHistSimKaonsOutOfAcceptanceWithDepositsSecondaries->Fill(pTk);}
1356 for(int l=0;l<nEtCuts;l++){
1357 fHistK0EDepositsVsPtOutOfAcceptance->Fill(pTk,totalClusterEts[l],etCuts[l]+0.001);
1358 fHistK0EGammaVsPtOutOfAcceptance->Fill(pTk,totalGammaEts[l],etCuts[l]+0.001);
1365 fHistMultChVsSignalVsMult->Fill(fClusterMultChargedTracks,fClusterMultGammas,fNClusters);
1366 fHistNeutralRemovedSecondaryNumVsNCluster->Fill(nNeutralSecondariesRemoved,fNClusters);
1367 fHistChargedRemovedSecondaryNumVsNCluster->Fill(nChargedSecondariesRemoved,fNClusters);
1368 fHistNeutralNotRemovedSecondaryNumVsNCluster->Fill(nNeutralSecondariesNotRemoved,fNClusters);
1369 fHistChargedNotRemovedSecondaryNumVsNCluster->Fill(nChargedSecondariesNotRemoved,fNClusters);
1370 fHistNeutralRemovedSecondaryNumVsCent->Fill(nNeutralSecondariesRemoved,fCentClass);
1371 fHistChargedRemovedSecondaryNumVsCent->Fill(nChargedSecondariesRemoved,fCentClass);
1372 fHistNeutralNotRemovedSecondaryNumVsCent->Fill(nNeutralSecondariesNotRemoved,fCentClass);
1373 fHistChargedNotRemovedSecondaryNumVsCent->Fill(nChargedSecondariesNotRemoved,fCentClass);
1374 //cout<<"Secondaries not removed: "<<fSecondaryNotRemoved<<" neutral secondaries not removed "<<nNeutralSecondariesNotRemoved<<" cluster mult "<<fClusterMult<<endl;
1379 void AliAnalysisEtMonteCarlo::Init()
1381 AliAnalysisEt::Init();
1384 void AliAnalysisEtMonteCarlo::ResetEventValues()
1385 { // reset event values
1386 AliAnalysisEt::ResetEventValues();
1389 fTotEtSecondary = 0;
1390 fTotEtSecondaryFromEmEtPrimary = 0;
1391 fTotEtWithSecondaryRemoved = 0;
1393 // collision geometry defaults for p+p:
1394 fImpactParameter = 0;
1398 fEtNonRemovedProtons = 0;
1399 fEtNonRemovedAntiProtons = 0;
1400 fEtNonRemovedPiPlus = 0;
1401 fEtNonRemovedPiMinus = 0;
1402 fEtNonRemovedKaonPlus = 0;
1403 fEtNonRemovedKaonMinus = 0;
1404 fEtNonRemovedK0S = 0;
1405 fEtNonRemovedK0L = 0;
1406 fEtNonRemovedLambdas = 0;
1407 fEtNonRemovedElectrons = 0;
1408 fEtNonRemovedPositrons = 0;
1409 fEtNonRemovedMuPlus = 0;
1410 fEtNonRemovedMuMinus = 0;
1411 fEtNonRemovedNeutrons = 0;
1412 fEtNonRemovedAntiNeutrons = 0;
1413 fEtNonRemovedGammas = 0;
1414 fEtNonRemovedGammasFromPi0 = 0;
1416 fEtRemovedProtons = 0;
1417 fEtRemovedAntiProtons = 0;
1418 fEtRemovedPiPlus = 0;
1419 fEtRemovedPiMinus = 0;
1420 fEtRemovedKaonPlus = 0;
1421 fEtRemovedKaonMinus = 0;
1424 fEtRemovedLambdas = 0;
1425 fEtRemovedElectrons = 0;
1426 fEtRemovedPositrons = 0;
1427 fEtRemovedMuPlus = 0;
1428 fEtRemovedMuMinus = 0;
1429 fEtRemovedNeutrons = 0;
1431 fEtRemovedGammasFromPi0 = 0;
1432 fEtRemovedGammas = 0;
1433 fEtRemovedNeutrons = 0;
1434 fEtRemovedAntiNeutrons = 0;
1436 fMultNonRemovedProtons = 0;
1437 fMultNonRemovedAntiProtons = 0;
1438 fMultNonRemovedPiPlus = 0;
1439 fMultNonRemovedPiMinus = 0;
1440 fMultNonRemovedKaonPlus = 0;
1441 fMultNonRemovedKaonMinus = 0;
1442 fMultNonRemovedK0s = 0;
1443 fMultNonRemovedK0L = 0;
1444 fMultNonRemovedLambdas = 0;
1445 fMultNonRemovedElectrons = 0;
1446 fMultNonRemovedPositrons = 0;
1447 fMultNonRemovedMuPlus = 0;
1448 fMultNonRemovedMuMinus = 0;
1449 fMultNonRemovedNeutrons = 0;
1450 fMultNonRemovedAntiNeutrons = 0;
1451 fMultNonRemovedGammas = 0;
1453 fMultRemovedProtons = 0;
1454 fMultRemovedAntiProtons = 0;
1455 fMultRemovedPiPlus = 0;
1456 fMultRemovedPiMinus = 0;
1457 fMultRemovedKaonPlus = 0;
1458 fMultRemovedKaonMinus = 0;
1459 fMultRemovedK0s = 0;
1460 fMultRemovedK0L = 0;
1461 fMultRemovedLambdas = 0;
1462 fMultRemovedElectrons = 0;
1463 fMultRemovedPositrons = 0;
1464 fMultRemovedMuPlus = 0;
1465 fMultRemovedMuMinus = 0;
1467 fMultRemovedGammas = 0;
1468 fMultRemovedNeutrons = 0;
1469 fMultRemovedAntiNeutrons = 0;
1471 fEnergyChargedNotRemoved = 0;
1472 fEnergyChargedRemoved = 0;
1473 fEnergyNeutralNotRemoved = 0;
1474 fEnergyNeutralRemoved = 0;
1476 fChargedNotRemoved = 0;
1477 fChargedRemoved = 0;
1478 fNeutralNotRemoved = 0;
1479 fNeutralRemoved = 0;
1481 fSecondaryNotRemoved = 0;
1483 fTrackMultInAcc = 0;
1485 fTotNeutralEtAfterMinEnergyCut = 0;
1487 fSecondaryNotRemoved = 0;
1496 void AliAnalysisEtMonteCarlo::CreateHistograms()
1497 { // histogram related additions
1498 AliAnalysisEt::CreateHistograms();
1500 if (fEventSummaryTree) {
1501 fEventSummaryTree->Branch("fImpactParameter",&fImpactParameter,"fImpactParameter/D");
1502 fEventSummaryTree->Branch("fNcoll",&fNcoll,"fNcoll/I");
1503 fEventSummaryTree->Branch("fNpart",&fNpart,"fNpart/I");
1504 fEventSummaryTree->Branch("fTotEtWithSecondaryRemoved", &fTotEtWithSecondaryRemoved, "fTotEtWithSecondaryRemoved/D");
1505 fEventSummaryTree->Branch("fTotEtSecondaryFromEmEtPrimary", &fTotEtSecondaryFromEmEtPrimary, "fTotEtSecondaryFromEmEtPrimary/D");
1506 fEventSummaryTree->Branch("fTotEtSecondary", &fTotEtSecondary, "fTotEtSecondary/D");
1507 fEventSummaryTree->Branch("fTotNeutralEtAfterMinEnergyCut", &fTotNeutralEtAfterMinEnergyCut, "fTotNeutralEtAfterMinEnergyCut/D");
1508 fEventSummaryTree->Branch("fSecondaryNotRemoved", &fSecondaryNotRemoved, "fSecondaryNotRemoved/I");
1509 fEventSummaryTree->Branch("fChargedNotRemoved", &fChargedNotRemoved, "fChargedNotRemoved/I");
1510 fEventSummaryTree->Branch("fNeutralNotRemoved", &fNeutralNotRemoved, "fNeutralNotRemoved/I");
1511 fEventSummaryTree->Branch("fChargedRemoved", &fChargedRemoved, "fChargedRemoved/I");
1512 fEventSummaryTree->Branch("fNeutralRemoved", &fNeutralRemoved, "fNeutralRemoved/I");
1513 fEventSummaryTree->Branch("fGammaRemoved", &fGammaRemoved, "fGammaRemoved/I");
1514 fEventSummaryTree->Branch("fTotPx", &fTotPx, "fTotPx/D");
1515 fEventSummaryTree->Branch("fTotPy", &fTotPy, "fTotPy/D");
1516 fEventSummaryTree->Branch("fTotPz", &fTotPz, "fTotPz/D");
1517 // fEventSummaryTree->Branch("f
1520 //fHistDecayVertexNonRemovedCharged = new TH3F("fHistDecayVertexNonRemovedCharged","fHistDecayVertexNonRemovedCharged", 500, -470, 30, 500, -300, 300, 40, -20, 20);
1521 //fHistDecayVertexRemovedCharged = new TH3F("fHistDecayVertexRemovedCharged","fHistDecayVertexRemovedCharged", 500, -470, 30, 500, -300, 300, 40, -20, 20);
1522 //fHistDecayVertexNonRemovedNeutral = new TH3F("fHistDecayVertexNonRemovedNeutral","fHistDecayVertexNonRemovedNeutral", 500, -470, 30, 500, -300, 300, 40, -20, 20);
1523 //fHistDecayVertexRemovedNeutral = new TH3F("fHistDecayVertexRemovedNeutral","fHistDecayVertexRemovedNeutral", 500, -470, 30, 500, -300, 300, 40, -20, 20);
1525 fHistRemovedOrNot = new TH2F("fHistRemovedOrNot", "fHistRemovedOrNot", 4, -0.5, 3.5, 10, -0.5, 9.5);
1527 fHistEtNonRemovedProtons = new TH2F("fHistEtNonRemovedProtons", "fHistEtNonRemovedProtons", 1500, 0, 30, 10, -0.5, 9.5);
1528 fHistEtNonRemovedAntiProtons = new TH2F("fHistEtNonRemovedAntiProtons", "fHistEtNonRemovedAntiProtons", 1500, 0, 30, 10, -0.5, 9.5);
1529 fHistEtNonRemovedPiPlus = new TH2F("fHistEtNonRemovedPiPlus", "fHistEtNonRemovedPiPlus", 1500, 0, 30, 10, -0.5, 9.5);
1530 fHistEtNonRemovedPiMinus = new TH2F("fHistEtNonRemovedPiMinus", "fHistEtNonRemovedPiMinus", 1500, 0, 30, 10, -0.5, 9.5);
1531 fHistEtNonRemovedKaonPlus = new TH2F("fHistEtNonRemovedKaonPlus", "fHistEtNonRemovedKaonPlus", 1500, 0, 30, 10, -0.5, 9.5);
1532 fHistEtNonRemovedKaonMinus = new TH2F("fHistEtNonRemovedKaonMinus", "fHistEtNonRemovedKaonMinus", 1500, 0, 30, 10, -0.5, 9.5);
1533 fHistEtNonRemovedK0s = new TH2F("fHistEtNonRemovedK0s", "fHistEtNonRemovedK0s", 1500, 0, 30, 10, -0.5, 9.5);
1534 fHistEtNonRemovedK0L = new TH2F("fHistEtNonRemovedK0L", "fHistEtNonRemovedK0L", 1500, 0, 30, 10, -0.5, 9.5);
1535 fHistEtNonRemovedLambdas = new TH2F("fHistEtNonRemovedLambdas", "fHistEtNonRemovedLambdas", 1500, 0, 30, 10, -0.5, 9.5);
1536 fHistEtNonRemovedElectrons = new TH2F("fHistEtNonRemovedElectrons", "fHistEtNonRemovedElectrons", 1500, 0, 30, 10, -0.5, 9.5);
1537 fHistEtNonRemovedPositrons = new TH2F("fHistEtNonRemovedPositrons", "fHistEtNonRemovedPositrons", 1500, 0, 30, 10, -0.5, 9.5);
1538 fHistEtNonRemovedMuPlus = new TH2F("fHistEtNonRemovedMuPlus", "fHistEtNonRemovedMuPlus", 1500, 0, 30, 10, -0.5, 9.5);
1539 fHistEtNonRemovedMuMinus = new TH2F("fHistEtNonRemovedMuMinus", "fHistEtNonRemovedMuMinus", 1500, 0, 30, 10, -0.5, 9.5);
1540 fHistEtNonRemovedNeutrons = new TH2F("fHistEtNonRemovedNeutrons", "fHistEtNonRemovedNeutrons", 1500, 0, 30, 10, -0.5, 9.5);
1541 fHistEtNonRemovedAntiNeutrons = new TH2F("fHistEtNonRemovedAntiNeutrons", "fHistEtNonRemovedAntiNeutrons", 1500, 0, 30, 10, -0.5, 9.5);
1543 fHistEtNonRemovedGammas = new TH2F("fHistEtNonRemovedGammas", "fHistEtNonRemovedGammas", 1500, 0, 30, 10, -0.5, 9.5);
1544 fHistEtNonRemovedGammasFromPi0 = new TH2F("fHistEtNonRemovedGammasFromPi0", "fHistEtNonRemovedGammasFromPi0", 1500, 0, 30, 10, -0.5, 9.5);
1546 fHistEtRemovedGammas = new TH2F("fHistEtRemovedGammas", "fHistEtRemovedGammas", 1500, 0, 30, 10, -0.5, 9.5);
1547 fHistEtRemovedNeutrons = new TH2F("fHistEtRemovedNeutrons", "fHistEtRemovedNeutrons", 1500, 0, 30, 10, -0.5, 9.5);
1548 fHistEtRemovedAntiNeutrons = new TH2F("fHistEtRemovedAntiNeutrons", "fHistEtRemovedAntiNeutrons", 1500, 0, 30, 10, -0.5, 9.5);
1550 fHistEtRemovedCharged = new TH2F("fHistEtRemovedCharged", "fHistEtRemovedCharged", 1500, 0, 30, 10, -0.5, 9.5);
1551 fHistEtRemovedNeutrals = new TH2F("fHistEtRemovedNeutrals", "fHistEtRemovedNeutrals", 1500, 0, 30, 10, -0.5, 9.5);
1553 fHistEtNonRemovedCharged = new TH2F("fHistEtNonRemovedCharged", "fHistEtNonRemovedCharged", 1500, 0, 30, 10, -0.5, 9.5);
1554 fHistEtNonRemovedNeutrals = new TH2F("fHistEtNonRemovedNeutrals", "fHistEtNonRemovedNeutrals", 1500, 0, 30, 10, -0.5, 9.5);
1556 fHistMultNonRemovedProtons = new TH2F("fHistMultNonRemovedProtons", "fHistMultNonRemovedProtons", 100, -0.5, 99.5, 10, -0.5, 9.5);
1557 fHistMultNonRemovedAntiProtons = new TH2F("fHistMultNonRemovedAntiProtons", "fHistMultNonRemovedAntiProtons", 100, -0.5, 99.5, 10, -0.5, 9.5);
1558 fHistMultNonRemovedPiPlus = new TH2F("fHistMultNonRemovedPiPlus", "fHistMultNonRemovedPiPlus", 100, -0.5, 99.5, 10, -0.5, 9.5);
1559 fHistMultNonRemovedPiMinus = new TH2F("fHistMultNonRemovedPiMinus", "fHistMultNonRemovedPiMinus", 100, -0.5, 99.5, 10, -0.5, 9.5);
1560 fHistMultNonRemovedKaonPlus = new TH2F("fHistMultNonRemovedKaonPlus", "fHistMultNonRemovedKaonPlus", 100, -0.5, 99.5, 10, -0.5, 9.5);
1561 fHistMultNonRemovedKaonMinus = new TH2F("fHistMultNonRemovedKaonMinus", "fHistMultNonRemovedKaonMinus", 100, -0.5, 99.5, 10, -0.5, 9.5);
1562 fHistMultNonRemovedK0s = new TH2F("fHistMultNonRemovedK0s", "fHistMultNonRemovedK0s", 100, -0.5, 99.5, 10, -0.5, 9.5);
1563 fHistMultNonRemovedK0L = new TH2F("fHistMultNonRemovedK0L", "fHistMultNonRemovedK0L", 100, -0.5, 99.5, 10, -0.5, 9.5);
1564 fHistMultNonRemovedLambdas = new TH2F("fHistMultNonRemovedLambdas", "fHistMultNonRemovedLambdas", 100, -0.5, 99.5, 10, -0.5, 9.5);
1565 fHistMultNonRemovedElectrons = new TH2F("fHistMultNonRemovedElectrons", "fHistMultNonRemovedElectrons", 100, -0.5, 99.5, 10, -0.5, 9.5);
1566 fHistMultNonRemovedPositrons = new TH2F("fHistMultNonRemovedPositrons", "fHistMultNonRemovedPositrons", 100, -0.5, 99.5, 10, -0.5, 9.5);
1567 fHistMultNonRemovedMuPlus = new TH2F("fHistMultNonRemovedMuPlus", "fHistMultNonRemovedMuPlus", 100, -0.5, 99.5, 10, -0.5, 9.5);
1568 fHistMultNonRemovedMuMinus = new TH2F("fHistMultNonRemovedMuMinus", "fHistMultNonRemovedMuMinus", 100, -0.5, 99.5, 10, -0.5, 9.5);
1569 fHistMultNonRemovedNeutrons = new TH2F("fHistMultNonRemovedNeutrons", "fHistMultNonRemovedNeutrons", 100, -0.5, 99.5, 10, -0.5, 9.5);
1570 fHistMultNonRemovedAntiNeutrons = new TH2F("fHistMultNonRemovedAntiNeutrons", "fHistMultNonRemovedAntiNeutrons", 100, -0.5, 99.5, 10, -0.5, 9.5);
1572 fHistMultNonRemovedGammas = new TH2F("fHistMultNonRemovedGammas", "fHistMultNonRemovedGammas", 100, -0.5, 99.5, 100, -0.5, 99.5);
1574 fHistMultRemovedGammas = new TH2F("fHistMultRemovedGammas", "fHistMultRemovedGammas", 100, -0.5, 99.5, 100, -0.5, 99.5);
1575 fHistMultRemovedNeutrons = new TH2F("fHistMultRemovedNeutrons", "fHistMultRemovedNeutrons", 100, -0.5, 99.5, 10, -0.5, 9.5);
1576 fHistMultRemovedAntiNeutrons = new TH2F("fHistMultRemovedAntiNeutrons", "fHistMultRemovedAntiNeutrons", 100, -0.5, 99.5, 10, -0.5, 9.5);
1578 fHistMultRemovedCharged = new TH2F("fHistMultRemovedCharged", "fHistMultRemovedCharged", 1500, 0, 30, 10, -0.5, 9.5);
1579 fHistMultRemovedNeutrals = new TH2F("fHistMultRemovedNeutrals", "fHistMultRemovedNeutrals", 1500, 0, 30, 10, -0.5, 9.5);
1581 fHistMultNonRemovedCharged = new TH2F("fHistMultNonRemovedCharged", "fHistMultNonRemovedCharged", 1500, 0, 30, 10, -0.5, 9.5);
1582 fHistMultNonRemovedNeutrals = new TH2F("fHistMultNonRemovedNeutrals", "fHistMultNonRemovedNeutrals", 1500, 0, 30, 10, -0.5, 9.5);*/
1585 fHistMultRemovedCharged = new TH2F("fHistMultRemovedCharged", "fHistMultRemovedCharged", 100, -0.5, 99.5, 100, -0.5, 99.5);
1586 fHistMultRemovedNeutrals = new TH2F("fHistMultRemovedNeutrals", "fHistMultRemovedNeutrals", 100, -0.5, 99.5, 100, -0.5, 99.5);
1588 fHistMultNonRemovedCharged = new TH2F("fHistMultNonRemovedCharged", "fHistMultNonRemovedCharged", 100, -0.5, 99.5, 100, -0.5, 99.5);
1589 fHistMultNonRemovedNeutrals = new TH2F("fHistMultNonRemovedNeutrals", "fHistMultNonRemovedNeutrals", 100, -0.5, 99.5, 100, -0.5, 99.5);
1591 fHistTrackMultvsNonRemovedCharged = new TH2F("fHistTrackMultvsNonRemovedCharged", "fHistTrackMultvsNonRemovedCharged", 1000, -0.5, 999.5, 100, -0.5, 99.5);
1592 fHistTrackMultvsNonRemovedNeutral = new TH2F("fHistTrackMultvsNonRemovedNeutral", "fHistTrackMultvsNonRemovedNeutral", 1000, -0.5, 999.5, 100, -0.5, 99.5);
1593 fHistTrackMultvsRemovedGamma = new TH2F("fHistTrackMultvsRemovedGamma", "fHistTrackMultvsRemovedGamma", 1000, -0.5, 999.5, 100, -0.5, 99.5);
1595 fHistClusterMultvsNonRemovedCharged = new TH2F("fHistClusterMultvsNonRemovedCharged", "fHistClusterMultvsNonRemovedCharged", 1000, -0.5, 999.5, 100, -0.5, 99.5);
1596 fHistClusterMultvsNonRemovedNeutral = new TH2F("fHistClusterMultvsNonRemovedNeutral", "fHistClusterMultvsNonRemovedNeutral", 1000, -0.5, 999.5, 100, -0.5, 99.5);
1597 fHistClusterMultvsRemovedGamma = new TH2F("fHistClusterMultvsRemovedGamma", "fHistClusterMultvsRemovedGamma", 1000, -0.5, 999.5, 100, -0.5, 99.5);
1599 fHistDxDzNonRemovedCharged = new TH2F("fHistDxDzNonRemovedCharged", "fHistDxDzNonRemovedCharged", 800, -200, 200, 800, -200, 200);
1600 fHistDxDzRemovedCharged = new TH2F("fHistDxDzRemovedCharged", "fHistDxDzRemovedCharged", 800, -200, 200, 800, -200, 200);
1601 fHistDxDzNonRemovedNeutral = new TH2F("fHistDxDzNonRemovedNeutral", "fHistDxDzNonRemovedNeutral", 800, -200, 200, 800, -200, 200);
1602 fHistDxDzRemovedNeutral = new TH2F("fHistDxDzRemovedNeutral", "fHistDxDzRemovedNeutral", 800, -200, 200, 800, -200, 200);
1604 if(fCalcForKaonCorrection){
1606 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};
1607 fHistK0EDepositsVsPtInAcceptance = new TH3F("fHistK0EDepositsVsPtInAcceptance","Kaon deposits with corrections for kaons with y<0.5",fgNumOfPtBins,fgPtAxis,fgNumOfPtBins,fgPtAxis,nEtCut,etCutAxis);
1608 fHistK0EGammaVsPtInAcceptance = new TH3F("fHistK0EGammaVsPtInAcceptance","Kaon deposits without corrections for kaons with y<0.5",fgNumOfPtBins,fgPtAxis,fgNumOfPtBins,fgPtAxis,nEtCut,etCutAxis);
1609 fHistK0EDepositsVsPtOutOfAcceptance = new TH3F("fHistK0EDepositsVsPtOutOfAcceptance","Kaon deposits with corrections for kaons with y>0.5",fgNumOfPtBins,fgPtAxis,fgNumOfPtBins,fgPtAxis,nEtCut,etCutAxis);
1610 fHistK0EGammaVsPtOutOfAcceptance = new TH3F("fHistK0EGammaVsPtOutOfAcceptance","Kaon deposits without corrections for kaons with y>0.5",fgNumOfPtBins,fgPtAxis,fgNumOfPtBins,fgPtAxis,nEtCut,etCutAxis);
1611 fHistK0EDepositsVsPtInAcceptance->GetXaxis()->SetTitle("Kaon p_{T}");
1612 fHistK0EGammaVsPtInAcceptance->GetXaxis()->SetTitle("Kaon p_{T}");
1613 fHistK0EDepositsVsPtOutOfAcceptance->GetXaxis()->SetTitle("Kaon p_{T}");
1614 fHistK0EGammaVsPtOutOfAcceptance->GetXaxis()->SetTitle("Kaon p_{T}");
1615 fHistK0EDepositsVsPtInAcceptance->GetYaxis()->SetTitle("Deposited E_{T}");
1616 fHistK0EGammaVsPtInAcceptance->GetYaxis()->SetTitle("Deposited E_{T}");
1617 fHistK0EDepositsVsPtOutOfAcceptance->GetYaxis()->SetTitle("Deposited E_{T}");
1618 fHistK0EGammaVsPtOutOfAcceptance->GetYaxis()->SetTitle("Deposited E_{T}");
1619 fHistK0EDepositsVsPtInAcceptance->GetZaxis()->SetTitle("E_{T} cut");
1620 fHistK0EGammaVsPtInAcceptance->GetZaxis()->SetTitle("E_{T} cut");
1621 fHistK0EDepositsVsPtOutOfAcceptance->GetZaxis()->SetTitle("E_{T} cut");
1622 fHistK0EGammaVsPtOutOfAcceptance->GetZaxis()->SetTitle("E_{T} cut");
1624 fHistSimKaonsInAcceptance = new TH1F("fHistSimKaonsInAcceptance","Kaons with y<0.5",fgNumOfPtBins,fgPtAxis);
1625 fHistSimK0SInAcceptance = new TH1F("fHistSimK0SInAcceptance","Kaons with y<0.5",fgNumOfPtBins,fgPtAxis);
1626 fHistSimK0LInAcceptance = new TH1F("fHistSimK0LInAcceptance","Kaons with y<0.5",fgNumOfPtBins,fgPtAxis);
1627 fHistSimKPlusInAcceptance = new TH1F("fHistSimKPlusInAcceptance","Kaons with y<0.5",fgNumOfPtBins,fgPtAxis);
1628 fHistSimKMinusInAcceptance = new TH1F("fHistSimKMinusInAcceptance","Kaons with y<0.5",fgNumOfPtBins,fgPtAxis);
1629 fHistSimKaonsOutOfAcceptance = new TH1F("fHistSimKaonsOutOfAcceptance","Kaons with y>0.5",fgNumOfPtBins,fgPtAxis);
1630 fHistSimKaonsInAcceptanceWithDepositsPrimaries = new TH1F("fHistSimKaonsInAcceptanceWithDepositsPrimaries","Primary Kaons which deposited energy in calorimeter with y>0.5",fgNumOfPtBins,fgPtAxis);
1631 fHistSimKaonsOutOfAcceptanceWithDepositsSecondaries = new TH1F("fHistSimKaonsOutOfAcceptanceWithDepositsSecondaries","Secondary Kaons which deposited energy in calorimeter with y>0.5",fgNumOfPtBins,fgPtAxis);
1632 fHistSimKaonsOutOfAcceptanceWithDepositsPrimaries = new TH1F("fHistSimKaonsOutOfAcceptanceWithDepositsPrimaries","Primary Kaons which deposited energy in calorimeter with y>0.5",fgNumOfPtBins,fgPtAxis);
1635 fHistPiPlusMult = new TH1F("fHistPiPlusMult", "fHistPiPlusMult", 2000, -0.5, 1999.5);
1636 fHistPiMinusMult = new TH1F("fHistPiMinusMult", "fHistPiMinusMult", 2000, -0.5, 1999.5);
1637 fHistPiZeroMult = new TH1F("fHistPiZeroMult", "fHistPiZeroMult", 2000, -0.5, 1999.5);
1639 fHistPiPlusMultAcc = new TH1F("fHistPiPlusMultAcc", "fHistPiPlusMultAcc", 2000, -0.5, 1999.5);
1640 fHistPiMinusMultAcc = new TH1F("fHistPiMinusMultAcc", "fHistPiMinusMultAcc", 2000, -0.5, 1999.5);
1641 fHistPiZeroMultAcc = new TH1F("fHistPiZeroMultAcc", "fHistPiZeroMultAcc", 2000, -0.5, 1999.5);
1643 if(fCuts->GetHistMakeTree())
1645 TString treename = "fPrimaryTree" + fHistogramNameSuffix;
1646 fPrimaryTree = new TTree(treename, treename);
1648 fPrimaryTree->Branch("fTotEt",&fTotEt,"fTotEt/D");
1649 fPrimaryTree->Branch("fNeutralMultiplicity", &fNeutralMultiplicity, "fNeutralMultiplicity/I");
1650 fPrimaryTree->Branch("fCentClass",&fCentClass,"fCentClass/I");
1652 fPrimaryTree->Branch("fPrimaryCode", &fPrimaryCode, "fPrimaryCode/I");
1653 fPrimaryTree->Branch("fPrimaryCharge", &fPrimaryCharge, "fPrimaryCharge/I");
1655 fPrimaryTree->Branch("fPrimaryE", &fPrimaryE, "fPrimaryE/D");
1656 fPrimaryTree->Branch("fPrimaryEt", &fPrimaryEt, "fPrimaryEt/D");
1658 fPrimaryTree->Branch("fPrimaryPx", &fPrimaryPx, "fPrimaryPx/D");
1659 fPrimaryTree->Branch("fPrimaryPy", &fPrimaryPy, "fPrimaryPy/D");
1660 fPrimaryTree->Branch("fPrimaryPz", &fPrimaryPz, "fPrimaryPz/D");
1662 fPrimaryTree->Branch("fPrimaryVx", &fPrimaryVx, "fPrimaryVx/D");
1663 fPrimaryTree->Branch("fPrimaryVy", &fPrimaryVy, "fPrimaryVy/D");
1664 fPrimaryTree->Branch("fPrimaryVz", &fPrimaryVz, "fPrimaryVz/D");
1666 fPrimaryTree->Branch("fPrimaryAccepted", &fPrimaryAccepted, "fPrimaryAccepted/B");
1667 fPrimaryTree->Branch("fPrimaryMatched", &fPrimaryMatched, "fPrimaryMatched/B");
1670 fPrimaryTree->Branch("fDepositedCode", &fDepositedCode, "fDepositedCode/I");
1671 fPrimaryTree->Branch("fDepositedCharge", &fDepositedCharge, "fDepositedCharge/I");
1672 fPrimaryTree->Branch("fDepositedE", &fDepositedE, "fDepositedE/D");
1673 fPrimaryTree->Branch("fDepositedEt", &fDepositedEt, "fDepositedEt/D");
1675 fPrimaryTree->Branch("fDepositedVx", &fDepositedVx, "fDepositedVx/D");
1676 fPrimaryTree->Branch("fDepositedVy", &fDepositedVy, "fDepositedVy/D");
1677 fPrimaryTree->Branch("fDepositedVz", &fDepositedVz, "fDepositedVz/D");
1679 fPrimaryTree->Branch("fSecondary", &fSecondary, "fSecondary/I");
1682 fPrimaryTree->Branch("fReconstructedE", &fReconstructedE, "fReconstructedE/D");
1683 fPrimaryTree->Branch("fReconstructedEt", &fReconstructedEt, "fReconstructedEt/D");
1685 fPrimaryTree->Branch("fClusterMult", &fClusterMult, "fClusterMult/I");
1690 fHistGammasFound = new TH1F("fHistGammasFound", "fHistGammasFound",200, 0, 10);
1691 fHistGammasGenerated = new TH1F("fHistGammasGenerated", "fHistGammasGenerated",200, 0, 10);
1692 fHistGammasFoundOutOfAccCent = new TH2F("fHistGammasFoundOutOfAccCent", "fHistGammasFoundOutOfAccCent",200, 0, 10,20,-0.5,19.5);
1693 fHistGammasFoundCent = new TH2F("fHistGammasFoundCent", "fHistGammasFoundCent",200, 0, 10,20,-0.5,19.5);
1694 fHistGammasGeneratedCent = new TH2F("fHistGammasGeneratedCent", "fHistGammasGeneratedCent",200, 0, 10,20,-0.5,19.5);
1695 fHistChargedTracksCut = new TH1F("fHistChargedTracksCut", "fHistChargedTracksCut",100, 0, 5);
1696 fHistChargedTracksAccepted = new TH1F("fHistChargedTracksAccepted", "fHistChargedTracksAccepted",100, 0, 5);
1697 fHistGammasCut = new TH1F("fHistGammasTracksCut", "fHistGammasTracksCut",100, 0, 5);
1698 fHistGammasAccepted = new TH1F("fHistGammasTracksAccepted", "fHistGammasTracksAccepted",100, 0, 5);
1700 if(fCalcTrackMatchVsMult){
1701 fHistChargedTracksCutMult = new TH2F("fHistChargedTracksCutMult", "fHistChargedTracksCutMult",100, 0, 5,10,0,100);
1702 fHistChargedTracksAcceptedMult = new TH2F("fHistChargedTracksAcceptedMult", "fHistChargedTracksAcceptedMult",100, 0, 5,10,0,100);
1703 fHistChargedTracksAcceptedLowPtCent = new TH2F("fHistChargedTracksAcceptedLowPtCent", "fHistChargedTracksAcceptedLowPtCent",100, 0, 5,20,-0.5,19.5);
1704 fHistChargedTracksAcceptedLowPtCent500MeV = new TH2F("fHistChargedTracksAcceptedLowPtCent500MeV", "fHistChargedTracksAcceptedLowPtCent500MeV",100, 0, 5,20,-0.5,19.5);
1705 fHistChargedTracksAcceptedLowPtCentNoAntiProtons = new TH2F("fHistChargedTracksAcceptedLowPtCentNoAntiProtons", "fHistChargedTracksAcceptedLowPtCentNoAntiProtons",100, 0, 5,20,-0.5,19.5);
1706 fHistChargedTracksAcceptedLowPtCentAntiProtons = new TH2F("fHistChargedTracksAcceptedLowPtCentAntiProtons", "fHistChargedTracksAcceptedLowPtCentAntiProtons",100, 0, 5,20,-0.5,19.5);
1707 fHistGammasCutMult = new TH2F("fHistGammasTracksCutMult", "fHistGammasTracksCutMult",100, 0, 5,10,0,100);
1708 fHistGammasAcceptedMult = new TH2F("fHistGammasTracksAcceptedMult", "fHistGammasTracksAcceptedMult",100, 0, 5,10,0,100);
1711 fHistBadTrackMatches = new TH1F("fHistBadTrackMatches", "fHistBadTrackMatches",100, 0, 5);
1712 fHistMatchedTracksEvspTBkgd = new TH2F("fHistMatchedTracksEvspTBkgd", "fHistMatchedTracksEvspTBkgd",100, 0, 3,100,0,3);
1713 fHistMatchedTracksEvspTSignal = new TH2F("fHistMatchedTracksEvspTSignal", "fHistMatchedTracksEvspTSignal",100, 0, 3,100,0,3);
1714 if(fCalcTrackMatchVsMult){
1715 fHistMatchedTracksEvspTBkgdPeripheral = new TH2F("fHistMatchedTracksEvspTBkgdPeripheral", "fHistMatchedTracksEvspTBkgd",100, 0, 3,100,0,3);
1716 fHistMatchedTracksEvspTSignalPeripheral = new TH2F("fHistMatchedTracksEvspTSignalPeripheral", "fHistMatchedTracksEvspTSignal",100, 0, 3,100,0,3);
1718 fHistMatchedTracksEvspTBkgdvsCent = new TH3F("fHistMatchedTracksEvspTBkgdvsCent", "fHistMatchedTracksEvspTBkgdvsCent",100, 0, 3,100,0,3,20,-0.5,19.5);
1719 fHistMatchedTracksEvspTSignalvsCent = new TH3F("fHistMatchedTracksEvspTSignalvsCent", "fHistMatchedTracksEvspTSignalvsCent",100, 0, 3,100,0,3,20,-0.5,19.5);
1720 fHistMatchedTracksEvspTBkgdvsCentEffCorr = new TH3F("fHistMatchedTracksEvspTBkgdvsCentEffCorr", "fHistMatchedTracksEvspTBkgdvsCent",100, 0, 3,100,0,3,20,-0.5,19.5);
1721 fHistMatchedTracksEvspTSignalvsCentEffCorr = new TH3F("fHistMatchedTracksEvspTSignalvsCentEffCorr", "fHistMatchedTracksEvspTSignalvsCent",100, 0, 3,100,0,3,20,-0.5,19.5);
1724 fHistChargedTracksCutPeripheral = new TH1F("fHistChargedTracksCutPeripheral", "fHistChargedTracksCut",100, 0, 5);
1725 fHistChargedTracksAcceptedPeripheral = new TH1F("fHistChargedTracksAcceptedPeripheral", "fHistChargedTracksAccepted",100, 0, 5);
1726 fHistGammasCutPeripheral = new TH1F("fHistGammasTracksCutPeripheral", "fHistGammasTracksCut",100, 0, 5);
1727 fHistGammasAcceptedPeripheral = new TH1F("fHistGammasTracksAcceptedPeripheral", "fHistGammasTracksAccepted",100, 0, 5);
1729 fHistBadTrackMatchesdPhidEta = new TH2F("fHistBadTrackMatchesdPhidEta", "fHistBadTrackMatchesdPhidEta",20, -0.1, 0.1,20,-.1,0.1);
1730 fHistGoodTrackMatchesdPhidEta = new TH2F("fHistGoodTrackMatchesdPhidEta", "fHistGoodTrackMatchesdPhidEta",20, -0.1, 0.1,20,-.1,0.1);
1732 fHistHadronDepositsAll = new TH1F("fHistHadronDepositsAll","All Hadrons which deposited energy in calorimeter",fgNumOfPtBins,fgPtAxis);
1733 fHistHadronDepositsReco = new TH1F("fHistHadronDepositsReco","Reconstructed Hadrons which deposited energy in calorimeter",fgNumOfPtBins,fgPtAxis);
1736 Float_t nMultCuts[21] = { 0, 5,10,15,20, 25,30,35,40,45,
1737 50,55,60,65,70, 75,80,85,90,95,
1740 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};
1742 fHistHadronDepositsAllCent = new TH2F("fHistHadronDepositsAllCent","All Hadrons which deposited energy in calorimeter",fgNumOfPtBins,fgPtAxis,nCent,nCentCuts);
1743 fHistHadronDepositsAllCent500MeV = new TH2F("fHistHadronDepositsAllCent500MeV","All Hadrons which deposited energy in calorimeter pT>500MeV",fgNumOfPtBins,fgPtAxis,nCent,nCentCuts);
1744 fHistHadronDepositsRecoCent = new TH2F("fHistHadronDepositsRecoCent","Reconstructed Hadrons which deposited energy in calorimeter",fgNumOfPtBins,fgPtAxis,nCent,nCentCuts);
1746 fHistHadronsAllCent = new TH2F("fHistHadronsAllCent","All Hadrons vs cluster mult",fgNumOfPtBins,fgPtAxis,nCent,nCentCuts);
1748 fHistMultChVsSignalVsMult = new TH3F("fHistMultChVsSignalVsMult","Charged particle Multiplicity vs Signal particle multiplicity vs Cluster Mult",nMult,nMultCuts,nMult,nMultCuts,nMult,nMultCuts);
1749 fHistNeutralRemovedSecondaryEtVsCent = new TH2F("fHistNeutralRemovedSecondaryEtVsCent","Neutral Removed Secondaries E_{T} vs centrality",100,0.0,2.0,20,-0.5,19.5);
1750 fHistChargedRemovedSecondaryEtVsCent = new TH2F("fHistChargedRemovedSecondaryEtVsCent","Charged Removed Secondaries E_{T} vs centrality",100,0.0,2.0,20,-0.5,19.5);
1751 fHistNeutralNotRemovedSecondaryEtVsCent = new TH2F("fHistNeutralNotRemovedSecondaryEtVsCent","Neutral NotRemoved Secondaries E_{T} vs centrality",100,0.0,2.0,20,-0.5,19.5);
1752 fHistChargedNotRemovedSecondaryEtVsCent = new TH2F("fHistChargedNotRemovedSecondaryEtVsCent","Charged NotRemoved Secondaries E_{T} vs centrality",100,0.0,2.0,20,-0.5,19.5);
1753 fHistNeutralRemovedSecondaryNumVsNCluster = new TH2F("fHistNeutralRemovedSecondaryNumVsNCluster","Neutral Removed Secondaries Number vs N_{cluster}",20,-0.5,19.5,250,0,250);
1754 fHistChargedRemovedSecondaryNumVsNCluster = new TH2F("fHistChargedRemovedSecondaryNumVsNCluster","Charged Removed Secondaries Number vs N_{cluster}",20,-0.5,19.5,250,0,250);
1755 fHistNeutralNotRemovedSecondaryNumVsNCluster = new TH2F("fHistNeutralNotRemovedSecondaryNumVsNCluster","Neutral NotRemoved Secondaries Number vs N_{cluster}",20,-0.5,19.5,250,0,250);
1756 fHistChargedNotRemovedSecondaryNumVsNCluster = new TH2F("fHistChargedNotRemovedSecondaryNumVsNCluster","Charged NotRemoved Secondaries Number vs N_{cluster}",20,-0.5,19.5,250,0,250);
1757 fHistNeutralRemovedSecondaryNumVsCent = new TH2F("fHistNeutralRemovedSecondaryNumVsCent","Neutral Removed Secondaries Number vs N_{cluster}",20,-0.5,19.5,20,-0.5,19.5);
1758 fHistChargedRemovedSecondaryNumVsCent = new TH2F("fHistChargedRemovedSecondaryNumVsCent","Charged Removed Secondaries Number vs N_{cluster}",20,-0.5,19.5,20,-0.5,19.5);
1759 fHistNeutralNotRemovedSecondaryNumVsCent = new TH2F("fHistNeutralNotRemovedSecondaryNumVsCent","Neutral NotRemoved Secondaries Number vs N_{cluster}",20,-0.5,19.5,20,-0.5,19.5);
1760 fHistChargedNotRemovedSecondaryNumVsCent = new TH2F("fHistChargedNotRemovedSecondaryNumVsCent","Charged NotRemoved Secondaries Number vs N_{cluster}",20,-0.5,19.5,20,-0.5,19.5);
1761 fHistNeutronsEtVsCent = new TH2F("fHistNeutronsEtVsCent","Neutrons and anti-neutrons - deposited ET vs Centrality bin",100,0,4.0,20,-0.5,19.5);
1762 fHistNeutronsNumVsCent = new TH2F("fHistNeutronsNumVsCent","Neutrons and anti-neutrons - number vs Centrality bin",20,-0.5,19.5,20,-0.5,19.5);
1763 fHistNotNeutronsNumVsCent = new TH2F("fHistNotNeutronsNumVsCent","Neutral particles not otherwise classified - number vs Centrality bin",20,-0.5,19.5,20,-0.5,19.5);
1764 Int_t nbinsEt = 125;
1765 Float_t maxEtRange = 125;
1766 Float_t maxEtRangeShort = 25;
1767 Float_t minEtRange = 0;
1768 Int_t nbinsMult = 100;
1769 Float_t maxMult = 3000;
1770 Float_t minMult = 0;
1771 Int_t nbinsCl = 175;
1772 Float_t maxCl = 350;
1774 fHistPiKPDepositedVsNch = new TH2F("fHistPiKPDepositedVsNch","#pi,K,p E_{T} deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRange,nbinsMult,minMult,maxMult);
1775 fHistPiKPNotTrackMatchedDepositedVsNch = new TH2F("fHistPiKPNotTrackMatchedDepositedVsNch","#pi,K,p E_{T} deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRange,nbinsMult,minMult,maxMult);
1776 fHistNeutronsDepositedVsNch = new TH2F("fHistNeutronsDepositedVsNch","n deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRangeShort,nbinsMult,minMult,maxMult);
1777 fHistAntiNeutronsDepositedVsNch = new TH2F("fHistAntiNeutronsDepositedVsNch","#bar{n} deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRangeShort,nbinsMult,minMult,maxMult);
1778 fHistProtonsDepositedVsNch = new TH2F("fHistProtonsDepositedVsNch","p deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRangeShort,nbinsMult,minMult,maxMult);
1779 fHistAntiProtonsDepositedVsNch = new TH2F("fHistAntiProtonsDepositedVsNch","#bar{p} deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRangeShort,nbinsMult,minMult,maxMult);
1780 fHistProtonsNotTrackMatchedDepositedVsNch = new TH2F("fHistProtonsNotTrackMatchedDepositedVsNch","p not track matched deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRangeShort,nbinsMult,minMult,maxMult);
1781 fHistAntiProtonsNotTrackMatchedDepositedVsNch = new TH2F("fHistAntiProtonsNotTrackMatchedDepositedVsNch","#bar{p} not track matched deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRangeShort,nbinsMult,minMult,maxMult);
1782 fHistSecondariesVsNch = new TH2F("fHistSecondariesVsNch","secondaries deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRangeShort,nbinsMult,minMult,maxMult);
1783 fHistSecondariesVsNcl = new TH2F("fHistSecondariesVsNcl","secondaries deposited in calorimeter vs number of clusters",nbinsEt,minEtRange,maxEtRangeShort,nbinsCl,minCl,maxCl);
1784 fHistSecondariesEffCorrVsNch = new TH2F("fHistSecondariesEffCorrVsNch","efficiency corrected secondaries deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRangeShort,nbinsMult,minMult,maxMult);
1785 fHistSecondariesEffCorrVsNcl = new TH2F("fHistSecondariesEffCorrVsNcl","efficiency corrected secondaries deposited in calorimeter vs number of clusters",nbinsEt,minEtRange,maxEtRangeShort,nbinsCl,minCl,maxCl);
1787 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);
1788 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);
1789 fHistCentVsNchVsNcl = new TH3F("fHistCentVsNchVsNcl","Cent bin vs Nch Vs NCl",20,-0.5,19.5,nbinsMult,minMult,maxMult,nbinsCl,minCl,maxCl);
1790 //float maxpos = 500;
1791 // int nbinspos = 200;
1792 // fHistSecondaryPositionInDetector = new TH3F("fHistSecondaryPositionInDetector","Position of secondaries",nbinspos,-maxpos,maxpos,nbinspos,-maxpos,maxpos,nbinspos,-maxpos,maxpos);
1793 // fHistSecondaryPositionInDetector->GetXaxis()->SetTitle("X");
1794 // fHistSecondaryPositionInDetector->GetYaxis()->SetTitle("Y");
1795 // fHistSecondaryPositionInDetector->GetZaxis()->SetTitle("Z");
1796 // fHistSecondaryPositionInDetectorMultiple = new TH3F("fHistSecondaryPositionInDetectorMultiple","Position of secondaries",nbinspos,-maxpos,maxpos,nbinspos,-maxpos,maxpos,nbinspos,-maxpos,maxpos);
1797 // fHistSecondaryPositionInDetectorMultiple->GetXaxis()->SetTitle("X");
1798 // fHistSecondaryPositionInDetectorMultiple->GetYaxis()->SetTitle("Y");
1799 // fHistSecondaryPositionInDetectorMultiple->GetZaxis()->SetTitle("Z");
1800 fClusterPositionWeird = new TH2F("fClusterPositionWeird", "Position of weird secondary clusters",300, -TMath::Pi(),TMath::Pi(), 100, -0.7 , 0.7);
1802 fSecondaryClusterEnergy = new TH1F("fSecondaryClusterEnergy","fSecondaryClusterEnergy", 100, 0, 5);
1805 void AliAnalysisEtMonteCarlo::FillOutputList(TList *list)
1806 { //fill the output list
1807 AliAnalysisEt::FillOutputList(list);
1810 if(fCuts->GetHistMakeTree())
1812 list->Add(fPrimaryTree);
1815 list->Add(fHistRemovedOrNot);
1817 list->Add(fHistEtNonRemovedProtons);
1818 list->Add(fHistEtNonRemovedAntiProtons);
1819 list->Add(fHistEtNonRemovedPiPlus);
1820 list->Add(fHistEtNonRemovedPiMinus);
1821 list->Add(fHistEtNonRemovedKaonPlus);
1822 list->Add(fHistEtNonRemovedKaonMinus);
1823 list->Add(fHistEtNonRemovedK0s);
1824 list->Add(fHistEtNonRemovedK0L);
1825 list->Add(fHistEtNonRemovedLambdas);
1826 list->Add(fHistEtNonRemovedElectrons);
1827 list->Add(fHistEtNonRemovedPositrons);
1828 list->Add(fHistEtNonRemovedMuPlus);
1829 list->Add(fHistEtNonRemovedMuMinus);
1830 list->Add(fHistEtNonRemovedNeutrons);
1831 list->Add(fHistEtNonRemovedAntiNeutrons);
1832 list->Add(fHistEtNonRemovedGammas);
1833 list->Add(fHistEtNonRemovedGammasFromPi0);
1835 list->Add(fHistEtRemovedGammas);
1836 list->Add(fHistEtRemovedNeutrons);
1837 list->Add(fHistEtRemovedAntiNeutrons);
1839 list->Add(fHistEtRemovedCharged);
1840 list->Add(fHistEtRemovedNeutrals);
1842 list->Add(fHistEtNonRemovedCharged);
1843 list->Add(fHistEtNonRemovedNeutrals);
1845 list->Add(fHistMultNonRemovedProtons);
1846 list->Add(fHistMultNonRemovedAntiProtons);
1847 list->Add(fHistMultNonRemovedPiPlus);
1848 list->Add(fHistMultNonRemovedPiMinus);
1849 list->Add(fHistMultNonRemovedKaonPlus);
1850 list->Add(fHistMultNonRemovedKaonMinus);
1851 list->Add(fHistMultNonRemovedK0s);
1852 list->Add(fHistMultNonRemovedK0L);
1853 list->Add(fHistMultNonRemovedLambdas);
1854 list->Add(fHistMultNonRemovedElectrons);
1855 list->Add(fHistMultNonRemovedPositrons);
1856 list->Add(fHistMultNonRemovedMuPlus);
1857 list->Add(fHistMultNonRemovedMuMinus);
1858 list->Add(fHistMultNonRemovedNeutrons);
1859 list->Add(fHistMultNonRemovedAntiNeutrons);
1860 list->Add(fHistMultNonRemovedGammas);
1862 list->Add(fHistMultRemovedGammas);
1863 list->Add(fHistMultRemovedNeutrons);
1864 list->Add(fHistMultRemovedAntiNeutrons);
1866 list->Add(fHistMultRemovedCharged);
1867 list->Add(fHistMultRemovedNeutrals);
1869 list->Add(fHistMultNonRemovedCharged);
1870 list->Add(fHistMultNonRemovedNeutrals);
1872 list->Add(fHistTrackMultvsNonRemovedCharged);
1873 list->Add(fHistTrackMultvsNonRemovedNeutral);
1874 list->Add(fHistTrackMultvsRemovedGamma);
1876 list->Add(fHistClusterMultvsNonRemovedCharged);
1877 list->Add(fHistClusterMultvsNonRemovedNeutral);
1878 list->Add(fHistClusterMultvsRemovedGamma);
1880 //list->Add(fHistDecayVertexNonRemovedCharged);
1881 //list->Add(fHistDecayVertexNonRemovedNeutral);
1882 //list->Add(fHistDecayVertexRemovedCharged);
1883 //list->Add(fHistDecayVertexRemovedNeutral);
1885 list->Add(fHistDxDzNonRemovedCharged);
1886 list->Add(fHistDxDzRemovedCharged);
1887 list->Add(fHistDxDzNonRemovedNeutral);
1888 list->Add(fHistDxDzRemovedNeutral);
1890 if(fCalcForKaonCorrection){
1891 list->Add(fHistK0EDepositsVsPtInAcceptance);
1892 list->Add(fHistK0EGammaVsPtInAcceptance);
1893 list->Add(fHistK0EDepositsVsPtOutOfAcceptance);
1894 list->Add(fHistK0EGammaVsPtOutOfAcceptance);
1895 list->Add(fHistSimKaonsInAcceptance);
1896 list->Add(fHistSimK0SInAcceptance);
1897 list->Add(fHistSimK0LInAcceptance);
1898 list->Add(fHistSimKPlusInAcceptance);
1899 list->Add(fHistSimKMinusInAcceptance);
1900 list->Add(fHistSimKaonsOutOfAcceptance);
1901 list->Add(fHistSimKaonsInAcceptanceWithDepositsPrimaries);
1902 list->Add(fHistSimKaonsOutOfAcceptanceWithDepositsSecondaries);
1903 list->Add(fHistSimKaonsOutOfAcceptanceWithDepositsPrimaries);
1906 list->Add(fHistPiPlusMult);
1907 list->Add(fHistPiMinusMult);
1908 list->Add(fHistPiZeroMult);
1909 list->Add(fHistPiPlusMultAcc);
1910 list->Add(fHistPiMinusMultAcc);
1911 list->Add(fHistPiZeroMultAcc);
1913 list->Add(fHistGammasFound);
1914 list->Add(fHistGammasGenerated);
1915 list->Add(fHistGammasFoundOutOfAccCent);
1916 list->Add(fHistGammasFoundCent);
1917 list->Add(fHistGammasGeneratedCent);
1918 list->Add(fHistChargedTracksCut);
1919 list->Add(fHistChargedTracksAccepted);
1920 list->Add(fHistGammasCut);
1921 list->Add(fHistGammasAccepted);
1922 if(fCalcTrackMatchVsMult){
1923 list->Add(fHistChargedTracksCutMult);
1924 list->Add(fHistChargedTracksAcceptedMult);
1925 list->Add(fHistChargedTracksAcceptedLowPtCent);
1926 list->Add(fHistChargedTracksAcceptedLowPtCent500MeV);
1927 list->Add(fHistChargedTracksAcceptedLowPtCentNoAntiProtons);
1928 list->Add(fHistChargedTracksAcceptedLowPtCentAntiProtons);
1929 list->Add(fHistGammasCutMult);
1930 list->Add(fHistGammasAcceptedMult);
1932 list->Add(fHistBadTrackMatches);
1933 list->Add(fHistMatchedTracksEvspTBkgd);
1934 list->Add(fHistMatchedTracksEvspTSignal);
1935 if(fCalcTrackMatchVsMult){
1936 list->Add(fHistMatchedTracksEvspTBkgdPeripheral);
1937 list->Add(fHistMatchedTracksEvspTSignalPeripheral);
1938 list->Add(fHistMatchedTracksEvspTBkgdvsCent);
1939 list->Add(fHistMatchedTracksEvspTSignalvsCent);
1940 list->Add(fHistMatchedTracksEvspTBkgdvsCentEffCorr);
1941 list->Add(fHistMatchedTracksEvspTSignalvsCentEffCorr);
1942 list->Add(fHistChargedTracksCutPeripheral);
1943 list->Add(fHistChargedTracksAcceptedPeripheral);
1944 list->Add(fHistGammasCutPeripheral);
1945 list->Add(fHistGammasAcceptedPeripheral);
1947 list->Add(fHistBadTrackMatchesdPhidEta);
1948 list->Add(fHistGoodTrackMatchesdPhidEta);
1949 list->Add(fHistHadronDepositsAll);
1950 list->Add(fHistHadronDepositsReco);
1951 list->Add(fHistHadronDepositsAllCent);
1952 list->Add(fHistHadronDepositsAllCent500MeV);
1953 list->Add(fHistHadronDepositsRecoCent);
1954 list->Add(fHistHadronsAllCent);
1955 list->Add(fHistMultChVsSignalVsMult);
1956 list->Add(fHistNeutralRemovedSecondaryEtVsCent);
1957 list->Add(fHistChargedRemovedSecondaryEtVsCent);
1958 list->Add(fHistNeutralNotRemovedSecondaryEtVsCent);
1959 list->Add(fHistChargedNotRemovedSecondaryEtVsCent);
1960 list->Add(fHistNeutralRemovedSecondaryNumVsNCluster);
1961 list->Add(fHistChargedRemovedSecondaryNumVsNCluster);
1962 list->Add(fHistNeutralNotRemovedSecondaryNumVsNCluster);
1963 list->Add(fHistChargedNotRemovedSecondaryNumVsNCluster);
1964 list->Add(fHistNeutralRemovedSecondaryNumVsCent);
1965 list->Add(fHistChargedRemovedSecondaryNumVsCent);
1966 list->Add(fHistNeutralNotRemovedSecondaryNumVsCent);
1967 list->Add(fHistChargedNotRemovedSecondaryNumVsCent);
1968 list->Add(fHistNeutronsEtVsCent);
1969 list->Add(fHistNeutronsNumVsCent);
1970 list->Add(fHistNotNeutronsNumVsCent);
1971 list->Add(fHistPiKPDepositedVsNch);
1972 list->Add(fHistPiKPNotTrackMatchedDepositedVsNch);
1973 list->Add(fHistNeutronsDepositedVsNch);
1974 list->Add(fHistAntiNeutronsDepositedVsNch);
1975 list->Add(fHistProtonsDepositedVsNch);
1976 list->Add(fHistAntiProtonsDepositedVsNch);
1977 list->Add(fHistProtonsNotTrackMatchedDepositedVsNch);
1978 list->Add(fHistAntiProtonsNotTrackMatchedDepositedVsNch);
1979 list->Add(fHistSecondariesVsNch);
1980 list->Add(fHistSecondariesVsNcl);
1981 list->Add(fHistSecondariesEffCorrVsNch);
1982 list->Add(fHistSecondariesEffCorrVsNcl);
1983 list->Add(fHistSecondariesOutOfAccEffCorrVsNch);
1984 list->Add(fHistSecondariesDetectorCoverEffCorrVsNch);
1985 list->Add(fHistCentVsNchVsNcl);
1986 //list->Add(fHistSecondaryPositionInDetector);
1987 list->Add(fClusterPositionWeird);
1988 //list->Add(fHistSecondaryPositionInDetectorMultiple);
1989 list->Add(fSecondaryClusterEnergy);
1995 bool AliAnalysisEtMonteCarlo::TrackHitsCalorimeter(TParticle* part, Double_t magField)
1997 // printf(" TrackHitsCalorimeter - magField %f\n", magField);
1998 AliESDtrack *esdTrack = new AliESDtrack(part);
1999 // Printf("MC Propagating track: eta: %f, phi: %f, pt: %f", esdTrack->Eta(), esdTrack->Phi(), esdTrack->Pt());
2001 Bool_t prop = esdTrack->PropagateTo(fDetectorRadius, magField);
2003 // if(prop) Printf("Track propagated, eta: %f, phi: %f, pt: %f", esdTrack->Eta(), esdTrack->Phi(), esdTrack->Pt());
2005 bool status = prop && fSelector->CutGeometricalAcceptance(*esdTrack);
2011 void AliAnalysisEtMonteCarlo::FillHistograms()
2012 { // let base class fill its histograms, and us fill the local ones
2013 AliAnalysisEt::FillHistograms();
2015 //std::cout << fEtNonRemovedPiPlus << " " << fCentClass << std::endl;
2017 fHistEtNonRemovedProtons->Fill(fEtNonRemovedProtons, fCentClass);
2018 fHistEtNonRemovedAntiProtons->Fill(fEtNonRemovedAntiProtons, fCentClass);
2019 fHistEtNonRemovedKaonPlus->Fill(fEtNonRemovedKaonPlus, fCentClass);
2020 fHistEtNonRemovedKaonMinus->Fill(fEtNonRemovedKaonMinus, fCentClass);
2021 fHistEtNonRemovedK0s->Fill(fEtNonRemovedK0S, fCentClass);
2022 fHistEtNonRemovedK0L->Fill(fEtNonRemovedK0L, fCentClass);
2023 fHistEtNonRemovedLambdas->Fill(fEtNonRemovedLambdas, fCentClass);
2024 fHistEtNonRemovedPiPlus->Fill(fEtNonRemovedPiPlus, fCentClass);
2025 fHistEtNonRemovedPiMinus->Fill(fEtNonRemovedPiMinus, fCentClass);
2026 fHistEtNonRemovedElectrons->Fill(fEtNonRemovedElectrons, fCentClass);
2027 fHistEtNonRemovedPositrons->Fill(fEtNonRemovedPositrons, fCentClass);
2028 fHistEtNonRemovedMuPlus->Fill(fEtNonRemovedMuPlus, fCentClass);
2029 fHistEtNonRemovedMuMinus->Fill(fEtNonRemovedMuMinus, fCentClass);
2030 fHistEtNonRemovedNeutrons->Fill(fEtNonRemovedNeutrons, fCentClass);
2031 fHistEtNonRemovedAntiNeutrons->Fill(fEtNonRemovedAntiNeutrons, fCentClass);
2032 fHistEtNonRemovedGammas->Fill(fEtNonRemovedGammas, fCentClass);
2033 fHistEtNonRemovedGammasFromPi0->Fill(fEtNonRemovedGammasFromPi0, fCentClass);
2035 fHistEtRemovedGammas->Fill(fEtRemovedGammas, fNClusters);
2036 fHistEtRemovedNeutrons->Fill(fEtRemovedNeutrons, fCentClass);
2037 fHistEtRemovedAntiNeutrons->Fill(fEtRemovedAntiNeutrons, fCentClass);
2039 // fHistEtRemovedCharged->Fill(fEtRemovedAntiProtons+fEtRemovedElectrons+fEtRemovedKaonMinus+fEtRemovedKaonPlus
2040 // +fEtRemovedMuMinus+fEtRemovedMuPlus+fEtRemovedPiMinus+fEtRemovedPiPlus+fEtRemovedPositrons
2041 // +fEtRemovedProtons.
2043 // fHistEtRemovedNeutrals->Fill(fEtRemovedNeutrons+fEtRemovedAntiNeutrons, fCentClass);
2045 // fHistEtNonRemovedCharged->Fill(fEtNonRemovedAntiProtons+fEtNonRemovedElectrons+fEtNonRemovedKaonMinus+fEtNonRemovedKaonPlus
2046 // +fEtNonRemovedMuMinus+fEtNonRemovedMuPlus+fEtNonRemovedPiMinus+fEtNonRemovedPiPlus+fEtNonRemovedPositrons
2047 // +fEtNonRemovedProtons,
2049 // fHistEtRemovedNeutrals->Fill(fEtNonRemovedNeutrons+fEtNonRemovedAntiNeutrons, fCentClass);
2051 fHistEtRemovedCharged->Fill(fEnergyChargedRemoved, fNClusters);
2052 fHistEtRemovedNeutrals->Fill(fEnergyNeutralRemoved, fNClusters);
2053 fHistEtNonRemovedCharged->Fill(fEnergyChargedNotRemoved, fNClusters);
2054 fHistEtNonRemovedNeutrals->Fill(fEnergyNeutralNotRemoved, fNClusters);
2056 fHistMultRemovedCharged->Fill(fChargedRemoved, fNClusters);
2057 fHistMultRemovedNeutrals->Fill(fNeutralRemoved, fNClusters);
2058 fHistMultNonRemovedCharged->Fill(fChargedNotRemoved, fNClusters);
2059 fHistMultNonRemovedNeutrals->Fill(fNeutralNotRemoved, fNClusters);
2062 fHistMultNonRemovedProtons->Fill(fMultNonRemovedProtons, fCentClass);
2063 fHistMultNonRemovedAntiProtons->Fill(fMultNonRemovedAntiProtons, fCentClass);
2064 fHistMultNonRemovedKaonPlus->Fill(fMultNonRemovedKaonPlus, fCentClass);
2065 fHistMultNonRemovedKaonMinus->Fill(fMultNonRemovedKaonMinus, fCentClass);
2066 fHistMultNonRemovedK0s->Fill(fMultNonRemovedK0s, fCentClass);
2067 fHistMultNonRemovedK0L->Fill(fMultNonRemovedK0L, fCentClass);
2068 fHistMultNonRemovedLambdas->Fill(fMultNonRemovedLambdas, fCentClass);
2069 fHistMultNonRemovedPiPlus->Fill(fMultNonRemovedPiPlus, fCentClass);
2070 fHistMultNonRemovedPiMinus->Fill(fMultNonRemovedPiMinus, fCentClass);
2071 fHistMultNonRemovedElectrons->Fill(fMultNonRemovedElectrons, fCentClass);
2072 fHistMultNonRemovedPositrons->Fill(fMultNonRemovedPositrons, fCentClass);
2073 fHistMultNonRemovedMuPlus->Fill(fMultNonRemovedMuPlus, fCentClass);
2074 fHistMultNonRemovedMuMinus->Fill(fMultNonRemovedMuMinus, fCentClass);
2075 fHistMultNonRemovedNeutrons->Fill(fMultNonRemovedNeutrons, fCentClass);
2076 fHistMultNonRemovedAntiNeutrons->Fill(fMultNonRemovedAntiNeutrons, fCentClass);
2077 fHistMultNonRemovedGammas->Fill(fMultNonRemovedGammas, fCentClass);
2079 fHistMultRemovedGammas->Fill(fMultRemovedGammas, fCentClass);
2080 fHistMultRemovedNeutrons->Fill(fMultRemovedNeutrons, fCentClass);
2081 fHistMultRemovedAntiNeutrons->Fill(fMultRemovedAntiNeutrons, fCentClass);
2083 fHistTrackMultvsNonRemovedCharged->Fill(fTrackMultInAcc,
2084 fMultNonRemovedAntiProtons+fMultNonRemovedElectrons+fMultNonRemovedKaonMinus+fMultNonRemovedKaonPlus
2085 +fMultNonRemovedMuMinus+fMultNonRemovedMuPlus+fMultNonRemovedPiMinus+fMultNonRemovedPiPlus+fMultNonRemovedPositrons
2086 +fMultNonRemovedProtons);
2088 fHistTrackMultvsNonRemovedNeutral->Fill(fTrackMultInAcc,
2089 fMultNonRemovedNeutrons+fMultNonRemovedAntiNeutrons+fMultNonRemovedK0s+fMultNonRemovedK0L+fMultNonRemovedLambdas+fK0sMult);
2091 fHistTrackMultvsRemovedGamma->Fill(fTrackMultInAcc,
2092 fMultRemovedGammas);
2094 fHistClusterMultvsNonRemovedCharged->Fill(fNClusters,
2095 fMultNonRemovedAntiProtons+fMultNonRemovedElectrons+fMultNonRemovedKaonMinus
2096 +fMultNonRemovedKaonPlus+fMultNonRemovedMuMinus+fMultNonRemovedMuPlus
2097 +fMultNonRemovedPiMinus+fMultNonRemovedPiPlus+fMultNonRemovedPositrons+fMultNonRemovedProtons);
2099 fHistClusterMultvsNonRemovedNeutral->Fill(fNClusters,
2100 fMultNonRemovedNeutrons+fMultNonRemovedAntiNeutrons+fMultNonRemovedK0s+fMultNonRemovedK0L+fMultNonRemovedLambdas+fK0sMult);
2102 fHistClusterMultvsRemovedGamma->Fill(fNClusters,
2103 fMultRemovedGammas);
2110 Int_t AliAnalysisEtMonteCarlo::PrintFamilyTree(Int_t partIdx, AliStack* stack)
2111 { // print family tree
2112 TParticle *part = stack->Particle(partIdx);
2113 // if(part->GetPdgCode() == fgK0SCode)
2115 std::cout << "This is index: " << partIdx << " (" << stack->Particle(partIdx)->GetName() <<") , is it primary: " << stack->IsPhysicalPrimary(partIdx)<< std::endl;
2116 std::cout << "PID: " << part->GetPdgCode() << "/" << part->GetName() << std::endl;
2117 std::cout << "Energy: " << part->Energy() << std::endl;
2118 Float_t vtx = TMath::Sqrt( TMath::Power(part->Vx(),2) + TMath::Power(part->Vy(),2) + TMath::Power(part->Vz(),2) );
2119 std::cout << "Vertex: " << part->Vx() << ", " << part->Vy() << ", " << part->Vz() <<"|Vtx| "<<vtx << std::endl;
2121 return PrintMothers(partIdx, stack, 1);
2124 Int_t AliAnalysisEtMonteCarlo::PrintMothers(Int_t partIdx, AliStack* stack, Int_t gen)
2126 char *tabs = new char[gen+1];
2127 for(Int_t i = 0; i < gen; ++i)
2129 //std::cout << i << std::endl;
2133 Int_t mothIdx = stack->Particle(partIdx)->GetMother(0);
2139 TParticle *mother = stack->Particle(mothIdx);
2140 // if(mother->GetPdgCode() == fgK0SCode)
2142 //std::cout << tabs << "Mother of index: " << partIdx << " (" << stack->Particle(partIdx)->GetName() <<") is: " << mothIdx << ", is it primary: " << stack->IsPhysicalPrimary(mothIdx)<< std::endl;
2143 std::cout << tabs << "Index: " << mothIdx << std::endl;
2144 std::cout << tabs << "Primary: " << stack->IsPhysicalPrimary(mothIdx) << std::endl;
2145 std::cout << tabs << "PID: " << mother->GetPdgCode() << "/" << mother->GetName() << std::endl;
2146 std::cout << tabs << "Energy: " << mother->Energy() << std::endl;
2147 if(mother->GetFirstMother() >= 0)
2149 std::cout << tabs << "Mother(s): " << stack->Particle(mother->GetFirstMother())->GetPdgCode();
2150 if(mother->GetSecondMother() >= 0) std::cout << ", " << stack->Particle(mother->GetSecondMother())->GetPdgCode();
2151 std::cout << std::endl;
2153 Float_t vtx = TMath::Sqrt( TMath::Power(mother->Vx(),2) + TMath::Power(mother->Vy(),2) + TMath::Power(mother->Vz(),2) );
2154 std::cout<<tabs << "Vertex: " << mother->Vx() << ", " << mother->Vy() << ", " << mother->Vz() <<"|Vtx| "<<vtx << std::endl;
2156 if(mother->GetPdgCode() == fgK0SCode)
2158 // std::cout << "K0S!!!!!!!!!!!!!11111!!!!!" << std::endl;
2160 // std::cout << "Mother of index: " << partIdx << " (" << stack->Particle(partIdx)->GetName() <<") is: " << mothIdx << std::endl;
2161 // std::cout << "PID: " << mother->GetPdgCode() << "/" << mother->GetName() << std::endl;
2162 // std::cout << "Energy: " << mother->Energy() << std::endl;
2163 // std::cout << "Vertex: " << mother->Vx() << ", " << mother->Vy() << ", " << mother->Vz() << std::endl;
2166 return PrintMothers(mothIdx, stack, gen+1) + 1;
2169 Int_t AliAnalysisEtMonteCarlo::GetPrimMother(Int_t partIdx, AliStack *stack)
2170 { // get primary mother
2173 //return stack->GetPrimary(partIdx);
2175 Int_t mothIdx = stack->Particle(partIdx)->GetMother(0);
2176 if(mothIdx < 0) return -1;
2177 TParticle *mother = stack->Particle(mothIdx);
2180 if(stack->IsPhysicalPrimary(mothIdx)) return mothIdx;
2181 else return GetPrimMother(mothIdx, stack);
2191 Int_t AliAnalysisEtMonteCarlo::GetK0InFamily(Int_t partIdx, AliStack* stack)
2192 { // get K0 in family
2195 if(stack->Particle(partIdx)->GetPdgCode() == fgK0SCode) return partIdx;
2196 Int_t mothIdx = stack->Particle(partIdx)->GetMother(0);
2197 if(mothIdx < 0) return -1;
2198 TParticle *mother = stack->Particle(mothIdx);
2201 if(mother->GetPdgCode() == fgK0SCode)
2205 return GetK0InFamily(mothIdx, stack);