10#include <dqm/analysis/modules/DQMHistAnalysisHLTMonObj.h>
13#include <hlt/utilities/Units.h>
30 setDescription(
"Produces MonitoringObject for the HLT from the available DQM histograms");
45 m_c_filter =
new TCanvas(
"Filter",
"filter", 750, 400);
46 m_c_skim =
new TCanvas(
"Skim",
"skim", 400, 400);
47 m_c_hardware =
new TCanvas(
"Hardware",
"hardware", 1000, 1000);
48 m_c_l1 =
new TCanvas(
"L1",
"l1", 750, 400);
64 TH1* h_hlt =
findHist(
"softwaretrigger/total_result");
65 TH1* h_skim =
findHist(
"softwaretrigger/skim");
66 TH1* h_budget =
findHist(
"timing_statistics/fullTimeHistogram");
67 TH1* h_processing =
findHist(
"timing_statistics/processingTimeHistogram");
68 TH1* h_meantime =
findHist(
"timing_statistics/meanTimeHistogram");
69 TH1* h_budg_unit =
findHist(
"timing_statistics/fullTimeMeanPerUnitHistogram");
70 TH1* h_proc_unit =
findHist(
"timing_statistics/processingTimeMeanPerUnitHistogram");
71 TH1* h_procs =
findHist(
"timing_statistics/processesPerUnitHistogram");
72 TH1* h_l1 =
findHist(
"softwaretrigger_before_filter/hlt_unit_number");
73 TH1* h_err_flag =
findHist(
"softwaretrigger_before_filter/error_flag");
74 TH1* h_hlt_triggers =
findHist(
"softwaretrigger/filter");
75 TH1* h_l1_triggers =
findHist(
"TRGGDL/hGDL_psn_all");
76 TH1* h_l1_triggers_filt =
findHist(
"softwaretrigger/l1_total_result");
77 TH1* h_l1_cat_w_overlap =
findHist(
"TRGGDL/hGDL_psn_raw_rate_all");
78 TH1* h_l1_cat_wo_overlap =
findHist(
"TRGGDL/hGDL_psn_effect_to_l1_all");
79 TH1* h_full_mem =
findHist(
"timing_statistics/fullMemoryHistogram");
80 TCanvas* c_GDL_ana_eff_shifter =
findCanvas(
"TRGGDL/hGDL_ana_eff_shifter");
81 TH1* h_GDL_ana_eff_shifter =
nullptr;
83 if (c_GDL_ana_eff_shifter) {
84 c_GDL_ana_eff_shifter->cd();
85 h_GDL_ana_eff_shifter =
dynamic_cast<TH1*
>(gPad->GetPrimitive(
"hGDL_ana_eff_shifter"));
92 if (h_hlt) h_hlt->Draw();
94 if (h_hlt_triggers) h_hlt_triggers->Draw();
96 if (h_err_flag) h_err_flag->Draw();
101 if (h_skim) h_skim->Draw();
107 if (h_l1) h_l1->Draw();
109 if (h_budget) h_budget->Draw();
111 if (h_processing) h_processing->Draw();
113 if (h_budg_unit) h_budg_unit->Draw();
115 if (h_proc_unit) h_proc_unit->Draw();
117 if (h_meantime) h_meantime->Draw();
119 if (h_procs) h_procs->Draw();
121 if (h_full_mem) h_full_mem->Draw();
127 if (h_l1_triggers) h_l1_triggers->Draw();
129 if (h_l1_triggers_filt) h_l1_triggers_filt->Draw();
131 if (h_l1_cat_w_overlap) h_l1_cat_w_overlap->Draw();
133 if (h_l1_cat_wo_overlap) h_l1_cat_wo_overlap->Draw();
138 if (h_GDL_ana_eff_shifter) h_GDL_ana_eff_shifter->Draw();
141 if (h_hlt) n_hlt = (double)h_hlt->GetBinContent((h_hlt->GetXaxis())->FindFixBin(
"total_result"));
144 if (h_l1) n_l1 = h_l1->GetEntries();
147 if (h_procs) n_procs = h_procs->GetEntries();
152 for (
int ibin = 1; ibin < h_skim->GetXaxis()->GetNbins() + 1; ibin++) {
153 double nentr = (double)h_skim->GetBinContent(ibin);
154 std::string bin_name(h_skim->GetXaxis()->GetBinLabel(ibin));
161 for (
int ibin = 1; ibin < h_l1_triggers->GetXaxis()->GetNbins() + 1; ibin++) {
162 double nentr = (double)h_l1_triggers->GetBinContent(ibin);
163 std::string bin_name(h_l1_triggers->GetXaxis()->GetBinLabel(ibin));
164 if (bin_name ==
"")
continue;
169 if (h_l1_triggers_filt) {
171 for (
int ibin = 1; ibin < h_l1_triggers_filt->GetXaxis()->GetNbins() + 1; ibin++) {
172 double nentr = (double)h_l1_triggers_filt->GetBinContent(ibin);
173 std::string bin_name(h_l1_triggers_filt->GetXaxis()->GetBinLabel(ibin));
174 if (bin_name ==
"")
continue;
179 if (h_hlt_triggers) {
181 for (
int ibin = 1; ibin < h_hlt_triggers->GetXaxis()->GetNbins() + 1; ibin++) {
182 double nentr = (double)h_hlt_triggers->GetBinContent(ibin);
183 std::string bin_name(h_hlt_triggers->GetXaxis()->GetBinLabel(ibin));
184 bin_name = std::regex_replace(bin_name, std::regex(
"=="),
"_eq_");
185 bin_name = std::regex_replace(bin_name, std::regex(
"\\."),
"_");
192 for (
int ibin = 1; ibin < h_meantime->GetXaxis()->GetNbins() + 1; ibin++) {
193 double nentr = (double)h_meantime->GetBinContent(ibin);
194 std::string bin_name(h_meantime->GetXaxis()->GetBinLabel(ibin));
201 for (
int ibin = 1; ibin < h_err_flag->GetXaxis()->GetNbins() + 1; ibin++) {
202 double nentr = (double)h_err_flag->GetBinContent(ibin);
203 std::string bin_name(h_err_flag->GetXaxis()->GetBinLabel(ibin));
208 if (h_l1_cat_w_overlap) {
210 for (
int ibin = 1; ibin < h_l1_cat_w_overlap->GetXaxis()->GetNbins() + 1; ibin++) {
211 double nentr = (double)h_l1_cat_w_overlap->GetBinContent(ibin);
212 std::string bin_name(h_l1_cat_w_overlap->GetXaxis()->GetBinLabel(ibin));
217 if (h_l1_cat_wo_overlap) {
219 for (
int ibin = 1; ibin < h_l1_cat_wo_overlap->GetXaxis()->GetNbins() + 1; ibin++) {
220 double nentr = (double)h_l1_cat_wo_overlap->GetBinContent(ibin);
221 std::string bin_name(h_l1_cat_wo_overlap->GetXaxis()->GetBinLabel(ibin));
226 if (h_GDL_ana_eff_shifter) {
228 for (
int ibin = 1; ibin < h_GDL_ana_eff_shifter->GetXaxis()->GetNbins() + 1; ibin++) {
229 double nentr = (double)h_GDL_ana_eff_shifter->GetBinContent(ibin);
230 std::string bin_name(h_GDL_ana_eff_shifter->GetXaxis()->GetBinLabel(ibin));
236 if (h_budget) bgt = h_budget->GetMean();
241 double procTime = 0.;
242 if (h_processing) procTime = h_processing->GetMean();
245 double fullMemory = 0.;
246 if (h_full_mem) fullMemory = h_full_mem->GetBinLowEdge(h_full_mem->FindLastBinAbove(0) + 1);
249 TH1* h_budgetUnit =
nullptr;
250 TH1* h_memoryUnit =
nullptr;
252 for (
unsigned int index = 1; index <= HLTUnits::max_hlt_units; index++) {
254 h_budgetUnit =
findHist((
"timing_statistics/fullTimePerUnitHistogram_HLT" + std::to_string(index)).c_str());
256 if (h_budgetUnit) bgunit = h_budgetUnit->GetMean();
259 h_budgetUnit =
findHist((
"timing_statistics/processingTimePerUnitHistogram_HLT" + std::to_string(index)).c_str());
260 if (h_budgetUnit) bgunit = h_budgetUnit->GetMean();
264 h_memoryUnit =
findHist((
"timing_statistics/fullMemoryPerUnitHistogram_HLT" + std::to_string(index)).c_str());
266 if (h_memoryUnit && bgunit > 0) memunit = h_memoryUnit->GetBinLowEdge(h_memoryUnit->FindLastBinAbove(0.) + 1);
270 B2DEBUG(20,
"DQMHistAnalysisHLTMonObj : endRun called");
275 B2DEBUG(20,
"terminate called");
TCanvas * m_c_ana_eff_shifter
Canvas with histogram related to ana_eff_shifter.
TCanvas * m_c_skim
Canvas with histograms related to HLT skims.
void initialize() override final
Initialize the Module.
TCanvas * m_c_l1
Canvas with histograms related to L1.
DQMHistAnalysisHLTMonObjModule()
Constructor.
MonitoringObject * m_monObj
MonitoringObject to be produced by this module.
void terminate() override final
Termination action.
TCanvas * m_c_filter
Canvas with histograms related to HLT filter.
void endRun() override final
End-of-run action.
~DQMHistAnalysisHLTMonObjModule()
Destructor.
TCanvas * m_c_hardware
Canvas with histograms related to HLT hardware.
The base class for the histogram analysis module.
TCanvas * findCanvas(TString cname)
Find canvas by name.
static MonitoringObject * getMonitoringObject(const std::string &name)
Get MonitoringObject with given name (new object is created if non-existing)
static TH1 * findHist(const std::string &histname, bool onlyIfUpdated=false)
Get histogram from list (no other search).
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 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)
void addCanvas(TCanvas *canv)
Add Canvas to monitoring object.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.