56 new TCanvas(
"HLT/Ratio"),
57 new TH1F(
"Ratio",
"Retention of selected HLT skims", 1, 0, 0)
60 new TCanvas(
"HLT/RatioTotal"),
61 new TH1F(
"RatioTotal",
"Ratio of Tags to all events", 1, 0, 0)
64 new TCanvas(
"HLT/CrossSection"),
65 new TH1F(
"CrossSection",
"Cross Section of triggered Events", 1, 0, 0)
68 new TCanvas(
"HLT/RatioToBahbha"),
69 new TH1F(
"RatioToBahbha",
"Ratio to bhabha events", 1, 0, 0)
74 new TCanvas((
"HLT/" + l1Name +
"RatioToL1").c_str()),
76 new TH1F((l1Name +
"RatioToL1").c_str(), (
"HLT Fractions for L1 " + l1Name).c_str(), 1, 0, 0)
82 new TCanvas((
"HLT/" + filterLine +
"_RetentionPerUnit").c_str()),
83 new TH1F((filterLine +
"_RetentionPerUnit").c_str(), (
"Retention rate per unit of: " + filterLine).c_str(),
84 HLTUnits::max_hlt_units + 1, 0,
85 HLTUnits::max_hlt_units + 1)
90 auto* histogram = canvasAndHisto.second;
91 histogram->SetDirectory(0);
92 histogram->SetOption(
"bar");
93 histogram->SetFillStyle(0);
94 histogram->SetMinimum(0);
95 histogram->SetStats(
false);
96 histogram->Draw(
"hist");
100 auto* histogram = nameAndcanvasAndHisto.second.second;
101 histogram->SetDirectory(0);
102 histogram->SetOption(
"bar");
103 histogram->SetFillStyle(0);
104 histogram->SetStats(
false);
105 histogram->Draw(
"hist");
109 auto* histogram = nameAndcanvasAndHisto.second.second;
110 histogram->SetDirectory(0);
111 histogram->SetOption(
"histe");
112 histogram->SetMinimum(0);
113 histogram->SetStats(
false);
118 new TCanvas(
"HLT/MeanTime"),
119 new TH1F(
"MeanTime",
"Mean processing time", 1, 0, 0)
123 new TCanvas(
"HLT/ErrorFlagFraction"),
124 new TH1D(
"ErrorFlagFraction",
"Fraction of events with Error Flags", 1, 0, 0)
128 new TCanvas(
"HLT/FilteredFractionPerUnit"),
129 new TH1D(
"FilteredFractionPerUnit",
"Fraction of events filtered per unit", 1, 0, 0)
133 new TCanvas(
"HLT/MeanBudgetTimePerUnit"),
134 new TH1F(
"MeanBudgetTimePerUnit",
"Mean budget time per unit", 1, 0, 0)
138 new TCanvas(
"HLT/MeanProcessingTimePerUnit"),
139 new TH1F(
"MeanProcessingTimePerUnit",
"Mean processing time per unit", 1, 0, 0)
143 new TCanvas(
"HLT/MeanMemoryChange"),
144 new TH1F(
"MeanMemoryChange",
"Mean memory change [MB]", 1, 0, 0)
149 if (!ca_current_context()) SEVCHK(ca_context_create(ca_disable_preemptive_callback),
"ca_context_create");
150 SEVCHK(ca_create_channel(
m_pvPrefix.data(), NULL, NULL, 10, &m_epicschid),
"ca_create_channel failure");
151 SEVCHK(ca_pend_io(5.0),
"ca_pend_io failure");
182 auto* filterHistogram =
findHist(
"softwaretrigger/filter");
183 auto* skimHistogram =
findHist(
"softwaretrigger/skim");
184 auto* totalResultHistogram =
findHist(
"softwaretrigger/total_result");
185 auto* hltUnitNumberHistogram =
findHist(
"softwaretrigger_before_filter/hlt_unit_number");
186 auto* processesPerUnitHistogram =
findHist(
"timing_statistics/processesPerUnitHistogram");
187 auto* meanTimeHistogram =
findHist(
"timing_statistics/meanTimeHistogram");
188 auto* errorFlagHistogram =
findHist(
"softwaretrigger_before_filter/error_flag");
189 auto* hltUnitNumberHistogram_filtered =
findHist(
"softwaretrigger/hlt_unit_number_after_filter");
190 auto* fullTimeMeanPerUnitHistogram =
findHist(
"timing_statistics/fullTimeMeanPerUnitHistogram");
191 auto* processingTimeMeanPerUnitHistogram =
findHist(
"timing_statistics/processingTimeMeanPerUnitHistogram");
192 auto* meanMemoryHistogram =
findHist(
"timing_statistics/meanMemoryHistogram");
194 if (not filterHistogram) {
195 B2ERROR(
"Can not find the filter histogram!");
198 if (not skimHistogram) {
199 B2ERROR(
"Can not find the skim histogram!");
202 if (not totalResultHistogram) {
203 B2ERROR(
"Can not find the total result histogram!");
206 if (not hltUnitNumberHistogram) {
207 B2ERROR(
"Can not find the HLT unit number histogram!");
210 if (not processesPerUnitHistogram) {
211 B2ERROR(
"Can not find the processes per unit histogram!");
214 if (not meanTimeHistogram) {
215 B2ERROR(
"Can not find the mean processing time histogram!");
218 if (not errorFlagHistogram) {
219 B2ERROR(
"Can not find the error flag histogram!");
222 if (not hltUnitNumberHistogram_filtered) {
223 B2ERROR(
"Can not find the HLT unit number after filter histogram!");
226 if (not fullTimeMeanPerUnitHistogram) {
227 B2ERROR(
"Can not find the HLT budget time per unit histogram!");
230 if (not processingTimeMeanPerUnitHistogram) {
231 B2ERROR(
"Can not find the HLT processing time per unit histogram!");
234 if (not meanMemoryHistogram) {
235 B2ERROR(
"Can not find the mean memory change histogram!");
244 double instLuminosity = 0;
245 double numberOfAcceptedHLTEvents = getValue(
"total_result", totalResultHistogram);
246 double numberOfBhabhaEvents = getValue(
m_bhabhaName, skimHistogram);
247 double numberOfAllEvents = hltUnitNumberHistogram->GetEntries();
248 double numberOfProcesses = processesPerUnitHistogram->GetEntries();
252 SEVCHK(ca_get(DBR_DOUBLE, m_epicschid, (
void*)&instLuminosity),
"ca_get failure");
253 SEVCHK(ca_pend_io(5.0),
"ca_pend_io failure");
259 m_hEfficiencyTotal.second->Fill(
"total_result", numberOfAcceptedHLTEvents / numberOfAllEvents);
260 if (instLuminosity != 0) {
261 m_hCrossSection.second->Fill(
"total_result", numberOfAcceptedHLTEvents / numberOfAllEvents * instLuminosity);
263 m_hRatios.second->Fill(
"total_result", numberOfAcceptedHLTEvents / numberOfBhabhaEvents);
266 const auto& from = columnMapping.first;
267 const auto& to = columnMapping.second;
270 if (hasValue(from, filterHistogram)) {
271 value = getValue(from, filterHistogram);
272 }
else if (hasValue(from, skimHistogram)) {
273 value = getValue(from, skimHistogram);
275 B2ERROR(
"Can not find value " << from <<
". Will not use it!");
279 m_hEfficiency.second->Fill(to.c_str(), value / numberOfAcceptedHLTEvents);
281 if (instLuminosity != 0) {
282 m_hCrossSection.second->Fill(to.c_str(), value / numberOfAllEvents * instLuminosity);
284 m_hRatios.second->Fill(to.c_str(), value / numberOfBhabhaEvents);
291 auto* l1Histogram =
findHist(
"softwaretrigger/" + l1Name);
292 auto* l1TotalResultHistogram =
findHist(
"softwaretrigger/l1_total_result");
294 if (not l1Histogram or not l1TotalResultHistogram) {
295 B2ERROR(
"Can not find L1 histograms from softwaretrigger!");
300 const auto& from = columnMapping.first;
301 const auto& to = columnMapping.second;
303 if (not hasValue(from, l1Histogram)) {
304 B2ERROR(
"Can not find label " << from <<
" in l1 histogram " << l1Name);
308 if (not hasValue(l1Name, l1TotalResultHistogram)) {
309 B2ERROR(
"Can not find label " << l1Name <<
" in l1 total result histogram");
313 const double hltValueInL1Bin = getValue(from, l1Histogram);
314 const double l1TotalResult = getValue(l1Name, l1TotalResultHistogram);
316 histogram->Fill(to.c_str(), hltValueInL1Bin / l1TotalResult);
320 const auto from =
"hlt_result";
321 const auto to =
"hlt_result";
323 if (not hasValue(from, l1Histogram)) {
324 B2ERROR(
"Can not find label " << from <<
" in l1 histogram " << l1Name);
328 if (not hasValue(l1Name, l1TotalResultHistogram)) {
329 B2ERROR(
"Can not find label " << l1Name <<
" in l1 total result histogram");
333 const double hltValueInL1Bin = getValue(from, l1Histogram);
334 const double l1TotalResult = getValue(l1Name, l1TotalResultHistogram);
336 histogram->Fill(to, hltValueInL1Bin / l1TotalResult);
343 auto* filterLineHistogram =
findHist(
"softwaretrigger/" + filterLine +
"_per_unit");
345 if (not filterLineHistogram) {
346 B2ERROR(
"Can not find " << filterLineHistogram <<
"_per_event histograms from softwaretrigger!");
350 for (
unsigned int i = 1; i <= HLTUnits::max_hlt_units + 1; i++) {
351 double totalUnitValue = hltUnitNumberHistogram->GetBinContent(i);
352 if (totalUnitValue == 0) {
353 histogram->Fill(i, 0);
355 double filterLineUnitValue = filterLineHistogram->GetBinContent(i);
356 histogram->SetBinContent(i, filterLineUnitValue / totalUnitValue);
361 m_hMeanTime.second = (TH1F*) meanTimeHistogram->Clone(
"MeanTime");
364 m_hMeanMemory.second = (TH1F*) meanMemoryHistogram->Clone(
"MeanMemoryChange");
382 auto* canvas = canvasAndHisto.first;
383 auto* histogram = canvasAndHisto.second;
386 histogram->LabelsDeflate(
"X");
387 histogram->Draw(
"hist");
393 auto* canvas = canvasAndHisto.first;
394 auto* histogram = canvasAndHisto.second;
397 histogram->LabelsDeflate(
"X");
398 histogram->Draw(
"hist");
399 histogram->SetStats(
false);
405 auto* canvas = nameAndCanvasAndHisto.second.first;
406 auto* histogram = nameAndCanvasAndHisto.second.second;
409 histogram->LabelsDeflate(
"X");
410 histogram->Draw(
"hist");
416 auto* canvas = nameAndCanvasAndHisto.second.first;
417 auto* histogram = nameAndCanvasAndHisto.second.second;
420 histogram->Draw(
"hist");