105 TH1* h_hlt =
findHist(
"softwaretrigger/total_result");
106 TH1* h_skim =
findHist(
"softwaretrigger/skim");
107 TH1* h_budget =
findHist(
"timing_statistics/fullTimeHistogram");
108 TH1* h_processing =
findHist(
"timing_statistics/processingTimeHistogram");
109 TH1* h_proc_passive =
findHist(
"timing_statistics/processingTimePassiveVeto");
110 TH1* h_proc_active =
findHist(
"timing_statistics/processingTimeNotPassiveVeto");
111 TH1* h_proc_prefilter_time =
findHist(
"timing_statistics/processingTimeNotPassiveVetoTimingCut");
112 TH1* h_proc_prefilter_cdcecl =
findHist(
"timing_statistics/processingTimeNotPassiveVetoCDCECLCut");
113 TH1* h_meantime =
findHist(
"timing_statistics/meanTimeHistogram");
114 TH1* h_budg_unit =
findHist(
"timing_statistics/fullTimeMeanPerUnitHistogram");
115 TH1* h_proc_unit =
findHist(
"timing_statistics/processingTimeMeanPerUnitHistogram");
116 TH1* h_procs =
findHist(
"timing_statistics/processesPerUnitHistogram");
117 TH1* h_l1 =
findHist(
"softwaretrigger_before_filter/hlt_unit_number");
118 TH1* h_err_flag =
findHist(
"softwaretrigger_before_filter/error_flag");
119 TH1* h_hlt_triggers =
findHist(
"softwaretrigger/filter");
120 TH1* h_l1_triggers =
findHist(
"TRGGDL/hGDL_psn_all");
121 TH1* h_l1_triggers_filt =
findHist(
"softwaretrigger/l1_total_result");
122 TH1* h_l1_cat_w_overlap =
findHist(
"TRGGDL/hGDL_psn_raw_rate_all");
123 TH1* h_l1_cat_wo_overlap =
findHist(
"TRGGDL/hGDL_psn_effect_to_l1_all");
124 TH1* h_full_mem =
findHist(
"timing_statistics/fullMemoryHistogram");
125 TCanvas* c_GDL_ana_eff_shifter =
findCanvas(
"TRGGDL/hGDL_ana_eff_shifter");
126 TH1* h_GDL_ana_eff_shifter =
nullptr;
128 if (c_GDL_ana_eff_shifter) {
129 c_GDL_ana_eff_shifter->cd();
130 h_GDL_ana_eff_shifter =
dynamic_cast<TH1*
>(gPad->GetPrimitive(
"hGDL_ana_eff_shifter"));
137 if (h_hlt) h_hlt->Draw();
139 if (h_hlt_triggers) h_hlt_triggers->Draw();
141 if (h_err_flag) h_err_flag->Draw();
146 if (h_skim) h_skim->Draw();
152 if (h_l1) h_l1->Draw();
154 if (h_budget) h_budget->Draw();
156 if (h_processing) h_processing->Draw();
158 if (h_budg_unit) h_budg_unit->Draw();
160 if (h_proc_unit) h_proc_unit->Draw();
162 if (h_meantime) h_meantime->Draw();
164 if (h_procs) h_procs->Draw();
166 if (h_full_mem) h_full_mem->Draw();
172 if (h_l1_triggers) h_l1_triggers->Draw();
174 if (h_l1_triggers_filt) h_l1_triggers_filt->Draw();
176 if (h_l1_cat_w_overlap) h_l1_cat_w_overlap->Draw();
178 if (h_l1_cat_wo_overlap) h_l1_cat_wo_overlap->Draw();
183 if (h_GDL_ana_eff_shifter) h_GDL_ana_eff_shifter->Draw();
186 if (h_hlt) n_hlt = (double)h_hlt->GetBinContent((h_hlt->GetXaxis())->FindFixBin(
"total_result"));
187 m_monObj->setVariable(
"n_hlt", n_hlt);
189 if (h_l1) n_l1 = h_l1->GetEntries();
190 m_monObj->setVariable(
"n_l1", n_l1);
192 if (h_procs) n_procs = h_procs->GetEntries();
193 m_monObj->setVariable(
"n_procs", n_procs);
197 for (
int ibin = 1; ibin < h_skim->GetXaxis()->GetNbins() + 1; ibin++) {
198 double nentr = (double)h_skim->GetBinContent(ibin);
199 std::string bin_name(h_skim->GetXaxis()->GetBinLabel(ibin));
200 m_monObj->setVariable(bin_name.replace(0, 6,
"effCS"), nentr);
206 for (
int ibin = 1; ibin < h_l1_triggers->GetXaxis()->GetNbins() + 1; ibin++) {
207 double nentr = (double)h_l1_triggers->GetBinContent(ibin);
208 std::string bin_name(h_l1_triggers->GetXaxis()->GetBinLabel(ibin));
209 if (bin_name ==
"")
continue;
210 m_monObj->setVariable(bin_name.insert(0,
"effCS_l1_"), nentr);
214 if (h_l1_triggers_filt) {
216 for (
int ibin = 1; ibin < h_l1_triggers_filt->GetXaxis()->GetNbins() + 1; ibin++) {
217 double nentr = (double)h_l1_triggers_filt->GetBinContent(ibin);
218 std::string bin_name(h_l1_triggers_filt->GetXaxis()->GetBinLabel(ibin));
219 if (bin_name ==
"")
continue;
220 m_monObj->setVariable(bin_name.insert(0,
"effCS_l1_fON_"), nentr);
224 if (h_hlt_triggers) {
226 for (
int ibin = 1; ibin < h_hlt_triggers->GetXaxis()->GetNbins() + 1; ibin++) {
227 double nentr = (double)h_hlt_triggers->GetBinContent(ibin);
228 std::string bin_name(h_hlt_triggers->GetXaxis()->GetBinLabel(ibin));
229 bin_name = std::regex_replace(bin_name, std::regex(
"=="),
"_eq_");
230 bin_name = std::regex_replace(bin_name, std::regex(
"\\."),
"_");
231 m_monObj->setVariable(bin_name.insert(0,
"effCS_hlt_"), nentr);
237 for (
int ibin = 1; ibin < h_meantime->GetXaxis()->GetNbins() + 1; ibin++) {
238 double nentr = (double)h_meantime->GetBinContent(ibin);
239 std::string bin_name(h_meantime->GetXaxis()->GetBinLabel(ibin));
240 m_monObj->setVariable(bin_name.insert(0,
"secTime_"), nentr);
246 for (
int ibin = 1; ibin < h_err_flag->GetXaxis()->GetNbins() + 1; ibin++) {
247 double nentr = (double)h_err_flag->GetBinContent(ibin);
248 std::string bin_name(h_err_flag->GetXaxis()->GetBinLabel(ibin));
249 m_monObj->setVariable(bin_name.insert(0,
"errFlag_"), nentr);
253 if (h_l1_cat_w_overlap) {
255 for (
int ibin = 1; ibin < h_l1_cat_w_overlap->GetXaxis()->GetNbins() + 1; ibin++) {
256 double nentr = (double)h_l1_cat_w_overlap->GetBinContent(ibin);
257 std::string bin_name(h_l1_cat_w_overlap->GetXaxis()->GetBinLabel(ibin));
258 m_monObj->setVariable(bin_name.insert(0,
"l1_Ov_"), nentr);
262 if (h_l1_cat_wo_overlap) {
264 for (
int ibin = 1; ibin < h_l1_cat_wo_overlap->GetXaxis()->GetNbins() + 1; ibin++) {
265 double nentr = (double)h_l1_cat_wo_overlap->GetBinContent(ibin);
266 std::string bin_name(h_l1_cat_wo_overlap->GetXaxis()->GetBinLabel(ibin));
267 m_monObj->setVariable(bin_name.insert(0,
"l1_noOv_"), nentr);
271 if (h_GDL_ana_eff_shifter) {
273 for (
int ibin = 1; ibin < h_GDL_ana_eff_shifter->GetXaxis()->GetNbins() + 1; ibin++) {
274 double nentr = (double)h_GDL_ana_eff_shifter->GetBinContent(ibin);
275 std::string bin_name(h_GDL_ana_eff_shifter->GetXaxis()->GetBinLabel(ibin));
276 m_monObj->setVariable(bin_name.insert(0,
"GDLanaEffShifter_"), nentr);
281 if (h_budget) bgt = h_budget->GetMean();
282 m_monObj->setVariable(
"budget_time", bgt);
284 m_monObj->setVariable(
"n_l1_x_budget_time", n_l1 * bgt);
286 double procTime = 0.;
287 if (h_processing) procTime = h_processing->GetMean();
288 m_monObj->setVariable(
"processing_time", procTime);
290 double procTimePassive = 0.;
291 if (h_proc_passive) procTimePassive = h_proc_passive->GetMean();
292 m_monObj->setVariable(
"processing_time_passive", procTimePassive);
294 double procTimeActive = 0.;
295 if (h_proc_active) procTimeActive = h_proc_active->GetMean();
296 m_monObj->setVariable(
"processing_time_active", procTimeActive);
298 double procTimePrefilterTiming = 0.;
299 if (h_proc_prefilter_time) procTimePrefilterTiming = h_proc_prefilter_time->GetMean();
300 m_monObj->setVariable(
"processing_time_prefilter_time", procTimePrefilterTiming);
302 double procTimePrefilterCDCECL = 0.;
303 if (h_proc_prefilter_cdcecl) procTimePrefilterCDCECL = h_proc_prefilter_cdcecl->GetMean();
304 m_monObj->setVariable(
"processing_time_prefilter_CDCECL", procTimePrefilterCDCECL);
307 double fullMemory = 0.;
308 if (h_full_mem) fullMemory = h_full_mem->GetBinLowEdge(h_full_mem->FindLastBinAbove(0) + 1);
309 m_monObj->setVariable(
"full_memory", fullMemory);
311 TH1* h_budgetUnit =
nullptr;
312 TH1* h_memoryUnit =
nullptr;
314 for (
unsigned int index = 1; index <= HLTUnits::max_hlt_units; index++) {
316 h_budgetUnit =
findHist((
"timing_statistics/fullTimePerUnitHistogram_HLT" + std::to_string(index)).c_str());
318 if (h_budgetUnit) bgunit = h_budgetUnit->GetMean();
319 m_monObj->setVariable((
"budget_time_HLT" + std::to_string(index)).c_str(), bgunit);
321 h_budgetUnit =
findHist((
"timing_statistics/processingTimePerUnitHistogram_HLT" + std::to_string(index)).c_str());
322 if (h_budgetUnit) bgunit = h_budgetUnit->GetMean();
324 m_monObj->setVariable((
"processing_time_HLT" + std::to_string(index)).c_str(), bgunit);
326 h_memoryUnit =
findHist((
"timing_statistics/fullMemoryPerUnitHistogram_HLT" + std::to_string(index)).c_str());
328 if (h_memoryUnit && bgunit > 0) memunit = h_memoryUnit->GetBinLowEdge(h_memoryUnit->FindLastBinAbove(0.) + 1);
329 m_monObj->setVariable((
"memory_HLT" + std::to_string(index)).c_str(), memunit);
335 RooMsgService::instance().setSilentMode(
true);
336 RooMsgService::instance().setGlobalKillBelow(RooFit::WARNING);
339 double nKs_active = 0;
340 double nKs_activeNotTime = 0;
341 double nKs_activeNotCDCECL = 0;
343 auto m_hKshortAllH =
findHist(
"PhysicsObjects/hist_nKshortAllH");
344 auto m_hKshortActiveH =
findHist(
"PhysicsObjects/hist_nKshortActiveH");
345 auto m_hKshortActiveNotTimeH =
findHist(
"PhysicsObjects/hist_nKshortActiveNotTimeH");
346 auto m_hKshortActiveNotCDCECLH =
findHist(
"PhysicsObjects/hist_nKshortActiveNotCDCECLH");
349 RooDataHist* KsHist_all =
new RooDataHist(
"KsHist_all",
"Histogram data", RooArgList(*
m_KsInvMass), m_hKshortAllH);
350 m_KsPdf->fitTo(*KsHist_all, RooFit::Minos(
true));
351 nKs_all =
m_sig->getValV();
354 m_monObj->setVariable(
"nKs_all_hlt", nKs_all);
356 if (m_hKshortActiveH) {
357 RooDataHist* KsHist_active =
new RooDataHist(
"KsHist_active",
"Histogram data", RooArgList(*
m_KsInvMass), m_hKshortActiveH);
358 m_KsPdf->fitTo(*KsHist_active, RooFit::Minos(
true));
359 nKs_active =
m_sig->getValV();
360 delete KsHist_active;
362 m_monObj->setVariable(
"nKs_activeVeto_hlt", nKs_active);
364 if (m_hKshortActiveNotTimeH) {
365 RooDataHist* KsHist_activeNotTime =
new RooDataHist(
"KsHist_activeNotTime",
"Histogram data", RooArgList(*
m_KsInvMass),
366 m_hKshortActiveNotTimeH);
367 m_KsPdf->fitTo(*KsHist_activeNotTime, RooFit::Minos(
true));
368 nKs_activeNotTime =
m_sig->getValV();
369 delete KsHist_activeNotTime;
371 m_monObj->setVariable(
"nKs_activeVetoPrefilterTime_hlt", nKs_activeNotTime);
373 if (m_hKshortActiveNotCDCECLH) {
374 RooDataHist* KsHist_activeNotCDCECL =
new RooDataHist(
"KsHist_activeNotCDCECL",
"Histogram data", RooArgList(*
m_KsInvMass),
375 m_hKshortActiveNotCDCECLH);
376 m_KsPdf->fitTo(*KsHist_activeNotCDCECL, RooFit::Minos(
true));
377 nKs_activeNotCDCECL =
m_sig->getValV();
378 delete KsHist_activeNotCDCECL;
381 m_monObj->setVariable(
"nKs_activeVetoPrefilterCDCECL_hlt", nKs_activeNotCDCECL);
384 B2DEBUG(20,
"DQMHistAnalysisHLTMonObj : endRun called");