Belle II Software development
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
12using namespace Belle2;
13
14REG_MODULE(KLMDigitTimeShifter);
15
17 Module()
18{
19 setDescription("Shift the time of KLMDigits according to the cable delay corrections.");
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}
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:29
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
#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.