Belle II Software development
KLMReconstructorModule.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/* Own header. */
10#include <klm/modules/KLMReconstructor/KLMReconstructorModule.h>
11
12/* KLM headers. */
13#include <klm/bklm/geometry/Module.h>
14#include <klm/dataobjects/eklm/EKLMElementNumbers.h>
15
16/* Basf2 headers. */
17#include <framework/gearbox/Const.h>
18#include <framework/logging/Logger.h>
19
20/* CLHEP headers. */
21#include <CLHEP/Vector/ThreeVector.h>
22
23/* C++ headers. */
24#include <utility>
25
26using namespace Belle2;
27using namespace Belle2::bklm;
28
29REG_MODULE(KLMReconstructor)
30
31static 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
43static bool comparePlane(KLMDigit* d1, KLMDigit* d2)
44{
45 return d1->getPlane() < d2->getPlane();
46}
47
48static bool compareStrip(KLMDigit* d1, KLMDigit* d2)
49{
50 return d1->getStrip() < d2->getStrip();
51}
52
53static bool compareTime(KLMDigit* d1, KLMDigit* d2)
54{
55 return d1->getTime() < d2->getTime();
56}
57
58static 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_EventT0Value(0.),
71 m_ElementNumbers(&(KLMElementNumbers::Instance())),
72 m_bklmGeoPar(nullptr),
73 m_eklmElementNumbers(&(EKLMElementNumbers::Instance())),
74 m_eklmGeoDat(nullptr),
75 m_eklmNStrip(0),
76 m_eklmTransformData{nullptr}
77{
78 setDescription("Create BKLMHit1ds from KLMDigits and then create KLMHit2ds from BKLMHit1ds; create KLMHit2ds from KLMDigits.");
80 addParam("TimeCableDelayCorrection", m_TimeCableDelayCorrection,
81 "Perform cable delay time correction (true) or not (false).", true);
82 addParam("EventT0Correction", m_EventT0Correction,
83 "Perform EventT0 correction (true) or not (false)", true);
84 addParam("IfAlign", m_bklmIfAlign,
85 "Perform alignment correction (true) or not (false).",
86 bool(true));
87 addParam("IgnoreScintillators", m_bklmIgnoreScintillators,
88 "Ignore scintillators (to debug their electronics mapping).",
89 false);
90 addParam("CheckSegmentIntersection", m_eklmCheckSegmentIntersection,
91 "Check if segments intersect.", true);
92 addParam("IgnoreHotChannels", m_IgnoreHotChannels,
93 "Use only Normal and Dead (for debugging) channels during 2d hit reconstruction",
94 true);
95}
96
98{
99}
100
102{
103 m_Digits.isRequired();
105 m_EventT0.isRequired();
106 // This object is registered by few packages. Let's be agnostic about the
107 // execution order of the modules: the first package run registers the module
108 m_EventLevelClusteringInfo.isOptional() ? m_EventLevelClusteringInfo.isRequired() :
109 m_EventLevelClusteringInfo.registerInDataStore();
110 m_Hit2ds.registerInDataStore();
111 m_Hit2ds.registerRelationTo(m_bklmHit1ds);
112 m_Hit2ds.registerRelationTo(m_Digits);
113 /* BKLM. */
114 m_bklmHit1ds.registerInDataStore();
115 m_bklmHit1ds.registerRelationTo(m_Digits);
117 /* EKLM. */
118 m_eklmAlignmentHits.registerInDataStore();
119 m_eklmAlignmentHits.registerRelationTo(m_Hit2ds);
123 if (m_eklmGeoDat->getNPlanes() != 2)
124 B2FATAL("It is not possible to run EKLM reconstruction with 1 plane.");
126}
127
129{
131 if (!m_TimeConstants.isValid())
132 B2FATAL("KLM time constants data are not available.");
133 if (!m_TimeCableDelay.isValid())
134 B2FATAL("KLM time cable decay data are not available.");
135 if (!m_TimeResolution.isValid())
136 B2ERROR("KLM time resolution data are not available. "
137 "The error is non-fatal because the data are only used to set "
138 "chi^2 of 2d hit, which is informational only now.");
139 }
140 if (!m_ChannelStatus.isValid())
141 B2FATAL("KLM channel status data are not available.");
142 if (!m_TimeWindow.isValid())
143 B2FATAL("KLM time window data are not available.");
144 m_CoincidenceWindow = m_TimeWindow->getCoincidenceWindow();
145 m_PromptTime = m_TimeWindow->getPromptTime();
146 m_PromptWindow = m_TimeWindow->getPromptWindow();
154 }
155}
156
158{
159 m_EventT0Value = 0.;
160 if (m_EventT0.isValid())
161 if (m_EventT0->hasEventT0())
162 m_EventT0Value = m_EventT0->getEventT0();
163 if (not m_EventLevelClusteringInfo.isValid())
164 m_EventLevelClusteringInfo.construct();
167}
168
170{
171 unsigned int cID = d->getUniqueChannelID();
172 ct -= m_TimeCableDelay->getTimeDelay(cID);
173}
174
175/*
176double KLMReconstructorModule::getTime(KLMDigit* d, double dist)
177{
178 int strip;
179 strip = m_eklmElementNumbers->stripNumber(
180 d->getSection(), d->getLayer(), d->getSector(),
181 d->getPlane(), d->getStrip()) - 1;
182 return d->getTime() -
183 (dist / m_eklmTimeCalibration->getEffectiveLightSpeed() +
184 m_eklmTimeCalibrationData[strip]->getTimeShift());
185
186 // TODO: Subtract time correction given by
187 // m_eklmTimeCalibration->getAmplitudeTimeConstant() / sqrt(d->getNPhotoelectrons()).
188 // It requires a new firmware version that will be able to extract amplitude.
189
190}
191*/
192
194{
195 int subdetector = digit->getSubdetector();
196 int section = digit->getSection();
197 int sector = digit->getSector();
198 int layer = digit->getLayer();
199 int plane = digit->getPlane();
200 int strip = digit->getStrip();
201 KLMChannelNumber channel = m_ElementNumbers->channelNumber(subdetector, section, sector, layer, plane, strip);
202 enum KLMChannelStatus::ChannelStatus status = m_ChannelStatus->getChannelStatus(channel);
203 if (status == KLMChannelStatus::c_Unknown)
204 B2FATAL("Incomplete KLM channel status data.");
205 if (status == KLMChannelStatus::c_Normal || status == KLMChannelStatus::c_Dead)
206 return true;
207 return false;
208}
209
211{
212 /* Let's count the multi-strip KLMDigits. */
213 uint16_t nKLMDigitsMultiStripBarrel{0};
214 /* Construct BKLMHit1Ds from KLMDigits. */
215 /* Sort KLMDigits by module and strip number. */
216 std::map<KLMChannelNumber, int> channelDigitMap;
217 for (int index = 0; index < m_Digits.getEntries(); ++index) {
218 const KLMDigit* digit = m_Digits[index];
220 continue;
221 if (digit->isMultiStrip()) {
222 nKLMDigitsMultiStripBarrel++;
223 }
224 if (m_bklmIgnoreScintillators && !digit->inRPC())
225 continue;
226 if (m_IgnoreHotChannels && !isNormal(digit))
227 continue;
228 if (digit->inRPC() || digit->isGood()) {
230 digit->getSection(), digit->getSector(),
231 digit->getLayer(), digit->getPlane(),
232 digit->getStrip());
233 channelDigitMap.insert(std::pair<KLMChannelNumber, int>(channel, index));
234 }
235 }
236 if (channelDigitMap.empty())
237 return;
238 std::vector<std::pair<const KLMDigit*, double>> digitCluster;
239 KLMChannelNumber previousChannel = channelDigitMap.begin()->first;
240 double averageTime = m_Digits[channelDigitMap.begin()->second]->getTime();
242 correctCableDelay(averageTime, m_Digits[channelDigitMap.begin()->second]);
243 for (std::map<KLMChannelNumber, int>::iterator it = channelDigitMap.begin(); it != channelDigitMap.end(); ++it) {
244 const KLMDigit* digit = m_Digits[it->second];
245 double digitTime = digit->getTime();
247 correctCableDelay(digitTime, digit);
248 if ((it->first > previousChannel + 1) || (std::fabs(digitTime - averageTime) > m_CoincidenceWindow)) {
249 m_bklmHit1ds.appendNew(digitCluster); // Also sets relation BKLMHit1d -> KLMDigit
250 digitCluster.clear();
251 }
252 previousChannel = it->first;
253 double n = (double)(digitCluster.size());
254 averageTime = (n * averageTime + digitTime) / (n + 1.0);
255 digitCluster.emplace_back(std::make_pair(digit, digitTime));
256 }
257 m_bklmHit1ds.appendNew(digitCluster); // Also sets relation BKLMHit1d -> KLMDigit
258
259 /* Construct BKLMHit2Ds from orthogonal same-module BKLMHit1Ds. */
260 for (int i = 0; i < m_bklmHit1ds.getEntries(); ++i) {
261 int moduleID = m_bklmHit1ds[i]->getModuleID();
262 const bklm::Module* m = m_bklmGeoPar->findModule(m_bklmHit1ds[i]->getSection(), m_bklmHit1ds[i]->getSector(),
263 m_bklmHit1ds[i]->getLayer());
264 bool isPhiReadout = m_bklmHit1ds[i]->isPhiReadout();
265 for (int j = i + 1; j < m_bklmHit1ds.getEntries(); ++j) {
267 moduleID, m_bklmHit1ds[j]->getModuleID()))
268 continue;
269 if (isPhiReadout == m_bklmHit1ds[j]->isPhiReadout())
270 continue;
271 int phiIndex = isPhiReadout ? i : j;
272 int zIndex = isPhiReadout ? j : i;
273 const BKLMHit1d* phiHit = m_bklmHit1ds[phiIndex];
274 const BKLMHit1d* zHit = m_bklmHit1ds[zIndex];
275 CLHEP::Hep3Vector local = m->getLocalPosition(phiHit->getStripAve(), zHit->getStripAve());
276 CLHEP::Hep3Vector propagationDist;
278 if (isPhiReadout) {
279 propagationDist = m->getPropagationDistance(
280 local, m_bklmHit1ds[j]->getStripMin(),
281 m_bklmHit1ds[i]->getStripMin());
282 } else {
283 propagationDist = m->getPropagationDistance(
284 local, m_bklmHit1ds[i]->getStripMin(),
285 m_bklmHit1ds[j]->getStripMin());
286 }
287 } else {
288 propagationDist = m->getPropagationTimes(local);
289 }
290 double delayPhi, delayZ;
291 if (phiHit->inRPC())
292 delayPhi = m_DelayRPCPhi;
293 else
294 delayPhi = m_DelayBKLMScintillators;
295 if (zHit->inRPC())
296 delayZ = m_DelayRPCZ;
297 else
299 double phiTime = phiHit->getTime() - propagationDist.y() * delayPhi;
300 double zTime = zHit->getTime() - propagationDist.z() * delayZ;
301 if (std::fabs(phiTime - zTime) > m_CoincidenceWindow)
302 continue;
303 // The second param in localToGlobal is whether do the alignment correction (true) or not (false)
304 CLHEP::Hep3Vector global = m->localToGlobal(local + m->getLocalReconstructionShift(), m_bklmIfAlign);
305 double time = 0.5 * (phiTime + zTime);
307 time -= m_EventT0Value;
308 KLMHit2d* hit2d = m_Hit2ds.appendNew(phiHit, zHit, global, time); // Also sets relation KLMHit2d -> BKLMHit1d
309 if (std::fabs(time - m_PromptTime) > m_PromptWindow)
310 hit2d->isOutOfTime(true);
311 }
312 }
313 m_EventLevelClusteringInfo->setNKLMDigitsMultiStripBarrel(nKLMDigitsMultiStripBarrel);
314}
315
316
318{
319 /* Let's count the multi-strip KLMDigits. */
320 uint16_t nKLMDigitsMultiStripFWD{0};
321 uint16_t nKLMDigitsMultiStripBWD{0};
322 int i, n;
323 double d1, d2, time, t1, t2, sd;
324 std::vector<KLMDigit*> digitVector;
325 std::vector<KLMDigit*>::iterator it1, it2, it3, it4, it5, it6, it7, it8, it9;
326 n = m_Digits.getEntries();
327 for (i = 0; i < n; i++) {
328 KLMDigit* digit = m_Digits[i];
330 continue;
331 if (digit->isMultiStrip()) {
332 digit->getSection() == EKLMElementNumbers::c_BackwardSection ? nKLMDigitsMultiStripBWD++ : nKLMDigitsMultiStripFWD++;
333 }
334 if (m_IgnoreHotChannels && !isNormal(digit))
335 continue;
336 if (digit->isGood())
337 digitVector.push_back(digit);
338 }
339 KLMDigit plane1Digit; // to look for geometric intersection of a multi-strip hit
340 KLMDigit plane2Digit; // to look for geometric intersection of a multi-strip hit
341 HepGeom::Point3D<double> crossPoint(0, 0, 0); // (x,y,z) of geometric intersection
342 /* Sort by sector. */
343 sort(digitVector.begin(), digitVector.end(), compareSector);
344 it1 = digitVector.begin();
345 while (it1 != digitVector.end()) {
346 it2 = it1;
347 while (1) {
348 ++it2;
349 if (it2 == digitVector.end())
350 break;
351 if (!sameSector(*it1, *it2))
352 break;
353 }
354 /* Now it1 .. it2 - hits in a sector. Sort by plane. */
355 sort(it1, it2, comparePlane);
356 /* If all hits are form the second plane, then continue. */
357 if ((*it1)->getPlane() != 1) {
358 it1 = it2;
359 continue;
360 }
361 it3 = it1;
362 while (1) {
363 ++it3;
364 if (it3 == it2)
365 break;
366 if ((*it3)->getPlane() != (*it1)->getPlane())
367 break;
368 }
369 /*
370 * Now it1 .. it3 - hits from the first plane, it3 .. it2 - hits from the
371 * second plane. If there are no hits from the second plane, then continue.
372 */
373 if (it3 == it2) {
374 it1 = it2;
375 continue;
376 }
377 /* Sort by strip. */
378 sort(it1, it3, compareStrip);
379 sort(it3, it2, compareStrip);
380 it4 = it1;
381 while (it4 != it2) {
382 it5 = it4;
383 while (1) {
384 ++it5;
385 if (it5 == it2)
386 break;
387 /* This loop is for both planes so it is necessary to compare planes. */
388 if ((*it5)->getStrip() != (*it4)->getStrip() ||
389 (*it5)->getPlane() != (*it4)->getPlane())
390 break;
391 }
392 /* Now it4 .. it5 - hits from the same strip. Sort by time. */
393 sort(it4, it5, compareTime);
394 it4 = it5;
395 }
396 /* Strip loop. */
397 it4 = it1;
398 while (it4 != it3) {
399 it5 = it4;
400 while (1) {
401 ++it5;
402 if (it5 == it3)
403 break;
404 if ((*it5)->getStrip() != (*it4)->getStrip())
405 break;
406 }
407 it6 = it3;
408 while (it6 != it2) {
409 it7 = it6;
410 while (1) {
411 ++it7;
412 if (it7 == it2)
413 break;
414 if ((*it7)->getStrip() != (*it6)->getStrip())
415 break;
416 }
417 /*
418 * Now it4 .. it5 - hits from a single first-plane strip and
419 * it6 .. it7 - hits from a single second-plane strip.
420 */
421 for (it8 = it4; it8 != it5; ++it8) {
422 for (it9 = it6; it9 != it7; ++it9) {
423 /*
424 * Check for intersection of the two orthogonal strips. On one strip,
425 * one hit might be multi-strip and another single-strip, so the
426 * intersection check must be done here rather than before the loop.
427 */
428 bool intersect = false;
429 if ((*it8)->isMultiStrip() || (*it9)->isMultiStrip()) {
430 plane1Digit = **it8;
431 plane2Digit = **it9;
432 int s1First = plane1Digit.getStrip();
433 int s1Last = std::max(s1First, plane1Digit.getLastStrip());
434 int s2First = plane2Digit.getStrip();
435 int s2Last = std::max(s2First, plane2Digit.getLastStrip());
436 for (int s1 = s1First; s1 <= s1Last; s1++) {
437 plane1Digit.setStrip(s1);
438 for (int s2 = s2First; s2 <= s2Last; s2++) {
439 plane2Digit.setStrip(s2);
440 intersect = m_eklmTransformData->intersection(&plane1Digit, &plane2Digit, &crossPoint,
441 &d1, &d2, &sd,
443 if (intersect)
444 break;
445 }
446 if (intersect)
447 break;
448 }
449 if (intersect) {
450 // use the middle strip in the multi-strip group to get the 2D intersection point
451 plane1Digit.setStrip((s1First + s1Last) / 2);
452 plane2Digit.setStrip((s2First + s2Last) / 2);
453 intersect = m_eklmTransformData->intersection(&plane1Digit, &plane2Digit, &crossPoint,
454 &d1, &d2, &sd,
455 false); // crossPoint MIGHT be outside fiducial area
456 }
457 } else {
458 intersect = m_eklmTransformData->intersection(*it8, *it9, &crossPoint,
459 &d1, &d2, &sd,
461 }
462 if (!intersect)
463 continue;
464 t1 = (*it8)->getTime() - d1 * m_DelayEKLMScintillators
465 + 0.5 * sd / Const::speedOfLight;
466 t2 = (*it9)->getTime() - d2 * m_DelayEKLMScintillators
467 - 0.5 * sd / Const::speedOfLight;
469 correctCableDelay(t1, *it8);
470 correctCableDelay(t2, *it9);
471 }
472 if (std::fabs(t1 - t2) > m_CoincidenceWindow)
473 continue;
474 time = (t1 + t2) / 2;
476 time -= m_EventT0Value;
477 KLMHit2d* hit2d = m_Hit2ds.appendNew(*it8, *it9);
478 hit2d->setEnergyDeposit((*it8)->getEnergyDeposit() +
479 (*it9)->getEnergyDeposit());
480 hit2d->setPosition(crossPoint.x(), crossPoint.y(), crossPoint.z());
481 double timeResolution = 1.0;
482 if (m_TimeResolution.isValid()) {
483 timeResolution *= m_TimeResolution->getTimeResolution(
484 (*it8)->getUniqueChannelID());
485 timeResolution *= m_TimeResolution->getTimeResolution(
486 (*it9)->getUniqueChannelID());
487 }
488 hit2d->setChiSq((t1 - t2) * (t1 - t2) / timeResolution);
489 hit2d->setTime(time);
490 hit2d->setMCTime(((*it8)->getMCTime() + (*it9)->getMCTime()) / 2);
491 hit2d->addRelationTo(*it8);
492 hit2d->addRelationTo(*it9);
493 for (i = 0; i < 2; i++) {
494 EKLMAlignmentHit* alignmentHit = m_eklmAlignmentHits.appendNew(i);
495 alignmentHit->addRelationTo(hit2d);
496 }
497 /* Exit the loop. Equivalent to selection of the earliest hit. */
498 break;
499 }
500 /* Exit the loop. Equivalent to selection of the earliest hit. */
501 break;
502 }
503 it6 = it7;
504 }
505 it4 = it5;
506 }
507 it1 = it2;
508 }
509 m_EventLevelClusteringInfo->setNKLMDigitsMultiStripBWD(nKLMDigitsMultiStripBWD);
510 m_EventLevelClusteringInfo->setNKLMDigitsMultiStripFWD(nKLMDigitsMultiStripFWD);
511}
512
514{
515}
516
518{
519 delete m_eklmTransformData;
520}
static KLMChannelNumber channelNumber(int section, int sector, int layer, int plane, int strip)
Get channel number.
@ c_FirstRPCLayer
First RPC layer.
static bool hitsFromSameModule(int module1, int module2)
Check whether the hits are from the same module.
Store one reconstructed BKLM 1D hit as a ROOT object.
Definition: BKLMHit1d.h:30
bool inRPC() const
Determine whether this 1D hit is in RPC or scintillator.
Definition: BKLMHit1d.h:54
float getTime() const
Get reconstructed hit time.
Definition: BKLMHit1d.h:126
double getStripAve() const
Get average strip number.
Definition: BKLMHit1d.h:111
static const double speedOfLight
[cm/ns]
Definition: Const.h:695
This dataobject is used only for EKLM alignment.
EKLM element numbers.
static const EKLMElementNumbers & Instance()
Instantiation.
int sectorNumber(int section, int layer, int sector) const
Get sector number.
static constexpr int getMaximalStripGlobalNumber()
Get maximal strip global number.
int getNPlanes() const
Get number of planes.
static const GeometryData & Instance(enum DataSource dataSource=c_Database, const GearDir *gearDir=nullptr)
Instantiation.
Definition: GeometryData.cc:33
Transformation data.
Definition: TransformData.h:35
@ c_Alignment
Use alignment data (for everything else).
Definition: TransformData.h:45
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.
ChannelStatus
Channel status.
@ c_Normal
Normally operating channel.
@ c_Dead
Dead channel (no signal).
@ c_Unknown
Unknown status (no data).
KLM digit (class representing a digitized hit in RPCs or scintillators).
Definition: KLMDigit.h:29
bool inRPC() const
Determine whether the hit is in RPC or scintillator.
Definition: KLMDigit.h:206
int getSubdetector() const
Get subdetector number.
Definition: KLMDigit.h:72
int getLayer() const
Get layer number.
Definition: KLMDigit.h:126
bool isGood() const
Whether hit could be used late (if it passed discriminator threshold)
Definition: KLMDigit.h:348
float getTime() const
Get hit time.
Definition: KLMDigit.h:276
int getSection() const
Get section number.
Definition: KLMDigit.h:90
int getPlane() const
Get plane number.
Definition: KLMDigit.h:144
int getStrip() const
Get strip number.
Definition: KLMDigit.h:162
bool isMultiStrip() const
Determine whether this digit is a multi-strip one or not.
Definition: KLMDigit.h:197
int getSector() const
Get sector number.
Definition: KLMDigit.h:108
void setStrip(int strip)
Set strip number.
Definition: KLMDigit.h:171
int getLastStrip() const
Get last strip number (for multi-strip digits).
Definition: KLMDigit.h:180
KLM element numbers.
KLMChannelNumber channelNumber(int subdetector, int section, int sector, int layer, int plane, int strip) const
Get channel number.
KLM 2d hit.
Definition: KLMHit2d.h:33
void setEnergyDeposit(float energyDeposit)
Set energy deposit.
Definition: KLMHit2d.h:369
void setChiSq(float chisq)
Set Chi^2 of the crossing point.
Definition: KLMHit2d.h:387
void setTime(float time)
Set hit time.
Definition: KLMHit2d.h:333
void setMCTime(float t)
Set MC time.
Definition: KLMHit2d.h:342
bool isOutOfTime() const
Determine whether this 2D hit is outside the trigger-coincidence window.
Definition: KLMHit2d.h:395
void setPosition(float x, float y, float z)
Set hit global position.
Definition: KLMHit2d.h:277
OptionalDBObjPtr< KLMTimeResolution > m_TimeResolution
KLM time resolution.
void reconstructEKLMHits()
Reconstruct EKLNM 2d hits.
bool m_TimeCableDelayCorrection
Perform cable delay time correction (true) or not (false).
StoreArray< KLMDigit > m_Digits
KLM digits.
DBObjPtr< KLMChannelStatus > m_ChannelStatus
Channel status.
EKLM::TransformData * m_eklmTransformData
Transformation data.
void initialize() override
Initializer.
void event() override
Called for each event.
const KLMElementNumbers * m_ElementNumbers
KLM element numbers.
bklm::GeometryPar * m_bklmGeoPar
BKLM GeometryPar singleton.
StoreArray< EKLMAlignmentHit > m_eklmAlignmentHits
Alignment Hits.
double m_CoincidenceWindow
Half-width of the time coincidence window used to create a 2D hit from 1D digits/hits.
void endRun() override
Called if the current run ends.
const EKLMElementNumbers * m_eklmElementNumbers
EKLM element numbers.
double m_DelayBKLMScintillators
Delay (ns / cm) for BKLM scintillators.
void terminate() override
Called at the end of the event processing.
bool m_bklmIfAlign
Perform alignment correction (true) or not (false).
StoreObjPtr< EventLevelClusteringInfo > m_EventLevelClusteringInfo
EventLevelClusteringInfo.
double m_EventT0Value
Value of the EventT0.
void reconstructBKLMHits()
Reconstruct BKLM 2d hits.
double m_PromptTime
Nominal time of prompt KLMHit2ds.
double m_DelayRPCPhi
Delay (ns / cm) for RPC phi plane.
void beginRun() override
Called when entering a new run.
bool isNormal(const KLMDigit *digit) const
Check if channel is normal or dead.
OptionalDBObjPtr< KLMTimeCableDelay > m_TimeCableDelay
KLM time cable delay.
void correctCableDelay(double &td, const KLMDigit *digit)
Time correction by subtract cable delay.
double m_PromptWindow
Half-width of the time window relative to the prompt time for KLMHit2ds.
StoreArray< BKLMHit1d > m_bklmHit1ds
BKLM 1d hits.
const EKLM::GeometryData * m_eklmGeoDat
Geometry data.
double m_DelayEKLMScintillators
Delay (ns / cm) for EKLM scintillators.
StoreObjPtr< EventT0 > m_EventT0
EventT0.
bool m_EventT0Correction
Perform EventT0 correction (true) or not (false).
bool m_bklmIgnoreScintillators
Ignore scintillators (to debug their electronics mapping).
bool m_IgnoreHotChannels
Use only normal and dead (for debugging) channels during 2d hit reconstruction.
OptionalDBObjPtr< KLMTimeConstants > m_TimeConstants
KLM time constants.
double m_DelayRPCZ
Delay (ns / cm) for RPC Z plane.
DBObjPtr< KLMTimeWindow > m_TimeWindow
KLM time window.
bool m_eklmCheckSegmentIntersection
Check if segments intersect.
StoreArray< KLMHit2d > m_Hit2ds
KLM 2d hits.
@ c_BKLM
BKLM scintillator.
@ c_EKLM
EKLM scintillator.
Base class for Modules.
Definition: Module.h:72
void setDescription(const std::string &description)
Sets the description of the module.
Definition: Module.cc:214
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
Definition: Module.cc:208
@ 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:80
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).
const Module * findModule(int section, int sector, int layer) const
Get the pointer to the definition of a module.
Definition: GeometryPar.cc:721
static GeometryPar * instance(void)
Static method to get a reference to the singleton GeometryPar instance.
Definition: GeometryPar.cc:27
Define the geometry of a BKLM module Each sector [octant] contains Modules.
Definition: Module.h:76
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:560
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:650
uint16_t KLMChannelNumber
Channel number.
int intersect(const TRGCDCLpar &lp1, const TRGCDCLpar &lp2, CLHEP::HepVector &v1, CLHEP::HepVector &v2)
intersection
Definition: Lpar.cc:249
Abstract base class for different kinds of events.