10#include <ecl/modules/eclDQMOutOfTimeDigits/eclDQMOutOfTimeDigits.h>
13#include <analysis/VariableManager/Manager.h>
14#include <framework/core/HistoModule.h>
15#include <mdst/dataobjects/TRGSummary.h>
18#include <TDirectory.h>
33 setDescription(
"ECL Data Quality monitoring module. See header file for the detailed description.");
37 "histogram directory in ROOT file", std::string(
"ECL"));
47 TDirectory* oldDir = gDirectory;
56 for (
auto& event_type : {
"rand",
"dphy",
"physics"}) {
57 for (
auto& ecl_part : {
"All",
"FWDEndcap",
"Barrel",
"BWDEndcap"}) {
58 std::string key_name = event_type + std::string(
"_") + ecl_part;
59 TString hist_name =
"out_of_time_" + key_name;
63 h_out_of_time[key_name] =
new TH1F(hist_name,
"", 250, 0, 2000);
66 h_out_of_time[key_name]->GetXaxis()->SetTitle(
"Out-of-time ECLCalDigits");
67 TString title =
"Out-of-time ECLCalDigits";
88 for (std::map<std::string, TH1F*>::iterator it =
h_out_of_time.begin();
100 bool bhatrig =
false;
101 try { bhatrig =
m_l1Trigger->testInput(
"bha_delay"); }
102 catch (
const std::exception&) { bhatrig =
false; }
104 if (bhatrig)
return "dphy";
113 for (
auto& ecl_part : {
"All",
"FWDEndcap",
"Barrel",
"BWDEndcap"}) {
114 std::string key_name = event_type + std::string(
"_") + ecl_part;
115 std::string var_name =
"nECLOutOfTimeCrystals";
116 if (std::string(ecl_part) !=
"All") var_name += ecl_part;
119 double value = std::get<double>(var->function(
nullptr));
virtual void initialize() override
Initialize the module.
StoreObjPtr< TRGSummary > m_l1Trigger
StoreObjPtr TRGSummary
virtual void event() override
Event processor.
ECLDQMOutOfTimeDigitsModule()
< derived from HistoModule class.
virtual void beginRun() override
Call when a run begins.
std::string m_histogramDirectoryName
Histogram directory in ROOT file.
virtual ~ECLDQMOutOfTimeDigitsModule()
Destructor.
std::string getEventType()
Return type of the current event.
std::map< std::string, TH1F * > h_out_of_time
Single-value histograms to hold the average value for out-of-time ECLCalDigits.
virtual void defineHisto() override
Function to define histograms.
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.
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
@ TTYP_POIS
poisson random trigger
@ TTYP_RAND
random trigger events
const Var * getVariable(std::string name)
Get the variable belonging to the given key.
static Manager & Instance()
get singleton instance.
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.