From e69b79127c784853400667c4681db866c65fd038 Mon Sep 17 00:00:00 2001 From: Valerie Ramillien Date: Tue, 3 Feb 2026 11:22:05 +0100 Subject: [PATCH 1/2] Add histo for PostProcessing evolution of localBoards --- Modules/MUON/MID/include/MID/DigitsQcCheck.h | 1 + Modules/MUON/MID/include/MID/DigitsQcTask.h | 2 + Modules/MUON/MID/src/DigitsQcCheck.cxx | 46 +++++++++++++++++++- Modules/MUON/MID/src/DigitsQcTask.cxx | 7 +++ 4 files changed, 54 insertions(+), 2 deletions(-) diff --git a/Modules/MUON/MID/include/MID/DigitsQcCheck.h b/Modules/MUON/MID/include/MID/DigitsQcCheck.h index 946e905fe2..d448c10514 100644 --- a/Modules/MUON/MID/include/MID/DigitsQcCheck.h +++ b/Modules/MUON/MID/include/MID/DigitsQcCheck.h @@ -53,6 +53,7 @@ class DigitsQcCheck : public o2::quality_control::checker::CheckInterface int nBadLB = 0; double maxVal = 0; double minVal = 1000; + int LineResp[36] = { 0 }; // NN std::unordered_map mQualityMap; ///! Quality map diff --git a/Modules/MUON/MID/include/MID/DigitsQcTask.h b/Modules/MUON/MID/include/MID/DigitsQcTask.h index 07a850b02a..408cd2b47b 100644 --- a/Modules/MUON/MID/include/MID/DigitsQcTask.h +++ b/Modules/MUON/MID/include/MID/DigitsQcTask.h @@ -85,6 +85,8 @@ class DigitsQcTask final : public TaskInterface std::array, 4> mBendHitsMap{}; std::array, 4> mNBendHitsMap{}; + std::array, 36> mLineLocalResp{}; + std::unique_ptr mDigitBCCounts{ nullptr }; o2::mid::Mapping mMapping; diff --git a/Modules/MUON/MID/src/DigitsQcCheck.cxx b/Modules/MUON/MID/src/DigitsQcCheck.cxx index 43bf5a44f4..d2d749c9ed 100644 --- a/Modules/MUON/MID/src/DigitsQcCheck.cxx +++ b/Modules/MUON/MID/src/DigitsQcCheck.cxx @@ -30,6 +30,7 @@ namespace o2::quality_control_modules::mid void DigitsQcCheck::configure() { + ILOG(Info, Devel) << "configure DigitsQcCheck" << ENDM; if (auto param = mCustomParameters.find("MeanMultThreshold"); param != mCustomParameters.end()) { ILOG(Info, Devel) << "Custom parameter - MeanMultThreshold: " << param->second << ENDM; @@ -63,6 +64,7 @@ void DigitsQcCheck::configure() Quality DigitsQcCheck::check(std::map>* moMap) { + Quality result = Quality::Good; // This info must be available from the beginning TH1* meanMultiHits = nullptr; @@ -124,12 +126,21 @@ Quality DigitsQcCheck::check(std::map(item.second->getObject()); if (histo) { mHistoHelper.normalizeHistoTokHz(histo); + int by0 = 0; // NN + for (int by = 1; by < 37; by++) + LineResp[by - 1] = 0; // init all lines NN for (int bx = 1; bx < 15; bx++) { for (int by = 1; by < 37; by++) { + Resp = 0; // NN + if (bx > 1) + LineResp[by - 1] = LineResp[by - 1] << 2; // NN + if (!((bx > 6) && (bx < 9) && (by > 15) && (by < 22))) { // central zone empty + Resp = 1; // NN double val = histo->GetBinContent(bx, by); if (val > maxVal) { maxVal = val; @@ -139,13 +150,28 @@ Quality DigitsQcCheck::check(std::map mLocalBoardThreshold) { nBadLB++; + Resp = 3; // NN } - if ((bx == 1) || (bx == 14) || (by == 1) || (by == 33)) { + LineResp[by - 1] = LineResp[by - 1] + Resp; // NN + by0 = by; // NN + if ((bx == 1) || (bx == 14) || (by == 1) || (by == 33)) { // board*4 + if ((bx == 14) && (by > 1) && (by < 33)) { + LineResp[by + 1] = LineResp[by + 1] << 2; // Resp = 00 line 14 board*2 + if ((by > 12) && (by < 25)) { // Resp = 00 board*4 NNN + LineResp[by] = LineResp[by] << 2; + LineResp[by + 2] = LineResp[by + 2] << 2; + } + } by += 3; } // zones 1 board - else if (!((bx > 4) && (bx < 11) && (by > 12) && (by < 25))) { + else if (!((bx > 4) && (bx < 11) && (by > 12) && (by < 25))) { // board*2 + // Resp = 00 board*2 ??? + if ((bx > 10) && (by > 12) && (by < 25)) { + LineResp[by] = LineResp[by] << 2; // Resp = 00 board*2 NNN + } by += 1; } // zones 2 boards } @@ -192,8 +218,24 @@ Quality DigitsQcCheck::check(std::mapgetName()] = qual; result = qual; + } // if mNTFInSeconds > 0. } + + /////NN + for (int by = 1; by < 37; by++) { + std::string nline = std::to_string(by); + std::string HistoName = "RespBoardLine" + nline; + if (item.second->getName() == HistoName) { + auto histo = dynamic_cast(item.second->getObject()); + if (histo) { + histo->SetBins(1, LineResp[by - 1] - 0.5, LineResp[by - 1] + 0.5); + histo->Fill(LineResp[by - 1]); + } + } + } + /////NN + if (item.second->getName() == "NbLBEmpty") { auto histo = dynamic_cast(item.second->getObject()); if (histo) { diff --git a/Modules/MUON/MID/src/DigitsQcTask.cxx b/Modules/MUON/MID/src/DigitsQcTask.cxx index 3a0f6bd6f2..5d9f2960de 100644 --- a/Modules/MUON/MID/src/DigitsQcTask.cxx +++ b/Modules/MUON/MID/src/DigitsQcTask.cxx @@ -68,6 +68,13 @@ void DigitsQcTask::initialize(o2::framework::InitContext& /*ctx*/) std::array chId{ "11", "12", "21", "22" }; + for (size_t i = 0; i < 36; ++i) { + std::string nline = ""; + nline = std::to_string(i + 1); + mLineLocalResp[i] = std::make_unique(fmt::format("RespBoardLine{}", nline).c_str(), fmt::format("RespBoardLine{}", nline).c_str(), 1, 0, 1); + getObjectsManager()->startPublishing(mLineLocalResp[i].get()); + } + for (size_t ich = 0; ich < 5; ++ich) { std::string chName = ""; if (ich < 4) { From afdc486ad8a9e5bef5a9baea6a08211839b228b9 Mon Sep 17 00:00:00 2001 From: Valerie Ramillien Date: Tue, 3 Feb 2026 13:53:44 +0100 Subject: [PATCH 2/2] MID: debug --- Modules/MUON/MID/src/DigitsQcCheck.cxx | 29 +++++++++++++------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/Modules/MUON/MID/src/DigitsQcCheck.cxx b/Modules/MUON/MID/src/DigitsQcCheck.cxx index d2d749c9ed..e652765b4c 100644 --- a/Modules/MUON/MID/src/DigitsQcCheck.cxx +++ b/Modules/MUON/MID/src/DigitsQcCheck.cxx @@ -126,21 +126,21 @@ Quality DigitsQcCheck::check(std::map(item.second->getObject()); if (histo) { mHistoHelper.normalizeHistoTokHz(histo); int by0 = 0; // NN for (int by = 1; by < 37; by++) - LineResp[by - 1] = 0; // init all lines NN + LineResp[by - 1] = 0; for (int bx = 1; bx < 15; bx++) { for (int by = 1; by < 37; by++) { Resp = 0; // NN if (bx > 1) - LineResp[by - 1] = LineResp[by - 1] << 2; // NN + LineResp[by - 1] = LineResp[by - 1] << 2; - if (!((bx > 6) && (bx < 9) && (by > 15) && (by < 22))) { // central zone empty - Resp = 1; // NN + if (!((bx > 6) && (bx < 9) && (by > 15) && (by < 22))) { + Resp = 1; double val = histo->GetBinContent(bx, by); if (val > maxVal) { maxVal = val; @@ -155,25 +155,24 @@ Quality DigitsQcCheck::check(std::map 1) && (by < 33)) { - LineResp[by + 1] = LineResp[by + 1] << 2; // Resp = 00 line 14 board*2 - if ((by > 12) && (by < 25)) { // Resp = 00 board*4 NNN + LineResp[by + 1] = LineResp[by + 1] << 2; + if ((by > 12) && (by < 25)) { LineResp[by] = LineResp[by] << 2; LineResp[by + 2] = LineResp[by + 2] << 2; } } by += 3; - } // zones 1 board - else if (!((bx > 4) && (bx < 11) && (by > 12) && (by < 25))) { // board*2 - // Resp = 00 board*2 ??? + } else if (!((bx > 4) && (bx < 11) && (by > 12) && (by < 25))) { + if ((bx > 10) && (by > 12) && (by < 25)) { - LineResp[by] = LineResp[by] << 2; // Resp = 00 board*2 NNN + LineResp[by] = LineResp[by] << 2; } by += 1; - } // zones 2 boards + } } } }