104 TH1* h_hlt =
findHist(
"softwaretrigger/total_result");
105 TH1* h_skim =
findHist(
"softwaretrigger/skim");
106 TH1* h_budget =
findHist(
"timing_statistics/fullTimeHistogram");
107 TH1* h_processing =
findHist(
"timing_statistics/processingTimeHistogram");
108 TH1* h_proc_passive =
findHist(
"timing_statistics/processingTimePassiveVeto");
109 TH1* h_proc_active =
findHist(
"timing_statistics/processingTimeNotPassiveVeto");
110 TH1* h_proc_prefilter_time =
findHist(
"timing_statistics/processingTimeNotPassiveVetoTimingCut");
111 TH1* h_proc_prefilter_cdcecl =
findHist(
"timing_statistics/processingTimeNotPassiveVetoCDCECLCut");
112 TH1* h_meantime =
findHist(
"timing_statistics/meanTimeHistogram");
113 TH1* h_budg_unit =
findHist(
"timing_statistics/fullTimeMeanPerUnitHistogram");
114 TH1* h_proc_unit =
findHist(
"timing_statistics/processingTimeMeanPerUnitHistogram");
115 TH1* h_procs =
findHist(
"timing_statistics/processesPerUnitHistogram");
116 TH1* h_l1 =
findHist(
"softwaretrigger_before_filter/hlt_unit_number");
117 TH1* h_err_flag =
findHist(
"softwaretrigger_before_filter/error_flag");
118 TH1* h_hlt_triggers =
findHist(
"softwaretrigger/filter");
119 TH1* h_l1_triggers =
findHist(
"TRGGDL/hGDL_psn_all");
120 TH1* h_l1_triggers_filt =
findHist(
"softwaretrigger/l1_total_result");
121 TH1* h_l1_cat_w_overlap =
findHist(
"TRGGDL/hGDL_psn_raw_rate_all");
122 TH1* h_l1_cat_wo_overlap =
findHist(
"TRGGDL/hGDL_psn_effect_to_l1_all");
123 TH1* h_full_mem =
findHist(
"timing_statistics/fullMemoryHistogram");
124 TCanvas* c_GDL_ana_eff_shifter =
findCanvas(
"TRGGDL/hGDL_ana_eff_shifter");
125 TH1* h_GDL_ana_eff_shifter =
nullptr;
127 if (c_GDL_ana_eff_shifter) {
128 c_GDL_ana_eff_shifter->cd();
129 h_GDL_ana_eff_shifter =
dynamic_cast<TH1*
>(gPad->GetPrimitive(
"hGDL_ana_eff_shifter"));
136 if (h_hlt) h_hlt->Draw();
138 if (h_hlt_triggers) h_hlt_triggers->Draw();
140 if (h_err_flag) h_err_flag->Draw();
145 if (h_skim) h_skim->Draw();
151 if (h_l1) h_l1->Draw();
153 if (h_budget) h_budget->Draw();
155 if (h_processing) h_processing->Draw();
157 if (h_budg_unit) h_budg_unit->Draw();
159 if (h_proc_unit) h_proc_unit->Draw();
161 if (h_meantime) h_meantime->Draw();
163 if (h_procs) h_procs->Draw();
165 if (h_full_mem) h_full_mem->Draw();
171 if (h_l1_triggers) h_l1_triggers->Draw();
173 if (h_l1_triggers_filt) h_l1_triggers_filt->Draw();
175 if (h_l1_cat_w_overlap) h_l1_cat_w_overlap->Draw();
177 if (h_l1_cat_wo_overlap) h_l1_cat_wo_overlap->Draw();
182 if (h_GDL_ana_eff_shifter) h_GDL_ana_eff_shifter->Draw();
185 if (h_hlt) n_hlt = (double)h_hlt->GetBinContent((h_hlt->GetXaxis())->FindFixBin(
"total_result"));
186 m_monObj->setVariable(
"n_hlt", n_hlt);
190 n_l1 = h_l1->GetEntries();
191 m_monObj->setVariable(
"n_l1", n_l1);
192 for (
int i = 2; i <= h_l1->GetXaxis()->GetNbins(); i++) {
193 std::string label =
"n_l1_HLT" + std::to_string(i - 1);
194 m_monObj->setVariable(label, h_l1->GetBinContent(i));
199 m_monObj->setVariable(
"n_procs", h_procs->GetEntries());
200 for (
int i = 2; i <= h_procs->GetXaxis()->GetNbins(); i++) {
201 std::string label =
"n_procs_HLT" + std::to_string(i - 1);
202 m_monObj->setVariable(label, h_procs->GetBinContent(i));
208 for (
int ibin = 1; ibin < h_skim->GetXaxis()->GetNbins() + 1; ibin++) {
209 double nentr = (double)h_skim->GetBinContent(ibin);
210 std::string bin_name(h_skim->GetXaxis()->GetBinLabel(ibin));
211 m_monObj->setVariable(bin_name.replace(0, 6,
"effCS"), nentr);
217 for (
int ibin = 1; ibin < h_l1_triggers->GetXaxis()->GetNbins() + 1; ibin++) {
218 double nentr = (double)h_l1_triggers->GetBinContent(ibin);
219 std::string bin_name(h_l1_triggers->GetXaxis()->GetBinLabel(ibin));
220 if (bin_name ==
"")
continue;
221 m_monObj->setVariable(bin_name.insert(0,
"effCS_l1_"), nentr);
225 if (h_l1_triggers_filt) {
227 for (
int ibin = 1; ibin < h_l1_triggers_filt->GetXaxis()->GetNbins() + 1; ibin++) {
228 double nentr = (double)h_l1_triggers_filt->GetBinContent(ibin);
229 std::string bin_name(h_l1_triggers_filt->GetXaxis()->GetBinLabel(ibin));
230 if (bin_name ==
"")
continue;
231 m_monObj->setVariable(bin_name.insert(0,
"effCS_l1_fON_"), nentr);
235 if (h_hlt_triggers) {
237 for (
int ibin = 1; ibin < h_hlt_triggers->GetXaxis()->GetNbins() + 1; ibin++) {
238 double nentr = (double)h_hlt_triggers->GetBinContent(ibin);
239 std::string bin_name(h_hlt_triggers->GetXaxis()->GetBinLabel(ibin));
240 bin_name = std::regex_replace(bin_name, std::regex(
"=="),
"_eq_");
241 bin_name = std::regex_replace(bin_name, std::regex(
"\\."),
"_");
242 m_monObj->setVariable(bin_name.insert(0,
"effCS_hlt_"), nentr);
248 for (
int ibin = 1; ibin < h_meantime->GetXaxis()->GetNbins() + 1; ibin++) {
249 double nentr = (double)h_meantime->GetBinContent(ibin);
250 std::string bin_name(h_meantime->GetXaxis()->GetBinLabel(ibin));
251 m_monObj->setVariable(bin_name.insert(0,
"secTime_"), nentr);
257 for (
int ibin = 1; ibin < h_err_flag->GetXaxis()->GetNbins() + 1; ibin++) {
258 double nentr = (double)h_err_flag->GetBinContent(ibin);
259 std::string bin_name(h_err_flag->GetXaxis()->GetBinLabel(ibin));
260 m_monObj->setVariable(bin_name.insert(0,
"errFlag_"), nentr);
264 if (h_l1_cat_w_overlap) {
266 for (
int ibin = 1; ibin < h_l1_cat_w_overlap->GetXaxis()->GetNbins() + 1; ibin++) {
267 double nentr = (double)h_l1_cat_w_overlap->GetBinContent(ibin);
268 std::string bin_name(h_l1_cat_w_overlap->GetXaxis()->GetBinLabel(ibin));
269 m_monObj->setVariable(bin_name.insert(0,
"l1_Ov_"), nentr);
273 if (h_l1_cat_wo_overlap) {
275 for (
int ibin = 1; ibin < h_l1_cat_wo_overlap->GetXaxis()->GetNbins() + 1; ibin++) {
276 double nentr = (double)h_l1_cat_wo_overlap->GetBinContent(ibin);
277 std::string bin_name(h_l1_cat_wo_overlap->GetXaxis()->GetBinLabel(ibin));
278 m_monObj->setVariable(bin_name.insert(0,
"l1_noOv_"), nentr);
282 if (h_GDL_ana_eff_shifter) {
284 for (
int ibin = 1; ibin < h_GDL_ana_eff_shifter->GetXaxis()->GetNbins() + 1; ibin++) {
285 double nentr = (double)h_GDL_ana_eff_shifter->GetBinContent(ibin);
286 std::string bin_name(h_GDL_ana_eff_shifter->GetXaxis()->GetBinLabel(ibin));
287 m_monObj->setVariable(bin_name.insert(0,
"GDLanaEffShifter_"), nentr);
292 if (h_budget) bgt = h_budget->GetMean();
293 m_monObj->setVariable(
"budget_time", bgt);
295 m_monObj->setVariable(
"n_l1_x_budget_time", n_l1 * bgt);
297 double procTime = 0.;
298 if (h_processing) procTime = h_processing->GetMean();
299 m_monObj->setVariable(
"processing_time", procTime);
301 double procTimePassive = 0.;
302 if (h_proc_passive) procTimePassive = h_proc_passive->GetMean();
303 m_monObj->setVariable(
"processing_time_passive", procTimePassive);
305 double procTimeActive = 0.;
306 if (h_proc_active) procTimeActive = h_proc_active->GetMean();
307 m_monObj->setVariable(
"processing_time_active", procTimeActive);
309 double procTimePrefilterTiming = 0.;
310 if (h_proc_prefilter_time) procTimePrefilterTiming = h_proc_prefilter_time->GetMean();
311 m_monObj->setVariable(
"processing_time_prefilter_time", procTimePrefilterTiming);
313 double procTimePrefilterCDCECL = 0.;
314 if (h_proc_prefilter_cdcecl) procTimePrefilterCDCECL = h_proc_prefilter_cdcecl->GetMean();
315 m_monObj->setVariable(
"processing_time_prefilter_CDCECL", procTimePrefilterCDCECL);
317 double nEventsPassive = 0.;
318 if (h_proc_passive) nEventsPassive = h_proc_passive->GetEntries();
319 m_monObj->setVariable(
"N_events_passive", nEventsPassive);
321 double nEventsActive = 0.;
322 if (h_proc_active) nEventsActive = h_proc_active->GetEntries();
323 m_monObj->setVariable(
"N_events_active", nEventsActive);
325 double nEventsPrefilterTiming = 0.;
326 if (h_proc_prefilter_time) nEventsPrefilterTiming = h_proc_prefilter_time->GetEntries();
327 m_monObj->setVariable(
"N_events_prefilter_time", nEventsPrefilterTiming);
329 double nEventsPrefilterCDCECL = 0.;
330 if (h_proc_prefilter_cdcecl) nEventsPrefilterCDCECL = h_proc_prefilter_cdcecl->GetEntries();
331 m_monObj->setVariable(
"N_events_prefilter_CDCECL", nEventsPrefilterCDCECL);
334 double fullMemory = 0.;
335 if (h_full_mem) fullMemory = h_full_mem->GetBinLowEdge(h_full_mem->FindLastBinAbove(0) + 1);
336 m_monObj->setVariable(
"full_memory", fullMemory);
338 TH1* h_budgetUnit =
nullptr;
339 TH1* h_memoryUnit =
nullptr;
341 for (
unsigned int index = 1; index <= HLTUnits::max_hlt_units; index++) {
343 h_budgetUnit =
findHist((
"timing_statistics/fullTimePerUnitHistogram_HLT" + std::to_string(index)).c_str());
345 if (h_budgetUnit) bgunit = h_budgetUnit->GetMean();
346 m_monObj->setVariable((
"budget_time_HLT" + std::to_string(index)).c_str(), bgunit);
348 h_budgetUnit =
findHist((
"timing_statistics/processingTimePerUnitHistogram_HLT" + std::to_string(index)).c_str());
349 if (h_budgetUnit) bgunit = h_budgetUnit->GetMean();
351 m_monObj->setVariable((
"processing_time_HLT" + std::to_string(index)).c_str(), bgunit);
353 h_memoryUnit =
findHist((
"timing_statistics/fullMemoryPerUnitHistogram_HLT" + std::to_string(index)).c_str());
355 if (h_memoryUnit && bgunit > 0) memunit = h_memoryUnit->GetBinLowEdge(h_memoryUnit->FindLastBinAbove(0.) + 1);
356 m_monObj->setVariable((
"memory_HLT" + std::to_string(index)).c_str(), memunit);
362 RooMsgService::instance().setSilentMode(
true);
363 RooMsgService::instance().setGlobalKillBelow(RooFit::WARNING);
366 double nKs_uncertainty_all = 0;
367 double nKs_active = 0;
368 double nKs_activeNotTime = 0;
369 double nKs_activeNotCDCECL = 0;
371 auto m_hKshortAllH =
findHist(
"PhysicsObjects/hist_nKshortAllH");
372 auto m_hKshortActiveH =
findHist(
"PhysicsObjects/hist_nKshortActiveH");
373 auto m_hKshortActiveNotTimeH =
findHist(
"PhysicsObjects/hist_nKshortActiveNotTimeH");
374 auto m_hKshortActiveNotCDCECLH =
findHist(
"PhysicsObjects/hist_nKshortActiveNotCDCECLH");
378 RooPlot* m_KshortAll_frame =
380 m_KshortAll_frame->GetXaxis()->SetTitle(
"M_{#pi^{+}#pi^{-}} [GeV/c^{2}]");
381 m_KshortAll_frame->GetYaxis()->SetTitle(
"Candidates / (2 MeV/c^{2})");
383 RooPlot* m_KshortActive_frame =
385 m_KshortActive_frame->GetXaxis()->SetTitle(
"M_{#pi^{+}#pi^{-}} [GeV/c^{2}]");
386 m_KshortActive_frame->GetYaxis()->SetTitle(
"Candidates / (2 MeV/c^{2})");
388 RooPlot* m_KshortActiveNotTime_frame =
389 m_KsInvMass->frame(RooFit::Title(
"Active veto (Prefilter Time)"));
390 m_KshortActiveNotTime_frame->GetXaxis()->SetTitle(
"M_{#pi^{+}#pi^{-}} [GeV/c^{2}]");
391 m_KshortActiveNotTime_frame->GetYaxis()->SetTitle(
"Candidates / (2 MeV/c^{2})");
393 RooPlot* m_KshortActiveNotCDCECL_frame =
394 m_KsInvMass->frame(RooFit::Title(
"Active veto (Prefilter CDC+ECL)"));
395 m_KshortActiveNotCDCECL_frame->GetXaxis()->SetTitle(
"M_{#pi^{+}#pi^{-}} [GeV/c^{2}]");
396 m_KshortActiveNotCDCECL_frame->GetYaxis()->SetTitle(
"Candidates / (2 MeV/c^{2})");
399 RooDataHist* KsHist_all =
new RooDataHist(
"KsHist_all",
"Histogram data", RooArgList(*
m_KsInvMass), m_hKshortAllH);
400 m_KsPdf->fitTo(*KsHist_all, RooFit::Minos(
true));
401 nKs_all =
m_sig->getValV();
402 nKs_uncertainty_all =
m_sig->getError();
403 KsHist_all->plotOn(m_KshortAll_frame) ;
404 m_KsPdf->plotOn(m_KshortAll_frame);
405 m_KsPdf->paramOn(m_KshortAll_frame, RooFit::Layout(0.6, 0.9, 0.9));
408 m_monObj->setVariable(
"nKs_all_hlt", nKs_all);
409 m_monObj->setVariable(
"nKs_uncertainty_all_hlt", nKs_uncertainty_all);
411 if (m_hKshortActiveH) {
412 RooDataHist* KsHist_active =
new RooDataHist(
"KsHist_active",
"Histogram data", RooArgList(*
m_KsInvMass), m_hKshortActiveH);
413 m_KsPdf->fitTo(*KsHist_active, RooFit::Minos(
true));
414 nKs_active =
m_sig->getValV();
415 KsHist_active->plotOn(m_KshortActive_frame) ;
416 m_KsPdf->plotOn(m_KshortActive_frame);
417 m_KsPdf->paramOn(m_KshortActive_frame, RooFit::Layout(0.6, 0.9, 0.9));
418 delete KsHist_active;
420 m_monObj->setVariable(
"nKs_activeVeto_hlt", nKs_active);
422 if (m_hKshortActiveNotTimeH) {
423 RooDataHist* KsHist_activeNotTime =
new RooDataHist(
"KsHist_activeNotTime",
"Histogram data", RooArgList(*
m_KsInvMass),
424 m_hKshortActiveNotTimeH);
425 m_KsPdf->fitTo(*KsHist_activeNotTime, RooFit::Minos(
true));
426 nKs_activeNotTime =
m_sig->getValV();
427 KsHist_activeNotTime->plotOn(m_KshortActiveNotTime_frame) ;
428 m_KsPdf->plotOn(m_KshortActiveNotTime_frame);
429 m_KsPdf->paramOn(m_KshortActiveNotTime_frame, RooFit::Layout(0.6, 0.9, 0.9));
430 delete KsHist_activeNotTime;
432 m_monObj->setVariable(
"nKs_activeVetoPrefilterTime_hlt", nKs_activeNotTime);
434 if (m_hKshortActiveNotCDCECLH) {
435 RooDataHist* KsHist_activeNotCDCECL =
new RooDataHist(
"KsHist_activeNotCDCECL",
"Histogram data", RooArgList(*
m_KsInvMass),
436 m_hKshortActiveNotCDCECLH);
437 m_KsPdf->fitTo(*KsHist_activeNotCDCECL, RooFit::Minos(
true));
438 nKs_activeNotCDCECL =
m_sig->getValV();
439 KsHist_activeNotCDCECL->plotOn(m_KshortActiveNotCDCECL_frame) ;
440 m_KsPdf->plotOn(m_KshortActiveNotCDCECL_frame);
441 m_KsPdf->paramOn(m_KshortActiveNotCDCECL_frame, RooFit::Layout(0.6, 0.9, 0.9));
442 delete KsHist_activeNotCDCECL;
444 m_monObj->setVariable(
"nKs_activeVetoPrefilterCDCECL_hlt", nKs_activeNotCDCECL);
452 m_KshortAll_frame->Draw();
454 m_KshortActive_frame->Draw();
456 m_KshortActiveNotTime_frame->Draw();
458 m_KshortActiveNotCDCECL_frame->Draw();
460 B2DEBUG(20,
"DQMHistAnalysisHLTMonObj : endRun called");