Belle II Software  release-06-01-15
KLMDigitizerModule.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/KLMDigitizer/KLMDigitizerModule.h>
11 
12 /* KLM headers. */
13 #include <klm/dataobjects/KLMChannelIndex.h>
14 #include <klm/dataobjects/KLMScintillatorFirmwareFitResult.h>
15 #include <klm/simulation/ScintillatorSimulator.h>
16 
17 /* Belle 2 headers. */
18 #include <framework/dataobjects/BackgroundMetaData.h>
19 #include <mdst/dataobjects/MCParticle.h>
20 
21 /* ROOT headers. */
22 #include <TRandom.h>
23 
24 using namespace Belle2;
25 
26 REG_MODULE(KLMDigitizer)
27 
29  Module(),
30  m_Time(&(KLMTime::Instance())),
31  m_ElementNumbers(&(KLMElementNumbers::Instance())),
32  m_ChannelSpecificSimulation(false),
33  m_EfficiencyMode(c_Plane),
34  m_Fitter(nullptr)
35 {
36  setDescription("KLM digitization module: create KLMDigits from BKLMSimHits and EKLMSimHits.");
37  setPropertyFlags(c_ParallelProcessingCertified);
38  addParam("SimulationMode", m_SimulationMode,
39  "Simulation mode (\"Generic\" or \"ChannelSpecific\").",
40  std::string("Generic"));
41  /*
42  * Initial digitization time is negative to work with cosmic events (the part
43  * of the track directed to the interaction pointhas a negative time).
44  */
45  addParam("DigitizationInitialTime", m_DigitizationInitialTime,
46  "Initial digitization time in CTIME periods.", -5);
47  addParam("SaveFPGAFit", m_SaveFPGAFit, "Save FPGA fit data and set a relation with KLMDigits.", false);
48  addParam("Efficiency", m_Efficiency,
49  "Efficiency determination mode (\"Strip\" or \"Plane\").",
50  std::string("Plane"));
51  addParam("Debug", m_Debug,
52  "Debug mode (generates additional output files with histograms).",
53  false);
54 }
55 
57 {
58 }
59 
61 {
62  m_bklmSimHits.isRequired();
63  m_eklmSimHits.isRequired();
64  m_Digits.registerInDataStore();
65  m_Digits.registerRelationTo(m_bklmSimHits);
66  m_Digits.registerRelationTo(m_eklmSimHits);
67  if (m_SaveFPGAFit) {
68  m_FPGAFits.registerInDataStore();
69  m_Digits.registerRelationTo(m_FPGAFits);
70  }
71  if (m_SimulationMode == "Generic") {
72  /* Nothing to do. */
73  } else if (m_SimulationMode == "ChannelSpecific") {
75  } else {
76  B2FATAL("Unknown simulation mode: " << m_SimulationMode);
77  }
78  if (m_Efficiency == "Strip")
80  else if (m_Efficiency == "Plane")
82  else
83  B2FATAL("Unknown efficiency mode: " << m_EfficiencyMode);
84 }
85 
87 {
88  KLMChannelIndex klmChannels;
89  for (KLMChannelIndex& klmChannel : klmChannels) {
90  KLMChannelNumber channel = m_ElementNumbers->channelNumber(klmChannel.getSubdetector(), klmChannel.getSection(),
91  klmChannel.getSector(), klmChannel.getLayer(),
92  klmChannel.getPlane(), klmChannel.getStrip());
93  const KLMScintillatorFEEData* FEEData = m_FEEPar->getFEEData(channel);
94  if (FEEData == nullptr)
95  B2FATAL("Incomplete scintillator FEE data.");
96  if (FEEData->getPhotoelectronAmplitude() <= 0) {
97  B2ERROR("Non-positive photoelectron amplitude. The requested "
98  "channel-specific simulation is impossible. "
99  "KLMDigitizer is switched to the generic mode."
100  << LogVar("Section", klmChannel.getSection())
101  << LogVar("Layer", klmChannel.getLayer())
102  << LogVar("Sector", klmChannel.getSector())
103  << LogVar("Plane", klmChannel.getPlane())
104  << LogVar("Strip", klmChannel.getStrip()));
106  return;
107  }
108  }
109 }
110 
112 {
113  if (!m_DigPar.isValid())
114  B2FATAL("KLM scintillator digitization parameters are not available.");
115  if (!m_FEEPar.isValid())
116  B2FATAL("KLM scintillator FEE parameters are not available.");
117  if (!m_ChannelStatus.isValid())
118  B2FATAL("KLM channel status data are not available.");
119  if (!m_StripEfficiency.isValid())
120  B2FATAL("KLM strip efficiency data are not available.");
124  m_Fitter = new KLM::ScintillatorFirmware(m_DigPar->getNDigitizations());
125 }
126 
127 /*
128  * Digitization. Light propagation into the fiber, SiPM and electronics effects
129  * are simulated in KLM::ScintillatorSimulator class.
130  */
131 
133 {
134  enum KLMChannelStatus::ChannelStatus status =
135  m_ChannelStatus->getChannelStatus(channel);
136  if (status == KLMChannelStatus::c_Unknown)
137  B2FATAL("Incomplete KLM channel status data.");
138  return (status != KLMChannelStatus::c_Dead);
139 }
140 
142 {
143  if (isnan(efficiency))
144  B2FATAL("Incomplete KLM efficiency data.");
145  double selection = gRandom->Rndm();
146  return (selection < efficiency);
147 }
148 
150 {
151  int tdc;
152  KLM::ScintillatorSimulator simulator(
153  &(*m_DigPar), m_Fitter,
155  const KLMScintillatorFEEData* FEEData;
156  std::multimap<KLMChannelNumber, const BKLMSimHit*>::iterator it, it2, ub;
157  for (it = m_bklmSimHitChannelMap.begin(); it != m_bklmSimHitChannelMap.end();
158  it = m_bklmSimHitChannelMap.upper_bound(it->first)) {
159  const BKLMSimHit* simHit = it->second;
160  ub = m_bklmSimHitChannelMap.upper_bound(it->first);
161  bool rpc = simHit->inRPC();
162  if (m_EfficiencyMode == c_Strip) {
163  float efficiency = m_StripEfficiency->getBarrelEfficiency(
164  simHit->getSection(), simHit->getSector(),
165  simHit->getLayer(), simHit->getPlane(),
166  simHit->getStrip());
167  if (!efficiencyCorrection(efficiency))
168  continue;
169  }
170  if (rpc) {
173  /* Select hit that has the smallest time. */
174  it2 = it;
175  const BKLMSimHit* hit = it->second;
176  double time = hit->getTime();
177  ++it2;
178  while (it2 != ub) {
179  if (it2->second->getTime() < time) {
180  time = it2->second->getTime();
181  hit = it2->second;
182  }
183  ++it2;
184  }
185  KLMDigit* bklmDigit = m_Digits.appendNew(hit, strip);
186  bklmDigit->addRelationTo(simHit);
187  } else {
190  simHit->getSection(), simHit->getSector(),
191  simHit->getLayer(), simHit->getPlane(),
192  simHit->getStrip());
193  FEEData = m_FEEPar->getFEEData(channel);
194  if (FEEData == nullptr)
195  B2FATAL("Incomplete KLM scintillator FEE data.");
196  simulator.setFEEData(FEEData);
197  }
198  simulator.simulate(it, ub);
199  if (simulator.getNGeneratedPhotoelectrons() == 0)
200  continue;
201  KLMDigit* bklmDigit = m_Digits.appendNew(simHit);
202  bklmDigit->addRelationTo(simHit);
203  bklmDigit->setMCTime(simulator.getMCTime());
204  bklmDigit->setSiPMMCTime(simulator.getSiPMMCTime());
206  if (simulator.getFitStatus() ==
207  KLM::c_ScintillatorFirmwareSuccessfulFit) {
208  tdc = simulator.getFPGAFit()->getStartTime();
209  bklmDigit->setCharge(simulator.getFPGAFit()->getMinimalAmplitude());
210  } else {
211  tdc = 0;
212  bklmDigit->setCharge(m_DigPar->getADCRange() - 1);
213  }
214  bklmDigit->setTDC(tdc);
215  bklmDigit->setTime(m_Time->getTimeSimulation(tdc, true));
216  bklmDigit->setFitStatus(simulator.getFitStatus());
217  bklmDigit->setNPhotoelectrons(simulator.getNPhotoelectrons());
218  bklmDigit->setEnergyDeposit(simulator.getEnergy());
219  if (simulator.getFitStatus() == KLM::c_ScintillatorFirmwareSuccessfulFit &&
220  m_SaveFPGAFit) {
222  m_FPGAFits.appendNew(*simulator.getFPGAFit());
223  bklmDigit->addRelationTo(fit);
224  }
225  }
226  }
227 }
228 
230 {
231  uint16_t tdc;
232  KLM::ScintillatorSimulator simulator(
233  &(*m_DigPar), m_Fitter,
235  const KLMScintillatorFEEData* FEEData;
236  std::multimap<KLMChannelNumber, const EKLMSimHit*>::iterator it, ub;
237  for (it = m_eklmSimHitChannelMap.begin(); it != m_eklmSimHitChannelMap.end();
238  it = m_eklmSimHitChannelMap.upper_bound(it->first)) {
239  const EKLMSimHit* simHit = it->second;
240  ub = m_eklmSimHitChannelMap.upper_bound(it->first);
241  if (m_EfficiencyMode == c_Strip) {
242  float efficiency = m_StripEfficiency->getEndcapEfficiency(simHit->getSection(), simHit->getSector(),
243  simHit->getLayer(), simHit->getPlane(),
244  simHit->getStrip());
245  if (!efficiencyCorrection(efficiency))
246  continue;
247  }
250  simHit->getSection(), simHit->getSector(),
251  simHit->getLayer(), simHit->getPlane(),
252  simHit->getStrip());
253  FEEData = m_FEEPar->getFEEData(channel);
254  if (FEEData == nullptr)
255  B2FATAL("Incomplete KLM scintillator FEE data.");
256  simulator.setFEEData(FEEData);
257  }
258  /* Simulation for a strip. */
259  simulator.simulate(it, ub);
260  if (simulator.getNGeneratedPhotoelectrons() == 0)
261  continue;
262  KLMDigit* eklmDigit = m_Digits.appendNew(simHit);
263  eklmDigit->addRelationTo(simHit);
264  eklmDigit->setMCTime(simulator.getMCTime());
265  eklmDigit->setSiPMMCTime(simulator.getSiPMMCTime());
267  if (simulator.getFitStatus() == KLM::c_ScintillatorFirmwareSuccessfulFit) {
268  tdc = simulator.getFPGAFit()->getStartTime();
269  eklmDigit->setCharge(simulator.getFPGAFit()->getMinimalAmplitude());
270  } else {
271  tdc = 0;
272  eklmDigit->setCharge(m_DigPar->getADCRange() - 1);
273  }
274  eklmDigit->setTDC(tdc);
275  eklmDigit->setTime(m_Time->getTimeSimulation(tdc, true));
276  eklmDigit->setFitStatus(simulator.getFitStatus());
277  eklmDigit->setNPhotoelectrons(simulator.getNPhotoelectrons());
278  eklmDigit->setEnergyDeposit(simulator.getEnergy());
279  if (simulator.getFitStatus() == KLM::c_ScintillatorFirmwareSuccessfulFit &&
280  m_SaveFPGAFit) {
282  m_FPGAFits.appendNew(*simulator.getFPGAFit());
283  eklmDigit->addRelationTo(fit);
284  }
285  }
286 }
287 
289 {
290  int i;
291  KLMChannelNumber channel;
292  m_bklmSimHitChannelMap.clear();
293  m_eklmSimHitChannelMap.clear();
294  if (m_EfficiencyMode == c_Plane) {
295  /* BKLM. */
296  {
297  m_bklmSimHitPlaneMap.clear();
298  for (i = 0; i < m_bklmSimHits.getEntries(); i++) {
299  const BKLMSimHit* hit = m_bklmSimHits[i];
300  if (hit->getStripMin() <= 0)
301  continue;
302  const MCParticle* particle = hit->getRelatedFrom<MCParticle>();
303  /*
304  * We do not simulate the plane efficiency for BKLMSimHits
305  * from beam background because there are no MCParticles associated
306  * to them.
307  */
308  if (particle != nullptr) {
310  hit->getSection(), hit->getSector(),
311  hit->getLayer(), hit->getPlane());
312  m_bklmSimHitPlaneMap.insert(
313  std::pair<KLMPlaneNumber, const BKLMSimHit*>(plane, hit));
314  } else {
315  B2ASSERT("The BKLMSimHit is not related to any MCParticle and "
316  "it is also not a beam background hit.",
317  hit->getBackgroundTag() != BackgroundMetaData::bg_none);
319  hit->getSection(), hit->getSector(), hit->getLayer(),
320  hit->getPlane(), hit->getStrip());
321  if (checkActive(channel))
322  m_bklmSimHitChannelMap.insert(
323  std::pair<KLMChannelNumber, const BKLMSimHit*>(channel, hit));
324  }
325  }
326  std::multimap<KLMPlaneNumber, const BKLMSimHit*>::iterator it, it2;
327  std::multimap<const MCParticle*, const BKLMSimHit*> particleHitMap;
328  std::multimap<const MCParticle*, const BKLMSimHit*>::iterator
329  itParticle, it2Particle;
330  it = m_bklmSimHitPlaneMap.begin();
331  while (it != m_bklmSimHitPlaneMap.end()) {
332  particleHitMap.clear();
333  it2 = it;
334  while (true) {
335  const BKLMSimHit* hit = it2->second;
336  const MCParticle* particle = hit->getRelatedFrom<MCParticle>();
337  particleHitMap.insert(
338  std::pair<const MCParticle*, const BKLMSimHit*>(particle, hit));
339  ++it2;
340  if (it2 == m_bklmSimHitPlaneMap.end())
341  break;
342  if (it2->first != it->first)
343  break;
344  }
345  itParticle = particleHitMap.begin();
346  while (itParticle != particleHitMap.end()) {
347  it2Particle = itParticle;
348  const BKLMSimHit* hit = it2Particle->second;
349  float efficiency = m_StripEfficiency->getBarrelEfficiency(
350  hit->getSection(), hit->getSector(),
351  hit->getLayer(), hit->getPlane(),
352  hit->getStripMin());
353  bool hitSelected = efficiencyCorrection(efficiency);
354  while (true) {
355  hit = it2Particle->second;
356  if (hitSelected) {
357  for (int s = hit->getStripMin(); s <= hit->getStripMax(); ++s) {
359  hit->getSection(), hit->getSector(), hit->getLayer(),
360  hit->getPlane(), s);
361  if (checkActive(channel)) {
362  m_bklmSimHitChannelMap.insert(
363  std::pair<KLMChannelNumber, const BKLMSimHit*>(channel, hit));
364  }
365  }
366  }
367  ++it2Particle;
368  if (it2Particle == particleHitMap.end())
369  break;
370  if (it2Particle->first != itParticle->first)
371  break;
372  }
373  itParticle = it2Particle;
374  }
375  it = it2;
376  }
377  }
378  /* EKLM. */
379  {
380  m_eklmSimHitPlaneMap.clear();
381  for (i = 0; i < m_eklmSimHits.getEntries(); i++) {
382  const EKLMSimHit* hit = m_eklmSimHits[i];
383  const MCParticle* particle = hit->getRelatedFrom<MCParticle>();
384  /*
385  * We do not simulate the plane efficiency for EKLMSimHits
386  * from beam background because there are no MCParticles
387  * associated to them.
388  */
389  if (particle != nullptr) {
391  hit->getSection(), hit->getSector(),
392  hit->getLayer(), hit->getPlane());
393  m_eklmSimHitPlaneMap.insert(
394  std::pair<KLMPlaneNumber, const EKLMSimHit*>(plane, hit));
395  } else {
396  B2ASSERT("The EKLMSimHit is not related to any MCParticle and "
397  "it is also not a beam background hit.",
398  hit->getBackgroundTag() != BackgroundMetaData::bg_none);
400  hit->getSection(), hit->getSector(), hit->getLayer(),
401  hit->getPlane(), hit->getStrip());
402  if (checkActive(channel))
403  m_eklmSimHitChannelMap.insert(
404  std::pair<KLMChannelNumber, const EKLMSimHit*>(channel, hit));
405  }
406  }
407  std::multimap<KLMPlaneNumber, const EKLMSimHit*>::iterator it, it2;
408  std::multimap<const MCParticle*, const EKLMSimHit*> particleHitMap;
409  std::multimap<const MCParticle*, const EKLMSimHit*>::iterator
410  itParticle, it2Particle;
411  it = m_eklmSimHitPlaneMap.begin();
412  while (it != m_eklmSimHitPlaneMap.end()) {
413  particleHitMap.clear();
414  it2 = it;
415  while (true) {
416  const EKLMSimHit* hit = it2->second;
417  const MCParticle* particle = hit->getRelatedFrom<MCParticle>();
418  particleHitMap.insert(
419  std::pair<const MCParticle*, const EKLMSimHit*>(particle, hit));
420  ++it2;
421  if (it2 == m_eklmSimHitPlaneMap.end())
422  break;
423  if (it2->first != it->first)
424  break;
425  }
426  itParticle = particleHitMap.begin();
427  while (itParticle != particleHitMap.end()) {
428  it2Particle = itParticle;
429  const EKLMSimHit* hit = it2Particle->second;
430  float efficiency = m_StripEfficiency->getEndcapEfficiency(
431  hit->getSection(), hit->getSector(),
432  hit->getLayer(), hit->getPlane(),
433  hit->getStrip());
434  bool hitSelected = efficiencyCorrection(efficiency);
435  while (true) {
436  hit = it2Particle->second;
437  if (hitSelected) {
439  hit->getSection(), hit->getSector(), hit->getLayer(),
440  hit->getPlane(), hit->getStrip());
441  if (checkActive(channel)) {
442  m_eklmSimHitChannelMap.insert(
443  std::pair<KLMChannelNumber, const EKLMSimHit*>(channel, hit));
444  }
445  }
446  ++it2Particle;
447  if (it2Particle == particleHitMap.end())
448  break;
449  if (it2Particle->first != itParticle->first)
450  break;
451  }
452  itParticle = it2Particle;
453  }
454  it = it2;
455  }
456  }
457  } else {
458  for (i = 0; i < m_bklmSimHits.getEntries(); i++) {
459  const BKLMSimHit* hit = m_bklmSimHits[i];
460  if (hit->inRPC()) {
461  if (hit->getStripMin() <= 0)
462  continue;
463  for (int s = hit->getStripMin(); s <= hit->getStripMax(); ++s) {
465  hit->getSection(), hit->getSector(), hit->getLayer(),
466  hit->getPlane(), s);
467  if (checkActive(channel)) {
468  m_bklmSimHitChannelMap.insert(
469  std::pair<KLMChannelNumber, const BKLMSimHit*>(channel, hit));
470  }
471  }
472  } else {
474  hit->getSection(), hit->getSector(), hit->getLayer(),
475  hit->getPlane(), hit->getStrip());
476  if (checkActive(channel)) {
477  m_bklmSimHitChannelMap.insert(
478  std::pair<KLMChannelNumber, const BKLMSimHit*>(channel, hit));
479  }
480  }
481  }
482  for (i = 0; i < m_eklmSimHits.getEntries(); i++) {
483  const EKLMSimHit* hit = m_eklmSimHits[i];
485  hit->getSection(), hit->getSector(), hit->getLayer(),
486  hit->getPlane(), hit->getStrip());
487  if (checkActive(channel)) {
488  m_eklmSimHitChannelMap.insert(
489  std::pair<KLMChannelNumber, const EKLMSimHit*>(channel, hit));
490  }
491  }
492  }
493  digitizeBKLM();
494  digitizeEKLM();
495 }
496 
498 {
499  delete m_Fitter;
500 }
501 
503 {
504 }
static int getStripByModule(int module)
Get strip number by module identifier.
Store one simulation hit as a ROOT object.
Definition: BKLMSimHit.h:25
bool inRPC() const
Determine whether this hit is in an RPC or scintillator.
Definition: BKLMSimHit.h:53
int getLayer() const
Get layer number.
Definition: BKLMSimHit.h:74
int getSection() const
Get section number.
Definition: BKLMSimHit.h:60
int getPlane() const
Get plane number.
Definition: BKLMSimHit.h:81
int getStrip() const
Get strip number of this hit.
Definition: BKLMSimHit.h:96
int getSector() const
Get sector number.
Definition: BKLMSimHit.h:67
int getLayer() const
Get layer number.
Definition: EKLMHitBase.h:64
int getSection() const
Get section number.
Definition: EKLMHitBase.h:46
int getSector() const
Get sector number.
Definition: EKLMHitBase.h:82
Class EKLMSimHit stores information on particular Geant step; using information from TrackID and Pare...
Definition: EKLMSimHit.h:32
int getPlane() const
Get plane number.
Definition: EKLMSimHit.h:107
int getStrip() const
Get strip number.
Definition: EKLMSimHit.h:125
KLM channel index.
ChannelStatus
Channel status.
@ 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:30
void setMCTime(float time)
Set MC time.
Definition: KLMDigit.h:391
void setNGeneratedPhotoelectrons(int nPhotoelectrons)
Set generated number of photoelectrons.
Definition: KLMDigit.h:346
void setSiPMMCTime(float time)
Set SiPM MC time.
Definition: KLMDigit.h:409
void setEnergyDeposit(float eDep)
Set EnergyDeposit.
Definition: KLMDigit.h:310
void setNPhotoelectrons(float nPhotoelectrons)
Set number of photoelectrons.
Definition: KLMDigit.h:328
void setTime(float time)
Set hit time.
Definition: KLMDigit.h:292
void setTDC(uint16_t tdc)
Set TDC.
Definition: KLMDigit.h:274
void setFitStatus(int s)
Set fit status.
Definition: KLMDigit.h:373
void setCharge(uint16_t charge)
Set charge.
Definition: KLMDigit.h:238
KLM digitization module.
std::multimap< KLMPlaneNumber, const BKLMSimHit * > m_bklmSimHitPlaneMap
Simulation hit map for BKLM (by plane).
StoreArray< EKLMSimHit > m_eklmSimHits
EKLM simulation hits.
std::multimap< KLMPlaneNumber, const EKLMSimHit * > m_eklmSimHitPlaneMap
Simulation hit map for EKLM (by plane).
EfficiencyMode m_EfficiencyMode
Efficiency determination mode (converted from the string parameter).
StoreArray< KLMDigit > m_Digits
KLM digits.
DBObjPtr< KLMChannelStatus > m_ChannelStatus
Channel status.
void digitizeBKLM()
Digitization in BKLM.
DBObjPtr< KLMScintillatorFEEParameters > m_FEEPar
Scintillator FEE parameters.
void initialize() override
Initializer.
bool efficiencyCorrection(float efficiency)
Efficiency correction.
std::multimap< KLMChannelNumber, const BKLMSimHit * > m_bklmSimHitChannelMap
Simulation hit map for BKLM (by channel).
void event() override
This method is called for each event.
const KLMElementNumbers * m_ElementNumbers
Element numbers.
bool m_SaveFPGAFit
Save FPGA fit data (KLMScintillatorFirmwareFitResult).
bool checkActive(KLMChannelNumber channel)
Check if channel is active (status is not KLMChannelStatus::c_Dead).
void endRun() override
This method is called if the current run ends.
DBObjPtr< KLMScintillatorDigitizationParameters > m_DigPar
Scintillator digitization parameters.
void terminate() override
This method is called at the end of the event processing.
bool m_Debug
Use debug mode in EKLM::ScintillatorSimulator or not.
void digitizeEKLM()
Digitization in EKLM.
int m_DigitizationInitialTime
Initial digitization time in CTIME periods.
std::multimap< KLMChannelNumber, const EKLMSimHit * > m_eklmSimHitChannelMap
Simulation hit map for EKLM (by channel).
void checkScintillatorFEEParameters()
Check scintillator FEE parameters for channel-specific simulation.
std::string m_Efficiency
Efficiency determination mode ("Strip" or "Plane").
void beginRun() override
Called when entering a new run.
StoreArray< KLMScintillatorFirmwareFitResult > m_FPGAFits
FPGA fits.
StoreArray< BKLMSimHit > m_bklmSimHits
BKLM simulation hits.
bool m_ChannelSpecificSimulation
Whether the simulation is channel-specific.
KLMTime * m_Time
Time conversion.
DBObjPtr< KLMStripEfficiency > m_StripEfficiency
Strip efficiency.
KLM::ScintillatorFirmware * m_Fitter
FPGA fitter.
std::string m_SimulationMode
Simulation mode.
KLM element numbers.
KLMChannelNumber channelNumberBKLM(int section, int sector, int layer, int plane, int strip) const
Get channel number for BKLM.
KLMChannelNumber channelNumber(int subdetector, int section, int sector, int layer, int plane, int strip) const
Get channel number.
KLMPlaneNumber planeNumberEKLM(int section, int sector, int layer, int plane) const
Get channel number for EKLM.
KLMPlaneNumber planeNumberBKLM(int section, int sector, int layer, int plane) const
Get plane number for BKLM.
int localChannelNumberBKLM(KLMChannelNumber channel) const
Get local BKLM channel number.
KLMChannelNumber channelNumberEKLM(int section, int sector, int layer, int plane, int strip) const
Get channel number for EKLM.
float getPhotoelectronAmplitude() const
Get photoelectron amplitude.
int getMinimalAmplitude() const
Get minimal amplitude (ADC output).
int getStartTime() const
Get signal start time (in TDC counts).
KLM time conversion.
Definition: KLMTime.h:27
double getCTimePeriod() const
Get CTIME period.
Definition: KLMTime.h:53
double getTimeSimulation(int tdc, bool scintillator) const
Get time for simulation.
Definition: KLMTime.cc:67
void updateConstants()
Update constants from database objects.
Definition: KLMTime.cc:20
Digitize EKLMSim2Hits to get EKLM StripHits.
float getSiPMMCTime() const
Get SiPM MC time.
void setFEEData(const KLMScintillatorFEEData *FEEData)
Set FEE data.
enum ScintillatorFirmwareFitStatus getFitStatus() const
Get fit status.
void simulate(const std::multimap< KLMChannelNumber, const BKLMSimHit * >::iterator &firstHit, const std::multimap< KLMChannelNumber, const BKLMSimHit * >::iterator &end)
Simulate BKLM strip.
double getEnergy()
Get total energy deposited in the strip (sum over ssimulation hits).
double getNPhotoelectrons()
Get number of photoelectrons (fit result).
KLMScintillatorFirmwareFitResult * getFPGAFit()
Get fit data.
int getNGeneratedPhotoelectrons()
Get generated number of photoelectrons.
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).
Class to store variables with their name which were sent to the logging service.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:650
uint16_t KLMChannelNumber
Channel number.
uint16_t KLMPlaneNumber
Plane number.
Abstract base class for different kinds of events.