108 TH1* h_hlt =
findHist(
"softwaretrigger/total_result");
109 TH1* h_skim =
findHist(
"softwaretrigger/skim");
110 TH1* h_budget =
findHist(
"timing_statistics/fullTimeHistogram");
111 TH1* h_processing =
findHist(
"timing_statistics/processingTimeHistogram");
112 TH1* h_proc_passive =
findHist(
"timing_statistics/processingTimePassiveVeto");
113 TH1* h_proc_active =
findHist(
"timing_statistics/processingTimeNotPassiveVeto");
114 TH1* h_proc_prefilter_time =
findHist(
"timing_statistics/processingTimeNotPassiveVetoTimingCut");
115 TH1* h_proc_prefilter_cdcecl =
findHist(
"timing_statistics/processingTimeNotPassiveVetoCDCECLCut");
116 TH1* h_meantime =
findHist(
"timing_statistics/meanTimeHistogram");
117 TH1* h_budg_unit =
findHist(
"timing_statistics/fullTimeMeanPerUnitHistogram");
118 TH1* h_proc_unit =
findHist(
"timing_statistics/processingTimeMeanPerUnitHistogram");
119 TH1* h_procs =
findHist(
"timing_statistics/processesPerUnitHistogram");
120 TH1* h_l1 =
findHist(
"softwaretrigger_before_filter/hlt_unit_number");
121 TH1* h_err_flag =
findHist(
"softwaretrigger_before_filter/error_flag");
122 TH1* h_hlt_triggers =
findHist(
"softwaretrigger/filter");
123 TH1* h_l1_triggers =
findHist(
"TRGGDL/hGDL_psn_all");
124 TH1* h_l1_triggers_filt =
findHist(
"softwaretrigger/l1_total_result");
125 TH1* h_l1_cat_w_overlap =
findHist(
"TRGGDL/hGDL_psn_raw_rate_all");
126 TH1* h_l1_cat_wo_overlap =
findHist(
"TRGGDL/hGDL_psn_effect_to_l1_all");
127 TH1* h_full_mem =
findHist(
"timing_statistics/fullMemoryHistogram");
128 TCanvas* c_GDL_ana_eff_shifter =
findCanvas(
"TRGGDL/hGDL_ana_eff_shifter");
129 TH1* h_GDL_ana_eff_shifter =
nullptr;
131 if (c_GDL_ana_eff_shifter) {
132 c_GDL_ana_eff_shifter->cd();
133 h_GDL_ana_eff_shifter =
dynamic_cast<TH1*
>(gPad->GetPrimitive(
"hGDL_ana_eff_shifter"));
140 if (h_hlt) h_hlt->Draw();
142 if (h_hlt_triggers) h_hlt_triggers->Draw();
144 if (h_err_flag) h_err_flag->Draw();
149 if (h_skim) h_skim->Draw();
155 if (h_l1) h_l1->Draw();
157 if (h_budget) h_budget->Draw();
159 if (h_processing) h_processing->Draw();
161 if (h_budg_unit) h_budg_unit->Draw();
163 if (h_proc_unit) h_proc_unit->Draw();
165 if (h_meantime) h_meantime->Draw();
167 if (h_procs) h_procs->Draw();
169 if (h_full_mem) h_full_mem->Draw();
175 if (h_l1_triggers) h_l1_triggers->Draw();
177 if (h_l1_triggers_filt) h_l1_triggers_filt->Draw();
179 if (h_l1_cat_w_overlap) h_l1_cat_w_overlap->Draw();
181 if (h_l1_cat_wo_overlap) h_l1_cat_wo_overlap->Draw();
186 if (h_GDL_ana_eff_shifter) h_GDL_ana_eff_shifter->Draw();
189 if (h_hlt) n_hlt = (double)h_hlt->GetBinContent((h_hlt->GetXaxis())->FindFixBin(
"total_result"));
190 m_monObj->setVariable(
"n_hlt", n_hlt);
192 if (h_l1) n_l1 = h_l1->GetEntries();
193 m_monObj->setVariable(
"n_l1", n_l1);
195 if (h_procs) n_procs = h_procs->GetEntries();
196 m_monObj->setVariable(
"n_procs", n_procs);
200 for (
int ibin = 1; ibin < h_skim->GetXaxis()->GetNbins() + 1; ibin++) {
201 double nentr = (double)h_skim->GetBinContent(ibin);
202 std::string bin_name(h_skim->GetXaxis()->GetBinLabel(ibin));
203 m_monObj->setVariable(bin_name.replace(0, 6,
"effCS"), nentr);
209 for (
int ibin = 1; ibin < h_l1_triggers->GetXaxis()->GetNbins() + 1; ibin++) {
210 double nentr = (double)h_l1_triggers->GetBinContent(ibin);
211 std::string bin_name(h_l1_triggers->GetXaxis()->GetBinLabel(ibin));
212 if (bin_name ==
"")
continue;
213 m_monObj->setVariable(bin_name.insert(0,
"effCS_l1_"), nentr);
217 if (h_l1_triggers_filt) {
219 for (
int ibin = 1; ibin < h_l1_triggers_filt->GetXaxis()->GetNbins() + 1; ibin++) {
220 double nentr = (double)h_l1_triggers_filt->GetBinContent(ibin);
221 std::string bin_name(h_l1_triggers_filt->GetXaxis()->GetBinLabel(ibin));
222 if (bin_name ==
"")
continue;
223 m_monObj->setVariable(bin_name.insert(0,
"effCS_l1_fON_"), nentr);
227 if (h_hlt_triggers) {
229 for (
int ibin = 1; ibin < h_hlt_triggers->GetXaxis()->GetNbins() + 1; ibin++) {
230 double nentr = (double)h_hlt_triggers->GetBinContent(ibin);
231 std::string bin_name(h_hlt_triggers->GetXaxis()->GetBinLabel(ibin));
232 bin_name = std::regex_replace(bin_name, std::regex(
"=="),
"_eq_");
233 bin_name = std::regex_replace(bin_name, std::regex(
"\\."),
"_");
234 m_monObj->setVariable(bin_name.insert(0,
"effCS_hlt_"), nentr);
240 for (
int ibin = 1; ibin < h_meantime->GetXaxis()->GetNbins() + 1; ibin++) {
241 double nentr = (double)h_meantime->GetBinContent(ibin);
242 std::string bin_name(h_meantime->GetXaxis()->GetBinLabel(ibin));
243 m_monObj->setVariable(bin_name.insert(0,
"secTime_"), nentr);
249 for (
int ibin = 1; ibin < h_err_flag->GetXaxis()->GetNbins() + 1; ibin++) {
250 double nentr = (double)h_err_flag->GetBinContent(ibin);
251 std::string bin_name(h_err_flag->GetXaxis()->GetBinLabel(ibin));
252 m_monObj->setVariable(bin_name.insert(0,
"errFlag_"), nentr);
256 if (h_l1_cat_w_overlap) {
258 for (
int ibin = 1; ibin < h_l1_cat_w_overlap->GetXaxis()->GetNbins() + 1; ibin++) {
259 double nentr = (double)h_l1_cat_w_overlap->GetBinContent(ibin);
260 std::string bin_name(h_l1_cat_w_overlap->GetXaxis()->GetBinLabel(ibin));
261 m_monObj->setVariable(bin_name.insert(0,
"l1_Ov_"), nentr);
265 if (h_l1_cat_wo_overlap) {
267 for (
int ibin = 1; ibin < h_l1_cat_wo_overlap->GetXaxis()->GetNbins() + 1; ibin++) {
268 double nentr = (double)h_l1_cat_wo_overlap->GetBinContent(ibin);
269 std::string bin_name(h_l1_cat_wo_overlap->GetXaxis()->GetBinLabel(ibin));
270 m_monObj->setVariable(bin_name.insert(0,
"l1_noOv_"), nentr);
274 if (h_GDL_ana_eff_shifter) {
276 for (
int ibin = 1; ibin < h_GDL_ana_eff_shifter->GetXaxis()->GetNbins() + 1; ibin++) {
277 double nentr = (double)h_GDL_ana_eff_shifter->GetBinContent(ibin);
278 std::string bin_name(h_GDL_ana_eff_shifter->GetXaxis()->GetBinLabel(ibin));
279 m_monObj->setVariable(bin_name.insert(0,
"GDLanaEffShifter_"), nentr);
284 if (h_budget) bgt = h_budget->GetMean();
285 m_monObj->setVariable(
"budget_time", bgt);
287 m_monObj->setVariable(
"n_l1_x_budget_time", n_l1 * bgt);
289 double procTime = 0.;
290 if (h_processing) procTime = h_processing->GetMean();
291 m_monObj->setVariable(
"processing_time", procTime);
293 double procTimePassive = 0.;
294 if (h_proc_passive) procTimePassive = h_proc_passive->GetMean();
295 m_monObj->setVariable(
"processing_time_passive", procTimePassive);
297 double procTimeActive = 0.;
298 if (h_proc_active) procTimeActive = h_proc_active->GetMean();
299 m_monObj->setVariable(
"processing_time_active", procTimeActive);
301 double procTimePrefilterTiming = 0.;
302 if (h_proc_prefilter_time) procTimePrefilterTiming = h_proc_prefilter_time->GetMean();
303 m_monObj->setVariable(
"processing_time_prefilter_time", procTimePrefilterTiming);
305 double procTimePrefilterCDCECL = 0.;
306 if (h_proc_prefilter_cdcecl) procTimePrefilterCDCECL = h_proc_prefilter_cdcecl->GetMean();
307 m_monObj->setVariable(
"processing_time_prefilter_CDCECL", procTimePrefilterCDCECL);
309 double nEventsPassive = 0.;
310 if (h_proc_passive) nEventsPassive = h_proc_passive->GetEntries();
311 m_monObj->setVariable(
"N_events_passive", nEventsPassive);
313 double nEventsActive = 0.;
314 if (h_proc_active) nEventsActive = h_proc_active->GetEntries();
315 m_monObj->setVariable(
"N_events_active", nEventsActive);
317 double nEventsPrefilterTiming = 0.;
318 if (h_proc_prefilter_time) nEventsPrefilterTiming = h_proc_prefilter_time->GetEntries();
319 m_monObj->setVariable(
"N_events_prefilter_time", nEventsPrefilterTiming);
321 double nEventsPrefilterCDCECL = 0.;
322 if (h_proc_prefilter_cdcecl) nEventsPrefilterCDCECL = h_proc_prefilter_cdcecl->GetEntries();
323 m_monObj->setVariable(
"N_events_prefilter_CDCECL", nEventsPrefilterCDCECL);
326 double fullMemory = 0.;
327 if (h_full_mem) fullMemory = h_full_mem->GetBinLowEdge(h_full_mem->FindLastBinAbove(0) + 1);
328 m_monObj->setVariable(
"full_memory", fullMemory);
330 TH1* h_budgetUnit =
nullptr;
331 TH1* h_memoryUnit =
nullptr;
333 for (
unsigned int index = 1; index <= HLTUnits::max_hlt_units; index++) {
335 h_budgetUnit =
findHist((
"timing_statistics/fullTimePerUnitHistogram_HLT" + std::to_string(index)).c_str());
337 if (h_budgetUnit) bgunit = h_budgetUnit->GetMean();
338 m_monObj->setVariable((
"budget_time_HLT" + std::to_string(index)).c_str(), bgunit);
340 h_budgetUnit =
findHist((
"timing_statistics/processingTimePerUnitHistogram_HLT" + std::to_string(index)).c_str());
341 if (h_budgetUnit) bgunit = h_budgetUnit->GetMean();
343 m_monObj->setVariable((
"processing_time_HLT" + std::to_string(index)).c_str(), bgunit);
345 h_memoryUnit =
findHist((
"timing_statistics/fullMemoryPerUnitHistogram_HLT" + std::to_string(index)).c_str());
347 if (h_memoryUnit && bgunit > 0) memunit = h_memoryUnit->GetBinLowEdge(h_memoryUnit->FindLastBinAbove(0.) + 1);
348 m_monObj->setVariable((
"memory_HLT" + std::to_string(index)).c_str(), memunit);
354 RooMsgService::instance().setSilentMode(
true);
355 RooMsgService::instance().setGlobalKillBelow(RooFit::WARNING);
358 double nKs_active = 0;
359 double nKs_activeNotTime = 0;
360 double nKs_activeNotCDCECL = 0;
362 auto m_hKshortAllH =
findHist(
"PhysicsObjects/hist_nKshortAllH");
363 auto m_hKshortActiveH =
findHist(
"PhysicsObjects/hist_nKshortActiveH");
364 auto m_hKshortActiveNotTimeH =
findHist(
"PhysicsObjects/hist_nKshortActiveNotTimeH");
365 auto m_hKshortActiveNotCDCECLH =
findHist(
"PhysicsObjects/hist_nKshortActiveNotCDCECLH");
368 RooPlot* m_KshortAll_frame =
m_KsInvMass->frame() ;
369 RooPlot* m_KshortActive_frame =
m_KsInvMass->frame() ;
370 RooPlot* m_KshortActiveNotTime_frame =
m_KsInvMass->frame() ;
371 RooPlot* m_KshortActiveNotCDCECL_frame =
m_KsInvMass->frame() ;
374 RooDataHist* KsHist_all =
new RooDataHist(
"KsHist_all",
"Histogram data", RooArgList(*
m_KsInvMass), m_hKshortAllH);
375 m_KsPdf->fitTo(*KsHist_all, RooFit::Minos(
true));
376 nKs_all =
m_sig->getValV();
377 KsHist_all->plotOn(m_KshortAll_frame) ;
378 m_KsPdf->plotOn(m_KshortAll_frame);
379 m_KsPdf->paramOn(m_KshortAll_frame, RooFit::Layout(0.6, 0.9, 0.9));
382 m_monObj->setVariable(
"nKs_all_hlt", nKs_all);
384 if (m_hKshortActiveH) {
385 RooDataHist* KsHist_active =
new RooDataHist(
"KsHist_active",
"Histogram data", RooArgList(*
m_KsInvMass), m_hKshortActiveH);
386 m_KsPdf->fitTo(*KsHist_active, RooFit::Minos(
true));
387 nKs_active =
m_sig->getValV();
388 KsHist_active->plotOn(m_KshortActive_frame) ;
389 m_KsPdf->plotOn(m_KshortActive_frame);
390 m_KsPdf->paramOn(m_KshortActive_frame, RooFit::Layout(0.6, 0.9, 0.9));
391 delete KsHist_active;
393 m_monObj->setVariable(
"nKs_activeVeto_hlt", nKs_active);
395 if (m_hKshortActiveNotTimeH) {
396 RooDataHist* KsHist_activeNotTime =
new RooDataHist(
"KsHist_activeNotTime",
"Histogram data", RooArgList(*
m_KsInvMass),
397 m_hKshortActiveNotTimeH);
398 m_KsPdf->fitTo(*KsHist_activeNotTime, RooFit::Minos(
true));
399 nKs_activeNotTime =
m_sig->getValV();
400 KsHist_activeNotTime->plotOn(m_KshortActiveNotTime_frame) ;
401 m_KsPdf->plotOn(m_KshortActiveNotTime_frame);
402 m_KsPdf->paramOn(m_KshortActiveNotTime_frame, RooFit::Layout(0.6, 0.9, 0.9));
403 delete KsHist_activeNotTime;
405 m_monObj->setVariable(
"nKs_activeVetoPrefilterTime_hlt", nKs_activeNotTime);
407 if (m_hKshortActiveNotCDCECLH) {
408 RooDataHist* KsHist_activeNotCDCECL =
new RooDataHist(
"KsHist_activeNotCDCECL",
"Histogram data", RooArgList(*
m_KsInvMass),
409 m_hKshortActiveNotCDCECLH);
410 m_KsPdf->fitTo(*KsHist_activeNotCDCECL, RooFit::Minos(
true));
411 nKs_activeNotCDCECL =
m_sig->getValV();
412 KsHist_activeNotCDCECL->plotOn(m_KshortActiveNotCDCECL_frame) ;
413 m_KsPdf->plotOn(m_KshortActiveNotCDCECL_frame);
414 m_KsPdf->paramOn(m_KshortActiveNotCDCECL_frame, RooFit::Layout(0.6, 0.9, 0.9));
415 delete KsHist_activeNotCDCECL;
417 m_monObj->setVariable(
"nKs_activeVetoPrefilterCDCECL_hlt", nKs_activeNotCDCECL);
425 m_KshortAll_frame->Draw();
427 m_KshortActive_frame->Draw();
429 m_KshortActiveNotTime_frame->Draw();
431 m_KshortActiveNotCDCECL_frame->Draw();
433 B2DEBUG(20,
"DQMHistAnalysisHLTMonObj : endRun called");