10 #include <dqm/analysis/modules/DQMHistAnalysisECLOutOfTimeDigits.h>
23 B2DEBUG(20,
"DQMHistAnalysisECLOutOfTimeDigits: Constructor done.");
24 setDescription(
"Module to collect and process 'out of time' ECL digits");
26 std::string(
"ECL:out_of_time_digits:"));
27 addParam(
"onlyIfUpdated",
m_onlyIfUpdated,
"If true (default), update EPICS PVs only if there histograms were updated.",
35 for (
auto& event_type : {
"rand",
"dphy",
"physics"}) {
36 for (
auto& ecl_part : {
"All",
"FWDEndcap",
"Barrel",
"BWDEndcap"}) {
37 std::string pv_name = event_type + std::string(
":") + ecl_part;
45 B2DEBUG(20,
"DQMHistAnalysisECLOutOfTimeDigits: initialized.");
51 for (
auto& event_type : {
"rand",
"dphy",
"physics"}) {
52 for (
auto& ecl_part : {
"All",
"FWDEndcap",
"Barrel",
"BWDEndcap"}) {
53 std::string pv_name = event_type + std::string(
":") + ecl_part;
54 std::string var_name = pv_name;
55 std::replace(var_name.begin(), var_name.end(),
':',
'_');
59 std::string hist_name =
"ECL/out_of_time_" + var_name;
77 B2DEBUG(20,
"DQMHistAnalysisECLOutOfTimeDigits: endRun called");
79 auto main_hist = (TH1F*)
findHist(
"ECL/out_of_time_physics_All");
81 if (main_hist ==
nullptr) {
82 m_monObj->
setVariable(
"comment_out_of_time_digits",
"No ECL out-of-time ECLCalDigits histograms available");
83 B2INFO(
"Histogram named ECL/out_of_time_physics_All is not found.");
87 TF1 gaus(
"fit_func",
"gaus");
89 for (
auto& event_type : {
"rand",
"dphy",
"physics"}) {
90 for (
auto& ecl_part : {
"All",
"FWDEndcap",
"Barrel",
"BWDEndcap"}) {
91 std::string pv_name = event_type + std::string(
":") + ecl_part;
92 std::string hist_name =
"ECL/out_of_time_" + pv_name;
93 std::string var_name =
"out_of_time_digits_" + pv_name;
95 std::replace(hist_name.begin(), hist_name.end(),
':',
'_');
96 std::replace(var_name.begin(), var_name.end(),
':',
'_');
99 auto hist = (TH1F*)
findHist(hist_name);
100 if (hist && hist->GetEntries() > 1000) {
void initialize() override final
Initialize the module.
std::map< std::string, double > m_out_of_time_digits
Out-of-time ECLCalDigits for several cases.
DQMHistAnalysisECLOutOfTimeDigitsModule()
< derived from DQMHistAnalysisModule class.
std::string m_pvPrefix
Prefix to use for PVs registered by this module.
MonitoringObject * m_monObj
monitoring object
void event() override final
Event processor.
void endRun() override final
Call when a run ends.
bool m_onlyIfUpdated
If true (default), update EPICS PVs only if there were changes in the histograms.
The base class for the histogram analysis module.
int registerEpicsPV(std::string pvname, std::string keyname="", bool update_pvs=true)
EPICS related Functions.
static TH1 * findHist(const std::string &histname, bool onlyIfUpdated=false)
Get histogram from list (no other search).
void setEpicsPV(std::string keyname, double value)
Write value to a EPICS PV.
static MonitoringObject * getMonitoringObject(const std::string &histname)
Get MonitoringObject with given name (new object is created if non-existing)
int updateEpicsPVs(float timeout)
Update all EPICS PV (flush to network)
void setDescription(const std::string &description)
Sets the description of the module.
void setVariable(const std::string &var, float val, float upErr=-1., float dwErr=-1)
set value to float variable (new variable is made if not yet existing)
REG_MODULE(arichBtest)
Register the Module.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
Abstract base class for different kinds of events.