10#include <dqm/analysis/modules/DQMHistAnalysisTRGGDL.h>
39 setDescription(
"Modify and analyze the data quality histograms of TRGGDL");
49 if (ca_current_context()) ca_context_destroy();
58 for (
unsigned iskim = 0; iskim <
nskim_gdldqm; iskim++) {
59 char charhist_eff[1000];
60 sprintf(charhist_eff,
"hGDL_ana_eff_%s",
skim_smap[iskim].c_str());
62 sprintf(charhist_eff,
"hGDL_ana_eff_fast_%s",
skim_smap[iskim].c_str());
64 for (
int i = 0; i <
n_eff; i++) {
65 m_h_eff[iskim]->GetXaxis()->SetBinLabel(i + 1,
c_eff[i]);
68 char charhist_c_eff[1000];
69 sprintf(charhist_c_eff,
"TRGGDL/hGDL_ana_eff_%s",
skim_smap[iskim].c_str());
70 m_c_eff[iskim] =
new TCanvas(charhist_c_eff);
71 sprintf(charhist_c_eff,
"TRGGDL/hGDL_ana_eff_fast_%s",
skim_smap[iskim].c_str());
98 if (!ca_current_context()) SEVCHK(ca_context_create(ca_disable_preemptive_callback),
"ca_context_create");
100 std::string aa =
"TRGAna:eff_shift_" + std::to_string(i);
101 SEVCHK(ca_create_channel(aa.c_str(), NULL, NULL, 10, &mychid[i]),
"ca_create_channel failure");
106 std::string aa =
"TRGAna:entry_" + std::to_string(i);
107 SEVCHK(ca_create_channel(aa.c_str(), NULL, NULL, 10, &mychid_entry[i]),
"ca_create_channel failure");
109 SEVCHK(ca_pend_io(5.0),
"ca_pend_io failure");
113 B2DEBUG(20,
"DQMHistAnalysisTRGGDL: initialized.");
120 for (
unsigned iskim = 0; iskim <
nskim_gdldqm; iskim++) {
124 sprintf(c_psn,
"TRGGDL/hGDL_psn_extra_fast_%s",
skim_smap[iskim].c_str());
128 B2WARNING(
"Histogram/canvas named TRGGDL/hGDL_psn_extra_fast is not found.");
343 for (
unsigned iskim = 0; iskim <
nskim_gdldqm; iskim++) {
347 sprintf(c_psn,
"TRGGDL/hGDL_psn_extra_%s",
skim_smap[iskim].c_str());
351 B2WARNING(
"Histogram/canvas named TRGGDL/hGDL_psn_extra is not found.");
356 if (
m_h_psn_extra[iskim]->GetBinContent(0 + 1) == 0)
continue;
357 if (
m_h_psn_extra[iskim]->GetBinContent(5 + 1) == 0)
continue;
383 if (
m_h_psn_extra[iskim]->GetBinContent(6 + 1) == 0)
continue;
453 if (
m_h_psn_extra[iskim]->GetBinContent(14 + 1) == 0)
continue;
588 B2WARNING(
"Histogram/canvas named hGDL_psn_pure_extra is not found.");
616 for (
unsigned iskim = 0; iskim <
nskim_gdldqm; iskim++) {
624 for (
unsigned iskim = 0; iskim <
nskim_gdldqm; iskim++) {
666 double eff_err_min = eff - 2 * err;
667 double eff_err_max = eff + 2 * err;
670 double eff_err_min_fast = eff_fast - 2 * err_fast;
671 double eff_err_max_fast = eff_fast + 2 * err_fast;
678 if (error_check == 1) {
752 if (mychid[i]) SEVCHK(ca_put(DBR_DOUBLE, mychid[i], (
void*)&data),
"ca_set failure");
757 B2WARNING(
"Histogram/canvas named hGDL_psn_extra is not found.");
759 B2WARNING(
"Histogram/canvas named hGDL_psn_extra is not found.");
761 if (i == 0 || i == 6) {
768 if (mychid_entry[i]) SEVCHK(ca_put(DBR_DOUBLE, mychid_entry[i], (
void*)&data),
"ca_set failure");
770 SEVCHK(ca_pend_io(5.0),
"ca_pend_io failure");
778 B2DEBUG(20,
"DQMHistAnalysisTRGGDL : endRun called");
786 if (mychid[i]) SEVCHK(ca_clear_channel(mychid[i]),
"ca_clear_channel failure");
789 if (mychid_entry[i]) SEVCHK(ca_clear_channel(mychid_entry[i]),
"ca_clear_channel failure");
791 SEVCHK(ca_pend_io(5.0),
"ca_pend_io failure");
794 B2DEBUG(20,
"terminate called");
The base class for the histogram analysis module.
static TH1 * findHist(const std::string &histname, bool onlyIfUpdated=false)
Get histogram from list (no other search).
static const std::string & getRunType(void)
Get the Run Type.
bool getUseEpics(void)
Getter for EPICS usage.
TH1D * m_h_eff_shifter_fast
Histogram for TRGGDL efficiency, simplified one for CR shifter.
void initialize() override final
Initialize the Module.
static const int n_eff_shifter
number of bins for the simplified efficiency histogram
TCanvas * m_c_eff_shifter_fast
Canvas for TRGGDL efficiency, simplified one for CR shifter.
TCanvas * m_c_eff_fast[nskim_gdldqm]
Canvas for TRGGDL efficiency in each HLT skim.
bool m_IsPhysicsRun
Run type flag for physics runs.
TH1D * m_h_eff_fast[nskim_gdldqm]
Histogram for TRGGDL efficiency in each HLT skim.
bool m_enableAlert
Enable alert by base color of canvases.
static const int nskim_gdldqm
number of HLT skims
TLine * m_line_limit_high_shifter[n_eff_shifter]
upper limit line for the simplified efficiency histogram
double m_limit_low_shifter[n_eff_shifter]
lower limit value in each bin
TH1D * m_h_pure_eff
Histogram for TRGGDL efficiency with offline selection.
TLine * m_line_limit_low_shifter[n_eff_shifter]
lower limit line for the simplified efficiency histogram
void terminate() override final
Termination action.
TH1D * m_h_eff[nskim_gdldqm]
Histogram for TRGGDL efficiency in each HLT skim.
const char * c_eff[n_eff]
label of bins for the efficiency histogram
void event() override final
Event processor.
std::string skim_smap[nskim_gdldqm]
name of HLT skims
TH1D * m_h_eff_shifter
Histogram for TRGGDL efficiency, simplified one for CR shifter.
TH1D * m_h_psn_extra_fast[nskim_gdldqm]
DQM Histogram for PSN bits in each HLT skim.
double m_limit_high_shifter[n_eff_shifter]
upper limit value in each bin
TH1D * m_h_psn_pure_extra
DQM Histogram for PSN bits with offline selection.
static const int n_pure_eff
number of bins for the efficiency histogram with offline selection
TH1D * m_h_psn_extra[nskim_gdldqm]
DQM Histogram for PSN bits in each HLT skim.
TCanvas * m_c_pure_eff
Canvas for TRGGDL efficiency with offline selection.
void endRun() override final
End-of-run action.
DQMHistAnalysisTRGGDLModule()
Constructor.
TCanvas * m_c_eff[nskim_gdldqm]
Canvas for TRGGDL efficiency in each HLT skim.
const char * c_pure_eff[n_pure_eff]
label of bins for the efficiency histogram with offline selection
~DQMHistAnalysisTRGGDLModule()
Destructor.
TCanvas * m_c_eff_shifter
Canvas for TRGGDL efficiency, simplified one for CR shifter.
static const int n_eff
number of bins for the efficiency histogram
const char * c_eff_shifter[n_eff_shifter]
label of bins for the simplified efficiency histogram
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...
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.
double sqrt(double a)
sqrt for double
Abstract base class for different kinds of events.