10 #include <dqm/analysis/modules/DQMHistAnalysisTRGGDL.h>
13 #include <dqm/analysis/modules/DQMHistAnalysis.h>
18 #include <TPaveText.h>
38 DQMHistAnalysisTRGGDLModule::DQMHistAnalysisTRGGDLModule()
42 setDescription(
"Modify and analyze the data quality histograms of TRGGDL");
53 if (ca_current_context()) ca_context_destroy();
62 for (
unsigned iskim = 0; iskim <
nskim_gdldqm; iskim++) {
63 char charhist_eff[1000];
64 sprintf(charhist_eff,
"hGDL_ana_eff_%s",
skim_smap[iskim].c_str());
66 sprintf(charhist_eff,
"hGDL_ana_eff_fast_%s",
skim_smap[iskim].c_str());
68 for (
int i = 0; i <
n_eff; i++) {
69 m_h_eff[iskim]->GetXaxis()->SetBinLabel(i + 1,
c_eff[i]);
72 char charhist_c_eff[1000];
73 sprintf(charhist_c_eff,
"TRGGDL/hGDL_ana_eff_%s",
skim_smap[iskim].c_str());
74 m_c_eff[iskim] =
new TCanvas(charhist_c_eff);
75 sprintf(charhist_c_eff,
"TRGGDL/hGDL_ana_eff_fast_%s",
skim_smap[iskim].c_str());
104 if (!ca_current_context()) SEVCHK(ca_context_create(ca_disable_preemptive_callback),
"ca_context_create");
106 std::string aa =
"TRGAna:eff_shift_" + std::to_string(i);
107 SEVCHK(ca_create_channel(aa.c_str(), NULL, NULL, 10, &mychid[i]),
"ca_create_channel failure");
112 std::string aa =
"TRGAna:entry_" + std::to_string(i);
113 SEVCHK(ca_create_channel(aa.c_str(), NULL, NULL, 10, &mychid_entry[i]),
"ca_create_channel failure");
115 SEVCHK(ca_pend_io(5.0),
"ca_pend_io failure");
119 B2DEBUG(20,
"DQMHistAnalysisTRGGDL: initialized.");
129 for (
unsigned iskim = 0; iskim <
nskim_gdldqm; iskim++) {
133 sprintf(c_psn,
"TRGGDL/hGDL_psn_extra_fast_%s",
skim_smap[iskim].c_str());
137 B2WARNING(
"Histogram/canvas named TRGGDL/hGDL_psn_extra_fast is not found.");
352 for (
unsigned iskim = 0; iskim <
nskim_gdldqm; iskim++) {
356 sprintf(c_psn,
"TRGGDL/hGDL_psn_extra_%s",
skim_smap[iskim].c_str());
360 B2WARNING(
"Histogram/canvas named TRGGDL/hGDL_psn_extra is not found.");
365 if (
m_h_psn_extra[iskim]->GetBinContent(0 + 1) == 0)
continue;
366 if (
m_h_psn_extra[iskim]->GetBinContent(5 + 1) == 0)
continue;
392 if (
m_h_psn_extra[iskim]->GetBinContent(6 + 1) == 0)
continue;
462 if (
m_h_psn_extra[iskim]->GetBinContent(14 + 1) == 0)
continue;
597 B2WARNING(
"Histogram/canvas named hGDL_psn_pure_extra is not found.");
625 for (
unsigned iskim = 0; iskim <
nskim_gdldqm; iskim++) {
633 for (
unsigned iskim = 0; iskim <
nskim_gdldqm; iskim++) {
675 double eff_err_min = eff - 2 * err;
676 double eff_err_max = eff + 2 * err;
679 double eff_err_min_fast = eff_fast - 2 * err_fast;
680 double eff_err_max_fast = eff_fast + 2 * err_fast;
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)
Find histogram.
TH1D * m_h_eff_shifter_fast
Histogram for TRGGDL efficiency, simplified one for CR shifter.
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.
virtual void initialize() override
Initialize the Module.
TH1D * m_h_eff_fast[nskim_gdldqm]
Histogram for TRGGDL efficiency in each HLT skim.
TH1 * m_rtype
histogram from DQMInfo with runtype
bool m_enableAlert
Enable alert by base color of canvases.
TString m_runtype
string with runtype: physics or cosmic
static const int nskim_gdldqm
number of HLT skims
virtual void event() override
Event processor.
TLine * m_line_limit_high_shifter[n_eff_shifter]
upper limit line for the simplified efficiency histogram
virtual void endRun() override
End-of-run action.
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.
virtual void terminate() override
Termination action.
TLine * m_line_limit_low_shifter[n_eff_shifter]
lower limit line for the simplified efficiency histogram
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
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.
virtual void beginRun() override
Called when entering a new run.
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.
bool m_useEpics
flag if to export to EPICS
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
virtual ~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.
Abstract base class for different kinds of events.