9#define TRGGDL_SHORT_NAMES
13#include "trg/trg/Debug.h"
14#include "trg/gdl/modules/trggdl/TRGGDLModule.h"
16#include <framework/logging/Logger.h>
34 return string(
"TRGGDLModule 0.00");
41 _configFilename(
"TRGGDLConfig.dat"),
43 _fastSimulationMode(0),
44 _firmwareSimulationMode(0),
46 _algFilePath(
"ftd.alg")
49 string desc =
"TRGGDLModule(" +
version() +
")";
54 addParam(
"Belle2Phase", _Phase,
"Phase2 or Phase3", _Phase);
57 "The filename of CDC trigger config file",
61 "TRGGDL simulation switch",
65 "TRGGDL fast simulation mode",
69 "TRGGDL firmware simulation mode",
74 "Set false when alg is taken from local file.",
82 addParam(
"timquality_threshold_sfin",
84 "Threshold to determine timing quality flag with MC truth: superfine",
87 addParam(
"timquality_threshold_fine",
89 "Threshold to determine timing quality flag with MC truth: fine",
94 "if True, L1 jitter is simulated by EventT0Generator.",
97 B2DEBUG(100,
"TRGGDLModule ... created");
104 B2DEBUG(100,
"good-bye");
106 B2DEBUG(100,
"TRGGDLModule ... destructed ");
114 oldDir->mkdir(
"TRGGDLModule");
115 newDir->cd(
"TRGGDLModule");
117 h_inp =
new TH1I(
"hTRGGDL_inp",
"input bits from TRGGDLModule", 200, 0, 200);
118 h_ftd =
new TH1I(
"hTRGGDL_ftd",
"ftdl bits from TRGGDLModule", 200, 0, 200);
119 h_psn =
new TH1I(
"hTRGGDL_psn",
"psnm bits from TRGGDLModule", 200, 0, 200);
135 B2INFO(
"TRGGDLModule::initialize. simulationMode=" <<
_simulationMode);
143 m_TRGSummary.registerInDataStore();
177 if (
_debugLevel > 9) printf(
"TRGGDLModule::beginRun() ends.\n");
181 B2DEBUG(100,
"TRGGDLModule ... beginRun called configFile = " << cfn);
188 if (
_debugLevel > 9) printf(
"TRGGDLModule::event() starts.\n");
200 bool result_summary =
false;
202 result_summary = m_TRGSummary->test();
204 B2WARNING(
"TRGGDLModule.cc: TRGSummary not found. Check it!!!!");
214 B2DEBUG(200,
"TRGGDLModule ... endRun called ");
223 B2DEBUG(100,
"TRGGDLModule ... terminate called ");
HistoModule.h is supposed to be used instead of Module.h for the modules with histogram definitions t...
void setDescription(const std::string &description)
Sets the description of the module.
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
void setReturnValue(int value)
Sets the return value for this module as integer.
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
StoreObjPtr< TRGGRLInfo > m_TRGGRLInfo
< required input for TRGGRLInfo
std::string _configFilename
Config. file name.
bool _algFromDB
Switch for algorithm source. False when using local .alg file.
int _debugLevel
Debug level.
double _timquality_threshold_sfin
Threshold to determine timing quality flag with MC truth: super fine.
int _simulationMode
Mode for TRGGDL simulation.
bool m_simulateT0Jitter
if True, L1 jitter is simulated by EventT0Generator
int _firmwareSimulationMode
Switch for the firmware simulation. 0:do nothing, 1:do everything.
double _timquality_threshold_fine
Threshold to determine timing quality flag with MC truth: fine.
int _fastSimulationMode
Switch for the fast simulation.
StoreObjPtr< SimClockState > m_simClockState
generated hardware clock state
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.
virtual void initialize() override
Initilizes TRGGDLModule.
virtual void event() override
Called event by event.
virtual void endRun() override
Called when run ended.
virtual ~TRGGDLModule()
Destructor.
virtual void terminate() override
Called when processing ended.
static TRGGDL * _gdl
A pointer to a TRGGDL;.
virtual void beginRun() override
Called when new run started.
TRGGDLModule()
Constructor.
std::string version(void) const
returns version of TRGGDLModule.
virtual void defineHisto() override
Define Histogram.
void checkDatabase() const
Check the content of the DBObjects used by this class.
void accumulatePsn(TH1I *)
Accumulate bit info in histogram.
void terminate(void)
terminates when run is finished
static TRGGDL * getTRGGDL(void)
returns TRGGDL object.
void accumulateFtd(TH1I *)
Accumulate bit info in histogram.
static int level(void)
returns the debug level.
void update(bool mcAnalysis=true)
updates TRGGDL information.
void accumulateInp(TH1I *)
Accumulate bit info in histogram.
std::string configFile(void) const
returns configuration file name.
void simulate(void)
fast trigger simulation.
Abstract base class for different kinds of events.