Belle II Software  release-06-00-14
KLMDigitTimeShifterModule.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/KLMDigitTimeShifter/KLMDigitTimeShifterModule.h>
11 
13 #include <cstdint>
14 
15 using namespace Belle2;
16 
17 REG_MODULE(KLMDigitTimeShifter)
18 
20  Module()
21 {
22  setDescription("Shift the time of KLMDigits according to the cable delay corrections.");
23  setPropertyFlags(c_ParallelProcessingCertified);
24 }
25 
27 {
28 }
29 
31 {
32  m_Digits.isRequired();
33 }
34 
36 {
37  if (!m_TimeDelay.isValid())
38  B2FATAL("KLM time cable delay data are not available.");
39 }
40 
42 {
43  for (KLMDigit& digit : m_Digits) {
44  KLMChannelNumber channel = digit.getUniqueChannelID();
45  float digitTimeShifted = digit.getTime() - m_TimeDelay->getTimeDelay(channel);
46  digit.setTime(digitTimeShifted);
47  }
48 }
KLM digit time shifter module.
StoreArray< KLMDigit > m_Digits
KLM digits.
DBObjPtr< KLMTimeCableDelay > m_TimeDelay
KLM time cable delay.
void event() override
This method is called for each event.
void beginRun() override
Called when entering a new run.
KLM digit (class representing a digitized hit in RPCs or scintillators).
Definition: KLMDigit.h:30
Base class for Modules.
Definition: Module.h:72
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:650
uint16_t KLMChannelNumber
Channel number.
Abstract base class for different kinds of events.