29 TH1::AddDirectory(
false);
34 for (
const auto& [
key, _] : errorNames) {
35 if (
static_cast<int>(
key) > maxErrorCode) {
41 mMapHist[
"ErrorCounter"] = std::make_unique<TH1I>(
"ErrorCounter",
"ErrorCounter", maxErrorCode, -0.5, maxErrorCode - 0.5);
42 mMapHist[
"ErrorCounter"]->GetXaxis()->SetTitle(
"Error Codes");
43 mMapHist[
"ErrorCounter"]->GetYaxis()->SetTitle(
"Entries");
45 for (
size_t bin = 1; bin <= maxErrorCode; bin++) {
46 auto const& it = errorNames.find(bin);
47 if (it != errorNames.end()) {
48 mMapHist[
"ErrorCounter"]->GetXaxis()->SetBinLabel(bin, it->second);
50 mMapHist[
"ErrorCounter"]->GetXaxis()->SetBinLabel(bin,
"NO_DEF");