From f104f73d930c8f4f9aa92a2cbd8b59f161642ed0 Mon Sep 17 00:00:00 2001 From: jokonig Date: Wed, 30 Apr 2025 16:43:49 +0200 Subject: [PATCH] [EMCAL-529] Change order in which noisy TRU are printed - Noisiest TRUs should be printed first as they are the most problematic and should be directly visible for the EMCAL oncall - Previuosly it was sorted by FEC index, hence it was hard to find the nosiest FEC --- .../include/EMCAL/NumPatchesPerFastORCheck.h | 24 ++++++++++++++----- .../EMCAL/src/NumPatchesPerFastORCheck.cxx | 14 +++++------ 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/Modules/EMCAL/include/EMCAL/NumPatchesPerFastORCheck.h b/Modules/EMCAL/include/EMCAL/NumPatchesPerFastORCheck.h index 0c6c6cf5ba..02decc0ea1 100644 --- a/Modules/EMCAL/include/EMCAL/NumPatchesPerFastORCheck.h +++ b/Modules/EMCAL/include/EMCAL/NumPatchesPerFastORCheck.h @@ -21,6 +21,7 @@ #include "EMCALBase/TriggerMappingV2.h" #include "EMCALBase/Geometry.h" #include +#include namespace o2::quality_control_modules::emcal { @@ -43,6 +44,7 @@ class NumPatchesPerFastORCheck : public o2::quality_control::checker::CheckInter std::string getAcceptedType() override; struct FastORNoiseInfo { + int mCounts; int mTRUIndex; int mFastORIndex; int mPosPhi; @@ -50,11 +52,11 @@ class NumPatchesPerFastORCheck : public o2::quality_control::checker::CheckInter bool operator==(const FastORNoiseInfo& other) const { - return mTRUIndex == other.mTRUIndex && mFastORIndex == other.mFastORIndex; + return mCounts == other.mCounts && mFastORIndex == other.mFastORIndex; } bool operator<(const FastORNoiseInfo& other) const { - if (mTRUIndex < other.mTRUIndex) { + if (mCounts < other.mCounts) { return true; } if (mTRUIndex == other.mTRUIndex) { @@ -62,6 +64,16 @@ class NumPatchesPerFastORCheck : public o2::quality_control::checker::CheckInter } return false; } + bool operator>(const FastORNoiseInfo& other) const + { + if (mCounts > other.mCounts) { + return true; + } + if (mTRUIndex == other.mTRUIndex) { + return mFastORIndex > other.mFastORIndex; + } + return false; + } }; struct FastORNoiseLevel { @@ -90,14 +102,14 @@ class NumPatchesPerFastORCheck : public o2::quality_control::checker::CheckInter * threshold cuts * ************************************************/ - float mBadSigmaNumPatchesPerFastOR = 5.; ///< Number of sigmas used in the Number of Patches Per FastOR fastORs outside of mean bad check + float mBadSigmaNumPatchesPerFastOR = 5.; ///< Number of sigmas used in the Number of Patches Per FastOR fastORs outside of mean bad check float mMedSigmaNumPatchesPerFastOR = 999.; ///< Number of sigmas used in the Number of Patches Per FastOR fastORs outside of mean medium check - int mLogLevelIL = 0; ///< Log level on InfoLogger + int mLogLevelIL = 0; ///< Log level on InfoLogger o2::emcal::Geometry* mGeometry = o2::emcal::Geometry::GetInstanceFromRunNumber(300000); ///< Geometry for mapping position between SM and full EMCAL std::unique_ptr mTriggerMapping = std::make_unique(mGeometry); ///! mNoisyTRUPositions; ///< Positions of all found noisy TRUs (bad quality) - std::set mHighCountTRUPositions; ///< Positions of all FastORs with high count rate (medium Quality) + std::set> mNoisyTRUPositions; ///< Positions of all found noisy TRUs (bad quality) + std::set> mHighCountTRUPositions; ///< Positions of all FastORs with high count rate (medium Quality) ClassDefOverride(NumPatchesPerFastORCheck, 1); }; diff --git a/Modules/EMCAL/src/NumPatchesPerFastORCheck.cxx b/Modules/EMCAL/src/NumPatchesPerFastORCheck.cxx index c65ffa8259..26b3f7f9fc 100644 --- a/Modules/EMCAL/src/NumPatchesPerFastORCheck.cxx +++ b/Modules/EMCAL/src/NumPatchesPerFastORCheck.cxx @@ -177,8 +177,8 @@ Quality NumPatchesPerFastORCheck::check(std::map::iterator itFinal = finalBadFastORs.begin(); itFinal != finalBadFastORs.end(); itFinal++) { auto [truID, fastorTRU] = mTriggerMapping->getTRUFromAbsFastORIndex(itFinal->mFastORID); auto [truID1, posEta, posPhi] = mTriggerMapping->getPositionInTRUFromAbsFastORIndex(itFinal->mFastORID); - FastORNoiseInfo obj{ static_cast(truID), static_cast(fastorTRU), static_cast(posPhi), static_cast(posEta) }; - std::string errorMessage = "TRU " + std::to_string(truID) + " has a noisy FastOR at position " + std::to_string(fastorTRU) + " (eta " + std::to_string(posEta) + ", phi " + std::to_string(posPhi) + ") in TRU."; + FastORNoiseInfo obj{ itFinal->mCounts, static_cast(truID), static_cast(fastorTRU), static_cast(posPhi), static_cast(posEta) }; + std::string errorMessage = "TRU " + std::to_string(truID) + " has a noisy FastOR at position " + std::to_string(fastorTRU) + " (eta " + std::to_string(posEta) + ", phi " + std::to_string(posPhi) + ") in TRU. (" + std::to_string(itFinal->mCounts) + "counts)"; messagebuilder << errorMessage << std::endl; if (mLogLevelIL > 1) { ILOG(Error, Support) << errorMessage << ENDM; @@ -220,8 +220,8 @@ Quality NumPatchesPerFastORCheck::check(std::map::iterator itFinal = finalMedFastORs.begin(); itFinal != finalMedFastORs.end(); itFinal++) { auto [truID, fastorTRU] = mTriggerMapping->getTRUFromAbsFastORIndex(itFinal->mFastORID); auto [truID1, posEta, posPhi] = mTriggerMapping->getPositionInTRUFromAbsFastORIndex(itFinal->mFastORID); - FastORNoiseInfo obj{ static_cast(truID), static_cast(fastorTRU), static_cast(posPhi), static_cast(posEta) }; - std::string errorMessage = "TRU " + std::to_string(truID) + " has a high rate in FastOR at position " + std::to_string(fastorTRU) + " (eta " + std::to_string(posEta) + ", phi " + std::to_string(posPhi) + ") in TRU."; + FastORNoiseInfo obj{ itFinal->mCounts, static_cast(truID), static_cast(fastorTRU), static_cast(posPhi), static_cast(posEta) }; + std::string errorMessage = "TRU " + std::to_string(truID) + " has a high rate in FastOR at position " + std::to_string(fastorTRU) + " (eta " + std::to_string(posEta) + ", phi " + std::to_string(posPhi) + ") in TRU. (" + std::to_string(itFinal->mCounts) + "counts)"; messagebuilder << errorMessage << std::endl; if (mLogLevelIL > 2) { ILOG(Warning, Support) << errorMessage << ENDM; @@ -262,7 +262,7 @@ void NumPatchesPerFastORCheck::beautify(std::shared_ptr mo, Quali int iErr = 0; for (const auto& noiseinfo : mNoisyTRUPositions) { stringstream errorMessageIndiv; - errorMessageIndiv << "Position " << noiseinfo.mFastORIndex << " (eta " << noiseinfo.mPosEta << ", phi " << noiseinfo.mPosPhi << ") in TRU " << noiseinfo.mTRUIndex << " is noisy." << std::endl; + errorMessageIndiv << "Position " << noiseinfo.mFastORIndex << " (eta " << noiseinfo.mPosEta << ", phi " << noiseinfo.mPosPhi << ") in TRU " << noiseinfo.mTRUIndex << " is noisy. (" << noiseinfo.mCounts << " counts)" << std::endl; msg = new TLatex(0.15, 0.8 - iErr / 25., errorMessageIndiv.str().c_str()); msg->SetNDC(); msg->SetTextSize(16); @@ -277,7 +277,7 @@ void NumPatchesPerFastORCheck::beautify(std::shared_ptr mo, Quali } for (const auto& noiseinfo : mHighCountTRUPositions) { stringstream errorMessageIndiv; - errorMessageIndiv << "Position " << noiseinfo.mFastORIndex << " (eta " << noiseinfo.mPosEta << ", phi " << noiseinfo.mPosPhi << ") in TRU " << noiseinfo.mTRUIndex << " has high counts." << std::endl; + errorMessageIndiv << "Position " << noiseinfo.mFastORIndex << " (eta " << noiseinfo.mPosEta << ", phi " << noiseinfo.mPosPhi << ") in TRU " << noiseinfo.mTRUIndex << " has high counts. (" << noiseinfo.mCounts << " counts)" << std::endl; msg = new TLatex(0.15, 0.8 - iErr / 25., errorMessageIndiv.str().c_str()); msg->SetNDC(); msg->SetTextSize(16); @@ -301,7 +301,7 @@ void NumPatchesPerFastORCheck::beautify(std::shared_ptr mo, Quali int iErr = 0; for (const auto& noiseinfo : mHighCountTRUPositions) { stringstream errorMessageIndiv; - errorMessageIndiv << "Position " << noiseinfo.mFastORIndex << " (eta " << noiseinfo.mPosEta << ", phi " << noiseinfo.mPosPhi << ") in TRU " << noiseinfo.mTRUIndex << " has high counts." << std::endl; + errorMessageIndiv << "Position " << noiseinfo.mFastORIndex << " (eta " << noiseinfo.mPosEta << ", phi " << noiseinfo.mPosPhi << ") in TRU " << noiseinfo.mTRUIndex << " has high counts. (" << noiseinfo.mCounts << " counts)" << std::endl; msg = new TLatex(0.15, 0.8 - iErr / 25., errorMessageIndiv.str().c_str()); msg->SetNDC(); msg->SetTextSize(16);