Belle II Software  release-05-02-19
KLMReconstructorModule.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2020 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Kirill Chilikin, Giacomo De Pietro, *
7  * Leo Piilonen, Timofey Uglov *
8  * *
9  * This software is provided "as is" without any warranty. *
10  **************************************************************************/
11 
12 /* Own header. */
13 #include <klm/modules/KLMReconstructor/KLMReconstructorModule.h>
14 
15 /* KLM headers. */
16 #include <klm/bklm/geometry/Module.h>
17 #include <klm/dataobjects/eklm/EKLMElementNumbers.h>
18 
19 /* Belle 2 headers. */
20 #include <framework/gearbox/Const.h>
21 #include <framework/logging/Logger.h>
22 
23 /* CLHEP headers. */
24 #include <CLHEP/Vector/ThreeVector.h>
25 
26 using namespace Belle2;
27 using namespace Belle2::bklm;
28 
29 REG_MODULE(KLMReconstructor)
30 
31 static bool compareSector(KLMDigit* d1, KLMDigit* d2)
32 {
33  int s1, s2;
34  static const EKLMElementNumbers& elementNumbers =
36  s1 = elementNumbers.sectorNumber(d1->getSection(), d1->getLayer(),
37  d1->getSector());
38  s2 = elementNumbers.sectorNumber(d2->getSection(), d2->getLayer(),
39  d2->getSector());
40  return s1 < s2;
41 }
42 
43 static bool comparePlane(KLMDigit* d1, KLMDigit* d2)
44 {
45  return d1->getPlane() < d2->getPlane();
46 }
47 
48 static bool compareStrip(KLMDigit* d1, KLMDigit* d2)
49 {
50  return d1->getStrip() < d2->getStrip();
51 }
52 
53 static bool compareTime(KLMDigit* d1, KLMDigit* d2)
54 {
55  return d1->getTime() < d2->getTime();
56 }
57 
58 static bool sameSector(KLMDigit* d1, KLMDigit* d2)
59 {
60  return ((d1->getSection() == d2->getSection()) &&
61  (d1->getLayer() == d2->getLayer()) &&
62  (d1->getSector() == d2->getSector()));
63 }
64 
66  Module(),
67  m_CoincidenceWindow(0),
68  m_PromptTime(0),
69  m_PromptWindow(0),
70  m_bklmGeoPar(nullptr),
71  m_eklmElementNumbers(&(EKLMElementNumbers::Instance())),
72  m_ElementNumbers(&(KLMElementNumbers::Instance())),
73  m_eklmGeoDat(nullptr),
74  m_eklmNStrip(0),
75  m_eklmTransformData(nullptr),
76  m_eklmTimeCalibrationData(nullptr)
77 {
78  setDescription("Create BKLMHit1ds from KLMDigits and then create BKLMHit2ds from BKLMHit1ds; create EKLMHit2ds from KLMDigits.");
80  addParam("IfAlign", m_bklmIfAlign,
81  "Perform alignment correction (true) or not (false).",
82  bool(true));
83  addParam("IgnoreScintillators", m_bklmIgnoreScintillators,
84  "Ignore scintillators (to debug their electronics mapping).",
85  false);
86  addParam("CheckSegmentIntersection", m_eklmCheckSegmentIntersection,
87  "Check if segments intersect.", true);
88  addParam("IgnoreHotChannels", m_IgnoreHotChannels,
89  "Use only Normal and Dead (for debugging) channels during 2d hit reconstruction",
90  true);
91 }
92 
94 {
95 }
96 
98 {
99  m_Digits.isRequired();
100  /* BKLM. */
101  m_bklmHit1ds.registerInDataStore();
102  m_bklmHit2ds.registerInDataStore();
103  m_bklmHit1ds.registerRelationTo(m_Digits);
104  m_bklmHit2ds.registerRelationTo(m_bklmHit1ds);
106  /* EKLM. */
107  m_eklmHit2ds.registerInDataStore();
108  m_eklmAlignmentHits.registerInDataStore();
109  m_eklmHit2ds.registerRelationTo(m_Digits);
110  m_eklmAlignmentHits.registerRelationTo(m_eklmHit2ds);
114  if (m_eklmGeoDat->getNPlanes() != 2)
115  B2FATAL("It is not possible to run EKLM reconstruction with 1 plane.");
118 }
119 
121 {
122  if (!m_ChannelStatus.isValid())
123  B2FATAL("KLM channel status data are not available.");
124  if (!m_TimeWindow.isValid())
125  B2FATAL("KLM time window data are not available.");
126  m_CoincidenceWindow = m_TimeWindow->getCoincidenceWindow();
127  m_PromptTime = m_TimeWindow->getPromptTime();
128  m_PromptWindow = m_TimeWindow->getPromptWindow();
129  /* EKLM. */
130  /* cppcheck-suppress variableScope */
131  int i;
132  if (!m_eklmRecPar.isValid())
133  B2FATAL("EKLM digitization parameters are not available.");
134  if (!m_eklmTimeCalibration.isValid())
135  B2FATAL("EKLM time calibration data is not available.");
136  if (m_eklmTimeCalibration.hasChanged()) {
137  for (i = 0; i < m_eklmNStrip; i++) {
139  m_eklmTimeCalibration->getTimeCalibrationData(i + 1);
140  if (m_eklmTimeCalibrationData[i] == nullptr) {
141  B2FATAL("EKLM time calibration data is missing for strip "
142  << i + 1 << ".");
144  }
145  }
146  }
147 }
148 
150 {
153 }
154 
156 {
157  int subdetector = digit->getSubdetector();
158  int section = digit->getSection();
159  int sector = digit->getSector();
160  int layer = digit->getLayer();
161  int plane = digit->getPlane();
162  int strip = digit->getStrip();
163  uint16_t channel = m_ElementNumbers->channelNumber(subdetector, section, sector, layer, plane, strip);
164  enum KLMChannelStatus::ChannelStatus status = m_ChannelStatus->getChannelStatus(channel);
165  if (status == KLMChannelStatus::c_Unknown)
166  B2FATAL("Incomplete KLM channel status data.");
167  if (status == KLMChannelStatus::c_Normal || status == KLMChannelStatus::c_Dead)
168  return true;
169  return false;
170 }
171 
173 {
174  /* Construct BKLMHit1Ds from KLMDigits. */
175  /* Sort KLMDigits by module and strip number. */
176  std::map<uint16_t, int> channelDigitMap;
177  for (int index = 0; index < m_Digits.getEntries(); ++index) {
178  const KLMDigit* digit = m_Digits[index];
180  continue;
181  if (digit->isMultiStrip())
182  continue;
183  if (m_bklmIgnoreScintillators && !digit->inRPC())
184  continue;
185  if (m_IgnoreHotChannels && !isNormal(digit))
186  continue;
187  if (digit->inRPC() || digit->isGood()) {
188  uint16_t channel = BKLMElementNumbers::channelNumber(
189  digit->getSection(), digit->getSector(),
190  digit->getLayer(), digit->getPlane(),
191  digit->getStrip());
192  channelDigitMap.insert(std::pair<uint16_t, int>(channel, index));
193  }
194  }
195  if (channelDigitMap.empty())
196  return;
197  std::vector<const KLMDigit*> digitCluster;
198  uint16_t previousChannel = channelDigitMap.begin()->first;
199  double averageTime = m_Digits[channelDigitMap.begin()->second]->getTime();
200  for (std::map<uint16_t, int>::iterator it = channelDigitMap.begin(); it != channelDigitMap.end(); ++it) {
201  const KLMDigit* digit = m_Digits[it->second];
202  double digitTime = digit->getTime();
203  if ((it->first > previousChannel + 1) || (std::fabs(digitTime - averageTime) > m_CoincidenceWindow)) {
204  m_bklmHit1ds.appendNew(digitCluster); // Also sets relation BKLMHit1d -> KLMDigit
205  digitCluster.clear();
206  }
207  previousChannel = it->first;
208  double n = (double)(digitCluster.size());
209  averageTime = (n * averageTime + digitTime) / (n + 1.0);
210  digitCluster.push_back(digit);
211  }
212  m_bklmHit1ds.appendNew(digitCluster); // Also sets relation BKLMHit1d -> KLMDigit
213 
214  /* Construct BKLMHit2Ds from orthogonal same-module BKLMHit1Ds. */
215  for (int i = 0; i < m_bklmHit1ds.getEntries(); ++i) {
216  int moduleID = m_bklmHit1ds[i]->getModuleID();
217  const bklm::Module* m = m_bklmGeoPar->findModule(m_bklmHit1ds[i]->getSection(), m_bklmHit1ds[i]->getSector(),
218  m_bklmHit1ds[i]->getLayer());
219  bool isPhiReadout = m_bklmHit1ds[i]->isPhiReadout();
220  for (int j = i + 1; j < m_bklmHit1ds.getEntries(); ++j) {
222  moduleID, m_bklmHit1ds[j]->getModuleID()))
223  continue;
224  if (isPhiReadout == m_bklmHit1ds[j]->isPhiReadout())
225  continue;
226  int phiIndex = isPhiReadout ? i : j;
227  int zIndex = isPhiReadout ? j : i;
228  const BKLMHit1d* phiHit = m_bklmHit1ds[phiIndex];
229  const BKLMHit1d* zHit = m_bklmHit1ds[zIndex];
230  CLHEP::Hep3Vector local = m->getLocalPosition(phiHit->getStripAve(), zHit->getStripAve());
231  CLHEP::Hep3Vector propagationTimes;
232  if (m_bklmHit1ds[i]->getLayer() < BKLMElementNumbers::c_FirstRPCLayer) {
233  if (isPhiReadout) {
234  propagationTimes = m->getPropagationTimes(
235  local, m_bklmHit1ds[j]->getStripMin(),
236  m_bklmHit1ds[i]->getStripMin());
237  } else {
238  propagationTimes = m->getPropagationTimes(
239  local, m_bklmHit1ds[i]->getStripMin(),
240  m_bklmHit1ds[j]->getStripMin());
241  }
242  } else {
243  propagationTimes = m->getPropagationTimes(local);
244  }
245  double phiTime = phiHit->getTime() - propagationTimes.y();
246  double zTime = zHit->getTime() - propagationTimes.z();
247  if (std::fabs(phiTime - zTime) > m_CoincidenceWindow)
248  continue;
249  // The second param in localToGlobal is whether do the alignment correction (true) or not (false)
250  CLHEP::Hep3Vector global = m->localToGlobal(local + m->getLocalReconstructionShift(), m_bklmIfAlign);
251  double time = 0.5 * (phiTime + zTime) - global.mag() / Const::speedOfLight;
252  BKLMHit2d* hit2d = m_bklmHit2ds.appendNew(phiHit, zHit, global, time); // Also sets relation BKLMHit2d -> BKLMHit1d
253  if (std::fabs(time - m_PromptTime) > m_PromptWindow)
254  hit2d->isOutOfTime(true);
255  }
256  }
257 }
258 
260 {
261  int strip;
263  d->getSection(), d->getLayer(), d->getSector(),
264  d->getPlane(), d->getStrip()) - 1;
265  return d->getTime() -
266  (dist / m_eklmTimeCalibration->getEffectiveLightSpeed() +
273 }
274 
276 {
277  int i, n;
278  double d1, d2, t, t1, t2, sd;
279  std::vector<KLMDigit*> digitVector;
280  std::vector<KLMDigit*>::iterator it1, it2, it3, it4, it5, it6, it7, it8, it9;
281  n = m_Digits.getEntries();
282  for (i = 0; i < n; i++) {
283  KLMDigit* digit = m_Digits[i];
285  continue;
286  if (digit->isMultiStrip())
287  continue;
288  if (m_IgnoreHotChannels && !isNormal(digit))
289  continue;
290  if (digit->isGood())
291  digitVector.push_back(digit);
292  }
293  /* Sort by sector. */
294  sort(digitVector.begin(), digitVector.end(), compareSector);
295  it1 = digitVector.begin();
296  while (it1 != digitVector.end()) {
297  it2 = it1;
298  while (1) {
299  ++it2;
300  if (it2 == digitVector.end())
301  break;
302  if (!sameSector(*it1, *it2))
303  break;
304  }
305  /* Now it1 .. it2 - hits in a sector. Sort by plane. */
306  sort(it1, it2, comparePlane);
307  /* If all hits are form the second plane, then continue. */
308  if ((*it1)->getPlane() != 1) {
309  it1 = it2;
310  continue;
311  }
312  it3 = it1;
313  while (1) {
314  ++it3;
315  if (it3 == it2)
316  break;
317  if ((*it3)->getPlane() != (*it1)->getPlane())
318  break;
319  }
320  /*
321  * Now it1 .. it3 - hits from the first plane, it3 .. it2 - hits from the
322  * second plane. If there are no hits from the second plane, then continue.
323  */
324  if (it3 == it2) {
325  it1 = it2;
326  continue;
327  }
328  /* Sort by strip. */
329  sort(it1, it3, compareStrip);
330  sort(it3, it2, compareStrip);
331  it4 = it1;
332  while (it4 != it2) {
333  it5 = it4;
334  while (1) {
335  ++it5;
336  if (it5 == it2)
337  break;
338  /* This loop is for both planes so it is necessary to compare planes. */
339  if ((*it5)->getStrip() != (*it4)->getStrip() ||
340  (*it5)->getPlane() != (*it4)->getPlane())
341  break;
342  }
343  /* Now it4 .. it5 - hits from the same strip. Sort by time. */
344  sort(it4, it5, compareTime);
345  it4 = it5;
346  }
347  /* Strip loop. */
348  it4 = it1;
349  while (it4 != it3) {
350  it5 = it4;
351  while (1) {
352  ++it5;
353  if (it5 == it3)
354  break;
355  if ((*it5)->getStrip() != (*it4)->getStrip())
356  break;
357  }
358  it6 = it3;
359  while (it6 != it2) {
360  it7 = it6;
361  while (1) {
362  ++it7;
363  if (it7 == it2)
364  break;
365  if ((*it7)->getStrip() != (*it6)->getStrip())
366  break;
367  }
368  /*
369  * Now it4 .. it5 - hits from a single fisrt-plane strip amd
370  * it6 .. it7 - hits from a single second-plane strip.
371  * If strips do not intersect, then continue.
372  */
373  HepGeom::Point3D<double> crossPoint(0, 0, 0);
374  if (!m_eklmTransformData->intersection(*it4, *it6, &crossPoint,
375  &d1, &d2, &sd,
377  it6 = it7;
378  continue;
379  }
380  for (it8 = it4; it8 != it5; ++it8) {
381  for (it9 = it6; it9 != it7; ++it9) {
382  t1 = getTime(*it8, d1) + 0.5 * sd / Const::speedOfLight;
383  t2 = getTime(*it9, d2) - 0.5 * sd / Const::speedOfLight;
384  if (std::fabs(t1 - t2) > m_CoincidenceWindow)
385  continue;
386  t = (t1 + t2) / 2;
387  EKLMHit2d* hit2d = m_eklmHit2ds.appendNew(*it8);
388  hit2d->setEnergyDeposit((*it8)->getEnergyDeposit() + (*it9)->getEnergyDeposit());
389  hit2d->setPosition(crossPoint.x(), crossPoint.y(), crossPoint.z());
390  hit2d->setChiSq((t1 - t2) * (t1 - t2) /
391  m_eklmRecPar->getTimeResolution() /
392  m_eklmRecPar->getTimeResolution());
393  hit2d->setTime(t);
394  hit2d->setMCTime(((*it8)->getMCTime() + (*it9)->getMCTime()) / 2);
395  hit2d->addRelationTo(*it8);
396  hit2d->addRelationTo(*it9);
397  for (i = 0; i < 2; i++) {
398  EKLMAlignmentHit* alignmentHit = m_eklmAlignmentHits.appendNew(i);
399  alignmentHit->addRelationTo(hit2d);
400  }
401  /* Exit the loop. Equivalent to selection of the earliest hit. */
402  break;
403  }
404  /* Exit the loop. Equivalent to selection of the earliest hit. */
405  break;
406  }
407  it6 = it7;
408  }
409  it4 = it5;
410  }
411  it1 = it2;
412  }
413 }
414 
416 {
417 }
418 
420 {
421  delete m_eklmTransformData;
422  delete[] m_eklmTimeCalibrationData;
423 }
Belle2::KLMDigit::getSubdetector
int getSubdetector() const
Get subdetector number.
Definition: KLMDigit.h:89
Belle2::KLMDigit::getPlane
int getPlane() const
Get plane number.
Definition: KLMDigit.h:161
Belle2::BKLMHit1d
Store one reconstructed BKLM 1D hit as a ROOT object.
Definition: BKLMHit1d.h:39
Belle2::KLMDigit::inRPC
bool inRPC() const
Determine whether the hit is in RPC or scintillator.
Definition: KLMDigit.h:223
Belle2::KLMReconstructorModule::m_Digits
StoreArray< KLMDigit > m_Digits
KLM digits.
Definition: KLMReconstructorModule.h:131
Belle2::EKLM::TransformData
Transformation data.
Definition: TransformData.h:37
Belle2::KLMReconstructorModule::reconstructEKLMHits
void reconstructEKLMHits()
Reconstruct EKLMHit2d.
Definition: KLMReconstructorModule.cc:275
Belle2::EKLMHitBase::setEnergyDeposit
void setEnergyDeposit(float eDep)
Set EnergyDeposit.
Definition: EKLMHitBase.h:119
Belle2::KLMReconstructorModule::endRun
virtual void endRun() override
Called if the current run ends.
Definition: KLMReconstructorModule.cc:415
Belle2::BKLMHit1d::getTime
float getTime() const
Get reconstructed hit time.
Definition: BKLMHit1d.h:135
Belle2::EKLMElementNumbers
EKLM element numbers.
Definition: EKLMElementNumbers.h:34
Belle2::KLMReconstructorModule::m_CoincidenceWindow
double m_CoincidenceWindow
Half-width of the time coincidence window used to create a 2D hit from 1D digits/hits.
Definition: KLMReconstructorModule.h:119
Belle2::Module::setDescription
void setDescription(const std::string &description)
Sets the description of the module.
Definition: Module.cc:216
Belle2::KLMReconstructorModule::m_TimeWindow
DBObjPtr< KLMTimeWindow > m_TimeWindow
KLM time window.
Definition: KLMReconstructorModule.h:128
Belle2::EKLMHitBase::setTime
void setTime(float time)
Set hit time.
Definition: EKLMHitBase.h:137
Belle2::EKLM::TransformData::c_Alignment
@ c_Alignment
Use alignment data (for everything else).
Definition: TransformData.h:47
Belle2::KLMReconstructorModule::m_ChannelStatus
DBObjPtr< KLMChannelStatus > m_ChannelStatus
Channel status.
Definition: KLMReconstructorModule.h:190
Belle2::EKLMGeometry::getNPlanes
int getNPlanes() const
Get number of planes.
Definition: EKLMGeometry.h:1717
REG_MODULE
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:652
Belle2::Module::c_ParallelProcessingCertified
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
Definition: Module.h:82
Belle2::KLMChannelStatus::ChannelStatus
ChannelStatus
Channel status.
Definition: KLMChannelStatus.h:44
Belle2::KLMReconstructorModule::m_eklmElementNumbers
const EKLMElementNumbers * m_eklmElementNumbers
Element numbers.
Definition: KLMReconstructorModule.h:159
Belle2::KLMReconstructorModule::m_PromptWindow
double m_PromptWindow
Half-width of the time window relative to the prompt time for BKLMHit2ds.
Definition: KLMReconstructorModule.h:125
Belle2::KLMElementNumbers::c_EKLM
@ c_EKLM
EKLM.
Definition: KLMElementNumbers.h:50
Belle2::RelationsInterface::addRelationTo
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).
Definition: RelationsObject.h:144
Belle2::KLMReconstructorModule::getTime
double getTime(KLMDigit *d, double dist)
Get 2d hit time corresponding to EKLM digit.
Definition: KLMReconstructorModule.cc:259
Belle2::KLMDigit::getSection
int getSection() const
Get section number.
Definition: KLMDigit.h:107
Belle2::KLMElementNumbers::channelNumber
uint16_t channelNumber(int subdetector, int section, int sector, int layer, int plane, int strip) const
Get channel number.
Definition: KLMElementNumbers.cc:37
Belle2::KLMDigit::getSector
int getSector() const
Get sector number.
Definition: KLMDigit.h:125
Belle2::KLMReconstructorModule::beginRun
virtual void beginRun() override
Called when entering a new run.
Definition: KLMReconstructorModule.cc:120
Belle2::KLMDigit::getTime
float getTime() const
Get hit time.
Definition: KLMDigit.h:293
Belle2::KLMDigit::getLayer
int getLayer() const
Get layer number.
Definition: KLMDigit.h:143
Belle2::EKLMTimeCalibrationData::getTimeShift
float getTimeShift() const
Get time shift.
Definition: EKLMTimeCalibrationData.h:64
Belle2::KLMReconstructorModule::m_eklmTimeCalibration
DBObjPtr< EKLMTimeCalibration > m_eklmTimeCalibration
Time calibration data.
Definition: KLMReconstructorModule.h:175
Belle2::EKLMAlignmentHit
This dataobject is used only for EKLM alignment.
Definition: EKLMAlignmentHit.h:39
Belle2::bklm::Module
Define the geometry of a BKLM module Each sector [octant] contains Modules.
Definition: Module.h:86
Belle2::KLMDigit
KLM digit (class representing a digitized hit in RPCs or scintillators).
Definition: KLMDigit.h:40
Belle2::EKLMElementNumbers::sectorNumber
int sectorNumber(int section, int layer, int sector) const
Get sector number.
Definition: EKLMElementNumbers.cc:145
Belle2::KLMReconstructorModule::m_bklmGeoPar
bklm::GeometryPar * m_bklmGeoPar
BKLM GeometryPar singleton.
Definition: KLMReconstructorModule.h:136
Belle2::KLMChannelStatus::c_Dead
@ c_Dead
Dead channel (no signal).
Definition: KLMChannelStatus.h:53
Belle2::EKLMElementNumbers::getMaximalStripGlobalNumber
static constexpr int getMaximalStripGlobalNumber()
Get maximal strip global number.
Definition: EKLMElementNumbers.h:377
Belle2::KLMReconstructorModule::m_bklmIfAlign
bool m_bklmIfAlign
Perform alignment correction (true) or not (false).
Definition: KLMReconstructorModule.h:139
Belle2::KLMReconstructorModule::event
virtual void event() override
Called for each event.
Definition: KLMReconstructorModule.cc:149
Belle2::Module
Base class for Modules.
Definition: Module.h:74
Belle2::Module::setPropertyFlags
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
Definition: Module.cc:210
Belle2::Const::speedOfLight
static const double speedOfLight
[cm/ns]
Definition: Const.h:568
Belle2::KLMReconstructorModule::m_eklmCheckSegmentIntersection
bool m_eklmCheckSegmentIntersection
Check if segments intersect.
Definition: KLMReconstructorModule.h:156
Belle2::KLMReconstructorModule::m_bklmHit2ds
StoreArray< BKLMHit2d > m_bklmHit2ds
BKLM 2d hits.
Definition: KLMReconstructorModule.h:148
Belle2::bklm::GeometryPar::instance
static GeometryPar * instance(void)
Static method to get a reference to the singleton GeometryPar instance.
Definition: GeometryPar.cc:30
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::KLMDigit::isMultiStrip
bool isMultiStrip() const
Determine whether this digit is a multi-strip one or not.
Definition: KLMDigit.h:214
Belle2::KLMReconstructorModule::m_eklmAlignmentHits
StoreArray< EKLMAlignmentHit > m_eklmAlignmentHits
Alignment Hits.
Definition: KLMReconstructorModule.h:187
Belle2::KLMReconstructorModule::m_IgnoreHotChannels
bool m_IgnoreHotChannels
Use only Normal and Dead (for debugging) channels during 2d hit reconstruction.
Definition: KLMReconstructorModule.h:193
Belle2::EKLMHit2d::setChiSq
void setChiSq(float chisq)
Set Chi^2 of the crossing point.
Definition: EKLMHit2d.h:73
Belle2::KLMDigit::isGood
bool isGood() const
Whether hit could be used late (if it passed discriminator threshold)
Definition: KLMDigit.h:365
Belle2::EKLMElementNumbers::Instance
static const EKLMElementNumbers & Instance()
Instantiation.
Definition: EKLMElementNumbers.cc:20
Belle2::KLMReconstructorModule::m_eklmRecPar
DBObjPtr< EKLMReconstructionParameters > m_eklmRecPar
Reconstruction parameters.
Definition: KLMReconstructorModule.h:172
Belle2::KLMReconstructorModule::isNormal
bool isNormal(const KLMDigit *digit) const
Check if channel is normal or dead.
Definition: KLMReconstructorModule.cc:155
Belle2::EKLMElementNumbers::stripNumber
int stripNumber(int section, int layer, int sector, int plane, int strip) const
Get strip number.
Definition: EKLMElementNumbers.cc:212
Belle2::KLMElementNumbers::c_BKLM
@ c_BKLM
BKLM.
Definition: KLMElementNumbers.h:47
Belle2::EKLM::TransformData::intersection
bool intersection(KLMDigit *hit1, KLMDigit *hit2, HepGeom::Point3D< double > *cross, double *d1, double *d2, double *sd, bool segments=true) const
Check if strips intersect, and find intersection point if yes.
Definition: TransformData.cc:350
Belle2::KLMReconstructorModule::initialize
virtual void initialize() override
Initializer.
Definition: KLMReconstructorModule.cc:97
Belle2::BKLMHit2d::isOutOfTime
bool isOutOfTime()
Determine whether this 2D hit is outside the trigger-coincidence window.
Definition: BKLMHit2d.h:145
Belle2::KLMReconstructorModule::m_bklmIgnoreScintillators
bool m_bklmIgnoreScintillators
Ignore scintillators (to debug their electronics mapping).
Definition: KLMReconstructorModule.h:142
Belle2::KLMReconstructorModule::terminate
virtual void terminate() override
Called at the end of the event processing.
Definition: KLMReconstructorModule.cc:419
Belle2::EKLMHitMCTime::setMCTime
void setMCTime(float t)
Set MC time.
Definition: EKLMHitMCTime.h:51
Belle2::Module::addParam
void addParam(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
Definition: Module.h:562
Belle2::KLMReconstructorModule::m_eklmNStrip
int m_eklmNStrip
Number of strips.
Definition: KLMReconstructorModule.h:166
Belle2::BKLMElementNumbers::hitsFromSameModule
static bool hitsFromSameModule(int module1, int module2)
Check whether the hits are from the same module.
Definition: BKLMElementNumbers.h:407
Belle2::KLMReconstructorModule::m_bklmHit1ds
StoreArray< BKLMHit1d > m_bklmHit1ds
BKLM 1d hits.
Definition: KLMReconstructorModule.h:145
Belle2::KLMChannelStatus::c_Unknown
@ c_Unknown
Unknown status (no data).
Definition: KLMChannelStatus.h:47
Belle2::EKLMTimeCalibrationData
EKLM time calibration data (for one strip).
Definition: EKLMTimeCalibrationData.h:33
Belle2::BKLMHit1d::getStripAve
double getStripAve() const
Get average strip number.
Definition: BKLMHit1d.h:120
Belle2::KLMReconstructorModule::m_eklmTransformData
EKLM::TransformData * m_eklmTransformData
Transformation data.
Definition: KLMReconstructorModule.h:169
Belle2::EKLMHitGlobalCoord::setPosition
void setPosition(float x, float y, float z)
Set hit global position.
Definition: EKLMHitGlobalCoord.cc:27
Belle2::KLMDigit::getStrip
int getStrip() const
Get strip number.
Definition: KLMDigit.h:179
HepGeom::Point3D< double >
Belle2::KLMElementNumbers
KLM element numbers.
Definition: KLMElementNumbers.h:37
Belle2::KLMReconstructorModule::~KLMReconstructorModule
virtual ~KLMReconstructorModule()
Destructor.
Definition: KLMReconstructorModule.cc:93
Belle2::BKLMElementNumbers::c_FirstRPCLayer
@ c_FirstRPCLayer
First RPC layer.
Definition: BKLMElementNumbers.h:71
Belle2::KLMReconstructorModule::m_eklmTimeCalibrationData
const EKLMTimeCalibrationData ** m_eklmTimeCalibrationData
Time calibration data for individual strips.
Definition: KLMReconstructorModule.h:178
Belle2::KLMChannelStatus::c_Normal
@ c_Normal
Normally operating channel.
Definition: KLMChannelStatus.h:50
Belle2::bklm::GeometryPar::findModule
const Module * findModule(int section, int sector, int layer) const
Get the pointer to the definition of a module.
Definition: GeometryPar.cc:716
Belle2::BKLMElementNumbers::channelNumber
static uint16_t channelNumber(int section, int sector, int layer, int plane, int strip)
Get channel number.
Definition: BKLMElementNumbers.cc:27
Belle2::KLMReconstructorModule::reconstructBKLMHits
void reconstructBKLMHits()
Reconstruct BKLMHit1d and BKLMHit2d.
Definition: KLMReconstructorModule.cc:172
Belle2::BKLMHit2d
Store one BKLM strip hit as a ROOT object.
Definition: BKLMHit2d.h:42
Belle2::KLMReconstructorModule::m_eklmHit2ds
StoreArray< EKLMHit2d > m_eklmHit2ds
EKLM 2d hits.
Definition: KLMReconstructorModule.h:184
Belle2::KLMReconstructorModule::KLMReconstructorModule
KLMReconstructorModule()
Constructor.
Definition: KLMReconstructorModule.cc:65
Belle2::EKLM::GeometryData::Instance
static const GeometryData & Instance(enum DataSource dataSource=c_Database, const GearDir *gearDir=nullptr)
Instantiation.
Definition: GeometryData.cc:35
Belle2::KLMReconstructorModule::m_PromptTime
double m_PromptTime
Nominal time of prompt BKLMHit2ds.
Definition: KLMReconstructorModule.h:122
Belle2::EKLMHit2d
Class for 2d hits handling.
Definition: EKLMHit2d.h:39
Belle2::KLMReconstructorModule::m_eklmGeoDat
const EKLM::GeometryData * m_eklmGeoDat
Geometry data.
Definition: KLMReconstructorModule.h:163
Belle2::KLMReconstructorModule::m_eklmDefaultTimeCalibrationData
EKLMTimeCalibrationData m_eklmDefaultTimeCalibrationData
Default time calibration data.
Definition: KLMReconstructorModule.h:181