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