55 new TCanvas(
"HLT/Ratio"),
56 new TH1F(
"Ratio",
"Retention of selected HLT skims", 1, 0, 0)
59 new TCanvas(
"HLT/RatioTotal"),
60 new TH1F(
"RatioTotal",
"Ratio of Tags to all events", 1, 0, 0)
63 new TCanvas(
"HLT/CrossSection"),
64 new TH1F(
"CrossSection",
"Cross Section of triggered Events", 1, 0, 0)
67 new TCanvas(
"HLT/RatioToBahbha"),
68 new TH1F(
"RatioToBahbha",
"Ratio to bhabha events", 1, 0, 0)
73 new TCanvas((
"HLT/" + l1Name +
"RatioToL1").c_str()),
75 new TH1F((l1Name +
"RatioToL1").c_str(), (
"HLT Fractions for L1 " + l1Name).c_str(), 1, 0, 0)
81 new TCanvas((
"HLT/" + filterLine +
"_RetentionPerUnit").c_str()),
82 new TH1F((filterLine +
"_RetentionPerUnit").c_str(), (
"Retention rate per unit of: " + filterLine).c_str(),
83 HLTUnits::max_hlt_units + 1, 0,
84 HLTUnits::max_hlt_units + 1)
89 auto* histogram = canvasAndHisto.second;
90 histogram->SetDirectory(0);
91 histogram->SetOption(
"bar");
92 histogram->SetFillStyle(0);
93 histogram->SetMinimum(0);
94 histogram->SetStats(
false);
95 histogram->Draw(
"hist");
99 auto* histogram = nameAndcanvasAndHisto.second.second;
100 histogram->SetDirectory(0);
101 histogram->SetOption(
"bar");
102 histogram->SetFillStyle(0);
103 histogram->SetStats(
false);
104 histogram->Draw(
"hist");
108 auto* histogram = nameAndcanvasAndHisto.second.second;
109 histogram->SetDirectory(0);
110 histogram->SetOption(
"histe");
111 histogram->SetMinimum(0);
112 histogram->SetStats(
false);
117 new TCanvas(
"HLT/MeanTime"),
118 new TH1F(
"MeanTime",
"Mean processing time", 1, 0, 0)
122 new TCanvas(
"HLT/ErrorFlagFraction"),
123 new TH1D(
"ErrorFlagFraction",
"Fraction of events with Error Flags", 1, 0, 0)
127 new TCanvas(
"HLT/FilteredFractionPerUnit"),
128 new TH1D(
"FilteredFractionPerUnit",
"Fraction of events filtered per unit", 1, 0, 0)
132 new TCanvas(
"HLT/MeanBudgetTimePerUnit"),
133 new TH1F(
"MeanBudgetTimePerUnit",
"Mean budget time per unit", 1, 0, 0)
137 new TCanvas(
"HLT/MeanProcessingTimePerUnit"),
138 new TH1F(
"MeanProcessingTimePerUnit",
"Mean processing time per unit", 1, 0, 0)
142 new TCanvas(
"HLT/MeanMemoryChange"),
143 new TH1F(
"MeanMemoryChange",
"Mean memory change [MB]", 1, 0, 0)
147 addDeltaPar(
"timing_statistics",
"processingTimeHistogram", HistDelta::c_Events, 10000, 1);
148 addDeltaPar(
"timing_statistics",
"processesPerUnitHistogram", HistDelta::c_Events, 10000, 1);
190 auto* filterHistogram =
findHist(
"softwaretrigger/filter");
191 auto* skimHistogram =
findHist(
"softwaretrigger/skim");
192 auto* totalResultHistogram =
findHist(
"softwaretrigger/total_result");
193 auto* hltUnitNumberHistogram =
findHist(
"softwaretrigger_before_filter/hlt_unit_number");
194 auto* processesPerUnitHistogram =
findHist(
"timing_statistics/processesPerUnitHistogram");
195 auto* meanTimeHistogram =
findHist(
"timing_statistics/meanTimeHistogram");
196 auto* errorFlagHistogram =
findHist(
"softwaretrigger_before_filter/error_flag");
197 auto* hltUnitNumberHistogram_filtered =
findHist(
"softwaretrigger/hlt_unit_number_after_filter");
198 auto* fullTimeMeanPerUnitHistogram =
findHist(
"timing_statistics/fullTimeMeanPerUnitHistogram");
199 auto* processingTimeMeanPerUnitHistogram =
findHist(
"timing_statistics/processingTimeMeanPerUnitHistogram");
200 auto* meanMemoryHistogram =
findHist(
"timing_statistics/meanMemoryHistogram");
202 if (not filterHistogram) {
203 B2ERROR(
"Can not find the filter histogram!");
206 if (not skimHistogram) {
207 B2ERROR(
"Can not find the skim histogram!");
210 if (not totalResultHistogram) {
211 B2ERROR(
"Can not find the total result histogram!");
214 if (not hltUnitNumberHistogram) {
215 B2ERROR(
"Can not find the HLT unit number histogram!");
218 if (not processesPerUnitHistogram) {
219 B2ERROR(
"Can not find the processes per unit histogram!");
222 if (not meanTimeHistogram) {
223 B2ERROR(
"Can not find the mean processing time histogram!");
226 if (not errorFlagHistogram) {
227 B2ERROR(
"Can not find the error flag histogram!");
230 if (not hltUnitNumberHistogram_filtered) {
231 B2ERROR(
"Can not find the HLT unit number after filter histogram!");
234 if (not fullTimeMeanPerUnitHistogram) {
235 B2ERROR(
"Can not find the HLT budget time per unit histogram!");
238 if (not processingTimeMeanPerUnitHistogram) {
239 B2ERROR(
"Can not find the HLT processing time per unit histogram!");
242 if (not meanMemoryHistogram) {
243 B2ERROR(
"Can not find the mean memory change histogram!");
248 auto hist_ProcessingTime =
getDelta(
"timing_statistics",
"processingTimeHistogram", 0,
true);
249 double HLTProcessingTime = 0;
251 if (hist_ProcessingTime) {
252 HLTProcessingTime = hist_ProcessingTime->GetMean();
253 setEpicsPV(
"ProcessingTime", HLTProcessingTime);
256 auto hist_Procs =
getDelta(
"timing_statistics",
"processesPerUnitHistogram", 0,
true);
257 double HLTBudgetTime = 0;
260 if (hist_Procs && L1Rate != 0) {
261 double nProcs = hist_Procs->GetMean() * 0.5;
262 HLTBudgetTime = nProcs * 1e03 / L1Rate;
266 if (HLTBudgetTime != 0)
267 setEpicsPV(
"CPUUsage", HLTProcessingTime / HLTBudgetTime);
275 double instLuminosity =
getEpicsPV(
"instLuminosity");
276 double numberOfAcceptedHLTEvents = getValue(
"total_result", totalResultHistogram);
277 double numberOfBhabhaEvents = getValue(
m_bhabhaName, skimHistogram);
278 double numberOfAllEvents = hltUnitNumberHistogram->GetEntries();
279 double numberOfProcesses = processesPerUnitHistogram->GetEntries();
281 m_hEfficiencyTotal.second->Fill(
"total_result", numberOfAcceptedHLTEvents / numberOfAllEvents);
282 if (instLuminosity != 0) {
283 m_hCrossSection.second->Fill(
"total_result", numberOfAcceptedHLTEvents / numberOfAllEvents * instLuminosity);
285 m_hRatios.second->Fill(
"total_result", numberOfAcceptedHLTEvents / numberOfBhabhaEvents);
288 const auto& from = columnMapping.first;
289 const auto& to = columnMapping.second;
292 if (hasValue(from, filterHistogram)) {
293 value = getValue(from, filterHistogram);
294 }
else if (hasValue(from, skimHistogram)) {
295 value = getValue(from, skimHistogram);
297 B2ERROR(
"Can not find value " << from <<
". Will not use it!");
301 m_hEfficiency.second->Fill(to.c_str(), value / numberOfAcceptedHLTEvents);
303 if (instLuminosity != 0) {
304 m_hCrossSection.second->Fill(to.c_str(), value / numberOfAllEvents * instLuminosity);
306 m_hRatios.second->Fill(to.c_str(), value / numberOfBhabhaEvents);
313 auto* l1Histogram =
findHist(
"softwaretrigger/" + l1Name);
314 auto* l1TotalResultHistogram =
findHist(
"softwaretrigger/l1_total_result");
316 if (not l1Histogram or not l1TotalResultHistogram) {
317 B2ERROR(
"Can not find L1 histograms from softwaretrigger!");
322 const auto& from = columnMapping.first;
323 const auto& to = columnMapping.second;
325 if (not hasValue(from, l1Histogram)) {
326 B2ERROR(
"Can not find label " << from <<
" in l1 histogram " << l1Name);
330 if (not hasValue(l1Name, l1TotalResultHistogram)) {
331 B2ERROR(
"Can not find label " << l1Name <<
" in l1 total result histogram");
335 const double hltValueInL1Bin = getValue(from, l1Histogram);
336 const double l1TotalResult = getValue(l1Name, l1TotalResultHistogram);
338 histogram->Fill(to.c_str(), hltValueInL1Bin / l1TotalResult);
342 const auto from =
"hlt_result";
343 const auto to =
"hlt_result";
345 if (not hasValue(from, l1Histogram)) {
346 B2ERROR(
"Can not find label " << from <<
" in l1 histogram " << l1Name);
350 if (not hasValue(l1Name, l1TotalResultHistogram)) {
351 B2ERROR(
"Can not find label " << l1Name <<
" in l1 total result histogram");
355 const double hltValueInL1Bin = getValue(from, l1Histogram);
356 const double l1TotalResult = getValue(l1Name, l1TotalResultHistogram);
358 histogram->Fill(to, hltValueInL1Bin / l1TotalResult);
365 auto* filterLineHistogram =
findHist(
"softwaretrigger/" + filterLine +
"_per_unit");
367 if (not filterLineHistogram) {
368 B2ERROR(
"Can not find " << filterLineHistogram <<
"_per_event histograms from softwaretrigger!");
372 for (
unsigned int i = 1; i <= HLTUnits::max_hlt_units + 1; i++) {
373 double totalUnitValue = hltUnitNumberHistogram->GetBinContent(i);
374 if (totalUnitValue == 0) {
375 histogram->Fill(i, 0);
377 double filterLineUnitValue = filterLineHistogram->GetBinContent(i);
378 histogram->SetBinContent(i, filterLineUnitValue / totalUnitValue);
384 m_hMeanTime.second = (TH1F*) meanTimeHistogram->Clone(
"MeanTime");
388 m_hMeanMemory.second = (TH1F*) meanMemoryHistogram->Clone(
"MeanMemoryChange");
410 auto* canvas = canvasAndHisto.first;
411 auto* histogram = canvasAndHisto.second;
414 histogram->LabelsDeflate(
"X");
415 histogram->Draw(
"hist");
421 auto* canvas = canvasAndHisto.first;
422 auto* histogram = canvasAndHisto.second;
425 histogram->LabelsDeflate(
"X");
426 histogram->Draw(
"hist");
427 histogram->SetStats(
false);
433 auto* canvas = nameAndCanvasAndHisto.second.first;
434 auto* histogram = nameAndCanvasAndHisto.second.second;
437 histogram->LabelsDeflate(
"X");
438 histogram->Draw(
"hist");
444 auto* canvas = nameAndCanvasAndHisto.second.first;
445 auto* histogram = nameAndCanvasAndHisto.second.second;
448 histogram->Draw(
"hist");