Belle II Software  release-06-01-15
ECLLocalMaximumFinderModule.cc
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 // THIS MODULE
10 #include <ecl/modules/eclLocalMaximumFinder/ECLLocalMaximumFinderModule.h>
11 
12 // ROOT
13 #include "TFile.h"
14 #include "TTree.h"
15 
16 // FRAMEWORK
17 #include <framework/datastore/StoreArray.h>
18 #include <framework/gearbox/Const.h>
19 #include <framework/logging/Logger.h>
20 
21 // MDST
22 #include <mdst/dataobjects/MCParticle.h>
23 
24 // ECL
25 #include <ecl/dataobjects/ECLHit.h>
26 #include <ecl/dataobjects/ECLDigit.h>
27 #include <ecl/dataobjects/ECLCalDigit.h>
28 #include <ecl/dataobjects/ECLLocalMaximum.h>
29 #include <ecl/dataobjects/ECLConnectedRegion.h>
30 #include <ecl/geometry/ECLNeighbours.h>
31 #include <ecl/geometry/ECLGeometryPar.h>
32 
33 // NAMESPACE(S)
34 using namespace Belle2;
35 using namespace ECL;
36 
37 //-----------------------------------------------------------------
38 // Register the Module
39 //-----------------------------------------------------------------
40 REG_MODULE(ECLLocalMaximumFinder)
41 REG_MODULE(ECLLocalMaximumFinderPureCsI)
42 
43 //-----------------------------------------------------------------
44 // Implementation
45 //-----------------------------------------------------------------
47  m_mcParticles(mcParticleArrayName()),
48  m_eclHits(eclHitArrayName()),
49  m_eclDigits(eclDigitArrayName()),
50  m_eclCalDigits(eclCalDigitArrayName()),
51  m_eclConnectedRegions(eclConnectedRegionArrayName()),
52  m_eclLocalMaximums(eclLocalMaximumArrayName())
53 {
54  // Set description.
55  setDescription("ECLLocalMaximumFinderModule");
56 
57  // Parallel processing certification.
58  setPropertyFlags(c_ParallelProcessingCertified);
59 
60  // Add module parameters.
61  addParam("energyCut", m_energyCut, "Seed energy cut [MeV], minimum is 5.0 MeV.", 10.0 * Belle2::Unit::MeV);
62  addParam("isTrainingMode", m_isTrainingMode,
63  "Run in training mode (i.e. fill file with MVA input variables and determine MC truth of LM.).", 0);
64  addParam("outfileName", m_outfileName, "Output file name for training file.", std::string("ECLLocalMaximumFinderOutput.root"));
65  addParam("method", m_method, "Method to determine the LM (cut, none, fastbdt).", std::string("none"));
66  addParam("truthFraction", m_truthFraction, "Minimum matched energy fraction truth/rec for the LM.", 0.51);
67  addParam("cutOffset", m_cutOffset, "Cut method specific: Offset. (BaBar: 2.5, high eff: 1.40)", 2.5);
68  addParam("cutSlope", m_cutSlope, "Cut method specific: Slope. (BaBar: 0.5, high eff: 3.0)", 0.5);
69  addParam("cutRatioCorrection", m_cutRatioCorrection, "Cut method specific: Ratio correction.", 0.0);
70 
71 }
72 
74 {
75  ;
76 }
77 
79 {
80  B2DEBUG(200, "ECLLocalMaximumFinderModule::initialize()");
81 
82  m_eclLocalMaximums.registerInDataStore(eclLocalMaximumArrayName());
83  m_eclCalDigits.registerInDataStore(eclCalDigitArrayName());
84  m_eclConnectedRegions.registerInDataStore(eclConnectedRegionArrayName());
85  m_eclConnectedRegions.registerRelationTo(m_eclLocalMaximums);
86  m_eclCalDigits.registerRelationTo(m_eclLocalMaximums);
87 
88  // Check user input.
89  if (m_energyCut < c_minEnergyCut) {
90  B2WARNING("ECLLocalMaximumFinderModule::initialize: Energy threshold too small, resetting to " << c_minEnergyCut << " GeV");
91  m_energyCut = c_minEnergyCut;
92  }
93 
94  if (m_truthFraction < 1e-6) {
95  B2WARNING("ECLLocalMaximumFinderModule::initialize: Matching fraction must be above 1e-6, input: " << m_truthFraction <<
96  " will be reset to 1e-6.");
97  m_truthFraction = 1e-6;
98  }
99 
100  if (m_truthFraction > 1.0) {
101  B2WARNING("ECLLocalMaximumFinderModule::initialize: Matching fraction must be below 1.0, input: " << m_truthFraction <<
102  " will be reset to 1.0.");
103  m_truthFraction = 1.0;
104  }
105 
106  // Geometry instance.
107  m_geom = ECLGeometryPar::Instance();
108 
109  // Initialize neighbour map.
110  m_neighbourMap = new ECLNeighbours("N", 1);
111 
112  // Reset all variables.
113  resetClassifierVariables();
114 
115  // Open output files and declare branches if in training mode. Each file will hold a flat ntuple of training data.
116  m_outfile = nullptr;
117  m_tree = nullptr;
118  if (m_isTrainingMode > 0) {
119  const int cBufferLength = 500;
120  char tmpBuffer[cBufferLength];
121  int tmpBufferLength = sprintf(tmpBuffer, "%s", m_outfileName.c_str());
122 
123  if (tmpBufferLength >= cBufferLength) {
124  B2FATAL("ECLLocalMaximumFinderModule::initialize(): Output training filename length too long!");
125  }
126 
127  m_outfile = new TFile(tmpBuffer, "RECREATE");
128  m_tree = new TTree("locmax", "locmax");
129  m_tree->Branch("energyRatioNeighbour0", &m_energyRatioNeighbour[0], "energyRatioNeighbour0/F");
130  m_tree->Branch("energyRatioNeighbour1", &m_energyRatioNeighbour[1], "energyRatioNeighbour1/F");
131  m_tree->Branch("energyRatioNeighbour2", &m_energyRatioNeighbour[2], "energyRatioNeighbour2/F");
132  m_tree->Branch("energyRatioNeighbour3", &m_energyRatioNeighbour[3], "energyRatioNeighbour3/F");
133  m_tree->Branch("energyRatioNeighbour4", &m_energyRatioNeighbour[4], "energyRatioNeighbour4/F");
134  m_tree->Branch("energyRatioNeighbour5", &m_energyRatioNeighbour[5], "energyRatioNeighbour5/F");
135  m_tree->Branch("energyRatioNeighbour6", &m_energyRatioNeighbour[6], "energyRatioNeighbour6/F");
136  m_tree->Branch("energyRatioNeighbour7", &m_energyRatioNeighbour[7], "energyRatioNeighbour7/F");
137  m_tree->Branch("energyRatioNeighbour8", &m_energyRatioNeighbour[8], "energyRatioNeighbour8/F");
138  m_tree->Branch("energyRatioNeighbour9", &m_energyRatioNeighbour[9], "energyRatioNeighbour9/F");
139  m_tree->Branch("energyRatioNeighbour10", &m_energyRatioNeighbour[10], "energyRatioNeighbour10/F");
140  m_tree->Branch("energyRatioNeighbour11", &m_energyRatioNeighbour[11], "energyRatioNeighbour11/F");
141  m_tree->Branch("energy", &m_energy, "energy/F");
142  m_tree->Branch("target", &m_target, "target/F");
143  m_tree->Branch("targetindex", &m_targetindex, "targetindex/F");
144  m_tree->Branch("targetpi0index", &m_targetpi0index, "targetpi0index/F");
145  m_tree->Branch("thetaId", &m_thetaId, "thetaId/F");
146  m_tree->Branch("phiId", &m_phiId, "phiId/F");
147  m_tree->Branch("cellId", &m_cellId, "cellId/F");
148  m_tree->Branch("maxNeighbourEnergy", &m_maxNeighbourEnergy, "maxNeighbourEnergy/F");
149  m_tree->Branch("nNeighbours10", &m_nNeighbours10, "nNeighbours10/F");
150  m_tree->Branch("time", &m_time, "time/F");
151  m_tree->Branch("timeResolution", &m_timeResolution, "timeResolution/F");
152  m_tree->Branch("timeFitFailed", &m_timeFitFailed, "timeFitFailed/F");
153  m_tree->Branch("CRId", &m_CRId, "CRId/F");
154  m_tree->Branch("LMId", &m_LMId, "LMId/F");
155  }
156 
157  // initialize the vector that gives the relation between cellid and store array position
158  m_StoreArrPosition.resize(8736 + 1);
159 
160 }
161 
163 {
164  ;
165 }
166 
168 {
169  B2DEBUG(200, "ECLLocalMaximumFinderModule::event()");
170 
171  // Fill a vector that can be used to map cellid -> store array position
172  std::fill_n(m_StoreArrPosition.begin(), m_StoreArrPosition.size(), -1);
173  for (int i = 0; i < m_eclCalDigits.getEntries(); i++) {
174  m_StoreArrPosition[m_eclCalDigits[i]->getCellId()] = i;
175  }
176 
177  // Vector with neighbour ids.
178  std::vector< double > vNeighourEnergies;
179  vNeighourEnergies.resize(c_nMaxNeighbours);
180 
181  // Loop over connected regions.
182  for (const ECLConnectedRegion& aCR : m_eclConnectedRegions) {
183  const int crId = aCR.getCRId();
184  int iLM = 1;
185 
186  // Loop over all entries in this CR.
187  for (const ECLCalDigit& aECLCalDigit : aCR.getRelationsTo<ECLCalDigit>()) {
188 
189  // Check seed energy cut.
190  if (aECLCalDigit.getEnergy() >= m_energyCut) {
191 
192  // Clean up for this candiate (MVA is trained per LM, regardless of CR)
193  std::fill_n(vNeighourEnergies.begin(), vNeighourEnergies.size(),
194  -999); // -999 means later: this digit is just not available in this neighbour definition.
195  resetTrainingVariables();
196  resetClassifierVariables();
197 
198  // Check neighbours: Must be a local energy maximum.
199  bool isLocMax = 1;
200  int neighbourCount = 0;
201  for (auto& neighbourId : m_neighbourMap->getNeighbours(aECLCalDigit.getCellId())) {
202  if (neighbourId == aECLCalDigit.getCellId()) continue; // Skip the center cell to avoid possible floating point issues.
203 
204  const int pos = m_StoreArrPosition[neighbourId]; // Get position in the store array for this digit.
205 
206  double energyNeighbour = 0.0;
207  if (pos >= 0) {
208  energyNeighbour = m_eclCalDigits[pos]->getEnergy(); // Get the energy directly from the store array.
209  vNeighourEnergies[neighbourCount] = energyNeighbour;
210  } else {
211  // Digit does not belong to this CR
212  vNeighourEnergies[neighbourCount] = 0.0;
213  }
214  ++neighbourCount;
215 
216  if (energyNeighbour > aECLCalDigit.getEnergy()) {
217  isLocMax = 0;
218  break;
219  }
220  }
221 
222  // It is a local maximum. Get all variables needed for classification.
223  if (isLocMax) {
224 
225  for (unsigned int npos = 0; npos < vNeighourEnergies.size(); ++npos) {
226  if (vNeighourEnergies[npos] >= 0) {
227  m_energyRatioNeighbour[npos] = static_cast < float >(vNeighourEnergies[npos] / aECLCalDigit.getEnergy());
228  if (vNeighourEnergies[npos] > m_maxNeighbourEnergy) m_maxNeighbourEnergy = vNeighourEnergies[npos];
229  if (vNeighourEnergies[npos] > 1.0 * Belle2::Unit::MeV) ++m_nNeighbours10;
230  } else m_energyRatioNeighbour[npos] = 0.0;
231  }
232  m_time = aECLCalDigit.getTime();
233  m_maxEnergyRatio = m_maxNeighbourEnergy / aECLCalDigit.getEnergy();
234 
235  // Fill training monitoring variables and MC truth information.
236  if (m_isTrainingMode > 0) {
237 
238  m_energy = static_cast < float >(aECLCalDigit.getEnergy());
239  m_cellId = static_cast < float >(aECLCalDigit.getCellId());
240  m_timeResolution = static_cast < float >(aECLCalDigit.getTimeResolution());
241  m_timeFitFailed = static_cast < float >(aECLCalDigit.isFailedFit());
242  m_CRId = static_cast < float >(crId);
243  m_LMId = static_cast < float >(iLM);
244 
245  m_geom->Mapping(m_cellId - 1);
246  m_thetaId = static_cast < float >(m_geom->GetThetaID());
247  m_phiId = static_cast < float >(m_geom->GetPhiID());
248 
249  // This requires MC matching before this stage!
250  int pi0index = -1;
251  int maxtype = 0;
252  int maxpos = 0;
253 
254  auto relatedParticlePairs = aECLCalDigit.getRelationsWith<MCParticle>();
255 
256  for (unsigned int irel = 0; irel < relatedParticlePairs.size(); irel++) {
257  const auto particle = relatedParticlePairs.object(irel);
258  const double weight = relatedParticlePairs.weight(irel);
259 
260  int motherpdg = -1;
261  int motherindex = -1;
262  pi0index = -1;
263  getEnteringMother(*particle, motherpdg, motherindex, pi0index);
264  addToSignalEnergy(motherpdg, motherindex, pi0index, weight);
265  }
266 
267  B2DEBUG(175, " -> digt energy: " << aECLCalDigit.getEnergy());
268  B2DEBUG(175, "photon: " << m_signalEnergy[0][0] << " " << m_signalEnergy[0][1]);
269  B2DEBUG(175, "pi0: " << m_signalEnergy[1][0] << " " << m_signalEnergy[1][1]);
270  B2DEBUG(175, "electron: " << m_signalEnergy[2][0] << " " << m_signalEnergy[2][1]);
271  B2DEBUG(175, "muon: " << m_signalEnergy[3][0] << " " << m_signalEnergy[3][1]);
272  B2DEBUG(175, "neutral hadron: " << m_signalEnergy[4][0] << " " << m_signalEnergy[4][1]);
273  B2DEBUG(175, "charged hadron: " << m_signalEnergy[5][0] << " " << m_signalEnergy[5][1]);
274  B2DEBUG(175, "other: " << m_signalEnergy[6][0]);
275 
276  maxtype = 0;
277  maxpos = 0;
278  getMax(maxtype, maxpos);
279 
280  if (maxtype >= 0) {
281  if (m_signalEnergy[maxtype][maxpos] >= m_truthFraction * aECLCalDigit.getEnergy()) {
282  m_target = maxtype;
283  m_targetindex = m_signalId[maxtype][maxpos];
284  m_targetpi0index = pi0index;
285  } else {
286  m_target = 7;
287  }
288  } else {
289  m_target = 7;
290  }
291 
292  m_tree->Fill();
293 
294  } // end training
295 
296  if (m_method == "cut") {
297 
298  B2DEBUG(200, "m_cutSlope: " << m_cutSlope << ", m_nNeighbours10: " << m_nNeighbours10 << ", m_cutOffset: " << m_cutOffset <<
299  ", m_maxNeighbourEnergy: " << m_maxNeighbourEnergy << ", m_cutRatioCorrection: " << m_cutRatioCorrection <<
300  ", aECLCalDigit.getEnergy(): " << aECLCalDigit.getEnergy());
301  B2DEBUG(200, "m_cutSlope * (m_nNeighbours10 - m_cutOffset): " << m_cutSlope * (m_nNeighbours10 - m_cutOffset));
302  B2DEBUG(200, "(m_maxNeighbourEnergy - m_cutRatioCorrection) / (aECLCalDigit.getEnergy() - m_cutRatioCorrection)" <<
303  (m_maxNeighbourEnergy - m_cutRatioCorrection) / (aECLCalDigit.getEnergy() - m_cutRatioCorrection) << "\n");
304 
305  if (m_cutSlope * (m_nNeighbours10 - m_cutOffset) >= (m_maxNeighbourEnergy - m_cutRatioCorrection) /
306  (aECLCalDigit.getEnergy() - m_cutRatioCorrection)) {
307  makeLocalMaximum(aCR, aECLCalDigit.getCellId(), iLM);
308  ++iLM;
309  }
310  } else if (m_method == "none") { // All energy local maximums will become local maximums.
311  makeLocalMaximum(aCR, aECLCalDigit.getCellId(), iLM);
312  ++iLM;
313  }
314 
315  }
316 
317  } // end check energy
318 
319  } // end CalDigit loop
320 
321  // Check if there is at least one local maximum in the CR. If not, make the highest energetic crystal one.
322  if (iLM == 1) {
323 
324  int highestEnergyCellId = -1;
325  double highestEnergy = 0.0;
326 
327  // Loop over all entries in this CR.
328  for (const ECLCalDigit& aECLCalDigit : aCR.getRelationsTo<ECLCalDigit>(eclCalDigitArrayName())) {
329  if (aECLCalDigit.getEnergy() > highestEnergy) {
330  highestEnergyCellId = aECLCalDigit.getCellId();
331  highestEnergy = aECLCalDigit.getEnergy();
332  }
333  } // end CalDigit loop
334 
335  makeLocalMaximum(aCR, highestEnergyCellId, 0);
336 
337  }
338 
339  } // end CR loop
340 
341 }
342 
343 
345 {
346  B2DEBUG(200, "ECLLocalMaximumFinderModule::endRun()");
347 }
348 
349 
351 {
352  B2DEBUG(200, "ECLLocalMaximumFinderModule::terminate()");
353 
354  // If run in trainingmode, write the training file.
355  if (m_outfile and m_tree) {
356  m_outfile->cd();
357  m_tree->Write();
358  m_outfile->Write();
359  m_outfile->Close();
360  delete m_outfile;
361  }
362 
363  if (m_neighbourMap) delete m_neighbourMap;
364 
365 }
366 
367 void ECLLocalMaximumFinderModule::makeLocalMaximum(const ECLConnectedRegion& aCR, const int cellId, const int lmId)
368 {
369  // Set the local maximum dataobject.
370  const auto aLocalMaximum = m_eclLocalMaximums.appendNew();
371 
372  B2DEBUG(175, "ECLLocalMaximumFinderModule::makeLocalMaximum(): local maximum cellid: " << cellId);
373 
374  // Set the id of this local maximum.
375  aLocalMaximum->setLMId(lmId);
376 
377  // Set the cell Id of the digit.
378  aLocalMaximum->setCellId(cellId);
379 
380  // Add relations to ECLConnectedRegion.
381  aCR.addRelationTo(aLocalMaximum);
382 
383 }
384 
386 {
387  m_target = -1;
388  m_targetindex = -1;
389  m_targetpi0index = -1;
390 
391  m_totalSignalEnergy = 0.;
392 
393  for (unsigned int i = 0; i < 10; ++i) {
394  for (unsigned int j = 0; j < 5; ++j) {
395  m_signalEnergy[i][j] = 0.;
396  m_signalId[i][j] = -1;
397  }
398  }
399 
400 }
401 
403 {
404 
405  for (unsigned i = 0; i < c_nMaxNeighbours; ++i) {
406  m_energyRatioNeighbour[i] = 0.;
407  }
408 
409  m_energy = 0.;
410  m_cellId = -1;
411  m_thetaId = -1;
412  m_phiId = -1;
413  m_nNeighbours10 = 0;
414  m_maxNeighbourEnergy = 0.0;
415  m_time = -9999;
416  m_timeResolution = -9999.;
417  m_timeFitFailed = -9999.;
418  m_CRId = -1;
419  m_LMId = -1;
420  m_maxEnergyRatio = 0.0;
421 }
422 
423 
424 void ECLLocalMaximumFinderModule::getEnteringMother(const MCParticle& particle, int& pdg, int& arrayindex, int& pi0arrayindex)
425 {
426 
427  int index = particle.getArrayIndex();
428  int pi0index = -1;
429 
430  while (!isEnteringECL(m_mcParticles[index]->getProductionVertex())) {
431  if (m_mcParticles[index]->getMother()) index = m_mcParticles[index]->getMother()->getArrayIndex();
432  else index = -1;
433  };
434 
435  // For photon mother: are they from a pi0? This can be used to improved overlap/merged pi0 reconstruction.
436  if (m_mcParticles[index]->getPDG() == Const::photon.getPDGCode()) {
437  if (m_mcParticles[index]->getMother()->getPDG() == Const::pi0.getPDGCode()) {
438  pi0index = m_mcParticles[index]->getMother()->getArrayIndex();
439  }
440  }
441 
442  // Dont include mother if its energy is too low or if its a photon from a neutron interaction.
443  if ((m_mcParticles[index]->getEnergy() < 5.0 * Belle2::Unit::MeV)
444  or (m_mcParticles[index]->getPDG() == Const::photon.getPDGCode()
445  and abs(m_mcParticles[index]->getMother()->getPDG()) == Const::proton.getPDGCode())) {
446  pdg = -1;
447  arrayindex = -1;
448  pi0arrayindex = -1;
449  } else {
450  pdg = m_mcParticles[index]->getPDG();
451  arrayindex = index;
452  pi0arrayindex = pi0index;
453  }
454 }
455 
457 {
458 
459  const double theta = vertex.Theta();
460 
461  if (theta > 0.555015 and theta < 2.26369) { //barrel
462  double radius = vertex.Perp();
463  if (radius < 125 * Belle2::Unit::cm) return true;
464  } else if (theta <= 0.555015) { //fwd
465  if (vertex.Z() < 196.16 * Belle2::Unit::cm) return true;
466  } else if (theta >= 2.26369) { //bwd
467  if (vertex.Z() > -102.16 * Belle2::Unit::cm) return true;
468  }
469 
470  return false;
471 }
472 
473 int ECLLocalMaximumFinderModule::getIdPosition(const int type, const int id)
474 {
475 
476  for (int i = 0; i < 5; i++) {
477  if (m_signalId[type][i] == id) return i;
478  if (m_signalId[type][i] == -1) {
479  m_signalId[type][i] = id;
480  return i; //next free one
481  }
482  }
483 
484  return -1;
485 }
486 
487 // of all entries, get the maximum!
488 void ECLLocalMaximumFinderModule::getMax(int& type, int& id)
489 {
490  double maxe = 0.;
491  int maxtype = -1;
492  int maxid = -1;
493 
494  for (unsigned int i = 0; i < 10; ++i) {
495  for (unsigned int j = 0; j < 5; ++j) {
496  if (m_signalEnergy[i][j] > maxe) {
497  maxe = m_signalEnergy[i][j];
498  maxtype = i;
499  maxid = j;
500  }
501  }
502  }
503 
504  type = maxtype;
505  id = maxid;
506 
507 }
508 
509 void ECLLocalMaximumFinderModule::addToSignalEnergy(int motherpdg, int motherindex, int pi0index, double weight)
510 {
511 
512  // for the LM training and CR/LM debugging
513  if (motherpdg == Const::photon.getPDGCode()) {
514  if (pi0index >= 0) { // photon from pi0
515  int idpos = getIdPosition(1, motherindex);
516  m_signalEnergy[1][idpos] += weight;
517  } else {
518  int idpos = getIdPosition(0, motherindex);
519  m_signalEnergy[0][idpos] += weight; // photon from another source
520  }
521  } else if (abs(motherpdg) == Const::electron.getPDGCode()) { // electron
522  int idpos = getIdPosition(2, motherindex);
523  m_signalEnergy[2][idpos] += weight;
524  } else if (abs(motherpdg) == Const::muon.getPDGCode()) { // muon
525  int idpos = getIdPosition(3, motherindex);
526  m_signalEnergy[3][idpos] += weight;
527  } else if (abs(motherpdg) == Const::Klong.getPDGCode() or abs(motherpdg) == Const::neutron.getPDGCode()) { // neutral hadron
528  int idpos = getIdPosition(4, motherindex);
529  m_signalEnergy[4][idpos] += weight;
530  } else if (abs(motherpdg) == Const::pion.getPDGCode() or abs(motherpdg) == Const::kaon.getPDGCode()
531  or abs(motherpdg) == Const::proton.getPDGCode()) { // charged hadron
532  int idpos = getIdPosition(5, motherindex);
533  m_signalEnergy[5][idpos] += weight;
534  } else { // everything else
535  int idpos = getIdPosition(6, motherindex);
536  m_signalEnergy[6][idpos] += weight;
537  }
538 }
static const ParticleType neutron
neutron particle
Definition: Const.h:556
static const ParticleType pi0
neutral pion particle
Definition: Const.h:555
static const ChargedStable muon
muon particle
Definition: Const.h:541
static const ChargedStable pion
charged pion particle
Definition: Const.h:542
static const ParticleType Klong
K^0_L particle.
Definition: Const.h:558
static const ChargedStable proton
proton particle
Definition: Const.h:544
static const ChargedStable kaon
charged kaon particle
Definition: Const.h:543
static const ParticleType photon
photon particle
Definition: Const.h:554
static const ChargedStable electron
electron particle
Definition: Const.h:540
Class to store calibrated ECLDigits: ECLCalDigits.
Definition: ECLCalDigit.h:23
Class to store connected regions (CRs)
void getEnteringMother(const MCParticle &particle, int &pdg, int &arrayindex, int &pi0arrayindex)
Get enterging mother of this particle.
virtual void initialize() override
Initialize.
int getIdPosition(const int type, const int id)
Get Id position in the vector.
virtual void terminate() override
Terminate (close ROOT files here if you have opened any).
void makeLocalMaximum(const ECLConnectedRegion &aCR, const int cellId, const int lmId)
Make local maximum for a given connected region.
void resetClassifierVariables()
Reset Classifier Variables.
bool isEnteringECL(const B2Vector3D &vec)
Check if particle is produced outside of the ECL.
void addToSignalEnergy(int motherpdg, int motherindex, int pi0index, double weight)
Add energy to vector.
void resetTrainingVariables()
Reset Debug Variables.
void getMax(int &maxtype, int &maxpos)
Get the highest energy deposition particle type.
static ECLGeometryPar * Instance()
Static method to get a reference to the ECLGeometryPar instance.
Class to get the neighbours for a given cell id.
Definition: ECLNeighbours.h:23
A Class to store the Monte Carlo particle information.
Definition: MCParticle.h:32
Base class for Modules.
Definition: Module.h:72
void addRelationTo(const RelationsInterface< BASE > *object, float weight=1.0, const std::string &namedRelation="") const
Add a relation from this object to another object (with caching).
RelationVector< TO > getRelationsTo(const std::string &name="", const std::string &namedRelation="") const
Get the relations that point from this object to another store array.
static const double MeV
[megaelectronvolt]
Definition: Unit.h:114
static const double cm
Standard units with the value = 1.
Definition: Unit.h:47
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:650
Abstract base class for different kinds of events.