9#include <svd/modules/svdSimulation/SVDEventInfoSetterModule.h>
10#include <root/TRandom.h>
11#include <mdst/dataobjects/TRGSummary.h>
29 "Sets the SVD event information. Use this "
30 "module to fill SVDEventInfo object which tells the digitizer "
31 "the conditions for creating ShaperDigits."
38 addParam(
"runType",
m_runType,
"Defines the run type: raw/transparent/zero-suppressed/z-s+hit time finding",
int(2));
39 addParam(
"eventType",
m_eventType,
"Defines the event type: TTD event (global run)/standalone event (local run)",
int(0));
41 "Defines the DAQ mode: = 2 for the default 6-sample mode, = 1 for the 3-sample mode, = 3 for the 3-mixed-6 sample mode. ",
int(2));
43 "Trigger bin 0/1/2/3 - useful for timing studies. The default is random if SimClockState is not valid.",
int(999));
45 addParam(
"crossTalk",
m_xTalk,
"Defines the cross-talk flag for the event",
bool(
false));
46 addParam(
"relativeShift",
m_relativeShift,
"Relative shift between 3- and 6-sample events, in units of APV clock / 4",
int(0));
47 addParam(
"useDB",
m_useDB,
"default = False. If true reads the DAQMode from SVDGlobalConfigParameters",
bool(
false));
59 B2WARNING(
"No valid SVDGlobalConfigParameters for the requested IoV, simulating a 6-sample event");
69 B2ERROR(
"Invalid number of frames (" << nFrames <<
") in SVDGlobalConfigParamters");
87 B2DEBUG(25,
"using fixed triggerBin");
93 const int triggerBinsInAPVclock = 4;
95 B2DEBUG(25,
"no SimClockState -> random generation of trigger bin");
124 if (storeTRGSummary.
isValid()) {
125 int trgQuality = storeTRGSummary->getTimQuality();
127 if (trgQuality == TRGSummary::ETimingQuality::TTYQ_FINE or trgQuality == TRGSummary::ETimingQuality::TTYQ_SFIN)
129 }
else B2DEBUG(25,
"DAQMode = 3, but no valid TRGSummary! We simulate a 6-sample event");
134 if (nAPVsamples == 3)
@ c_ErrorIfAlreadyRegistered
If the object/array was already registered, produce an error (aborting initialisation).
void setDescription(const std::string &description)
Sets the description of the module.
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
bool m_xTalk
Cross-talk flag to be set.
StoreObjPtr< SVDEventInfo > m_svdEventInfoPtr
Output object.
virtual void initialize() override
Initializes the Module.
virtual void event() override
Stores the SVD event info into the DataStore.
int m_fixedTriggerBin
fixed trigger bin
uint8_t m_triggerType
Trigger type content to be set.
SVDEventInfoSetterModule()
Constructor.
virtual void beginRun() override
Reads Detector Configuration from DB daqMode and relativeShift.
bool m_ModeByteMatch
SVDModeByte matching flag to be set.
DBObjPtr< HardwareClockSettings > m_hwClock
systems clock
std::string m_svdEventInfoName
Name of the SVDEventInfo object.
int m_triggerBin
trigger bin
DBObjPtr< SVDGlobalConfigParameters > m_svdGlobalConfig
SVD Global Configuration payload.
int m_eventType
event type
int m_relativeShift
latency difference between the 3- and 6-sample acquired events
SVDTriggerType m_SVDTriggerType
SVDTriggerType object.
SVDModeByte m_SVDModeByte
SVDModeByte object.
bool m_TriggerTypeMatch
SVDTriggerType matching flag to be set.
virtual ~SVDEventInfoSetterModule()
Destructor.
std::string m_objTrgSummaryName
Name of the StoreObjectPrt TRGSummary.
bool m_useDB
if true reads the configuration from SVDGlobalConfigParameters payload
StoreObjPtr< SimClockState > m_simClockState
generated hardware clock state
Type-safe access to single objects in the data store.
bool isValid() const
Check whether the object was created.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.