From 9bce78cc2ed1c1b335378997da225712939680b4 Mon Sep 17 00:00:00 2001 From: Lucia Anna Tarasovicova Date: Mon, 21 Oct 2024 09:19:56 +0200 Subject: [PATCH] histogram labels from CTPInputsConfiguration --- Modules/CTP/include/CTP/RawDataReaderCheck.h | 15 +++++++-------- Modules/CTP/src/RawDataReaderCheck.cxx | 9 +++++++-- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/Modules/CTP/include/CTP/RawDataReaderCheck.h b/Modules/CTP/include/CTP/RawDataReaderCheck.h index 4428d71fd..3cf9d480e 100644 --- a/Modules/CTP/include/CTP/RawDataReaderCheck.h +++ b/Modules/CTP/include/CTP/RawDataReaderCheck.h @@ -65,14 +65,13 @@ class RawDataReaderCheck : public o2::quality_control::checker::CheckInterface TH1D* mHistClassesPrevious = nullptr; // histogram storing ctp class rates from previous cycle TH1D* mHistInputRatioPrevious = nullptr; // histogram storing ctp input ratios to MB from previous cycle TH1D* mHistClassRatioPrevious = nullptr; - TH1D* mHistAbsolute = nullptr; // histogram storing ctp class ratios to MB from previous cycle - std::vector mVecGoodBC; // vector of good BC positions - std::vector mVecMediumBC; // vector of medium BC positions, we expect a BC at this position, but inputs are below mThreshold - std::vector mVecBadBC; // vector of bad BC positions, we don't expect a BC at this position, but inputs are abow mThreshold - std::vector mVecIndexBad; // vector of ctp input and class indices, which had a big relative change - std::vector mVecIndexMedium; // vector of ctp input and class indices, which had a relative change - std::bitset mLHCBCs; // LHC filling scheme - const char* ctpinputs[49] = { "T0A", "T0C", "TVX", "TSC", "TCE", "VBA", "VOR", "VIR", "VNC", "VCH", "11", "12", "UCE", "DMC", "USC", "UVX", "U0C", "U0A", "COS", "LAS", "EMC", "PH0", "23", "24", "ZED", "ZNC", "PHL", "PHH", "PHM", "30", "31", "32", "33", "34", "35", "36", "EJ1", "EJ2", "EG1", "EG2", "DJ1", "DG1", "DJ2", "DG2", "45", "46", "47", "48", "49" }; // ctp input names + TH1D* mHistAbsolute = nullptr; // histogram storing ctp class ratios to MB from previous cycle + std::vector mVecGoodBC; // vector of good BC positions + std::vector mVecMediumBC; // vector of medium BC positions, we expect a BC at this position, but inputs are below mThreshold + std::vector mVecBadBC; // vector of bad BC positions, we don't expect a BC at this position, but inputs are abow mThreshold + std::vector mVecIndexBad; // vector of ctp input and class indices, which had a big relative change + std::vector mVecIndexMedium; // vector of ctp input and class indices, which had a relative change + std::bitset mLHCBCs; // LHC filling scheme ClassDefOverride(RawDataReaderCheck, 9); }; diff --git a/Modules/CTP/src/RawDataReaderCheck.cxx b/Modules/CTP/src/RawDataReaderCheck.cxx index d57d59578..2b487f0a3 100644 --- a/Modules/CTP/src/RawDataReaderCheck.cxx +++ b/Modules/CTP/src/RawDataReaderCheck.cxx @@ -266,7 +266,12 @@ void RawDataReaderCheck::beautify(std::shared_ptr mo, Quality che } if (mFlagInput) { for (size_t i = 0; i < h->GetXaxis()->GetNbins(); i++) { - h->GetXaxis()->SetBinLabel(i + 1, ctpinputs[i]); + std::string label = o2::ctp::CTPInputsConfiguration::getInputNameFromIndex(i + 1); + if (label == "none") { + h->GetXaxis()->SetBinLabel(i + 1, Form("%i", i + 1)); + } else { + h->GetXaxis()->SetBinLabel(i + 1, label.c_str()); + } } h->GetXaxis()->SetLabelSize(0.045); h->GetXaxis()->LabelsOption("v"); @@ -282,7 +287,7 @@ void RawDataReaderCheck::beautify(std::shared_ptr mo, Quality che h->GetListOfFunctions()->Add(msg->Clone()); for (size_t i = 0; i < mVecIndexBad.size(); i++) { if (mFlagInput) { - msg = std::make_shared(0.45, 0.65 - i * 0.05, Form("Check %s %s", ctpinputs[mVecIndexBad[i]], groupName.c_str())); + msg = std::make_shared(0.45, 0.65 - i * 0.05, Form("Check %s %s", o2::ctp::CTPInputsConfiguration::getInputNameFromIndex(mVecIndexBad[i + 1]).c_str(), groupName.c_str())); } else { msg = std::make_shared(0.45, 0.65 - i * 0.05, Form("Check %s %s", groupName.c_str(), h->GetXaxis()->GetBinLabel(mVecIndexBad[i] + 1))); }