Belle II Software  release-06-02-00
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 
12 using namespace Belle2;
13 
14 REG_MODULE(KLMDigitTimeShifter)
15 
17  Module()
18 {
19  setDescription("Shift the time of KLMDigits according to the cable delay corrections.");
20  setPropertyFlags(c_ParallelProcessingCertified);
21 }
22 
24 {
25 }
26 
28 {
29  m_Digits.isRequired();
30 }
31 
33 {
34  if (!m_TimeDelay.isValid())
35  B2FATAL("KLM time cable delay data are not available.");
36 }
37 
39 {
40  for (KLMDigit& digit : m_Digits) {
41  KLMChannelNumber channel = digit.getUniqueChannelID();
42  float digitTimeShifted = digit.getTime() - m_TimeDelay->getTimeDelay(channel);
43  digit.setTime(digitTimeShifted);
44  }
45 }
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.