Belle II Software  release-06-02-00
ECLDataAnalysisModule.cc
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 //This module
10 #include <ecl/modules/eclDataAnalysis/ECLDataAnalysisModule.h>
11 
12 #include <TTree.h>
13 #include <TFile.h>
14 
15 // FRAMEWORK
16 #include <framework/dataobjects/EventMetaData.h>
17 #include <framework/datastore/RelationVector.h>
18 #include <framework/gearbox/Const.h>
19 #include <framework/logging/Logger.h>
20 
21 // MDST
22 #include <mdst/dataobjects/MCParticle.h>
23 #include <mdst/dataobjects/ECLCluster.h>
24 #include <mdst/dataobjects/Track.h>
25 #include <mdst/dataobjects/EventLevelClusteringInfo.h>
26 
27 // ECL
28 #include <ecl/dataobjects/ECLDigit.h>
29 #include <ecl/dataobjects/ECLCalDigit.h>
30 #include <ecl/dataobjects/ECLHit.h>
31 #include <ecl/dataobjects/ECLShower.h>
32 #include <ecl/dataobjects/ECLSimHit.h>
33 #include <ecl/dataobjects/ECLPidLikelihood.h>
34 #include <ecl/dataobjects/ECLConnectedRegion.h>
35 #include <ecl/dataobjects/ECLLocalMaximum.h>
36 
37 using namespace std;
38 using namespace Belle2;
39 
40 //-----------------------------------------------------------------
41 // Register the Module
42 //-----------------------------------------------------------------
43 
44 REG_MODULE(ECLDataAnalysis)
45 
46 //-----------------------------------------------------------------
47 // Implementation
48 //-----------------------------------------------------------------
49 
51  : Module(),
52  m_rootFilePtr(0),
53  m_writeToRoot(1),
54  m_doTracking(0),
55  m_eclSimHits(eclSimHitArrayName()),
56  m_eclHits(eclHitArrayName()),
57  m_eclDigits(eclDigitArrayName()),
58  m_eclCalDigits(eclCalDigitArrayName()),
59  m_eclConnectedRegions(eclConnectedRegionArrayName()),
60  m_eclShowers(eclShowerArrayName()),
61  m_eclClusters(eclClusterArrayName()),
62  m_eclLocalMaximums(eclLocalMaximumArrayName()),
63  m_eclPureDigits(eclPureDigitArrayName()),
64  m_eclPureCalDigits(eclPureCalDigitArrayName()),
65  m_eclPureConnectedRegions(eclPureConnectedRegionArrayName()),
66  m_eclPureShowers(eclPureShowerArrayName()),
67  m_eclPureClusters(eclPureClusterArrayName()),
68  m_eclPureLocalMaximums(eclPureLocalMaximumArrayName()),
69  m_tree(0),
70  m_iExperiment(0),
71  m_iRun(0),
72  m_iEvent(0),
73 //Digit
74  m_eclDigitMultip(0),
75  m_eclDigitIdx(0),
76  m_eclDigitToMC(0),
77  m_eclDigitCellId(0),
78  m_eclDigitAmp(0),
79  m_eclDigitTimeFit(0),
80  m_eclDigitFitQuality(0),
81  m_eclDigitToCalDigit(0),
82 //CalDigit
83  m_eclCalDigitMultip(0),
84  m_eclCalDigitIdx(0),
85  m_eclCalDigitToMC1(0),
86  m_eclCalDigitToMC1PDG(0),
87  m_eclCalDigitToMCWeight1(0),
88  m_eclCalDigitToMC2(0),
89  m_eclCalDigitToMC2PDG(0),
90  m_eclCalDigitToMCWeight2(0),
91  m_eclCalDigitToMC3(0),
92  m_eclCalDigitToMC3PDG(0),
93  m_eclCalDigitToMCWeight3(0),
94  m_eclCalDigitToMC4(0),
95  m_eclCalDigitToMC4PDG(0),
96  m_eclCalDigitToMCWeight4(0),
97  m_eclCalDigitToMC5(0),
98  m_eclCalDigitToMC5PDG(0),
99  m_eclCalDigitToMCWeight5(0),
100  m_eclCalDigitToBkgWeight(0),
101  m_eclCalDigitSimHitSum(0),
102  m_eclCalDigitToShower(0),
103  m_eclCalDigitCellId(0),
104  m_eclCalDigitAmp(0),
105  m_eclCalDigitTimeFit(0),
106  m_eclCalDigitFitQuality(0),
107  m_eclCalDigitToCR(0),
108  m_eclCalDigitToLM(0),
109 //Connected Region
110  m_eclCRIdx(0),
111  m_eclCRIsTrack(0),
112  m_eclCRLikelihoodMIPNGamma(0),
113  m_eclCRLikelihoodChargedHadron(0),
114  m_eclCRLikelihoodElectronNGamma(0),
115  m_eclCRLikelihoodNGamma(0),
116  m_eclCRLikelihoodNeutralHadron(0),
117  m_eclCRLikelihoodMergedPi0(0),
118 //Local Maxima
119  m_eclLMMultip(0),
120  m_eclLMId(0),
121  m_eclLMType(0),
122  m_eclLMCellId(0),
123 //SimHit
124  m_eclSimHitMultip(0),
125  m_eclSimHitIdx(0),
126  m_eclSimHitToMC(0),
127  m_eclSimHitCellId(0),
128  m_eclSimHitPdg(0),
129  m_eclSimHitEnergyDep(0),
130  m_eclSimHitFlightTime(0),
131  m_eclSimHitX(0),
132  m_eclSimHitY(0),
133  m_eclSimHitZ(0),
134  m_eclSimHitPx(0),
135  m_eclSimHitPy(0),
136  m_eclSimHitPz(0),
137 //Hit
138  m_eclHitMultip(0),
139  m_eclHitIdx(0),
140  m_eclHitToMC(0),
141  m_eclHitToDigit(0),
142  m_eclHitToDigitAmp(0),
143  m_eclHitToPureDigit(0),
144  m_eclHitToPureDigitAmp(0),
145  m_eclHitCellId(0),
146  m_eclHitEnergyDep(0),
147  m_eclHitTimeAve(0),
148 //Cluster
149  m_eclClusterMultip(0),
150  m_eclClusterTrueMultip(0),
151  m_eclClusterGammaMultip(0),
152  m_eclClusterIdx(0),
153  m_eclClusterToMC1(0),
154  m_eclClusterToMCWeight1(0),
155  m_eclClusterToMC1PDG(0),
156  m_eclClusterToMC2(0),
157  m_eclClusterToMCWeight2(0),
158  m_eclClusterToMC2PDG(0),
159  m_eclClusterToMC3(0),
160  m_eclClusterToMCWeight3(0),
161  m_eclClusterToMC3PDG(0),
162  m_eclClusterToMC4(0),
163  m_eclClusterToMCWeight4(0),
164  m_eclClusterToMC4PDG(0),
165  m_eclClusterToMC5(0),
166  m_eclClusterToMCWeight5(0),
167  m_eclClusterToMC5PDG(0),
168  m_eclClusterToBkgWeight(0),
169  m_eclClusterSimHitSum(0),
170  m_eclClusterToShower(0),
171  m_eclClusterEnergy(0),
172  m_eclClusterEnergyError(0),
173  m_eclClusterTheta(0),
174  m_eclClusterThetaError(0),
175  m_eclClusterPhi(0),
176  m_eclClusterPhiError(0),
177  m_eclClusterR(0),
178  m_eclClusterEnergyDepSum(0),
179  m_eclClusterTiming(0),
180  m_eclClusterTimingError(0),
181  m_eclClusterE9oE21(0),
182  m_eclClusterHighestE(0),
183  m_eclClusterCellId(0),
184  m_eclClusterNofCrystals(0),
185  m_eclClusterCrystalHealth(0),
186  m_eclClusterIsTrack(0),
187  m_eclClusterClosestTrackDist(0),
188  m_eclClusterDeltaL(0),
189  m_eclClusterAbsZernike40(0),
190  m_eclClusterAbsZernike51(0),
191  m_eclClusterZernikeMVA(0),
192  m_eclClusterE1oE9(0),
193  m_eclClusterSecondMoment(0),
194  m_eclClusterLAT(0),
195  m_eclClusterDeltaTime99(0),
196  m_eclClusterDetectorRegion(0),
197  m_eclClusterHasNPhotonHypothesis(0),
198  m_eclClusterHasNeutralHadronHypothesis(0),
199 
200 //PureDigits
201  m_eclPureDigitMultip(0),
202  m_eclPureDigitIdx(0),
203  m_eclPureDigitToMC(0),
204  m_eclPureDigitCellId(0),
205  m_eclPureDigitAmp(0),
206  m_eclPureDigitTimeFit(0),
207  m_eclPureDigitFitQuality(0),
208  m_eclPureDigitToCluster(0),
209 //PureCalDigit
210  m_eclPureCalDigitMultip(0),
211  m_eclPureCalDigitIdx(0),
212  m_eclPureCalDigitToMC1(0),
213  m_eclPureCalDigitToMC1PDG(0),
214  m_eclPureCalDigitToMCWeight1(0),
215  m_eclPureCalDigitToMC2(0),
216  m_eclPureCalDigitToMC2PDG(0),
217  m_eclPureCalDigitToMCWeight2(0),
218  m_eclPureCalDigitToMC3(0),
219  m_eclPureCalDigitToMC3PDG(0),
220  m_eclPureCalDigitToMCWeight3(0),
221  m_eclPureCalDigitToMC4(0),
222  m_eclPureCalDigitToMC4PDG(0),
223  m_eclPureCalDigitToMCWeight4(0),
224  m_eclPureCalDigitToMC5(0),
225  m_eclPureCalDigitToMC5PDG(0),
226  m_eclPureCalDigitToMCWeight5(0),
227  m_eclPureCalDigitToBkgWeight(0),
228  m_eclPureCalDigitSimHitSum(0),
229  m_eclPureCalDigitToShower(0),
230  m_eclPureCalDigitCellId(0),
231  m_eclPureCalDigitAmp(0),
232  m_eclPureCalDigitTimeFit(0),
233  m_eclPureCalDigitFitQuality(0),
234  m_eclPureCalDigitToCR(0),
235  m_eclPureCalDigitToLM(0),
236 //Connected Region
237  m_eclPureCRIdx(0),
238  m_eclPureCRIsTrack(0),
239  m_eclPureCRLikelihoodMIPNGamma(0),
240  m_eclPureCRLikelihoodChargedHadron(0),
241  m_eclPureCRLikelihoodElectronNGamma(0),
242  m_eclPureCRLikelihoodNGamma(0),
243  m_eclPureCRLikelihoodNeutralHadron(0),
244  m_eclPureCRLikelihoodMergedPi0(0),
245 //Local Maxima
246  m_eclPureLMMultip(0),
247  m_eclPureLMId(0),
248  m_eclPureLMType(0),
249  m_eclPureLMCellId(0),
250 //PureCluster
251  m_eclPureClusterMultip(0),
252  m_eclPureClusterIdx(0),
253  m_eclPureClusterToMC1(0),
254  m_eclPureClusterToMCWeight1(0),
255  m_eclPureClusterToMC1PDG(0),
256  m_eclPureClusterToMC2(0),
257  m_eclPureClusterToMCWeight2(0),
258  m_eclPureClusterToMC2PDG(0),
259  m_eclPureClusterToMC3(0),
260  m_eclPureClusterToMCWeight3(0),
261  m_eclPureClusterToMC3PDG(0),
262  m_eclPureClusterToMC4(0),
263  m_eclPureClusterToMCWeight4(0),
264  m_eclPureClusterToMC4PDG(0),
265  m_eclPureClusterToMC5(0),
266  m_eclPureClusterToMCWeight5(0),
267  m_eclPureClusterToMC5PDG(0),
268  m_eclPureClusterToBkgWeight(0),
269  m_eclPureClusterEnergy(0),
270  m_eclPureClusterEnergyError(0),
271  m_eclPureClusterTheta(0),
272  m_eclPureClusterThetaError(0),
273  m_eclPureClusterPhi(0),
274  m_eclPureClusterPhiError(0),
275  m_eclPureClusterR(0),
276  m_eclPureClusterEnergyDepSum(0),
277  m_eclPureClusterTiming(0),
278  m_eclPureClusterTimingError(0),
279  m_eclPureClusterE9oE21(0),
280  m_eclPureClusterHighestE(0),
281  m_eclPureClusterCellId(0),
282  m_eclPureClusterLat(0),
283  m_eclPureClusterNofCrystals(0),
284  m_eclPureClusterCrystalHealth(0),
285  m_eclPureClusterIsTrack(0),
286  m_eclPureClusterDeltaL(0),
287  m_eclPureClusterClosestTrackDist(0),
288  m_eclPureClusterAbsZernike40(0),
289  m_eclPureClusterAbsZernike51(0),
290  m_eclPureClusterZernikeMVA(0),
291  m_eclPureClusterSecondMoment(0),
292  m_eclPureClusterE1oE9(0),
293  m_eclPureClusterDeltaTime99(0),
294  m_eclPureClusterDetectorRegion(0),
295  m_eclPureClusterHasNPhotonHypothesis(0),
296  m_eclPureClusterHasNeutralHadronHypothesis(0),
297 
298 //Shower
299  m_eclShowerMultip(0),
300  m_eclShowerIdx(0),
301  m_eclShowerToMC1(0),
302  m_eclShowerToMCWeight1(0),
303  m_eclShowerToMC1PDG(0),
304  m_eclShowerToMC1Moth(0),
305  m_eclShowerToMC1MothPDG(0),
306  m_eclShowerToMC1GMoth(0),
307  m_eclShowerToMC1GMothPDG(0),
308  m_eclShowerToMC2(0),
309  m_eclShowerToMCWeight2(0),
310  m_eclShowerToMC2PDG(0),
311  m_eclShowerToMC2Moth(0),
312  m_eclShowerToMC2MothPDG(0),
313  m_eclShowerToMC2GMoth(0),
314  m_eclShowerToMC2GMothPDG(0),
315  m_eclShowerToMC3(0),
316  m_eclShowerToMCWeight3(0),
317  m_eclShowerToMC3PDG(0),
318  m_eclShowerToMC3Moth(0),
319  m_eclShowerToMC3MothPDG(0),
320  m_eclShowerToMC3GMoth(0),
321  m_eclShowerToMC3GMothPDG(0),
322  m_eclShowerToMC4(0),
323  m_eclShowerToMCWeight4(0),
324  m_eclShowerToMC4PDG(0),
325  m_eclShowerToMC4Moth(0),
326  m_eclShowerToMC4MothPDG(0),
327  m_eclShowerToMC4GMoth(0),
328  m_eclShowerToMC4GMothPDG(0),
329  m_eclShowerToMC5(0),
330  m_eclShowerToMCWeight5(0),
331  m_eclShowerToMC5PDG(0),
332  m_eclShowerToMC5Moth(0),
333  m_eclShowerToMC5MothPDG(0),
334  m_eclShowerToMC5GMoth(0),
335  m_eclShowerToMC5GMothPDG(0),
336  m_eclShowerToBkgWeight(0),
337  m_eclShowerToLM1(0),
338  m_eclShowerToLM2(0),
339  m_eclShowerToLM3(0),
340  m_eclShowerToLM4(0),
341  m_eclShowerToLM5(0),
342  m_eclShowerSimHitSum(0),
343  m_eclShowerUncEnergy(0),
344  m_eclShowerEnergy(0),
345  m_eclShowerTheta(0),
346  m_eclShowerPhi(0),
347  m_eclShowerR(0),
348  m_eclShowerNHits(0),
349  m_eclShowerE9oE21(0),
350  m_eclShowerTime(0),
351  m_eclShowerT99(0),
352  m_eclShowerConnectedRegionId(0),
353  m_eclShowerHypothesisId(0),
354  m_eclShowerCentralCellId(0),
355  m_eclShowerEnergyError(0),
356  m_eclShowerThetaError(0),
357  m_eclShowerPhiError(0),
358  m_eclShowerTimeResolution(0),
359  m_eclShowerHighestEnergy(0),
360  m_eclShowerLateralEnergy(0),
361  m_eclShowerMinTrkDistance(0),
362  m_eclShowerTrkDepth(0),
363  m_eclShowerShowerDepth(0),
364  m_eclShowerAbsZernike40(0),
365  m_eclShowerAbsZernike51(0),
366  m_eclShowerZernikeMVA(0),
367  m_eclShowerSecondMoment(0),
368  m_eclShowerE1oE9(0),
369  m_eclShowerIsTrack(0),
370  m_eclShowerIsCluster(0),
371  m_eclShowerMCVtxInEcl(0),
372  m_eclShowerMCFlightMatch(0),
373  m_eclShowerMCFFlightMatch(0),
374  m_eclShowerHighestE1mE2(0),
375  m_eclShowerNumberOfCrystalsForEnergy(0),
376 //MC
377  m_mcMultip(0),
378  m_mcIdx(0),
379  m_mcPdg(0),
380  m_mcMothPdg(0),
381  m_mcGMothPdg(0),
382  m_mcGGMothPdg(0),
383  m_mcEnergy(0),
384  m_mcPx(0),
385  m_mcPy(0),
386  m_mcPz(0),
387  m_mcDecayVtxX(0),
388  m_mcDecayVtxY(0),
389  m_mcDecayVtxZ(0),
390  m_mcProdVtxX(0),
391  m_mcProdVtxY(0),
392  m_mcProdVtxZ(0),
393  m_mcSecondaryPhysProc(0),
394 //Tracks
395  m_trkMultip(0),
396  m_trkPdg(0),
397  m_trkIdx(0),
398  m_trkCharge(0),
399  m_trkPx(0),
400  m_trkPy(0),
401  m_trkPz(0),
402  m_trkP(0),
403  m_trkTheta(0),
404  m_trkPhi(0),
405  m_trkX(0),
406  m_trkY(0),
407  m_trkZ(0),
408 //PID
409  m_eclpidtrkIdx(0),
410  m_eclpidEnergy(0),
411  m_eclpidEop(0),
412  m_eclpidE9E21(0),
413  m_eclpidNCrystals(0),
414  m_eclpidNClusters(0),
415  m_eclLogLikeEl(0),
416  m_eclLogLikeMu(0),
417  m_eclLogLikePi(0)
418 
419 {
420  //Set module properties
421  setDescription("This module produces an ntuple with ECL-related quantities starting from mdst");
422  addParam("writeToRoot", m_writeToRoot,
423  "set true if you want to save the informations in a root file named by parameter 'rootFileName'", bool(true));
424  addParam("rootFileName", m_rootFileName,
425  "fileName used for root file where info are saved. Will be ignored if parameter 'writeToRoot' is false (standard)",
426  string("eclDataAnalysis"));
427  addParam("doTracking", m_doTracking, "set true if you want to save the informations from TrackFitResults'rootFileName'",
428  bool(false));
429  addParam("doHits", m_doHits, "set true if you want to save the Hit and SimHit informations'", bool(false));
430  addParam("doDigits", m_doDigits, "set true if you want to save the Digits and CalDigits informations'", bool(false));
431  addParam("doPureCsI", m_doPureCsI, "set true if you want to save the informations for upgrade option'", bool(false));
432 
433 }
434 
435 ECLDataAnalysisModule::~ECLDataAnalysisModule()
436 {
437 }
438 
439 
440 void ECLDataAnalysisModule::initialize()
441 {
442 
443  B2INFO("[ECLDataAnalysis Module]: Starting initialization of ECLDataAnalysis Module.");
444 
445  m_eventLevelClusteringInfo.registerInDataStore();
446 
447  m_eclSimHits.registerInDataStore(eclSimHitArrayName());
448  m_eclHits.registerInDataStore(eclHitArrayName());
449 
450  m_eclDigits.registerInDataStore(eclDigitArrayName());
451  m_eclCalDigits.registerInDataStore(eclCalDigitArrayName());
452  m_eclConnectedRegions.registerInDataStore(eclConnectedRegionArrayName());
453  m_eclShowers.registerInDataStore(eclShowerArrayName());
454  m_eclClusters.registerInDataStore(eclClusterArrayName());
455  m_eclLocalMaximums.registerInDataStore(eclLocalMaximumArrayName());
456 
457  m_eclCalDigits.registerRelationTo(m_mcParticles);
458  m_eclDigits.registerRelationTo(m_mcParticles);
459  m_eclShowers.registerRelationTo(m_mcParticles);
460  m_eclClusters.registerRelationTo(m_mcParticles);
461 
462  if (m_doPureCsI == 1) {
463  m_eclPureDigits.registerInDataStore(eclPureDigitArrayName());
464  m_eclPureCalDigits.registerInDataStore(eclPureCalDigitArrayName());
465  m_eclPureConnectedRegions.registerInDataStore(eclPureConnectedRegionArrayName());
466  m_eclPureShowers.registerInDataStore(eclPureShowerArrayName());
467  m_eclPureClusters.registerInDataStore(eclPureClusterArrayName());
468  m_eclPureLocalMaximums.registerInDataStore(eclPureLocalMaximumArrayName());
469 
470  m_eclPureCalDigits.registerRelationTo(m_mcParticles);
471  m_eclPureDigits.registerRelationTo(m_mcParticles);
472  m_eclPureShowers.registerRelationTo(m_mcParticles);
473  m_eclPureClusters.registerRelationTo(m_mcParticles);
474  }
475 
476  if (m_doTracking == true) {
477  m_tracks.isRequired();
478  m_trackFitResults.isRequired();
479  m_eclPidLikelihoods.isRequired();
480  }
481 
482  if (m_writeToRoot == true) {
483  m_rootFilePtr = new TFile(m_rootFileName.c_str(), "RECREATE");
484  } else
485  m_rootFilePtr = nullptr;
486 
487  // initialize tree
488  m_tree = new TTree("m_tree", "ECL Analysis tree");
489 
490  m_tree->Branch("expNo", &m_iExperiment, "expNo/I");
491  m_tree->Branch("runNo", &m_iRun, "runNo/I");
492  m_tree->Branch("evtNo", &m_iEvent, "evtNo/I");
493 
494  //EventLevelClusteringInfo
495  m_tree->Branch("eclNumOutOfTimeDigitsFwd", &m_nECLCalDigitsOutOfTimeFWD, "eclNumOutOfTimeDigitsFwd/s");
496  m_tree->Branch("eclNumOutOfTimeDigitsBrl", &m_nECLCalDigitsOutOfTimeBarrel, "eclNumOutOfTimeDigitsBrl/s");
497  m_tree->Branch("eclNumOutOfTimeDigitsBwd", &m_nECLCalDigitsOutOfTimeBWD, "eclNumOutOfTimeDigitsBwd/s");
498  m_tree->Branch("eclNumRejectedShowersFwd", &m_nECLShowersRejectedFWD, "eclNumRejectedShowersFwd/b");
499  m_tree->Branch("eclNumRejectedShowersBrl", &m_nECLShowersRejectedBarrel, "eclNumRejectedShowersBrl/b");
500  m_tree->Branch("eclNumRejectedShowersBwd", &m_nECLShowersRejectedBWD, "eclNumRejectedShowersBwd/b");
501 
502  if (m_doDigits == 1) {
503  m_tree->Branch("eclDigitMultip", &m_eclDigitMultip, "ecldigit_Multip/I");
504  m_tree->Branch("eclDigitIdx", "std::vector<int>", &m_eclDigitIdx);
505  m_tree->Branch("eclDigitToMC", "std::vector<int>", &m_eclDigitToMC);
506  m_tree->Branch("eclDigitCellId", "std::vector<int>", &m_eclDigitCellId);
507  m_tree->Branch("eclDigitAmp", "std::vector<int>", &m_eclDigitAmp);
508  m_tree->Branch("eclDigitTimeFit", "std::vector<int>", &m_eclDigitTimeFit);
509  m_tree->Branch("eclDigitFitQuality", "std::vector<int>", &m_eclDigitFitQuality);
510  m_tree->Branch("eclDigitToCalDigit", "std::vector<int>", &m_eclDigitToCalDigit);
511 
512  m_tree->Branch("eclCalDigitMultip", &m_eclCalDigitMultip, "eclCaldigit_Multip/I");
513  m_tree->Branch("eclCalDigitIdx", "std::vector<int>", &m_eclCalDigitIdx);
514  m_tree->Branch("eclCalDigitToMC1", "std::vector<int>", &m_eclCalDigitToMC1);
515  m_tree->Branch("eclCalDigitToMC1PDG", "std::vector<int>", &m_eclCalDigitToMC1PDG);
516  m_tree->Branch("eclCalDigitToMCWeight1", "std::vector<double>", &m_eclCalDigitToMCWeight1);
517  m_tree->Branch("eclCalDigitToMC2", "std::vector<int>", &m_eclCalDigitToMC2);
518  m_tree->Branch("eclCalDigitToMC2PDG", "std::vector<int>", &m_eclCalDigitToMC2PDG);
519  m_tree->Branch("eclCalDigitToMCWeight2", "std::vector<double>", &m_eclCalDigitToMCWeight2);
520  m_tree->Branch("eclCalDigitToMC3", "std::vector<int>", &m_eclCalDigitToMC3);
521  m_tree->Branch("eclCalDigitToMC3PDG", "std::vector<int>", &m_eclCalDigitToMC3PDG);
522  m_tree->Branch("eclCalDigitToMCWeight3", "std::vector<double>", &m_eclCalDigitToMCWeight3);
523  m_tree->Branch("eclCalDigitToMC4", "std::vector<int>", &m_eclCalDigitToMC4);
524  m_tree->Branch("eclCalDigitToMC4PDG", "std::vector<int>", &m_eclCalDigitToMC4PDG);
525  m_tree->Branch("eclCalDigitToMCWeight4", "std::vector<double>", &m_eclCalDigitToMCWeight4);
526  m_tree->Branch("eclCalDigitToMC5", "std::vector<int>", &m_eclCalDigitToMC5);
527  m_tree->Branch("eclCalDigitToMC5PDG", "std::vector<int>", &m_eclCalDigitToMC5PDG);
528  m_tree->Branch("eclCalDigitToMCWeight5", "std::vector<double>", &m_eclCalDigitToMCWeight5);
529  m_tree->Branch("eclCalDigitToBkgWeight", "std::vector<double>", &m_eclCalDigitToBkgWeight);
530  m_tree->Branch("eclCalDigitSimHitSum", "std::vector<double>", &m_eclCalDigitSimHitSum);
531  m_tree->Branch("eclCalDigitToShower", "std::vector<int>", &m_eclCalDigitToShower);
532  m_tree->Branch("eclCalDigitCellId", "std::vector<int>", &m_eclCalDigitCellId);
533  m_tree->Branch("eclCalDigitAmp", "std::vector<double>", &m_eclCalDigitAmp);
534  m_tree->Branch("eclCalDigitTimeFit", "std::vector<double>", &m_eclCalDigitTimeFit);
535  m_tree->Branch("eclCalDigitFitQuality", "std::vector<int>", &m_eclCalDigitFitQuality);
536  m_tree->Branch("eclCalDigitToCR", "std::vector<int>", &m_eclCalDigitToCR);
537  m_tree->Branch("eclCalDigitToLM", "std::vector<int>", &m_eclCalDigitToLM);
538  }
539 
540  m_tree->Branch("eclCRIdx", "std::vector<int>", &m_eclCRIdx);
541  m_tree->Branch("eclCRIsTrack", "std::vector<int>", &m_eclCRIsTrack);
542  m_tree->Branch("eclCRLikelihoodMIPNGamma", "std::vector<double>", &m_eclCRLikelihoodMIPNGamma);
543  m_tree->Branch("eclCRLikelihoodChargedHadron", "std::vector<double>", &m_eclCRLikelihoodChargedHadron);
544  m_tree->Branch("eclCRLikelihoodElectronNGamma", "std::vector<double>", &m_eclCRLikelihoodElectronNGamma);
545  m_tree->Branch("eclCRLikelihoodNGamma", "std::vector<double>", &m_eclCRLikelihoodNGamma);
546  m_tree->Branch("eclCRLikelihoodNeutralHadron", "std::vector<double>", &m_eclCRLikelihoodNeutralHadron);
547  m_tree->Branch("eclCRLikelihoodMergedPi0", "std::vector<double>", &m_eclCRLikelihoodMergedPi0);
548 
549  if (m_doHits == 1) {
550  m_tree->Branch("eclSimHitMultip", &m_eclSimHitMultip, "eclSimHitMultip/I");
551  m_tree->Branch("eclSimHitIdx", "std::vector<int>", &m_eclSimHitIdx);
552  m_tree->Branch("eclSimHitToMC", "std::vector<int>", &m_eclSimHitToMC);
553  m_tree->Branch("eclSimHitCellId", "std::vector<int>", &m_eclSimHitCellId);
554  m_tree->Branch("eclSimHitPdg", "std::vector<int>", &m_eclSimHitPdg);
555  m_tree->Branch("eclSimHitEnergyDep", "std::vector<double>", &m_eclSimHitEnergyDep);
556  m_tree->Branch("eclSimHitFlightTime", "std::vector<double>", &m_eclSimHitFlightTime);
557  m_tree->Branch("eclSimHitX", "std::vector<double>", &m_eclSimHitX);
558  m_tree->Branch("eclSimHitY", "std::vector<double>", &m_eclSimHitY);
559  m_tree->Branch("eclSimHitZ", "std::vector<double>", &m_eclSimHitZ);
560  m_tree->Branch("eclSimHitPx", "std::vector<double>", &m_eclSimHitPx);
561  m_tree->Branch("eclSimHitPy", "std::vector<double>", &m_eclSimHitPy);
562  m_tree->Branch("eclSimHitPz", "std::vector<double>", &m_eclSimHitPz);
563 
564  m_tree->Branch("eclHitMultip", &m_eclHitMultip, "eclHitMultip/I");
565  m_tree->Branch("eclHitIdx", "std::vector<int>", &m_eclHitIdx);
566  m_tree->Branch("eclHitToMC", "std::vector<int>", &m_eclHitToMC);
567  m_tree->Branch("eclHitToDigit", "std::vector<int>", &m_eclHitToDigit);
568  m_tree->Branch("eclHitToDigitAmp", "std::vector<int>", &m_eclHitToDigitAmp);
569  m_tree->Branch("eclHitCellId", "std::vector<int>", &m_eclHitCellId);
570  m_tree->Branch("eclHitEnergyDep", "std::vector<double>", &m_eclHitEnergyDep);
571  m_tree->Branch("eclHitTimeAve", "std::vector<double>", &m_eclHitTimeAve);
572  }
573 
574  m_tree->Branch("eclLMMultip", &m_eclLMMultip, "eclLMMultip/I");
575  m_tree->Branch("eclLMId", "std::vector<int>", &m_eclLMId);
576  m_tree->Branch("eclLMType", "std::vector<int>", &m_eclLMType);
577  m_tree->Branch("eclLMCellId", "std::vector<int>", &m_eclLMCellId);
578 
579  m_tree->Branch("eclClusterMultip", &m_eclClusterMultip, "eclClusterMultip/I");
580  m_tree->Branch("eclClusterTrueMultip", &m_eclClusterTrueMultip, "eclClusterTrueMultip/I");
581  m_tree->Branch("eclClusterGammaMultip", &m_eclClusterGammaMultip, "eclClusterGammaMultip/I");
582  m_tree->Branch("eclClusterIdx", "std::vector<int>", &m_eclClusterIdx);
583  m_tree->Branch("eclClusterToMC1", "std::vector<int>", &m_eclClusterToMC1);
584  m_tree->Branch("eclClusterToMCWeight1", "std::vector<double>", &m_eclClusterToMCWeight1);
585  m_tree->Branch("eclClusterToMC1PDG", "std::vector<int>", &m_eclClusterToMC1PDG);
586  m_tree->Branch("eclClusterToMC2", "std::vector<int>", &m_eclClusterToMC2);
587  m_tree->Branch("eclClusterToMCWeight2", "std::vector<double>", &m_eclClusterToMCWeight2);
588  m_tree->Branch("eclClusterToMC2PDG", "std::vector<int>", &m_eclClusterToMC2PDG);
589  m_tree->Branch("eclClusterToMC3", "std::vector<int>", &m_eclClusterToMC3);
590  m_tree->Branch("eclClusterToMCWeight3", "std::vector<double>", &m_eclClusterToMCWeight3);
591  m_tree->Branch("eclClusterToMC3PDG", "std::vector<int>", &m_eclClusterToMC3PDG);
592  m_tree->Branch("eclClusterToMC4", "std::vector<int>", &m_eclClusterToMC4);
593  m_tree->Branch("eclClusterToMCWeight4", "std::vector<double>", &m_eclClusterToMCWeight4);
594  m_tree->Branch("eclClusterToMC4PDG", "std::vector<int>", &m_eclClusterToMC4PDG);
595  m_tree->Branch("eclClusterToMC5", "std::vector<int>", &m_eclClusterToMC5);
596  m_tree->Branch("eclClusterToMCWeight5", "std::vector<double>", &m_eclClusterToMCWeight5);
597  m_tree->Branch("eclClusterToMC5PDG", "std::vector<int>", &m_eclClusterToMC5PDG);
598  m_tree->Branch("eclClusterToBkgWeight", "std::vector<double>", &m_eclClusterToBkgWeight);
599  m_tree->Branch("eclClusterSimHitSum", "std::vector<double>", &m_eclClusterSimHitSum);
600  m_tree->Branch("eclClusterToShower", "std::vector<int>", &m_eclClusterToShower);
601  m_tree->Branch("eclClusterEnergy", "std::vector<double>", &m_eclClusterEnergy);
602  m_tree->Branch("eclClusterEnergyError", "std::vector<double>", &m_eclClusterEnergyError);
603  m_tree->Branch("eclClusterTheta", "std::vector<double>", &m_eclClusterTheta);
604  m_tree->Branch("eclClusterThetaError", "std::vector<double>", &m_eclClusterThetaError);
605  m_tree->Branch("eclClusterPhi", "std::vector<double>", &m_eclClusterPhi);
606  m_tree->Branch("eclClusterPhiError", "std::vector<double>", &m_eclClusterPhiError);
607  m_tree->Branch("eclClusterR", "std::vector<double>", &m_eclClusterR);
608  m_tree->Branch("eclClusterEnergyDepSum", "std::vector<double>", &m_eclClusterEnergyDepSum);
609  m_tree->Branch("eclClusterTiming", "std::vector<double>", &m_eclClusterTiming);
610  m_tree->Branch("eclClusterTimingError", "std::vector<double>", &m_eclClusterTimingError);
611  m_tree->Branch("eclClusterE9oE21", "std::vector<double>", &m_eclClusterE9oE21);
612  m_tree->Branch("eclClusterHighestE", "std::vector<double>", &m_eclClusterHighestE);
613  m_tree->Branch("eclClusterCellId", "std::vector<int>", &m_eclClusterCellId);
614  m_tree->Branch("eclClusterNofCrystals", "std::vector<int>", &m_eclClusterNofCrystals);
615  m_tree->Branch("eclClusterCrystalHealth", "std::vector<int>", &m_eclClusterCrystalHealth);
616  m_tree->Branch("eclClusterIsTrack", "std::vector<bool>", &m_eclClusterIsTrack);
617  m_tree->Branch("eclClusterClosestTrackDist", "std::vector<double>", &m_eclClusterClosestTrackDist);
618  m_tree->Branch("eclClusterDeltaL", "std::vector<double>", &m_eclClusterDeltaL);
619  m_tree->Branch("eclClusterAbsZernike40", "std::vector<double>", &m_eclClusterAbsZernike40);
620  m_tree->Branch("eclClusterAbsZernike51", "std::vector<double>", &m_eclClusterAbsZernike51);
621  m_tree->Branch("eclClusterZernikeMVA", "std::vector<double>", &m_eclClusterZernikeMVA);
622  m_tree->Branch("eclClusterE1oE9", "std::vector<double>", &m_eclClusterE1oE9);
623  m_tree->Branch("eclClusterSecondMoment", "std::vector<double>", &m_eclClusterSecondMoment);
624  m_tree->Branch("eclClusterLAT", "std::vector<double>", &m_eclClusterLAT);
625  m_tree->Branch("eclClusterDeltaTime99", "std::vector<double>", &m_eclClusterDeltaTime99);
626  m_tree->Branch("eclClusterDetectorRegion", "std::vector<int>", &m_eclClusterDetectorRegion);
627  m_tree->Branch("eclClusterHasNPhotonHypothesis", "std::vector<int>", &m_eclClusterHasNPhotonHypothesis);
628  m_tree->Branch("eclClusterHasNeutralHadronHypothesis", "std::vector<int>", &m_eclClusterHasNeutralHadronHypothesis);
629 
630  if (m_doPureCsI == true) {
631  m_tree->Branch("eclHitToPureDigit", "std::vector<int>", &m_eclHitToPureDigit);
632  m_tree->Branch("eclHitToPureDigitAmp", "std::vector<int>", &m_eclHitToPureDigitAmp);
633  //Pure Digit
634  m_tree->Branch("eclPureDigitMultip", &m_eclPureDigitMultip, "eclPureDigit_Multip/I");
635  m_tree->Branch("eclPureDigitIdx", "std::vector<int>", &m_eclPureDigitIdx);
636  m_tree->Branch("eclPureDigitToMC", "std::vector<int>", &m_eclPureDigitToMC);
637  m_tree->Branch("eclPureDigitCellId", "std::vector<int>", &m_eclPureDigitCellId);
638  m_tree->Branch("eclPureDigitAmp", "std::vector<int>", &m_eclPureDigitAmp);
639  m_tree->Branch("eclPureDigitTimeFit", "std::vector<int>", &m_eclPureDigitTimeFit);
640  m_tree->Branch("eclPureDigitFitQuality", "std::vector<int>", &m_eclPureDigitFitQuality);
641  m_tree->Branch("eclPureDigitToCluster", "std::vector<int>", &m_eclPureDigitToCluster);
642  //Pure CalDigit
643  m_tree->Branch("eclPureCalDigitMultip", &m_eclPureCalDigitMultip, "eclPureCalDigit_Multip/I");
644  m_tree->Branch("eclPureCalDigitIdx", "std::vector<int>", &m_eclPureCalDigitIdx);
645  m_tree->Branch("eclPureCalDigitToMC1", "std::vector<int>", &m_eclPureCalDigitToMC1);
646  m_tree->Branch("eclPureCalDigitToMC1PDG", "std::vector<int>", &m_eclPureCalDigitToMC1PDG);
647  m_tree->Branch("eclPureCalDigitToMCWeight1", "std::vector<double>", &m_eclPureCalDigitToMCWeight1);
648  m_tree->Branch("eclPureCalDigitToMC2", "std::vector<int>", &m_eclPureCalDigitToMC2);
649  m_tree->Branch("eclPureCalDigitToMC2PDG", "std::vector<int>", &m_eclPureCalDigitToMC2PDG);
650  m_tree->Branch("eclPureCalDigitToMCWeight2", "std::vector<double>", &m_eclPureCalDigitToMCWeight2);
651  m_tree->Branch("eclPureCalDigitToMC3", "std::vector<int>", &m_eclPureCalDigitToMC3);
652  m_tree->Branch("eclPureCalDigitToMC3PDG", "std::vector<int>", &m_eclPureCalDigitToMC3PDG);
653  m_tree->Branch("eclPureCalDigitToMCWeight3", "std::vector<double>", &m_eclPureCalDigitToMCWeight3);
654  m_tree->Branch("eclPureCalDigitToMC4", "std::vector<int>", &m_eclPureCalDigitToMC4);
655  m_tree->Branch("eclPureCalDigitToMC4PDG", "std::vector<int>", &m_eclPureCalDigitToMC4PDG);
656  m_tree->Branch("eclPureCalDigitToMCWeight4", "std::vector<double>", &m_eclPureCalDigitToMCWeight4);
657  m_tree->Branch("eclPureCalDigitToMC5", "std::vector<int>", &m_eclPureCalDigitToMC5);
658  m_tree->Branch("eclPureCalDigitToMC5PDG", "std::vector<int>", &m_eclPureCalDigitToMC5PDG);
659  m_tree->Branch("eclPureCalDigitToMCWeight5", "std::vector<double>", &m_eclPureCalDigitToMCWeight5);
660  m_tree->Branch("eclPureCalDigitToBkgWeight", "std::vector<double>", &m_eclPureCalDigitToBkgWeight);
661  m_tree->Branch("eclPureCalDigitSimHitSum", "std::vector<double>", &m_eclPureCalDigitSimHitSum);
662  m_tree->Branch("eclPureCalDigitToShower", "std::vector<int>", &m_eclPureCalDigitToShower);
663  m_tree->Branch("eclPureCalDigitCellId", "std::vector<int>", &m_eclPureCalDigitCellId);
664  m_tree->Branch("eclPureCalDigitAmp", "std::vector<double>", &m_eclPureCalDigitAmp);
665  m_tree->Branch("eclPureCalDigitTimeFit", "std::vector<double>", &m_eclPureCalDigitTimeFit);
666  m_tree->Branch("eclPureCalDigitFitQuality", "std::vector<int>", &m_eclPureCalDigitFitQuality);
667  m_tree->Branch("eclPureCalDigitToCR", "std::vector<int>", &m_eclPureCalDigitToCR);
668  m_tree->Branch("eclPureCalDigitToLM", "std::vector<int>", &m_eclPureCalDigitToLM);
669  m_tree->Branch("eclPureLMMultip", &m_eclPureLMMultip, "eclPureLMMultip/I");
670 
671  m_tree->Branch("eclPureCRIdx", "std::vector<int>", &m_eclPureCRIdx);
672  m_tree->Branch("eclPureCRIsTrack", "std::vector<int>", &m_eclPureCRIsTrack);
673  m_tree->Branch("eclPureCRLikelihoodMIPNGamma", "std::vector<double>", &m_eclPureCRLikelihoodMIPNGamma);
674  m_tree->Branch("eclPureCRLikelihoodChargedHadron", "std::vector<double>", &m_eclPureCRLikelihoodChargedHadron);
675  m_tree->Branch("eclPureCRLikelihoodElectronNGamma", "std::vector<double>", &m_eclPureCRLikelihoodElectronNGamma);
676  m_tree->Branch("eclPureCRLikelihoodNGamma", "std::vector<double>", &m_eclPureCRLikelihoodNGamma);
677  m_tree->Branch("eclPureCRLikelihoodNeutralHadron", "std::vector<double>", &m_eclPureCRLikelihoodNeutralHadron);
678  m_tree->Branch("eclPureCRLikelihoodMergedPi0", "std::vector<double>", &m_eclPureCRLikelihoodMergedPi0);
679 
680  m_tree->Branch("eclPureLMId", "std::vector<int>", &m_eclPureLMId);
681  m_tree->Branch("eclPureLMType", "std::vector<int>", &m_eclPureLMType);
682  m_tree->Branch("eclPureLMCellId", "std::vector<int>", &m_eclPureLMCellId);
683  //Pure Clusters
684  m_tree->Branch("eclPureClusterMultip", &m_eclPureClusterMultip, "eclPureClusterMultip/I");
685  m_tree->Branch("eclPureClusterIdx", "std::vector<int>", &m_eclPureClusterIdx);
686  m_tree->Branch("eclPureClusterToMC1", "std::vector<int>", &m_eclPureClusterToMC1);
687  m_tree->Branch("eclPureClusterToMCWeight1", "std::vector<double>", &m_eclPureClusterToMCWeight1);
688  m_tree->Branch("eclPureClusterToMC1PDG", "std::vector<int>", &m_eclPureClusterToMC1PDG);
689  m_tree->Branch("eclPureClusterToMC2", "std::vector<int>", &m_eclPureClusterToMC2);
690  m_tree->Branch("eclPureClusterToMCWeight2", "std::vector<double>", &m_eclPureClusterToMCWeight2);
691  m_tree->Branch("eclPureClusterToMC2PDG", "std::vector<int>", &m_eclPureClusterToMC2PDG);
692  m_tree->Branch("eclPureClusterToMC3", "std::vector<int>", &m_eclPureClusterToMC3);
693  m_tree->Branch("eclPureClusterToMCWeight3", "std::vector<double>", &m_eclPureClusterToMCWeight3);
694  m_tree->Branch("eclPureClusterToMC3PDG", "std::vector<int>", &m_eclPureClusterToMC3PDG);
695  m_tree->Branch("eclPureClusterToMC4", "std::vector<int>", &m_eclPureClusterToMC4);
696  m_tree->Branch("eclPureClusterToMCWeight4", "std::vector<double>", &m_eclPureClusterToMCWeight4);
697  m_tree->Branch("eclPureClusterToMC4PDG", "std::vector<int>", &m_eclPureClusterToMC4PDG);
698  m_tree->Branch("eclPureClusterToMC5", "std::vector<int>", &m_eclPureClusterToMC5);
699  m_tree->Branch("eclPureClusterToMCWeight5", "std::vector<double>", &m_eclPureClusterToMCWeight5);
700  m_tree->Branch("eclPureClusterToMC5PDG", "std::vector<int>", &m_eclPureClusterToMC5PDG);
701  m_tree->Branch("eclPureClusterToBkgWeight", "std::vector<double>", &m_eclPureClusterToBkgWeight);
702  m_tree->Branch("eclPureClusterEnergy", "std::vector<double>", &m_eclPureClusterEnergy);
703  m_tree->Branch("eclPureClusterEnergyError", "std::vector<double>", &m_eclPureClusterEnergyError);
704  m_tree->Branch("eclPureClusterTheta", "std::vector<double>", &m_eclPureClusterTheta);
705  m_tree->Branch("eclPureClusterThetaError", "std::vector<double>", &m_eclPureClusterThetaError);
706  m_tree->Branch("eclPureClusterPhi", "std::vector<double>", &m_eclPureClusterPhi);
707  m_tree->Branch("eclPureClusterPhiError", "std::vector<double>", &m_eclPureClusterPhiError);
708  m_tree->Branch("eclPureClusterR", "std::vector<double>", &m_eclPureClusterR);
709  m_tree->Branch("eclPureClusterEnergyDepSum", "std::vector<double>", &m_eclPureClusterEnergyDepSum);
710  m_tree->Branch("eclPureClusterTiming", "std::vector<double>", &m_eclPureClusterTiming);
711  m_tree->Branch("eclPureClusterTimingError", "std::vector<double>", &m_eclPureClusterTimingError);
712  m_tree->Branch("eclPureClusterE9oE21", "std::vector<double>", &m_eclPureClusterE9oE21);
713  m_tree->Branch("eclPureClusterHighestE", "std::vector<double>", &m_eclPureClusterHighestE);
714  m_tree->Branch("eclPureClusterCellId", "std::vector<int>", &m_eclPureClusterCellId);
715  m_tree->Branch("eclPureClusterLat", "std::vector<double>", &m_eclPureClusterLat);
716  m_tree->Branch("eclPureClusterNofCrystals", "std::vector<int>", &m_eclPureClusterNofCrystals);
717  m_tree->Branch("eclPureClusterCrystalHealth", "std::vector<int>", &m_eclPureClusterCrystalHealth);
718  m_tree->Branch("eclPureClusterClosestTrackDist", "std::vector<double>", &m_eclPureClusterClosestTrackDist);
719  m_tree->Branch("eclPureClusterAbsZernike40", "std::vector<double>", &m_eclPureClusterAbsZernike40);
720  m_tree->Branch("eclPureClusterAbsZernike51", "std::vector<double>", &m_eclPureClusterAbsZernike51);
721  m_tree->Branch("eclPureClusterZernikeMVA", "std::vector<double>", &m_eclPureClusterZernikeMVA);
722  m_tree->Branch("eclPureClusterSecondMoment", "std::vector<double>", &m_eclPureClusterSecondMoment);
723  m_tree->Branch("eclPureClusterIsTrack", "std::vector<bool>", &m_eclPureClusterIsTrack);
724  m_tree->Branch("eclPureClusterDeltaL", "std::vector<double>", &m_eclPureClusterDeltaL);
725  m_tree->Branch("eclPureClusterE1oE9", "std::vector<double>", &m_eclPureClusterE1oE9);
726  m_tree->Branch("eclPureClusterDeltaTime99", "std::vector<double>", &m_eclPureClusterDeltaTime99);
727  m_tree->Branch("eclPureClusterDetectorRegion", "std::vector<int>", &m_eclPureClusterDetectorRegion);
728  m_tree->Branch("eclPureClusterHasNPhotonHypothesis", "std::vector<int>", &m_eclPureClusterHasNPhotonHypothesis);
729  m_tree->Branch("eclPureClusterHasNeutralHadronHypothesis", "std::vector<int>", &m_eclPureClusterHasNeutralHadronHypothesis);
730  }
731 
733  m_tree->Branch("eclShowerMultip", &m_eclShowerMultip, "eclShowerMultip/I");
734  m_tree->Branch("eclShowerIdx", "std::vector<int>", &m_eclShowerIdx);
735  m_tree->Branch("eclShowerToMC1", "std::vector<int>", &m_eclShowerToMC1);
736  m_tree->Branch("eclShowerToMCWeight1", "std::vector<double>", &m_eclShowerToMCWeight1);
737  m_tree->Branch("eclShowerToMC1PDG", "std::vector<int>", &m_eclShowerToMC1PDG);
738  m_tree->Branch("eclShowerToMC1Moth", "std::vector<int>", &m_eclShowerToMC1Moth);
739  m_tree->Branch("eclShowerToMC1MothPDG", "std::vector<int>", &m_eclShowerToMC1MothPDG);
740  m_tree->Branch("eclShowerToMC1GMoth", "std::vector<int>", &m_eclShowerToMC1GMoth);
741  m_tree->Branch("eclShowerToMC1GMothPDG", "std::vector<int>", &m_eclShowerToMC1GMothPDG);
742  m_tree->Branch("eclShowerToMC2", "std::vector<int>", &m_eclShowerToMC2);
743  m_tree->Branch("eclShowerToMCWeight2", "std::vector<double>", &m_eclShowerToMCWeight2);
744  m_tree->Branch("eclShowerToMC2PDG", "std::vector<int>", &m_eclShowerToMC2PDG);
745  m_tree->Branch("eclShowerToMC2Moth", "std::vector<int>", &m_eclShowerToMC2Moth);
746  m_tree->Branch("eclShowerToMC2MothPDG", "std::vector<int>", &m_eclShowerToMC2MothPDG);
747  m_tree->Branch("eclShowerToMC2GMoth", "std::vector<int>", &m_eclShowerToMC2GMoth);
748  m_tree->Branch("eclShowerToMC2GMothPDG", "std::vector<int>", &m_eclShowerToMC2GMothPDG);
749  m_tree->Branch("eclShowerToMC3", "std::vector<int>", &m_eclShowerToMC3);
750  m_tree->Branch("eclShowerToMCWeight3", "std::vector<double>", &m_eclShowerToMCWeight3);
751  m_tree->Branch("eclShowerToMC3PDG", "std::vector<int>", &m_eclShowerToMC3PDG);
752  m_tree->Branch("eclShowerToMC3Moth", "std::vector<int>", &m_eclShowerToMC3Moth);
753  m_tree->Branch("eclShowerToMC3MothPDG", "std::vector<int>", &m_eclShowerToMC3MothPDG);
754  m_tree->Branch("eclShowerToMC3GMoth", "std::vector<int>", &m_eclShowerToMC3GMoth);
755  m_tree->Branch("eclShowerToMC3GMothPDG", "std::vector<int>", &m_eclShowerToMC3GMothPDG);
756  m_tree->Branch("eclShowerToMC4", "std::vector<int>", &m_eclShowerToMC4);
757  m_tree->Branch("eclShowerToMCWeight4", "std::vector<double>", &m_eclShowerToMCWeight4);
758  m_tree->Branch("eclShowerToMC4PDG", "std::vector<int>", &m_eclShowerToMC4PDG);
759  m_tree->Branch("eclShowerToMC4Moth", "std::vector<int>", &m_eclShowerToMC4Moth);
760  m_tree->Branch("eclShowerToMC4MothPDG", "std::vector<int>", &m_eclShowerToMC4MothPDG);
761  m_tree->Branch("eclShowerToMC4GMoth", "std::vector<int>", &m_eclShowerToMC4GMoth);
762  m_tree->Branch("eclShowerToMC4GMothPDG", "std::vector<int>", &m_eclShowerToMC4GMothPDG);
763  m_tree->Branch("eclShowerToMC5", "std::vector<int>", &m_eclShowerToMC5);
764  m_tree->Branch("eclShowerToMCWeight5", "std::vector<double>", &m_eclShowerToMCWeight5);
765  m_tree->Branch("eclShowerToMC5PDG", "std::vector<int>", &m_eclShowerToMC5PDG);
766  m_tree->Branch("eclShowerToMC5Moth", "std::vector<int>", &m_eclShowerToMC5Moth);
767  m_tree->Branch("eclShowerToMC5MothPDG", "std::vector<int>", &m_eclShowerToMC5MothPDG);
768  m_tree->Branch("eclShowerToMC5GMoth", "std::vector<int>", &m_eclShowerToMC5GMoth);
769  m_tree->Branch("eclShowerToMC5GMothPDG", "std::vector<int>", &m_eclShowerToMC5GMothPDG);
770  m_tree->Branch("eclShowerToBkgWeight", "std::vector<double>", &m_eclShowerToBkgWeight);
771  m_tree->Branch("eclShowerToLM1", "std::vector<int>", &m_eclShowerToLM1);
772  m_tree->Branch("eclShowerToLM2", "std::vector<int>", &m_eclShowerToLM2);
773  m_tree->Branch("eclShowerToLM3", "std::vector<int>", &m_eclShowerToLM3);
774  m_tree->Branch("eclShowerToLM4", "std::vector<int>", &m_eclShowerToLM4);
775  m_tree->Branch("eclShowerToLM5", "std::vector<int>", &m_eclShowerToLM5);
776  m_tree->Branch("eclShowerSimHitSum", "std::vector<double>", &m_eclShowerSimHitSum);
777  m_tree->Branch("eclShowerEnergy", "std::vector<double>", &m_eclShowerEnergy);
778  m_tree->Branch("eclShowerUncEnergy", "std::vector<double>", &m_eclShowerUncEnergy);
779  m_tree->Branch("eclShowerTheta", "std::vector<double>", &m_eclShowerTheta);
780  m_tree->Branch("eclShowerPhi", "std::vector<double>", &m_eclShowerPhi);
781  m_tree->Branch("eclShowerR", "std::vector<double>", &m_eclShowerR);
782  m_tree->Branch("eclShowerNHits", "std::vector<double>", &m_eclShowerNHits);
783  m_tree->Branch("eclShowerE9oE21", "std::vector<double>", &m_eclShowerE9oE21);
784  m_tree->Branch("eclShowerTime", "std::vector<double>", &m_eclShowerTime);
785  m_tree->Branch("eclShowerT99", "std::vector<double>", &m_eclShowerT99);
786  m_tree->Branch("eclShowerConnectedRegionId", "std::vector<int>", &m_eclShowerConnectedRegionId);
787  m_tree->Branch("eclShowerHypothesisId", "std::vector<int>", &m_eclShowerHypothesisId);
788  m_tree->Branch("eclShowerCentralCellId", "std::vector<int>", &m_eclShowerCentralCellId);
789  m_tree->Branch("eclShowerEnergyError", "std::vector<double>", &m_eclShowerEnergyError);
790  m_tree->Branch("eclShowerThetaError", "std::vector<double>", &m_eclShowerThetaError);
791  m_tree->Branch("eclShowerPhiError", "std::vector<double>", &m_eclShowerPhiError);
792  m_tree->Branch("eclShowerTimeResolution", "std::vector<double>", &m_eclShowerTimeResolution);
793  m_tree->Branch("eclShowerHighestEnergy", "std::vector<double>", &m_eclShowerHighestEnergy);
794  m_tree->Branch("eclShowerLateralEnergy", "std::vector<double>", &m_eclShowerLateralEnergy);
795  m_tree->Branch("eclShowerMinTrkDistance", "std::vector<double>", &m_eclShowerMinTrkDistance);
796  m_tree->Branch("eclShowerTrkDepth", "std::vector<double>", &m_eclShowerTrkDepth);
797  m_tree->Branch("eclShowerShowerDepth", "std::vector<double>", &m_eclShowerShowerDepth);
798  m_tree->Branch("eclShowerAbsZernike40", "std::vector<double>", &m_eclShowerAbsZernike40);
799  m_tree->Branch("eclShowerAbsZernike51", "std::vector<double>", &m_eclShowerAbsZernike51);
800  m_tree->Branch("eclShowerZernikeMVA", "std::vector<double>", &m_eclShowerZernikeMVA);
801  m_tree->Branch("eclShowerSecondMoment", "std::vector<double>", &m_eclShowerSecondMoment);
802  m_tree->Branch("eclShowerE1oE9", "std::vector<double>", &m_eclShowerE1oE9);
803  m_tree->Branch("eclShowerIsTrack", "std::vector<int>", &m_eclShowerIsTrack);
804  m_tree->Branch("eclShowerIsCluster", "std::vector<bool>", &m_eclShowerIsCluster);
805  m_tree->Branch("eclShowerMCVtxInEcl", "std::vector<int>", &m_eclShowerMCVtxInEcl);
806  m_tree->Branch("eclShowerMCFlightMatch", "std::vector<int>", &m_eclShowerMCFlightMatch);
807  m_tree->Branch("eclShowerMCFFlightMatch", "std::vector<int>", &m_eclShowerMCFFlightMatch);
808  m_tree->Branch("eclShowerHighestE1mE2", "std::vector<double>", &m_eclShowerHighestE1mE2);
809  m_tree->Branch("eclShowerNumberOfCrystalsForEnergy", "std::vector<double>", &m_eclShowerNumberOfCrystalsForEnergy);
810 
811  //MC Truth
812  m_tree->Branch("mcMultip", &m_mcMultip, "mcMultip/I");
813  m_tree->Branch("mcIdx", "std::vector<int>", &m_mcIdx);
814  m_tree->Branch("mcPdg", "std::vector<int>", &m_mcPdg);
815  m_tree->Branch("mcMothPdg", "std::vector<int>", &m_mcMothPdg);
816  m_tree->Branch("mcGMothPdg", "std::vector<int>", &m_mcGMothPdg);
817  m_tree->Branch("mcGGMothPdg", "std::vector<int>", &m_mcGGMothPdg);
818  m_tree->Branch("mcEnergy", "std::vector<double>", &m_mcEnergy);
819  m_tree->Branch("mcPx", "std::vector<double>", &m_mcPx);
820  m_tree->Branch("mcPy", "std::vector<double>", &m_mcPy);
821  m_tree->Branch("mcPz", "std::vector<double>", &m_mcPz);
822  m_tree->Branch("mcDecVtxx", "std::vector<double>", &m_mcDecayVtxX);
823  m_tree->Branch("mcDecVtxy", "std::vector<double>", &m_mcDecayVtxY);
824  m_tree->Branch("mcDecVtxz", "std::vector<double>", &m_mcDecayVtxZ);
825  m_tree->Branch("mcProdVtxx", "std::vector<double>", &m_mcProdVtxX);
826  m_tree->Branch("mcProdVtxy", "std::vector<double>", &m_mcProdVtxY);
827  m_tree->Branch("mcProdVtxz", "std::vector<double>", &m_mcProdVtxZ);
828  m_tree->Branch("mcSecProc", "std::vector<int>", &m_mcSecondaryPhysProc);
829 
830  if (m_doTracking == true) {
831  m_tree->Branch("trkMultip", &m_trkMultip, "trkMulti/I");
832  m_tree->Branch("trkIdx", "std::vector<int>", &m_trkIdx);
833  m_tree->Branch("trkPdg", "std::vector<int>", &m_trkPdg);
834  m_tree->Branch("trkCharge", "std::vector<int>", &m_trkCharge);
835  m_tree->Branch("trkPx", "std::vector<double>", &m_trkPx);
836  m_tree->Branch("trkPy", "std::vector<double>", &m_trkPy);
837  m_tree->Branch("trkPz", "std::vector<double>", &m_trkPz);
838  m_tree->Branch("trkP", "std::vector<double>", &m_trkP);
839  m_tree->Branch("trkTheta", "std::vector<double>", &m_trkTheta);
840  m_tree->Branch("trkPhi", "std::vector<double>", &m_trkPhi);
841  m_tree->Branch("trkPosx", "std::vector<double>", &m_trkX);
842  m_tree->Branch("trkPosy", "std::vector<double>", &m_trkY);
843  m_tree->Branch("trkPosz", "std::vector<double>", &m_trkZ);
844 
845  m_tree->Branch("eclpidtrkIdx", "std::vector<int>", &m_eclpidtrkIdx);
846  m_tree->Branch("eclpidEnergy", "std::vector<double>", &m_eclpidEnergy);
847  m_tree->Branch("eclpidEop", "std::vector<double>", &m_eclpidEop);
848  m_tree->Branch("eclpidE9E21", "std::vector<double>", &m_eclpidE9E21);
849  m_tree->Branch("eclpidNCrystals", "std::vector<int>", &m_eclpidNCrystals);
850  m_tree->Branch("eclpidNClusters", "std::vector<int>", &m_eclpidNClusters);
851  m_tree->Branch("eclLogLikeEl", "std::vector<double>", &m_eclLogLikeEl);
852  m_tree->Branch("eclLogLikeMu", "std::vector<double>", &m_eclLogLikeMu);
853  m_tree->Branch("eclLogLikePi", "std::vector<double>", &m_eclLogLikePi);
854  }
855 
856  B2INFO("[ECLDataAnalysis Module]: Initialization of ECLDataAnalysis Module completed.");
857 
858 }
859 
860 void ECLDataAnalysisModule::beginRun()
861 {
862 }
863 
864 
865 void ECLDataAnalysisModule::event()
866 {
867 
868  B2DEBUG(1, " ++++++++++++++ ECLDataAnalysisModule");
869 
870  //EventLevelClusteringInfo
871  m_nECLCalDigitsOutOfTimeFWD = 0;
872  m_nECLCalDigitsOutOfTimeBarrel = 0;
873  m_nECLCalDigitsOutOfTimeBWD = 0;
874  m_nECLShowersRejectedFWD = 0;
875  m_nECLShowersRejectedBarrel = 0;
876  m_nECLShowersRejectedBWD = 0;
877 
878  if (m_doDigits == 1) {
880  m_eclDigitMultip = 0;
881  m_eclDigitIdx->clear();
882  m_eclDigitToMC->clear();
883  m_eclDigitCellId->clear();
884  m_eclDigitAmp->clear();
885  m_eclDigitTimeFit->clear();
886  m_eclDigitFitQuality->clear();
887  m_eclDigitToCalDigit->clear();
888 
890  m_eclCalDigitMultip = 0;
891  m_eclCalDigitCellId->clear();
892  m_eclCalDigitAmp->clear();
893  m_eclCalDigitTimeFit->clear();
894  m_eclCalDigitFitQuality->clear();
895  m_eclCalDigitIdx->clear();
896  m_eclCalDigitToMC1->clear();
897  m_eclCalDigitToMCWeight1->clear();
898  m_eclCalDigitToMC2->clear();
899  m_eclCalDigitToMCWeight2->clear();
900  m_eclCalDigitToMC3->clear();
901  m_eclCalDigitToMCWeight3->clear();
902  m_eclCalDigitToMC4->clear();
903  m_eclCalDigitToMCWeight4->clear();
904  m_eclCalDigitToMC5->clear();
905  m_eclCalDigitToMCWeight5->clear();
906  m_eclCalDigitToMC1PDG->clear();
907  m_eclCalDigitToMC2PDG->clear();
908  m_eclCalDigitToMC3PDG->clear();
909  m_eclCalDigitToMC4PDG->clear();
910  m_eclCalDigitToMC5PDG->clear();
911  m_eclCalDigitToBkgWeight->clear();
912  m_eclCalDigitSimHitSum->clear();
913  m_eclCalDigitToShower->clear();
914  m_eclCalDigitToCR->clear();
915  m_eclCalDigitToLM->clear();
916  }
917 
918  m_eclCRIdx->clear();
919  m_eclCRIsTrack->clear();
920  m_eclCRLikelihoodMIPNGamma->clear();
921  m_eclCRLikelihoodChargedHadron->clear();
922  m_eclCRLikelihoodElectronNGamma->clear();
923  m_eclCRLikelihoodNGamma->clear();
924  m_eclCRLikelihoodNeutralHadron->clear();
925  m_eclCRLikelihoodMergedPi0->clear();
926 
927  if (m_doHits == 1) {
928  //SimHit
929  m_eclSimHitMultip = 0;
930  m_eclSimHitCellId->clear();
931  m_eclSimHitPdg->clear();
932  m_eclSimHitEnergyDep->clear();
933  m_eclSimHitFlightTime->clear();
934  m_eclSimHitIdx->clear();
935  m_eclSimHitToMC->clear();
936  m_eclSimHitX->clear();
937  m_eclSimHitY->clear();
938  m_eclSimHitZ->clear();
939  m_eclSimHitPx->clear();
940  m_eclSimHitPy->clear();
941  m_eclSimHitPz->clear();
942 
944  m_eclHitMultip = 0;
945  m_eclHitCellId->clear();
946  m_eclHitEnergyDep->clear();
947  m_eclHitTimeAve->clear();
948  m_eclHitIdx->clear();
949  m_eclHitToMC->clear();
950  m_eclHitToDigit->clear();
951  m_eclHitToDigitAmp->clear();
952  }
953 
954  m_eclLMMultip = 0;
955  m_eclLMId->clear();
956  m_eclLMType->clear();
957  m_eclLMCellId->clear();
958 
960  m_eclClusterMultip = 0;
961  m_eclClusterTrueMultip = 0;
962  m_eclClusterGammaMultip = 0;
963  m_eclClusterEnergy->clear();
964  m_eclClusterEnergyError->clear();
965  m_eclClusterTheta->clear();
966  m_eclClusterThetaError->clear();
967  m_eclClusterPhi->clear();
968  m_eclClusterPhiError->clear();
969  m_eclClusterR->clear();
970  m_eclClusterIdx->clear();
971  m_eclClusterToMC1->clear();
972  m_eclClusterToMCWeight1->clear();
973  m_eclClusterToMC1PDG->clear();
974  m_eclClusterToMC2->clear();
975  m_eclClusterToMCWeight2->clear();
976  m_eclClusterToMC2PDG->clear();
977  m_eclClusterToMC3->clear();
978  m_eclClusterToMCWeight3->clear();
979  m_eclClusterToMC3PDG->clear();
980  m_eclClusterToMC4->clear();
981  m_eclClusterToMCWeight4->clear();
982  m_eclClusterToMC4PDG->clear();
983  m_eclClusterToMC5->clear();
984  m_eclClusterToMCWeight5->clear();
985  m_eclClusterToMC5PDG->clear();
986  m_eclClusterToBkgWeight->clear();
987  m_eclClusterSimHitSum->clear();
988  m_eclClusterEnergyDepSum->clear();
989  m_eclClusterTiming->clear();
990  m_eclClusterTimingError->clear();
991  m_eclClusterE9oE21->clear();
992  m_eclClusterHighestE->clear();
993  m_eclClusterCellId->clear();
994  m_eclClusterNofCrystals->clear();
995  m_eclClusterCrystalHealth->clear();
996  m_eclClusterIsTrack->clear();
997  m_eclClusterClosestTrackDist->clear();
998  m_eclClusterDeltaL->clear();
999  m_eclClusterToShower->clear();
1000  m_eclClusterAbsZernike40->clear();
1001  m_eclClusterAbsZernike51->clear();
1002  m_eclClusterZernikeMVA->clear();
1003  m_eclClusterE1oE9->clear();
1004  m_eclClusterSecondMoment->clear();
1005  m_eclClusterLAT->clear();
1006  m_eclClusterDeltaTime99->clear();
1007  m_eclClusterDetectorRegion->clear();
1008  m_eclClusterHasNPhotonHypothesis->clear();
1009  m_eclClusterHasNeutralHadronHypothesis->clear();
1010 
1012  m_eclShowerMultip = 0;
1013  m_eclShowerIdx->clear();
1014  m_eclShowerToMC1->clear();
1015  m_eclShowerToMCWeight1->clear();
1016  m_eclShowerToMC1PDG->clear();
1017  m_eclShowerToMC1Moth->clear();
1018  m_eclShowerToMC1MothPDG->clear();
1019  m_eclShowerToMC1GMoth->clear();
1020  m_eclShowerToMC1GMothPDG->clear();
1021  m_eclShowerToMC2->clear();
1022  m_eclShowerToMCWeight2->clear();
1023  m_eclShowerToMC2PDG->clear();
1024  m_eclShowerToMC2Moth->clear();
1025  m_eclShowerToMC2MothPDG->clear();
1026  m_eclShowerToMC2GMoth->clear();
1027  m_eclShowerToMC2GMothPDG->clear();
1028  m_eclShowerToMC3->clear();
1029  m_eclShowerToMCWeight3->clear();
1030  m_eclShowerToMC3PDG->clear();
1031  m_eclShowerToMC3Moth->clear();
1032  m_eclShowerToMC3MothPDG->clear();
1033  m_eclShowerToMC3GMoth->clear();
1034  m_eclShowerToMC3GMothPDG->clear();
1035  m_eclShowerToMC4->clear();
1036  m_eclShowerToMCWeight4->clear();
1037  m_eclShowerToMC4PDG->clear();
1038  m_eclShowerToMC4Moth->clear();
1039  m_eclShowerToMC4MothPDG->clear();
1040  m_eclShowerToMC4GMoth->clear();
1041  m_eclShowerToMC4GMothPDG->clear();
1042  m_eclShowerToMC5->clear();
1043  m_eclShowerToMCWeight5->clear();
1044  m_eclShowerToMC5PDG->clear();
1045  m_eclShowerToMC5Moth->clear();
1046  m_eclShowerToMC5MothPDG->clear();
1047  m_eclShowerToMC5GMoth->clear();
1048  m_eclShowerToMC5GMothPDG->clear();
1049  m_eclShowerToBkgWeight->clear();
1050  m_eclShowerToLM1->clear();
1051  m_eclShowerToLM2->clear();
1052  m_eclShowerToLM3->clear();
1053  m_eclShowerToLM4->clear();
1054  m_eclShowerToLM5->clear();
1055  m_eclShowerSimHitSum->clear();
1056  m_eclShowerUncEnergy->clear();
1057  m_eclShowerEnergy->clear();
1058  m_eclShowerTheta->clear();
1059  m_eclShowerPhi->clear();
1060  m_eclShowerR->clear();
1061  m_eclShowerNHits->clear();
1062  m_eclShowerE9oE21->clear();
1063  m_eclShowerTime->clear();
1064  m_eclShowerT99->clear();
1065  m_eclShowerConnectedRegionId->clear();
1066  m_eclShowerHypothesisId->clear();
1067  m_eclShowerCentralCellId->clear();
1068  m_eclShowerEnergyError->clear();
1069  m_eclShowerThetaError->clear();
1070  m_eclShowerPhiError->clear();
1071  m_eclShowerTimeResolution->clear();
1072  m_eclShowerHighestEnergy->clear();
1073  m_eclShowerLateralEnergy->clear();
1074  m_eclShowerMinTrkDistance->clear();
1075  m_eclShowerTrkDepth->clear();
1076  m_eclShowerShowerDepth->clear();
1077  m_eclShowerAbsZernike40->clear();
1078  m_eclShowerAbsZernike51->clear();
1079  m_eclShowerZernikeMVA->clear();
1080  m_eclShowerSecondMoment->clear();
1081  m_eclShowerE1oE9->clear();
1082  m_eclShowerIsTrack->clear();
1083  m_eclShowerIsCluster->clear();
1084  m_eclShowerMCVtxInEcl->clear();
1085  m_eclShowerMCFlightMatch->clear();
1086  m_eclShowerMCFFlightMatch->clear();
1087  m_eclShowerHighestE1mE2->clear();
1088  m_eclShowerNumberOfCrystalsForEnergy->clear();
1089 
1091  if (m_doPureCsI == true) {
1092  m_eclPureDigitMultip = 0;
1093  m_eclPureDigitIdx->clear();
1094  m_eclPureDigitToMC->clear();
1095  m_eclPureDigitCellId->clear();
1096  m_eclPureDigitAmp->clear();
1097  m_eclPureDigitTimeFit->clear();
1098  m_eclPureDigitFitQuality->clear();
1099  m_eclPureDigitToCluster->clear();
1100  m_eclHitToPureDigit->clear();
1101  m_eclHitToPureDigitAmp->clear();
1102 
1103  //Pure CalDigits
1104  m_eclPureCalDigitMultip = 0;
1105  m_eclPureCalDigitCellId->clear();
1106  m_eclPureCalDigitAmp->clear();
1107  m_eclPureCalDigitTimeFit->clear();
1108  m_eclPureCalDigitFitQuality->clear();
1109  m_eclPureCalDigitIdx->clear();
1110  m_eclPureCalDigitToMC1->clear();
1111  m_eclPureCalDigitToMCWeight1->clear();
1112  m_eclPureCalDigitToMC2->clear();
1113  m_eclPureCalDigitToMCWeight2->clear();
1114  m_eclPureCalDigitToMC3->clear();
1115  m_eclPureCalDigitToMCWeight3->clear();
1116  m_eclPureCalDigitToMC4->clear();
1117  m_eclPureCalDigitToMCWeight4->clear();
1118  m_eclPureCalDigitToMC5->clear();
1119  m_eclPureCalDigitToMCWeight5->clear();
1120  m_eclPureCalDigitToMC1PDG->clear();
1121  m_eclPureCalDigitToMC2PDG->clear();
1122  m_eclPureCalDigitToMC3PDG->clear();
1123  m_eclPureCalDigitToMC4PDG->clear();
1124  m_eclPureCalDigitToMC5PDG->clear();
1125  m_eclPureCalDigitToBkgWeight->clear();
1126  m_eclPureCalDigitSimHitSum->clear();
1127  m_eclPureCalDigitToShower->clear();
1128  m_eclPureCalDigitToCR->clear();
1129  m_eclPureCalDigitToLM->clear();
1130 
1131  m_eclPureCRIdx->clear();
1132  m_eclPureCRIsTrack->clear();
1133  m_eclPureCRLikelihoodMIPNGamma->clear();
1134  m_eclPureCRLikelihoodChargedHadron->clear();
1135  m_eclPureCRLikelihoodElectronNGamma->clear();
1136  m_eclPureCRLikelihoodNGamma->clear();
1137  m_eclPureCRLikelihoodNeutralHadron->clear();
1138  m_eclPureCRLikelihoodMergedPi0->clear();
1139 
1140  m_eclPureLMMultip = 0;
1141  m_eclPureLMId->clear();
1142  m_eclPureLMType->clear();
1143  m_eclPureLMCellId->clear();
1144 
1146  m_eclPureClusterMultip = 0;
1147  m_eclPureClusterToMC1->clear();
1148  m_eclPureClusterToMCWeight1->clear();
1149  m_eclPureClusterToMC1PDG->clear();
1150  m_eclPureClusterToMC2->clear();
1151  m_eclPureClusterToMCWeight2->clear();
1152  m_eclPureClusterToMC2PDG->clear();
1153  m_eclPureClusterToMC3->clear();
1154  m_eclPureClusterToMCWeight3->clear();
1155  m_eclPureClusterToMC3PDG->clear();
1156  m_eclPureClusterToMC4->clear();
1157  m_eclPureClusterToMCWeight4->clear();
1158  m_eclPureClusterToMC4PDG->clear();
1159  m_eclPureClusterToMC5->clear();
1160  m_eclPureClusterToMCWeight5->clear();
1161  m_eclPureClusterToMC5PDG->clear();
1162  m_eclPureClusterToBkgWeight->clear();
1163  m_eclPureClusterEnergy->clear();
1164  m_eclPureClusterEnergyError->clear();
1165  m_eclPureClusterTheta->clear();
1166  m_eclPureClusterEnergyDepSum->clear();
1167  m_eclPureClusterThetaError->clear();
1168  m_eclPureClusterPhi->clear();
1169  m_eclPureClusterPhiError->clear();
1170  m_eclPureClusterR->clear();
1171  m_eclPureClusterIdx->clear();
1172  m_eclPureClusterTiming->clear();
1173  m_eclPureClusterTimingError->clear();
1174  m_eclPureClusterE9oE21->clear();
1175  m_eclPureClusterHighestE->clear();
1176  m_eclPureClusterCellId->clear();
1177  m_eclPureClusterLat->clear();
1178  m_eclPureClusterNofCrystals->clear();
1179  m_eclPureClusterCrystalHealth->clear();
1180  m_eclPureClusterClosestTrackDist->clear();
1181  m_eclPureClusterAbsZernike40->clear();
1182  m_eclPureClusterAbsZernike51->clear();
1183  m_eclPureClusterZernikeMVA->clear();
1184  m_eclPureClusterSecondMoment->clear();
1185  m_eclPureClusterIsTrack->clear();
1186  m_eclPureClusterDeltaL->clear();
1187  m_eclPureClusterE1oE9->clear();
1188  m_eclPureClusterDeltaTime99->clear();
1189  m_eclPureClusterDetectorRegion->clear();
1190  m_eclPureClusterHasNPhotonHypothesis->clear();
1191  m_eclPureClusterHasNeutralHadronHypothesis->clear();
1192  }
1193 
1195  m_mcMultip = 0;
1196  m_mcIdx->clear();
1197  m_mcPdg->clear();
1198  m_mcMothPdg->clear();
1199  m_mcGMothPdg->clear();
1200  m_mcGGMothPdg->clear();
1201  m_mcEnergy->clear();
1202  m_mcPx->clear();
1203  m_mcPy->clear();
1204  m_mcPz->clear();
1205  m_mcDecayVtxX->clear();
1206  m_mcDecayVtxY->clear();
1207  m_mcDecayVtxZ->clear();
1208  m_mcProdVtxX->clear();
1209  m_mcProdVtxY->clear();
1210  m_mcProdVtxZ->clear();
1211  m_mcSecondaryPhysProc->clear();
1212 
1214  if (m_doTracking == true) {
1215  m_trkMultip = 0;
1216  m_trkIdx->clear();
1217  m_trkPdg->clear();
1218  m_trkCharge->clear();
1219  m_trkPx->clear();
1220  m_trkPy->clear();
1221  m_trkPz->clear();
1222  m_trkP->clear();
1223  m_trkPhi->clear();
1224  m_trkTheta->clear();
1225  m_trkPhi->clear();
1226  m_trkX->clear();
1227  m_trkY->clear();
1228  m_trkZ->clear();
1229 
1231  m_eclpidtrkIdx->clear();
1232  m_eclpidEnergy->clear();
1233  m_eclpidEop->clear();
1234  m_eclpidE9E21->clear();
1235  m_eclpidNCrystals->clear();
1236  m_eclpidNClusters->clear();
1237  m_eclLogLikeEl->clear();
1238  m_eclLogLikeMu->clear();
1239  m_eclLogLikePi->clear();
1240  }
1241 
1242 
1243  if (m_eventmetadata) {
1244  m_iExperiment = m_eventmetadata->getExperiment();
1245  m_iRun = m_eventmetadata->getRun();
1246  m_iEvent = m_eventmetadata->getEvent();
1247  } else {
1248  m_iExperiment = -1;
1249  m_iRun = -1;
1250  m_iEvent = -1;
1251  }
1252 
1253  //EventLevelClusteringInfo
1254  m_nECLCalDigitsOutOfTimeFWD = m_eventLevelClusteringInfo->getNECLCalDigitsOutOfTimeFWD();
1255  m_nECLCalDigitsOutOfTimeBarrel = m_eventLevelClusteringInfo->getNECLCalDigitsOutOfTimeBarrel();
1256  m_nECLCalDigitsOutOfTimeBWD = m_eventLevelClusteringInfo->getNECLCalDigitsOutOfTimeBWD();
1257  m_nECLShowersRejectedFWD = m_eventLevelClusteringInfo->getNECLShowersRejectedFWD();
1258  m_nECLShowersRejectedBarrel = m_eventLevelClusteringInfo->getNECLShowersRejectedBarrel();
1259  m_nECLShowersRejectedBWD = m_eventLevelClusteringInfo->getNECLShowersRejectedBWD();
1260 
1261  if (m_doDigits == 1) {
1262  //DIGITS
1263  m_eclDigitMultip = m_eclDigits.getEntries();
1264  for (int idigits = 0; idigits < m_eclDigits.getEntries() ; idigits++) {
1265  ECLDigit* aECLDigits = m_eclDigits[idigits];
1266  m_eclDigitIdx->push_back(idigits);
1267  m_eclDigitCellId->push_back(aECLDigits->getCellId());
1268  m_eclDigitAmp->push_back(aECLDigits->getAmp());
1269  m_eclDigitTimeFit->push_back(aECLDigits->getTimeFit());
1270  m_eclDigitFitQuality->push_back(aECLDigits->getQuality());
1271 
1272  if (aECLDigits->getRelated<MCParticle>() != (nullptr)) {
1273  const MCParticle* mc_digit = aECLDigits->getRelated<MCParticle>();
1274  m_eclDigitToMC->push_back(mc_digit->getArrayIndex());
1275  } else
1276  m_eclDigitToMC->push_back(-1);
1277 
1278  if (aECLDigits->getRelated<ECLCalDigit>() != (nullptr)) {
1279  const ECLCalDigit* cal_digit = aECLDigits->getRelated<ECLCalDigit>();
1280  m_eclDigitToCalDigit->push_back(cal_digit->getArrayIndex());
1281  } else
1282  m_eclDigitToCalDigit->push_back(-1);
1283  }
1284 
1285  //CAL DIGITS
1286  m_eclCalDigitMultip = m_eclCalDigits.getEntries();
1287  for (uint icaldigits = 0; icaldigits < (uint)m_eclCalDigits.getEntries() ; icaldigits++) {
1288  ECLCalDigit* aECLCalDigits = m_eclCalDigits[icaldigits];
1289 
1290  m_eclCalDigitIdx->push_back(icaldigits);
1291  m_eclCalDigitCellId->push_back(aECLCalDigits->getCellId());
1292  m_eclCalDigitAmp->push_back(aECLCalDigits->getEnergy());
1293  m_eclCalDigitTimeFit->push_back(aECLCalDigits->getTime());
1294  m_eclCalDigitFitQuality->push_back(aECLCalDigits->isFailedFit());
1295 
1296  double sumHit = 0;
1297  int idx[10];
1298  for (int i = 0; i < 10; i++)
1299  idx[i] = -1;
1300 
1301  double wi[10];
1302  for (int i = 0; i < 10; i++)
1303  wi[i] = -1;
1304 
1305  int ii = 0;
1306  sumHit = 0;
1307 
1308  auto digitMCRelations = aECLCalDigits->getRelationsTo<MCParticle>();
1309  for (unsigned int i = 0; i < digitMCRelations.size(); ++i) {
1310  if (ii < 10) {
1311  const auto mcParticle = digitMCRelations.object(i);
1312  idx[ii] = mcParticle->getIndex() - 1;
1313  wi[ii] = digitMCRelations.weight(i);
1314  sumHit = sumHit + digitMCRelations.weight(i);
1315  ii++;
1316  }
1317  }
1318 
1319  //Re-ordering based on contribution
1320  int y = 0;
1321  while (y < 10) {
1322  for (int i = 0; i < 9; i++) {
1323  if (((idx[i]) > -1) && ((idx[i + 1]) > -1)) {
1324  if (wi[i] < wi[i + 1]) {
1325  int temp = idx[i];
1326  idx[i] = idx[i + 1];
1327  idx[i + 1] = temp;
1328 
1329  double wtemp = wi[i];
1330  wi[i] = wi[i + 1];
1331  wi[i + 1] = wtemp;
1332  }
1333  }
1334  }
1335  y++;
1336  }
1337 
1338  m_eclCalDigitToBkgWeight->push_back(aECLCalDigits->getEnergy() - sumHit);
1339  m_eclCalDigitSimHitSum->push_back(sumHit);
1340  if (idx[0] > -1) {
1341  m_eclCalDigitToMCWeight1->push_back(wi[0]);
1342  m_eclCalDigitToMC1->push_back(idx[0]);
1343  MCParticle* amcParticle = m_mcParticles[idx[0]];
1344  m_eclCalDigitToMC1PDG->push_back(amcParticle->getPDG());
1345  } else {
1346  m_eclCalDigitToMCWeight1->push_back(-1);
1347  m_eclCalDigitToMC1->push_back(-1);
1348  m_eclCalDigitToMC1PDG->push_back(-1);
1349  }
1350  if (idx[1] > -1) {
1351  m_eclCalDigitToMCWeight2->push_back(wi[1]);
1352  m_eclCalDigitToMC2->push_back(idx[1]);
1353  MCParticle* amcParticle = m_mcParticles[idx[1]];
1354  m_eclCalDigitToMC2PDG->push_back(amcParticle->getPDG());
1355  } else {
1356  m_eclCalDigitToMCWeight2->push_back(-1);
1357  m_eclCalDigitToMC2->push_back(-1);
1358  m_eclCalDigitToMC2PDG->push_back(-1);
1359  }
1360  if (idx[2] > -1) {
1361  m_eclCalDigitToMCWeight3->push_back(wi[2]);
1362  m_eclCalDigitToMC3->push_back(idx[2]);
1363  MCParticle* amcParticle = m_mcParticles[idx[2]];
1364  m_eclCalDigitToMC3PDG->push_back(amcParticle->getPDG());
1365  } else {
1366  m_eclCalDigitToMCWeight3->push_back(-1);
1367  m_eclCalDigitToMC3->push_back(-1);
1368  m_eclCalDigitToMC3PDG->push_back(-1);
1369  }
1370  if (idx[3] > -1) {
1371  m_eclCalDigitToMCWeight4->push_back(wi[3]);
1372  m_eclCalDigitToMC4->push_back(idx[3]);
1373  MCParticle* amcParticle = m_mcParticles[idx[3]];
1374  m_eclCalDigitToMC4PDG->push_back(amcParticle->getPDG());
1375  } else {
1376  m_eclCalDigitToMCWeight4->push_back(-1);
1377  m_eclCalDigitToMC4->push_back(-1);
1378  m_eclCalDigitToMC4PDG->push_back(-1);
1379  }
1380  if (idx[4] > -1) {
1381  m_eclCalDigitToMCWeight5->push_back(wi[4]);
1382  m_eclCalDigitToMC5->push_back(idx[4]);
1383  MCParticle* amcParticle = m_mcParticles[idx[4]];
1384  m_eclCalDigitToMC5PDG->push_back(amcParticle->getPDG());
1385  } else {
1386  m_eclCalDigitToMCWeight5->push_back(-1);
1387  m_eclCalDigitToMC5->push_back(-1);
1388  m_eclCalDigitToMC5PDG->push_back(-1);
1389  }
1390 
1391  if (aECLCalDigits->getRelated<ECLShower>() != (nullptr)) {
1392  const ECLShower* shower_caldigit = aECLCalDigits->getRelated<ECLShower>();
1393  m_eclCalDigitToShower->push_back(shower_caldigit->getArrayIndex());
1394  } else
1395  m_eclCalDigitToShower->push_back(-1);
1396 
1397  if (aECLCalDigits->getRelated<ECLConnectedRegion>() != (nullptr)) {
1398  const ECLConnectedRegion* cr_caldigit = aECLCalDigits->getRelated<ECLConnectedRegion>();
1399  m_eclCalDigitToCR->push_back(cr_caldigit->getCRId());
1400  } else
1401  m_eclCalDigitToCR->push_back(-1);
1402 
1403  if (aECLCalDigits->getRelated<ECLLocalMaximum>() != (nullptr)) {
1404  const ECLLocalMaximum* lm_caldigit = aECLCalDigits->getRelated<ECLLocalMaximum>();
1405  m_eclCalDigitToLM->push_back(lm_caldigit->getLMId());
1406  } else
1407  m_eclCalDigitToLM->push_back(-1);
1408 
1409  }
1410  }
1411 
1412  //CR
1413  int CRmultip = m_eclConnectedRegions.getEntries();
1414  for (int i = 0; i < CRmultip; i++) {
1415  ECLConnectedRegion* aECLCR = m_eclConnectedRegions[i];
1416  m_eclCRIdx->push_back(aECLCR->getCRId());
1417  m_eclCRIsTrack->push_back(aECLCR->isTrack());
1418  m_eclCRLikelihoodMIPNGamma->push_back(aECLCR->getLikelihoodMIPNGamma());
1419  m_eclCRLikelihoodChargedHadron->push_back(aECLCR->getLikelihoodChargedHadron());
1420  m_eclCRLikelihoodElectronNGamma->push_back(aECLCR->getLikelihoodElectronNGamma());
1421  m_eclCRLikelihoodNGamma->push_back(aECLCR->getLikelihoodNGamma());
1422  m_eclCRLikelihoodNeutralHadron->push_back(aECLCR->getLikelihoodNeutralHadron());
1423  m_eclCRLikelihoodMergedPi0->push_back(aECLCR->getLikelihoodMergedPi0());
1424  }
1425 
1426  if (m_doHits == 1) {
1427 
1428  //SIM HITS
1429  m_eclSimHitMultip = m_eclSimHits.getEntries();
1430  for (int isimhits = 0; isimhits < m_eclSimHits.getEntries() ; isimhits++) {
1431  ECLSimHit* aECLSimHits = m_eclSimHits[isimhits];
1432 
1433  m_eclSimHitIdx->push_back(isimhits);
1434  m_eclSimHitCellId->push_back(aECLSimHits->getCellId());
1435  m_eclSimHitPdg->push_back(aECLSimHits->getPDGCode());
1436  m_eclSimHitEnergyDep->push_back(aECLSimHits->getEnergyDep());
1437  m_eclSimHitFlightTime->push_back(aECLSimHits->getFlightTime());
1438  m_eclSimHitX->push_back(aECLSimHits->getPosition().x());
1439  m_eclSimHitY->push_back(aECLSimHits->getPosition().y());
1440  m_eclSimHitZ->push_back(aECLSimHits->getPosition().z());
1441  m_eclSimHitPx->push_back(aECLSimHits->getMomentum().x());
1442  m_eclSimHitPy->push_back(aECLSimHits->getMomentum().y());
1443  m_eclSimHitPz->push_back(aECLSimHits->getMomentum().z());
1444 
1445  if (aECLSimHits->getRelated<MCParticle>() != (nullptr)) {
1446  const MCParticle* mc_simhit = aECLSimHits->getRelated<MCParticle>();
1447  m_eclSimHitToMC->push_back(mc_simhit->getArrayIndex());
1448  } else
1449  m_eclSimHitToMC->push_back(-1);
1450  }
1451 
1452  //HITS
1453  m_eclHitMultip = m_eclHits.getEntries();
1454  for (int ihits = 0; ihits < m_eclHits.getEntries() ; ihits++) {
1455  ECLHit* aECLHits = m_eclHits[ihits];
1456  m_eclHitIdx->push_back(ihits);
1457  m_eclHitCellId->push_back(aECLHits->getCellId());
1458  m_eclHitEnergyDep->push_back(aECLHits->getEnergyDep());
1459  m_eclHitTimeAve->push_back(aECLHits->getTimeAve());
1460 
1461  if (aECLHits->getRelated<ECLDigit>() != (nullptr)) {
1462  const ECLDigit* hit_digit = aECLHits->getRelated<ECLDigit>();
1463  m_eclHitToDigit->push_back(hit_digit->getArrayIndex());
1464  m_eclHitToDigitAmp->push_back(hit_digit->getAmp());
1465  } else {
1466  m_eclHitToDigit->push_back(-1);
1467  m_eclHitToDigitAmp->push_back(-1);
1468  }
1469 
1470  if (m_doPureCsI == true) {
1471  if (aECLHits->getRelated<ECLDigit>(eclPureDigitArrayName()) != (nullptr)) {
1472  const ECLDigit* hit_pdigit = aECLHits->getRelated<ECLDigit>(eclPureDigitArrayName());
1473  m_eclHitToPureDigit->push_back(hit_pdigit->getArrayIndex());
1474  m_eclHitToPureDigitAmp->push_back(hit_pdigit->getAmp());
1475  } else {
1476  m_eclHitToPureDigit->push_back(-1);
1477  m_eclHitToPureDigitAmp->push_back(-1);
1478  }
1479  }
1480 
1481  if (aECLHits->getRelated<MCParticle>() != (nullptr)) {
1482  const MCParticle* mc_hit = aECLHits->getRelated<MCParticle>();
1483  m_eclHitToMC->push_back(mc_hit->getArrayIndex());
1484  } else
1485  m_eclHitToMC->push_back(-1);
1486  }
1487  }
1488 
1489  //LM
1490  m_eclLMMultip = m_eclLocalMaximums.getEntries();
1491  for (unsigned int ilms = 0; ilms < (unsigned int)m_eclLocalMaximums.getEntries() ; ilms++) {
1492  ECLLocalMaximum* aECLLMs = m_eclLocalMaximums[ilms];
1493  m_eclLMId->push_back(aECLLMs->getLMId());
1494  m_eclLMType->push_back(aECLLMs->getType());
1495  m_eclLMCellId->push_back(aECLLMs->getCellId());
1496  }
1497 
1498  //CLUSTERS
1499  m_eclClusterMultip = m_eclClusters.getEntries();
1500  for (unsigned int iclusters = 0; iclusters < (unsigned int)m_eclClusters.getEntries() ; iclusters++) {
1501  ECLCluster* aECLClusters = m_eclClusters[iclusters];
1502  m_eclClusterIdx->push_back(iclusters);
1503 
1504  double clusterE = 0.0;
1505  if (aECLClusters->hasHypothesis(ECLCluster::EHypothesisBit::c_nPhotons)) clusterE = aECLClusters->getEnergy(
1506  ECLCluster::EHypothesisBit::c_nPhotons);
1507  else clusterE = aECLClusters->getEnergy(ECLCluster::EHypothesisBit::c_neutralHadron);
1508  m_eclClusterEnergy->push_back(clusterE);
1509 
1510  m_eclClusterEnergyError->push_back(aECLClusters->getUncertaintyEnergy());
1511  m_eclClusterTheta->push_back(aECLClusters->getTheta());
1512  m_eclClusterThetaError->push_back(aECLClusters->getUncertaintyTheta());
1513  m_eclClusterPhi->push_back(aECLClusters->getPhi());
1514  m_eclClusterPhiError->push_back(aECLClusters->getUncertaintyPhi());
1515  m_eclClusterR->push_back(aECLClusters->getR());
1516  m_eclClusterEnergyDepSum->push_back(aECLClusters->getEnergyRaw());
1517  m_eclClusterTiming->push_back(aECLClusters->getTime());
1518  m_eclClusterTimingError->push_back(aECLClusters->getDeltaTime99());
1519  m_eclClusterE9oE21->push_back(aECLClusters->getE9oE21());
1520  m_eclClusterHighestE->push_back(aECLClusters->getEnergyHighestCrystal());
1521  m_eclClusterCellId->push_back(aECLClusters->getMaxECellId());
1522  m_eclClusterNofCrystals->push_back(aECLClusters->getNumberOfCrystals());
1523  m_eclClusterCrystalHealth->push_back(aECLClusters->getStatus());
1524 
1525  m_eclClusterIsTrack->push_back(aECLClusters->isTrack());
1526  m_eclClusterClosestTrackDist->push_back(aECLClusters->getMinTrkDistance());
1527  m_eclClusterDeltaL->push_back(aECLClusters->getDeltaL());
1528 
1529  m_eclClusterAbsZernike40->push_back(aECLClusters->getAbsZernike40());
1530  m_eclClusterAbsZernike51->push_back(aECLClusters->getAbsZernike51());
1531  m_eclClusterZernikeMVA->push_back(aECLClusters->getZernikeMVA());
1532  m_eclClusterE1oE9->push_back(aECLClusters->getE1oE9());
1533  m_eclClusterSecondMoment->push_back(aECLClusters->getSecondMoment());
1534  m_eclClusterLAT->push_back(aECLClusters->getLAT());
1535  m_eclClusterDeltaTime99->push_back(aECLClusters->getDeltaTime99());
1536  m_eclClusterDetectorRegion->push_back(aECLClusters->getDetectorRegion());
1537  m_eclClusterHasNPhotonHypothesis->push_back(aECLClusters->hasHypothesis(ECLCluster::EHypothesisBit::c_nPhotons));
1538  m_eclClusterHasNeutralHadronHypothesis->push_back(aECLClusters->hasHypothesis(ECLCluster::EHypothesisBit::c_neutralHadron));
1539 
1540  if (aECLClusters->getRelated<ECLShower>() != (nullptr)) {
1541  const ECLShower* shower_cluster = aECLClusters->getRelated<ECLShower>();
1542  m_eclClusterToShower->push_back(shower_cluster->getArrayIndex());
1543  } else
1544  m_eclClusterToShower->push_back(-1);
1545 
1546  //Dump MC Info - Multiple Matching
1547  double sumHit = 0;
1548  int idx[10];
1549  for (int i = 0; i < 10; i++)
1550  idx[i] = -1;
1551 
1552  double wi[10];
1553  for (int i = 0; i < 10; i++)
1554  wi[i] = -1;
1555 
1556  int ii = 0;
1557  sumHit = 0;
1558 
1559  auto clusterMCRelations = aECLClusters->getRelationsTo<MCParticle>();
1560  for (unsigned int i = 0; i < clusterMCRelations.size(); ++i) {
1561  if (ii < 10) {
1562  const auto mcParticle = clusterMCRelations.object(i);
1563  idx[ii] = mcParticle->getIndex() - 1;
1564  wi[ii] = clusterMCRelations.weight(i);
1565  sumHit = sumHit + clusterMCRelations.weight(i);
1566  ii++;
1567  }
1568  }
1569 
1570  //Re-ordering based on contribution
1571  int y = 0;
1572  while (y < 10) {
1573  for (int i = 0; i < 9; i++) {
1574  if (((idx[i]) > -1) && ((idx[i + 1]) > -1)) {
1575  if (wi[i] < wi[i + 1]) {
1576  int temp = idx[i];
1577  idx[i] = idx[i + 1];
1578  idx[i + 1] = temp;
1579 
1580  double wtemp = wi[i];
1581  wi[i] = wi[i + 1];
1582  wi[i + 1] = wtemp;
1583  }
1584  }
1585  }
1586  y++;
1587  }
1588 
1589  m_eclClusterToBkgWeight->push_back(clusterE - sumHit);
1590  m_eclClusterSimHitSum->push_back(sumHit);
1591  if (idx[0] > -1) {
1592  m_eclClusterToMCWeight1->push_back(wi[0]);
1593  m_eclClusterToMC1->push_back(idx[0]);
1594  MCParticle* amcParticle = m_mcParticles[idx[0]];
1595  m_eclClusterToMC1PDG->push_back(amcParticle->getPDG());
1596  } else {
1597  m_eclClusterToMCWeight1->push_back(-1);
1598  m_eclClusterToMC1->push_back(-1);
1599  m_eclClusterToMC1PDG->push_back(-1);
1600  }
1601  if (idx[1] > -1) {
1602  m_eclClusterToMCWeight2->push_back(wi[1]);
1603  m_eclClusterToMC2->push_back(idx[1]);
1604  MCParticle* amcParticle = m_mcParticles[idx[1]];
1605  m_eclClusterToMC2PDG->push_back(amcParticle->getPDG());
1606  } else {
1607  m_eclClusterToMCWeight2->push_back(-1);
1608  m_eclClusterToMC2->push_back(-1);
1609  m_eclClusterToMC2PDG->push_back(-1);
1610  }
1611  if (idx[2] > -1) {
1612  m_eclClusterToMCWeight3->push_back(wi[2]);
1613  m_eclClusterToMC3->push_back(idx[2]);
1614  MCParticle* amcParticle = m_mcParticles[idx[2]];
1615  m_eclClusterToMC3PDG->push_back(amcParticle->getPDG());
1616  } else {
1617  m_eclClusterToMCWeight3->push_back(-1);
1618  m_eclClusterToMC3->push_back(-1);
1619  m_eclClusterToMC3PDG->push_back(-1);
1620  }
1621  if (idx[3] > -1) {
1622  m_eclClusterToMCWeight4->push_back(wi[3]);
1623  m_eclClusterToMC4->push_back(idx[3]);
1624  MCParticle* amcParticle = m_mcParticles[idx[3]];
1625  m_eclClusterToMC4PDG->push_back(amcParticle->getPDG());
1626  } else {
1627  m_eclClusterToMCWeight4->push_back(-1);
1628  m_eclClusterToMC4->push_back(-1);
1629  m_eclClusterToMC4PDG->push_back(-1);
1630  }
1631  if (idx[4] > -1) {
1632  m_eclClusterToMCWeight5->push_back(wi[4]);
1633  m_eclClusterToMC5->push_back(idx[4]);
1634  MCParticle* amcParticle = m_mcParticles[idx[4]];
1635  m_eclClusterToMC5PDG->push_back(amcParticle->getPDG());
1636  } else {
1637  m_eclClusterToMCWeight5->push_back(-1);
1638  m_eclClusterToMC5->push_back(-1);
1639  m_eclClusterToMC5PDG->push_back(-1);
1640  }
1641 
1642  }
1643 
1644  if (m_doPureCsI == true) {
1645 
1646  m_eclPureDigitMultip = m_eclPureDigits.getEntries();
1647  for (int idigits = 0; idigits < m_eclPureDigits.getEntries() ; idigits++) {
1648  ECLDigit* aECLPureDigits = m_eclPureDigits[idigits];
1649 
1650  m_eclPureDigitIdx->push_back(idigits);
1651  m_eclPureDigitCellId->push_back(aECLPureDigits->getCellId());
1652  m_eclPureDigitAmp->push_back(aECLPureDigits->getAmp());
1653  m_eclPureDigitTimeFit->push_back(aECLPureDigits->getTimeFit());
1654  m_eclPureDigitFitQuality->push_back(aECLPureDigits->getQuality());
1655 
1656  if (aECLPureDigits->getRelated<MCParticle>() != (nullptr)) {
1657  const MCParticle* mc_digit = aECLPureDigits->getRelated<MCParticle>();
1658  m_eclPureDigitToMC->push_back(mc_digit->getArrayIndex());
1659  } else
1660  m_eclPureDigitToMC->push_back(-1);
1661  }
1662 
1663  //PURE CAL DIGITS
1664  m_eclPureCalDigitMultip = m_eclPureCalDigits.getEntries();
1665  for (uint icaldigits = 0; icaldigits < (uint)m_eclPureCalDigits.getEntries() ; icaldigits++) {
1666  ECLCalDigit* aECLPureCalDigits = m_eclPureCalDigits[icaldigits];
1667 
1668  m_eclPureCalDigitIdx->push_back(icaldigits);
1669  m_eclPureCalDigitCellId->push_back(aECLPureCalDigits->getCellId());
1670  m_eclPureCalDigitAmp->push_back(aECLPureCalDigits->getEnergy());
1671  m_eclPureCalDigitTimeFit->push_back(aECLPureCalDigits->getTime());
1672  m_eclPureCalDigitFitQuality->push_back(aECLPureCalDigits->isFailedFit());
1673 
1674  double sumHit = 0;
1675  int idx[10];
1676  for (int i = 0; i < 10; i++)
1677  idx[i] = -1;
1678 
1679  double wi[10];
1680  for (int i = 0; i < 10; i++)
1681  wi[i] = -1;
1682 
1683  int ii = 0;
1684  sumHit = 0;
1685 
1686  auto digitMCRelations = aECLPureCalDigits->getRelationsTo<MCParticle>();
1687  for (unsigned int i = 0; i < digitMCRelations.size(); ++i) {
1688  if (ii < 10) {
1689  const auto mcParticle = digitMCRelations.object(i);
1690  idx[ii] = mcParticle->getIndex() - 1;
1691  wi[ii] = digitMCRelations.weight(i);
1692  sumHit = sumHit + digitMCRelations.weight(i);
1693  ii++;
1694  }
1695  }
1696 
1697  //Re-ordering based on contribution
1698  int y = 0;
1699  while (y < 10) {
1700  for (int i = 0; i < 9; i++) {
1701  if (((idx[i]) > -1) && ((idx[i + 1]) > -1)) {
1702  if (wi[i] < wi[i + 1]) {
1703  int temp = idx[i];
1704  idx[i] = idx[i + 1];
1705  idx[i + 1] = temp;
1706 
1707  double wtemp = wi[i];
1708  wi[i] = wi[i + 1];
1709  wi[i + 1] = wtemp;
1710  }
1711  }
1712  }
1713  y++;
1714  }
1715 
1716  m_eclPureCalDigitToBkgWeight->push_back(aECLPureCalDigits->getEnergy() - sumHit);
1717  m_eclPureCalDigitSimHitSum->push_back(sumHit);
1718  if (idx[0] > -1) {
1719  m_eclPureCalDigitToMCWeight1->push_back(wi[0]);
1720  m_eclPureCalDigitToMC1->push_back(idx[0]);
1721  MCParticle* amcParticle = m_mcParticles[idx[0]];
1722  m_eclPureCalDigitToMC1PDG->push_back(amcParticle->getPDG());
1723  } else {
1724  m_eclPureCalDigitToMCWeight1->push_back(-1);
1725  m_eclPureCalDigitToMC1->push_back(-1);
1726  m_eclPureCalDigitToMC1PDG->push_back(-1);
1727  }
1728  if (idx[1] > -1) {
1729  m_eclPureCalDigitToMCWeight2->push_back(wi[1]);
1730  m_eclPureCalDigitToMC2->push_back(idx[1]);
1731  MCParticle* amcParticle = m_mcParticles[idx[1]];
1732  m_eclPureCalDigitToMC2PDG->push_back(amcParticle->getPDG());
1733  } else {
1734  m_eclPureCalDigitToMCWeight2->push_back(-1);
1735  m_eclPureCalDigitToMC2->push_back(-1);
1736  m_eclPureCalDigitToMC2PDG->push_back(-1);
1737  }
1738  if (idx[2] > -1) {
1739  m_eclPureCalDigitToMCWeight3->push_back(wi[2]);
1740  m_eclPureCalDigitToMC3->push_back(idx[2]);
1741  MCParticle* amcParticle = m_mcParticles[idx[2]];
1742  m_eclPureCalDigitToMC3PDG->push_back(amcParticle->getPDG());
1743  } else {
1744  m_eclPureCalDigitToMCWeight3->push_back(-1);
1745  m_eclPureCalDigitToMC3->push_back(-1);
1746  m_eclPureCalDigitToMC3PDG->push_back(-1);
1747  }
1748  if (idx[3] > -1) {
1749  m_eclPureCalDigitToMCWeight4->push_back(wi[3]);
1750  m_eclPureCalDigitToMC4->push_back(idx[3]);
1751  MCParticle* amcParticle = m_mcParticles[idx[3]];
1752  m_eclPureCalDigitToMC4PDG->push_back(amcParticle->getPDG());
1753  } else {
1754  m_eclPureCalDigitToMCWeight4->push_back(-1);
1755  m_eclPureCalDigitToMC4->push_back(-1);
1756  m_eclPureCalDigitToMC4PDG->push_back(-1);
1757  }
1758  if (idx[4] > -1) {
1759  m_eclPureCalDigitToMCWeight5->push_back(wi[4]);
1760  m_eclPureCalDigitToMC5->push_back(idx[4]);
1761  MCParticle* amcParticle = m_mcParticles[idx[4]];
1762  m_eclPureCalDigitToMC5PDG->push_back(amcParticle->getPDG());
1763  } else {
1764  m_eclPureCalDigitToMCWeight5->push_back(-1);
1765  m_eclPureCalDigitToMC5->push_back(-1);
1766  m_eclPureCalDigitToMC5PDG->push_back(-1);
1767  }
1768 
1769  if (aECLPureCalDigits->getRelated<ECLShower>() != (nullptr)) {
1770  const ECLShower* shower_caldigit = aECLPureCalDigits->getRelated<ECLShower>();
1771  m_eclPureCalDigitToShower->push_back(shower_caldigit->getArrayIndex());
1772  } else
1773  m_eclPureCalDigitToShower->push_back(-1);
1774 
1775  if (aECLPureCalDigits->getRelated<ECLConnectedRegion>(eclPureConnectedRegionArrayName()) != (nullptr)) {
1776  const ECLConnectedRegion* cr_caldigit = aECLPureCalDigits->getRelated<ECLConnectedRegion>(eclPureConnectedRegionArrayName());
1777  m_eclPureCalDigitToCR->push_back(cr_caldigit->getCRId());
1778  } else
1779  m_eclPureCalDigitToCR->push_back(-1);
1780 
1781  if (aECLPureCalDigits->getRelated<ECLLocalMaximum>(eclPureLocalMaximumArrayName()) != (nullptr)) {
1782  const ECLLocalMaximum* lm_caldigit = aECLPureCalDigits->getRelated<ECLLocalMaximum>(eclPureLocalMaximumArrayName());
1783  m_eclPureCalDigitToLM->push_back(lm_caldigit->getLMId());
1784  } else
1785  m_eclPureCalDigitToLM->push_back(-1);
1786 
1787  }
1788 
1789  //CR
1790  int PureCRmultip = m_eclPureConnectedRegions.getEntries();
1791  for (int i = 0; i < PureCRmultip; i++) {
1792  ECLConnectedRegion* aECLPureCR = m_eclPureConnectedRegions[i];
1793  m_eclPureCRIdx->push_back(aECLPureCR->getCRId());
1794  m_eclPureCRIsTrack->push_back(aECLPureCR->isTrack());
1795  m_eclPureCRLikelihoodMIPNGamma->push_back(aECLPureCR->getLikelihoodMIPNGamma());
1796  m_eclPureCRLikelihoodChargedHadron->push_back(aECLPureCR->getLikelihoodChargedHadron());
1797  m_eclPureCRLikelihoodElectronNGamma->push_back(aECLPureCR->getLikelihoodElectronNGamma());
1798  m_eclPureCRLikelihoodNGamma->push_back(aECLPureCR->getLikelihoodNGamma());
1799  m_eclPureCRLikelihoodNeutralHadron->push_back(aECLPureCR->getLikelihoodNeutralHadron());
1800  m_eclPureCRLikelihoodMergedPi0->push_back(aECLPureCR->getLikelihoodMergedPi0());
1801  }
1802 
1803  //LM
1804  m_eclPureLMMultip = m_eclPureLocalMaximums.getEntries();
1805  for (unsigned int pure_ilms = 0; pure_ilms < (unsigned int)m_eclPureLocalMaximums.getEntries() ; pure_ilms++) {
1806  ECLLocalMaximum* aECLLMs = m_eclPureLocalMaximums[pure_ilms];
1807  m_eclPureLMId->push_back(aECLLMs->getLMId());
1808  m_eclPureLMType->push_back(aECLLMs->getType());
1809  m_eclPureLMCellId->push_back(aECLLMs->getCellId());
1810  }
1811 
1812  m_eclPureClusterMultip = m_eclPureClusters.getEntries();
1813  for (unsigned int iclusters = 0; iclusters < (unsigned int)m_eclPureClusters.getEntries() ; iclusters++) {
1814  ECLCluster* aECLClusters = m_eclPureClusters[iclusters];
1815  m_eclPureClusterIdx->push_back(iclusters);
1816 
1817  double clusterE = 0.0;
1818  if (aECLClusters->hasHypothesis(ECLCluster::EHypothesisBit::c_nPhotons)) clusterE = aECLClusters->getEnergy(
1819  ECLCluster::EHypothesisBit::c_nPhotons);
1820  else clusterE = aECLClusters->getEnergy(ECLCluster::EHypothesisBit::c_neutralHadron);
1821  m_eclPureClusterEnergy->push_back(clusterE);
1822 
1823  m_eclPureClusterEnergyError->push_back(aECLClusters->getUncertaintyEnergy());
1824  m_eclPureClusterTheta->push_back(aECLClusters->getTheta());
1825  m_eclPureClusterThetaError->push_back(aECLClusters->getUncertaintyTheta());
1826  m_eclPureClusterPhi->push_back(aECLClusters->getPhi());
1827  m_eclPureClusterPhiError->push_back(aECLClusters->getUncertaintyPhi());
1828  m_eclPureClusterR->push_back(aECLClusters->getR());
1829  m_eclPureClusterEnergyDepSum->push_back(aECLClusters->getEnergyRaw());
1830  m_eclPureClusterTiming->push_back(aECLClusters->getTime());
1831  m_eclPureClusterTimingError->push_back(aECLClusters->getDeltaTime99());
1832  m_eclPureClusterE9oE21->push_back(aECLClusters->getE9oE21());
1833  m_eclPureClusterHighestE->push_back(aECLClusters->getEnergyHighestCrystal());
1834  m_eclPureClusterCellId->push_back(aECLClusters->getMaxECellId());
1835  m_eclPureClusterLat->push_back(aECLClusters->getLAT());
1836  m_eclPureClusterNofCrystals->push_back(aECLClusters->getNumberOfCrystals());
1837  m_eclPureClusterCrystalHealth->push_back(aECLClusters->getStatus());
1838 
1839  m_eclPureClusterClosestTrackDist->push_back(aECLClusters->getMinTrkDistance());
1840  m_eclPureClusterAbsZernike40->push_back(aECLClusters->getAbsZernike40());
1841  m_eclPureClusterAbsZernike51->push_back(aECLClusters->getAbsZernike51());
1842  m_eclPureClusterZernikeMVA->push_back(aECLClusters->getZernikeMVA());
1843  m_eclPureClusterSecondMoment->push_back(aECLClusters->getSecondMoment());
1844 
1845  m_eclPureClusterIsTrack->push_back(aECLClusters->isTrack());
1846  m_eclPureClusterDeltaL->push_back(aECLClusters->getDeltaL());
1847 
1848  m_eclPureClusterE1oE9->push_back(aECLClusters->getE1oE9());
1849  m_eclPureClusterDeltaTime99->push_back(aECLClusters->getDeltaTime99());
1850  m_eclPureClusterDetectorRegion->push_back(aECLClusters->getDetectorRegion());
1851  m_eclPureClusterHasNPhotonHypothesis->push_back(aECLClusters->hasHypothesis(ECLCluster::EHypothesisBit::c_nPhotons));
1852  m_eclPureClusterHasNeutralHadronHypothesis->push_back(aECLClusters->hasHypothesis(ECLCluster::EHypothesisBit::c_neutralHadron));
1853 
1854  //Dump MC Info - Multiple Matching
1855  double sumHit = 0;
1856  int idx[10];
1857  for (int i = 0; i < 10; i++)
1858  idx[i] = -1;
1859 
1860  double wi[10];
1861  for (int i = 0; i < 10; i++)
1862  wi[i] = -1;
1863 
1864  int ii = 0;
1865  sumHit = 0;
1866 
1867  auto clusterMCRelations = aECLClusters->getRelationsTo<MCParticle>();
1868  for (unsigned int i = 0; i < clusterMCRelations.size(); ++i) {
1869  if (ii < 10) {
1870  const auto mcParticle = clusterMCRelations.object(i);
1871  idx[ii] = mcParticle->getIndex() - 1;
1872  wi[ii] = clusterMCRelations.weight(i);
1873  sumHit = sumHit + clusterMCRelations.weight(i);
1874  ii++;
1875  }
1876  }
1877 
1878  //Re-ordering based on contribution
1879  int y = 0;
1880  while (y < 10) {
1881  for (int i = 0; i < 9; i++) {
1882  if (((idx[i]) > -1) && ((idx[i + 1]) > -1)) {
1883  if (wi[i] < wi[i + 1]) {
1884  int temp = idx[i];
1885  idx[i] = idx[i + 1];
1886  idx[i + 1] = temp;
1887 
1888  double wtemp = wi[i];
1889  wi[i] = wi[i + 1];
1890  wi[i + 1] = wtemp;
1891  }
1892  }
1893  }
1894  y++;
1895  }
1896 
1897  m_eclPureClusterToBkgWeight->push_back(clusterE - sumHit);
1898  if (idx[0] > -1) {
1899  m_eclPureClusterToMCWeight1->push_back(wi[0]);
1900  m_eclPureClusterToMC1->push_back(idx[0]);
1901  MCParticle* amcParticle = m_mcParticles[idx[0]];
1902  m_eclPureClusterToMC1PDG->push_back(amcParticle->getPDG());
1903  } else {
1904  m_eclPureClusterToMCWeight1->push_back(-1);
1905  m_eclPureClusterToMC1->push_back(-1);
1906  m_eclPureClusterToMC1PDG->push_back(-1);
1907  }
1908  if (idx[1] > -1) {
1909  m_eclPureClusterToMCWeight2->push_back(wi[1]);
1910  m_eclPureClusterToMC2->push_back(idx[1]);
1911  MCParticle* amcParticle = m_mcParticles[idx[1]];
1912  m_eclPureClusterToMC2PDG->push_back(amcParticle->getPDG());
1913  } else {
1914  m_eclPureClusterToMCWeight2->push_back(-1);
1915  m_eclPureClusterToMC2->push_back(-1);
1916  m_eclPureClusterToMC2PDG->push_back(-1);
1917  }
1918  if (idx[2] > -1) {
1919  m_eclPureClusterToMCWeight3->push_back(wi[2]);
1920  m_eclPureClusterToMC3->push_back(idx[2]);
1921  MCParticle* amcParticle = m_mcParticles[idx[2]];
1922  m_eclPureClusterToMC3PDG->push_back(amcParticle->getPDG());
1923  } else {
1924  m_eclPureClusterToMCWeight3->push_back(-1);
1925  m_eclPureClusterToMC3->push_back(-1);
1926  m_eclPureClusterToMC3PDG->push_back(-1);
1927  }
1928  if (idx[3] > -1) {
1929  m_eclPureClusterToMCWeight4->push_back(wi[3]);
1930  m_eclPureClusterToMC4->push_back(idx[3]);
1931  MCParticle* amcParticle = m_mcParticles[idx[3]];
1932  m_eclPureClusterToMC4PDG->push_back(amcParticle->getPDG());
1933  } else {
1934  m_eclPureClusterToMCWeight4->push_back(-1);
1935  m_eclPureClusterToMC4->push_back(-1);
1936  m_eclPureClusterToMC4PDG->push_back(-1);
1937  }
1938  if (idx[4] > -1) {
1939  m_eclPureClusterToMCWeight5->push_back(wi[4]);
1940  m_eclPureClusterToMC5->push_back(idx[4]);
1941  MCParticle* amcParticle = m_mcParticles[idx[4]];
1942  m_eclPureClusterToMC5PDG->push_back(amcParticle->getPDG());
1943  } else {
1944  m_eclPureClusterToMCWeight5->push_back(-1);
1945  m_eclPureClusterToMC5->push_back(-1);
1946  m_eclPureClusterToMC5PDG->push_back(-1);
1947  }
1948 
1949  }
1950  }
1951 
1952  m_eclShowerMultip = m_eclShowers.getEntries();
1953  for (uint ishowers = 0; ishowers < (uint)m_eclShowers.getEntries() ; ishowers++) {
1954  ECLShower* aECLShowers = m_eclShowers[ishowers];
1955  m_eclShowerIdx->push_back(ishowers);
1956  m_eclShowerEnergy->push_back(aECLShowers->getEnergy());
1957  m_eclShowerTheta->push_back(aECLShowers->getTheta());
1958  m_eclShowerPhi->push_back(aECLShowers->getPhi());
1959  m_eclShowerR->push_back(aECLShowers->getR());
1960  m_eclShowerNHits->push_back(aECLShowers->getNumberOfCrystals());
1961  m_eclShowerE9oE21->push_back(aECLShowers->getE9oE21());
1962  m_eclShowerUncEnergy->push_back(aECLShowers->getEnergyRaw());
1963  m_eclShowerTime->push_back(aECLShowers->getTime());
1964  m_eclShowerT99->push_back(aECLShowers->getDeltaTime99());
1965  m_eclShowerConnectedRegionId->push_back(aECLShowers->getConnectedRegionId());
1966  m_eclShowerHypothesisId->push_back(aECLShowers->getHypothesisId());
1967  m_eclShowerCentralCellId->push_back(aECLShowers->getCentralCellId());
1968  m_eclShowerEnergyError->push_back(aECLShowers->getUncertaintyEnergy());
1969  m_eclShowerThetaError->push_back(aECLShowers->getUncertaintyTheta());
1970  m_eclShowerPhiError->push_back(aECLShowers->getUncertaintyPhi());
1971  m_eclShowerTimeResolution->push_back(aECLShowers->getDeltaTime99());
1972  m_eclShowerHighestEnergy->push_back(aECLShowers->getEnergyHighestCrystal());
1973  m_eclShowerLateralEnergy->push_back(aECLShowers->getLateralEnergy());
1974  m_eclShowerMinTrkDistance->push_back(aECLShowers->getMinTrkDistance());
1975  m_eclShowerTrkDepth->push_back(aECLShowers->getTrkDepth());
1976  m_eclShowerShowerDepth->push_back(aECLShowers->getShowerDepth());
1977  m_eclShowerAbsZernike40->push_back(aECLShowers->getAbsZernike40());
1978  m_eclShowerAbsZernike51->push_back(aECLShowers->getAbsZernike51());
1979  m_eclShowerZernikeMVA->push_back(aECLShowers->getZernikeMVA());
1980  m_eclShowerSecondMoment->push_back(aECLShowers->getSecondMoment());
1981  m_eclShowerE1oE9->push_back(aECLShowers->getE1oE9());
1982  m_eclShowerIsTrack->push_back(aECLShowers->getIsTrack());
1983  m_eclShowerNumberOfCrystalsForEnergy->push_back(aECLShowers->getNumberOfCrystalsForEnergy());
1984 
1985  double fe = 0.;
1986  double se = 0.;
1987 
1988  auto showerDigitRelations = aECLShowers->getRelationsTo<ECLCalDigit>();
1989  for (unsigned int i = 0; i < showerDigitRelations.size(); ++i) {
1990  const auto aECLCalDigits = showerDigitRelations.object(i);
1991  if (aECLCalDigits->getEnergy() > fe) {
1992  se = fe;
1993  fe = aECLCalDigits->getEnergy();
1994  }
1995  }
1996  if (fe > 0 && se > 0)
1997  m_eclShowerHighestE1mE2->push_back(fe - se);
1998  else
1999  m_eclShowerHighestE1mE2->push_back(-1);
2000 
2001  int lm1[5] = { -1, -1, -1, -1, -1};
2002 
2003  auto showerLMRelations = aECLShowers->getRelationsTo<ECLLocalMaximum>();
2004  for (unsigned int i = 0; i < showerLMRelations.size(); ++i) {
2005  const auto aECLLM = showerLMRelations.object(i);
2006  lm1[i] = aECLLM->getLMId();
2007  }
2008  m_eclShowerToLM1->push_back(lm1[0]);
2009  m_eclShowerToLM2->push_back(lm1[1]);
2010  m_eclShowerToLM3->push_back(lm1[2]);
2011  m_eclShowerToLM4->push_back(lm1[3]);
2012  m_eclShowerToLM5->push_back(lm1[4]);
2013 
2014  double sumHit = 0;
2015 
2016  int idx[10];
2017  for (int i = 0; i < 10; i++)
2018  idx[i] = -1;
2019 
2020  double wi[10];
2021  for (int i = 0; i < 10; i++)
2022  wi[i] = -1;
2023 
2024  int ii = 0;
2025  sumHit = 0;
2026 
2027  auto showerMCRelations = aECLShowers->getRelationsTo<MCParticle>();
2028  for (unsigned int i = 0; i < showerMCRelations.size(); ++i) {
2029  if (ii < 10) {
2030  const auto mcParticle = showerMCRelations.object(i);
2031  idx[ii] = mcParticle->getIndex() - 1;
2032  wi[ii] = showerMCRelations.weight(i);
2033  sumHit = sumHit + showerMCRelations.weight(i);
2034  ii++;
2035  }
2036  }
2037 
2038  //Re-ordering based on contribution
2039  int y = 0;
2040  while (y < 10) {
2041  for (int i = 0; i < 9; i++) {
2042  if (((idx[i]) > -1) && ((idx[i + 1]) > -1)) {
2043  if (wi[i] < wi[i + 1]) {
2044  int temp = idx[i];
2045  idx[i] = idx[i + 1];
2046  idx[i + 1] = temp;
2047 
2048  double wtemp = wi[i];
2049  wi[i] = wi[i + 1];
2050  wi[i + 1] = wtemp;
2051  }
2052  }
2053  }
2054  y++;
2055  }
2056 
2057  int no_rel = 0;
2058  int no_Primary = 1;
2059 
2060  for (unsigned int i = 0; i < showerMCRelations.size(); ++i) {
2061  no_rel++;
2062  const auto mcParticle = showerMCRelations.object(i);
2063  if (mcParticle->getSecondaryPhysicsProcess() == 0 && mcParticle->getPDG() == Const::Klong.getPDGCode()) {
2064  double vtxx = mcParticle->getDecayVertex().X();
2065  double vtxy = mcParticle->getDecayVertex().Y();
2066  double vtxz = mcParticle->getDecayVertex().Z();
2067  if ((TMath::Sqrt(vtxx * vtxx + vtxy * vtxy) > 118) || (vtxz > 196.16) || (vtxz < -102.16))
2068  no_Primary = 0;
2069  } else if (mcParticle->getSecondaryPhysicsProcess() != 0 && mcParticle->getMother()->getPDG() == Const::Klong.getPDGCode()) {
2070  double vtxx = mcParticle->getProductionVertex().X();
2071  double vtxy = mcParticle->getProductionVertex().Y();
2072  double vtxz = mcParticle->getProductionVertex().Z();
2073  if ((TMath::Sqrt(vtxx * vtxx + vtxy * vtxy) > 118) || (vtxz > 196.16) || (vtxz < -102.16))
2074  no_Primary = 0;
2075  }
2076  }
2077 
2078  if (no_Primary == 0)
2079  m_eclShowerMCVtxInEcl->push_back(1);
2080  else
2081  m_eclShowerMCVtxInEcl->push_back(0);
2082 
2083  double no_fMatch = 0;
2084  double no_fFMatch = 0;
2085 
2086  for (unsigned int i = 0; i < showerMCRelations.size(); ++i) {
2087  no_rel++;
2088  const auto mcParticle = showerMCRelations.object(i);
2089  if (mcParticle->getSecondaryPhysicsProcess() == 0) {
2090  double vtxx = mcParticle->getDecayVertex().X();
2091  double vtxy = mcParticle->getDecayVertex().Y();
2092  double vtxz = mcParticle->getDecayVertex().Z();
2093  double px = mcParticle->getMomentum().X();
2094  double py = mcParticle->getMomentum().Y();
2095  double pz = mcParticle->getMomentum().Z();
2096  double p = TMath::Sqrt(px * px + py * py + pz * pz);
2097  double pTheta = TMath::ACos(pz / p);
2098  double pPhi = 10.;
2099  if (py > 0) {
2100  if (px > 0)
2101  pPhi = TMath::ATan(py / px);
2102  if (px < 0)
2103  pPhi = TMath::ATan(py / px) + 3.1415;
2104  } else {
2105  if (px > 0)
2106  pPhi = TMath::ATan(py / px) ;
2107  if (px < 0)
2108  pPhi = TMath::ATan(py / px) - 3.1415;
2109  }
2110  if ((TMath::Sqrt(vtxx * vtxx + vtxy * vtxy) > 118) || (vtxz > 196.16) || (vtxz < -102.16)) {
2111  if (TMath::Abs(aECLShowers->getTheta() - pTheta) < 0.05 && TMath::Abs(aECLShowers->getPhi() - pPhi) < 0.05)
2112  no_fMatch = 1;
2113  no_fFMatch = 1;
2114  }
2115  } else if (mcParticle->getMother()->getPDG() == Const::Klong.getPDGCode()) {
2116  double vtxx = mcParticle->getProductionVertex().X();
2117  double vtxy = mcParticle->getProductionVertex().Y();
2118  double vtxz = mcParticle->getProductionVertex().Z();
2119  MCParticle* amcParticle = mcParticle->getMother();
2120  double px = amcParticle->getMomentum().X();
2121  double py = amcParticle->getMomentum().Y();
2122  double pz = amcParticle->getMomentum().Z();
2123  double p = TMath::Sqrt(px * px + py * py + pz * pz);
2124  double pTheta = TMath::ACos(pz / p);
2125  double pPhi = 10.;
2126  if (py > 0) {
2127  if (px > 0)
2128  pPhi = TMath::ATan(py / px);
2129  if (px < 0)
2130  pPhi = TMath::ATan(py / px) + 3.1415;
2131  } else {
2132  if (px > 0)
2133  pPhi = TMath::ATan(py / px) ;
2134  if (px < 0)
2135  pPhi = TMath::ATan(py / px) - 3.1415;
2136  }
2137  if ((TMath::Sqrt(vtxx * vtxx + vtxy * vtxy) > 118) || (vtxz > 196.16) || (vtxz < -102.16)) {
2138  if (TMath::Abs(aECLShowers->getTheta() - pTheta) < 0.05 && TMath::Abs(aECLShowers->getPhi() - pPhi) < 0.05)
2139  no_fMatch = 1;
2140  }
2141  }
2142  }
2143 
2144  if (no_fMatch == 1)
2145  m_eclShowerMCFlightMatch->push_back(1);
2146  else
2147  m_eclShowerMCFlightMatch->push_back(0);
2148 
2149  if (no_fFMatch == 1)
2150  m_eclShowerMCFFlightMatch->push_back(1);
2151  else
2152  m_eclShowerMCFFlightMatch->push_back(0);
2153 
2154  if (idx[0] > -1) {
2155  m_eclShowerToMCWeight1->push_back(wi[0]);
2156  m_eclShowerToMC1->push_back(idx[0]);
2157  MCParticle* amcParticle = m_mcParticles[idx[0]];
2158  m_eclShowerToMC1PDG->push_back(amcParticle->getPDG());
2159  if (amcParticle->getMother() != nullptr) {
2160  m_eclShowerToMC1Moth->push_back(amcParticle->getMother()->getIndex());
2161  m_eclShowerToMC1MothPDG->push_back(amcParticle->getMother()->getPDG());
2162  if (amcParticle->getMother()->getMother() != nullptr) {
2163  m_eclShowerToMC1GMoth->push_back(amcParticle->getMother()->getMother()->getIndex());
2164  m_eclShowerToMC1GMothPDG->push_back(amcParticle->getMother()->getMother()->getPDG());
2165  } else {
2166  m_eclShowerToMC1GMoth->push_back(-999);
2167  m_eclShowerToMC1GMothPDG->push_back(-999);
2168  }
2169  } else {
2170  m_eclShowerToMC1Moth->push_back(-999);
2171  m_eclShowerToMC1MothPDG->push_back(-999);
2172  m_eclShowerToMC1GMoth->push_back(-999);
2173  m_eclShowerToMC1GMothPDG->push_back(-999);
2174  }
2175  } else {
2176  m_eclShowerToMCWeight1->push_back(-1);
2177  m_eclShowerToMC1->push_back(-1);
2178  m_eclShowerToMC1PDG->push_back(-1);
2179  m_eclShowerToMC1Moth->push_back(-1);
2180  m_eclShowerToMC1MothPDG->push_back(-1);
2181  m_eclShowerToMC1GMoth->push_back(-1);
2182  m_eclShowerToMC1GMothPDG->push_back(-1);
2183  }
2184  if (idx[1] > -1) {
2185  m_eclShowerToMCWeight2->push_back(wi[1]);
2186  m_eclShowerToMC2->push_back(idx[1]);
2187  MCParticle* amcParticle = m_mcParticles[idx[1]];
2188  m_eclShowerToMC2PDG->push_back(amcParticle->getPDG());
2189  if (amcParticle->getMother() != nullptr) {
2190  m_eclShowerToMC2Moth->push_back(amcParticle->getMother()->getIndex());
2191  m_eclShowerToMC2MothPDG->push_back(amcParticle->getMother()->getPDG());
2192  if (amcParticle->getMother()->getMother() != nullptr) {
2193  m_eclShowerToMC2GMoth->push_back(amcParticle->getMother()->getMother()->getIndex());
2194  m_eclShowerToMC2GMothPDG->push_back(amcParticle->getMother()->getMother()->getPDG());
2195  } else {
2196  m_eclShowerToMC2GMoth->push_back(-999);
2197  m_eclShowerToMC2GMothPDG->push_back(-999);
2198  }
2199  } else {
2200  m_eclShowerToMC2Moth->push_back(-999);
2201  m_eclShowerToMC2MothPDG->push_back(-999);
2202  m_eclShowerToMC2GMoth->push_back(-999);
2203  m_eclShowerToMC2GMothPDG->push_back(-999);
2204  };
2205  } else {
2206  m_eclShowerToMCWeight2->push_back(-1);
2207  m_eclShowerToMC2->push_back(-1);
2208  m_eclShowerToMC2PDG->push_back(-1);
2209  m_eclShowerToMC2Moth->push_back(-1);
2210  m_eclShowerToMC2MothPDG->push_back(-1);
2211  m_eclShowerToMC2GMoth->push_back(-1);
2212  m_eclShowerToMC2GMothPDG->push_back(-1);
2213  }
2214  if (idx[2] > -1) {
2215  m_eclShowerToMCWeight3->push_back(wi[2]);
2216  m_eclShowerToMC3->push_back(idx[2]);
2217  MCParticle* amcParticle = m_mcParticles[idx[2]];
2218  m_eclShowerToMC3PDG->push_back(amcParticle->getPDG());
2219  if (amcParticle->getMother() != nullptr) {
2220  m_eclShowerToMC3Moth->push_back(amcParticle->getMother()->getIndex());
2221  m_eclShowerToMC3MothPDG->push_back(amcParticle->getMother()->getPDG());
2222  if (amcParticle->getMother()->getMother() != nullptr) {
2223  m_eclShowerToMC3GMoth->push_back(amcParticle->getMother()->getMother()->getIndex());
2224  m_eclShowerToMC3GMothPDG->push_back(amcParticle->getMother()->getMother()->getPDG());
2225  } else {
2226  m_eclShowerToMC3GMoth->push_back(-999);
2227  m_eclShowerToMC3GMothPDG->push_back(-999);
2228  }
2229  } else {
2230  m_eclShowerToMC3Moth->push_back(-999);
2231  m_eclShowerToMC3MothPDG->push_back(-999);
2232  m_eclShowerToMC3GMoth->push_back(-999);
2233  m_eclShowerToMC3GMothPDG->push_back(-999);
2234  }
2235  } else {
2236  m_eclShowerToMCWeight3->push_back(-1);
2237  m_eclShowerToMC3->push_back(-1);
2238  m_eclShowerToMC3PDG->push_back(-1);
2239  m_eclShowerToMC3Moth->push_back(-1);
2240  m_eclShowerToMC3MothPDG->push_back(-1);
2241  m_eclShowerToMC3GMoth->push_back(-1);
2242  m_eclShowerToMC3GMothPDG->push_back(-1);
2243  }
2244  if (idx[3] > -1) {
2245  m_eclShowerToMCWeight4->push_back(wi[3]);
2246  m_eclShowerToMC4->push_back(idx[3]);
2247  MCParticle* amcParticle = m_mcParticles[idx[3]];
2248  m_eclShowerToMC4PDG->push_back(amcParticle->getPDG());
2249  if (amcParticle->getMother() != nullptr) {
2250  m_eclShowerToMC4Moth->push_back(amcParticle->getMother()->getIndex());
2251  m_eclShowerToMC4MothPDG->push_back(amcParticle->getMother()->getPDG());
2252  if (amcParticle->getMother()->getMother() != nullptr) {
2253  m_eclShowerToMC4GMoth->push_back(amcParticle->getMother()->getMother()->getIndex());
2254  m_eclShowerToMC4GMothPDG->push_back(amcParticle->getMother()->getMother()->getPDG());
2255  } else {
2256  m_eclShowerToMC4GMoth->push_back(-999);
2257  m_eclShowerToMC4GMothPDG->push_back(-999);
2258  }
2259  } else {
2260  m_eclShowerToMC4Moth->push_back(-999);
2261  m_eclShowerToMC4MothPDG->push_back(-999);
2262  m_eclShowerToMC4GMoth->push_back(-999);
2263  m_eclShowerToMC4GMothPDG->push_back(-999);
2264  }
2265  } else {
2266  m_eclShowerToMCWeight4->push_back(-1);
2267  m_eclShowerToMC4->push_back(-1);
2268  m_eclShowerToMC4PDG->push_back(-1);
2269  m_eclShowerToMC4Moth->push_back(-1);
2270  m_eclShowerToMC4MothPDG->push_back(-1);
2271  m_eclShowerToMC4GMoth->push_back(-1);
2272  m_eclShowerToMC4GMothPDG->push_back(-1);
2273  }
2274  if (idx[4] > -1) {
2275  m_eclShowerToMCWeight5->push_back(wi[4]);
2276  m_eclShowerToMC5->push_back(idx[4]);
2277  MCParticle* amcParticle = m_mcParticles[idx[4]];
2278  m_eclShowerToMC5PDG->push_back(amcParticle->getPDG());
2279  if (amcParticle->getMother() != nullptr) {
2280  m_eclShowerToMC5Moth->push_back(amcParticle->getMother()->getIndex());
2281  m_eclShowerToMC5MothPDG->push_back(amcParticle->getMother()->getPDG());
2282  if (amcParticle->getMother()->getMother() != nullptr) {
2283  m_eclShowerToMC5GMoth->push_back(amcParticle->getMother()->getMother()->getIndex());
2284  m_eclShowerToMC5GMothPDG->push_back(amcParticle->getMother()->getMother()->getPDG());
2285  } else {
2286  m_eclShowerToMC5GMoth->push_back(-999);
2287  m_eclShowerToMC5GMothPDG->push_back(-999);
2288  }
2289  } else {
2290  m_eclShowerToMC5Moth->push_back(-999);
2291  m_eclShowerToMC5MothPDG->push_back(-999);
2292  m_eclShowerToMC5GMoth->push_back(-999);
2293  m_eclShowerToMC5GMothPDG->push_back(-999);
2294  }
2295  } else {
2296  m_eclShowerToMCWeight5->push_back(-1);
2297  m_eclShowerToMC5->push_back(-1);
2298  m_eclShowerToMC5PDG->push_back(-1);
2299  m_eclShowerToMC5Moth->push_back(-1);
2300  m_eclShowerToMC5MothPDG->push_back(-1);
2301  m_eclShowerToMC5GMoth->push_back(-1);
2302  m_eclShowerToMC5GMothPDG->push_back(-1);
2303  }
2304  m_eclShowerToBkgWeight->push_back(aECLShowers->getEnergy() - sumHit);
2305  }
2306 
2307  m_mcMultip = m_mcParticles.getEntries();
2308  for (int imcpart = 0; imcpart < m_mcParticles.getEntries(); imcpart++) {
2309  MCParticle* amcParticle = m_mcParticles[imcpart];
2310  m_mcIdx->push_back(amcParticle->getArrayIndex());
2311  m_mcPdg->push_back(amcParticle->getPDG());
2312  if (amcParticle->getMother() != nullptr) m_mcMothPdg->push_back(amcParticle->getMother()->getPDG());
2313  else m_mcMothPdg->push_back(-999);
2314  if (amcParticle->getMother() != nullptr
2315  && amcParticle->getMother()->getMother() != nullptr) m_mcGMothPdg->push_back(amcParticle->getMother()->getMother()->getPDG());
2316  else m_mcGMothPdg->push_back(-999);
2317  if (amcParticle->getMother() != nullptr && amcParticle->getMother()->getMother() != nullptr
2318  && amcParticle->getMother()->getMother()->getMother() != nullptr)
2319  m_mcGGMothPdg->push_back(amcParticle->getMother()->getMother()->getMother()->getPDG());
2320  else m_mcGGMothPdg->push_back(-999);
2321  m_mcEnergy->push_back(amcParticle->getEnergy());
2322  m_mcSecondaryPhysProc->push_back(amcParticle->getSecondaryPhysicsProcess());
2323 
2324  m_mcPx->push_back(amcParticle->getMomentum().X());
2325  m_mcPy->push_back(amcParticle->getMomentum().Y());
2326  m_mcPz->push_back(amcParticle->getMomentum().Z());
2327 
2328  m_mcDecayVtxX->push_back(amcParticle->getDecayVertex().X());
2329  m_mcDecayVtxY->push_back(amcParticle->getDecayVertex().Y());
2330  m_mcDecayVtxZ->push_back(amcParticle->getDecayVertex().Z());
2331 
2332  m_mcProdVtxX->push_back(amcParticle->getProductionVertex().X());
2333  m_mcProdVtxY->push_back(amcParticle->getProductionVertex().Y());
2334  m_mcProdVtxZ->push_back(amcParticle->getProductionVertex().Z());
2335 
2336  }
2337 
2338  if (m_doTracking == true) {
2339  m_trkMultip = 0;
2340  for (const Track& itrk : m_tracks) {
2341  const TrackFitResult* atrk = itrk.getTrackFitResult(Const::pion);
2342  if (atrk == nullptr) continue;
2343 
2344  m_trkIdx->push_back(m_trkMultip);
2345  m_trkPdg->push_back(atrk->getParticleType().getPDGCode());
2346  m_trkCharge->push_back(atrk->getChargeSign());
2347  m_trkPx->push_back(atrk->getMomentum().X());
2348  m_trkPy->push_back(atrk->getMomentum().Y());
2349  m_trkPz->push_back(atrk->getMomentum().Z());
2350  m_trkP->push_back(atrk->getMomentum().Mag());
2351  m_trkTheta->push_back(atrk->getMomentum().Theta());
2352  m_trkPhi->push_back(atrk->getMomentum().Phi());
2353  m_trkX->push_back(atrk->getPosition().X());
2354  m_trkY->push_back(atrk->getPosition().Y());
2355  m_trkZ->push_back(atrk->getPosition().Z());
2356 
2357  const ECLPidLikelihood* eclpid = itrk.getRelatedTo<ECLPidLikelihood>() ;
2358 
2359  if (eclpid != nullptr) {
2360  m_eclpidtrkIdx -> push_back(m_trkMultip);
2361  m_eclpidEnergy -> push_back(eclpid-> energy());
2362  m_eclpidEop -> push_back(eclpid-> eop());
2363  m_eclpidE9E21 -> push_back(eclpid-> e9e25());
2364  m_eclpidNCrystals -> push_back(eclpid-> nCrystals());
2365  m_eclpidNClusters -> push_back(eclpid-> nClusters());
2366  m_eclLogLikeEl -> push_back(eclpid-> getLogLikelihood(Const::electron));
2367  m_eclLogLikeMu -> push_back(eclpid-> getLogLikelihood(Const::muon));
2368  m_eclLogLikePi -> push_back(eclpid-> getLogLikelihood(Const::pion));
2369  } else {
2370  m_eclpidtrkIdx -> push_back(m_trkMultip);
2371  m_eclpidEnergy -> push_back(0);
2372  m_eclpidEop -> push_back(0);
2373  m_eclpidE9E21 -> push_back(0);
2374  m_eclpidNCrystals -> push_back(0);
2375  m_eclpidNClusters -> push_back(0);
2376  m_eclLogLikeEl -> push_back(0);
2377  m_eclLogLikeMu -> push_back(0);
2378  m_eclLogLikePi -> push_back(0);
2379  }
2380  m_trkMultip++;
2381  }
2382  }
2383 
2384  m_tree->Fill();
2385 }
2386 
2387 void ECLDataAnalysisModule::endRun()
2388 {
2389 }
2390 
2391 void ECLDataAnalysisModule::terminate()
2392 {
2393 
2394  if (m_rootFilePtr != nullptr) {
2395  m_rootFilePtr->cd();
2396  m_tree->Write();
2397  }
2398 
2399 }
int getPDGCode() const
PDG code.
Definition: Const.h:354
Class to store calibrated ECLDigits: ECLCalDigits.
Definition: ECLCalDigit.h:23
int getCellId() const
Get Cell ID.
Definition: ECLCalDigit.h:114
double getEnergy() const
Get Calibrated Energy.
Definition: ECLCalDigit.h:119
double getTime() const
Get Calibrated Time.
Definition: ECLCalDigit.h:159
ECL cluster data.
Definition: ECLCluster.h:27
unsigned short getMaxECellId() const
Return cellID of maximum energy crystal.
Definition: ECLCluster.h:247
bool isTrack() const
Return true if the cluster matches with track.
Definition: ECLCluster.h:235
bool hasHypothesis(EHypothesisBit bitmask) const
Return if specific hypothesis bit is set.
Definition: ECLCluster.h:348
double getPhi() const
Return Corrected Phi of Shower (radian).
Definition: ECLCluster.h:301
double getE1oE9() const
Return E1/E9 (shower shape variable).
Definition: ECLCluster.h:274
double getDeltaL() const
Return deltaL.
Definition: ECLCluster.h:262
double getR() const
Return R.
Definition: ECLCluster.h:307
double getEnergyRaw() const
Return Uncorrected Energy deposited (GeV)
Definition: ECLCluster.h:313
double getUncertaintyTheta() const
Return Uncertainty on Theta of Shower.
Definition: ECLCluster.h:322
double getLAT() const
Return LAT (shower shape variable).
Definition: ECLCluster.h:289
double getE9oE21() const
Return E9/E21 (shower shape variable).
Definition: ECLCluster.h:277
int getDetectorRegion() const
Return detector region: 0: below acceptance, 1: FWD, 2: BRL, 3: BWD, 11: FWDGAP, 13: BWDGAP.
Definition: ECLCluster.cc:66
unsigned short getStatus() const
Return status.
Definition: ECLCluster.h:241
double getEnergy(EHypothesisBit hypothesis) const
Return Energy (GeV).
Definition: ECLCluster.cc:19
double getUncertaintyEnergy() const
Return Uncertainty on Energy of Shower.
Definition: ECLCluster.h:319
double getMinTrkDistance() const
Get distance between cluster COG and track extrapolation to ECL.
Definition: ECLCluster.h:256
double getNumberOfCrystals() const
Return number of a crystals in a shower (sum of weights).
Definition: ECLCluster.h:292
double getEnergyHighestCrystal() const
Return energy of highest energetic crystal in cluster (GeV)
Definition: ECLCluster.h:316
double getZernikeMVA() const
Return MVA based hadron/photon value based on Zernike moments (shower shape variable).
Definition: ECLCluster.h:271
double getUncertaintyPhi() const
Return Uncertainty on Phi of Shower.
Definition: ECLCluster.h:325
double getAbsZernike40() const
Return Zernike moment 40 (shower shape variable).
Definition: ECLCluster.h:265
double getSecondMoment() const
Return second moment (shower shape variable).
Definition: ECLCluster.h:286
double getTheta() const
Return Corrected Theta of Shower (radian).
Definition: ECLCluster.h:304
double getDeltaTime99() const
Return cluster delta time 99.
Definition: ECLCluster.h:298
double getTime() const
Return cluster time.
Definition: ECLCluster.h:295
double getAbsZernike51() const
Return Zernike moment 51 (shower shape variable).
Definition: ECLCluster.h:268
Class to store connected regions (CRs)
float getLikelihoodChargedHadron() const
Get Charged Hadron likelihood (ECL based only) T2.
bool isTrack() const
Get boolean to flag if a track is matched to the CR.
float getLikelihoodNeutralHadron() const
Get Neutral Hadron likelihood (ECL based only) N2.
float getLikelihoodMIPNGamma() const
Get MIPNGamma likelihood (ECL based only) T1.
float getLikelihoodNGamma() const
Get NGamma likelihood (ECL based only) N1.
int getCRId() const
Get CR identifieer.
float getLikelihoodMergedPi0() const
Get Merged Pi0 likelihood (ECL based only) N3.
float getLikelihoodElectronNGamma() const
Get ElectronNGamma likelihood (ECL based only) T3.
The ECL Data Analysis Module.
Class to store ECL digitized hits (output of ECLDigi) relation to ECLHit filled in ecl/modules/eclDig...
Definition: ECLDigit.h:24
int getAmp() const
Get Fitting Amplitude.
Definition: ECLDigit.h:70
int getQuality() const
Get Fitting Quality.
Definition: ECLDigit.h:80
int getCellId() const
Get Cell ID.
Definition: ECLDigit.h:64
int getTimeFit() const
Get Fitting Time.
Definition: ECLDigit.h:75
Class to store simulated hits which equate to average of ECLSImHit on crystals input for digitization...
Definition: ECLHit.h:25
double getTimeAve() const
Get average time.
Definition: ECLHit.h:75
int getCellId() const
Get Cell ID.
Definition: ECLHit.h:65
double getEnergyDep() const
Get deposit energy.
Definition: ECLHit.h:70
Class to store local maxima (LM)
int getCellId() const
Get CellId.
int getLMId() const
Get LM identifier.
int getType() const
Get type.
Container for likelihoods with ECL PID (ECLChargedPIDModule)
Class to store ECL Showers.
Definition: ECLShower.h:25
int getHypothesisId() const
Get Hypothesis Id.
Definition: ECLShower.h:259
double getPhi() const
Get Phi.
Definition: ECLShower.h:284
double getLateralEnergy() const
Get Lateral Energy in Shower.
Definition: ECLShower.h:334
double getE1oE9() const
Get energy ratio E1oE9.
Definition: ECLShower.h:379
double getEnergy() const
Get Energy.
Definition: ECLShower.h:269
double getShowerDepth() const
path on track extrapolation to POCA to average cluster direction
Definition: ECLShower.h:349
int getConnectedRegionId() const
Get Connected region Id.
Definition: ECLShower.h:254
double getR() const
Get R.
Definition: ECLShower.h:289
double getEnergyRaw() const
Get Energy Sum.
Definition: ECLShower.h:274
double getUncertaintyTheta() const
Get Error of theta.
Definition: ECLShower.h:309
double getE9oE21() const
Get energy ratio E9oE21.
Definition: ECLShower.h:384
double getNumberOfCrystalsForEnergy() const
Get number of crystals used for energy calculation.
Definition: ECLShower.h:404
double getUncertaintyEnergy() const
Get Error of Energy.
Definition: ECLShower.h:304
double getTrkDepth() const
path on track extrapolation to POCA to average cluster direction
Definition: ECLShower.h:344
double getMinTrkDistance() const
Get distance to closest Track.
Definition: ECLShower.h:339
double getNumberOfCrystals() const
Get NofCrystals.
Definition: ECLShower.h:354
double getEnergyHighestCrystal() const
Get Highest Energy in Shower.
Definition: ECLShower.h:329
double getZernikeMVA() const
Get Zernike MVA.
Definition: ECLShower.h:369
bool getIsTrack() const
Get if matched with a Track.
Definition: ECLShower.h:239
double getUncertaintyPhi() const
Get Error of phi.
Definition: ECLShower.h:314
double getAbsZernike40() const
Get absolute value of Zernike moment 40.
Definition: ECLShower.h:359
int getCentralCellId() const
Get central cell Id.
Definition: ECLShower.h:264
double getSecondMoment() const
Get second moment.
Definition: ECLShower.h:374
double getTheta() const
Get Theta.
Definition: ECLShower.h:279
double getDeltaTime99() const
Get Time Resolution.
Definition: ECLShower.h:324
double getTime() const
Get Time.
Definition: ECLShower.h:319
double getAbsZernike51() const
Get absolute value of Zernike moment 51.
Definition: ECLShower.h:364
ClassECLSimHit - Geant4 simulated hit for the ECL.
Definition: ECLSimHit.h:29
int getPDGCode() const
Get Particle PDG (can be one of secondaries)
Definition: ECLSimHit.h:96
int getCellId() const
Get Cell ID.
Definition: ECLSimHit.h:86
double getFlightTime() const
Get Flight time from IP.
Definition: ECLSimHit.h:101
double getEnergyDep() const
Get Deposit energy.
Definition: ECLSimHit.h:106
G4ThreeVector getPosition() const
Get Position.
Definition: ECLSimHit.h:126
G4ThreeVector getMomentum() const
Get Momentum.
Definition: ECLSimHit.h:116
A Class to store the Monte Carlo particle information.
Definition: MCParticle.h:32
float getEnergy() const
Return particle energy in GeV.
Definition: MCParticle.h:147
int getIndex() const
Get 1-based index of the particle in the corresponding MCParticle list.
Definition: MCParticle.h:230
int getArrayIndex() const
Get 0-based index of the particle in the corresponding MCParticle list.
Definition: MCParticle.h:244
TVector3 getMomentum() const
Return momentum.
Definition: MCParticle.h:198
TVector3 getDecayVertex() const
Return decay vertex.
Definition: MCParticle.h:219
int getPDG() const
Return PDG code of particle.
Definition: MCParticle.h:112
TVector3 getProductionVertex() const
Return production vertex position.
Definition: MCParticle.h:189
int getSecondaryPhysicsProcess() const
Returns the physics process type of a secondary particle.
Definition: MCParticle.h:294
Base class for Modules.
Definition: Module.h:72
int getArrayIndex() const
Returns this object's array index (in StoreArray), or -1 if not found.
RelationVector< TO > getRelationsTo(const std::string &name="", const std::string &namedRelation="") const
Get the relations that point from this object to another store array.
T * getRelated(const std::string &name="", const std::string &namedRelation="") const
Get the object to or from which this object has a relation.
TO * getRelatedTo(const std::string &name="", const std::string &namedRelation="") const
Get the object to which this object has a relation.
Values of the result of a track fit with a given particle hypothesis.
short getChargeSign() const
Return track charge (1 or -1).
TVector3 getMomentum() const
Getter for vector of momentum at closest approach of track in r/phi projection.
TVector3 getPosition() const
Getter for vector of position at closest approach of track in r/phi projection.
Const::ParticleType getParticleType() const
Getter for ParticleType of the mass hypothesis of the track fit.
Class that bundles various TrackFitResults.
Definition: Track.h:25
bool isFailedFit() const
Get Boolean Fit Failed Status.
Definition: ECLCalDigit.h:250
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:650
MCParticle * getMother() const
Returns a pointer to the mother particle.
Definition: MCParticle.h:582
Abstract base class for different kinds of events.