Skip to content

Commit 9cabb12

Browse files
jokonigjokonig
andauthored
[EMCAL-529] Change order in which noisy TRU are printed (#2547)
- 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 Co-authored-by: jokonig <jokonig@cern.ch>
1 parent 82f5ed7 commit 9cabb12

File tree

2 files changed

+25
-13
lines changed

2 files changed

+25
-13
lines changed

Modules/EMCAL/include/EMCAL/NumPatchesPerFastORCheck.h

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "EMCALBase/TriggerMappingV2.h"
2222
#include "EMCALBase/Geometry.h"
2323
#include <set>
24+
#include <functional>
2425

2526
namespace o2::quality_control_modules::emcal
2627
{
@@ -43,25 +44,36 @@ class NumPatchesPerFastORCheck : public o2::quality_control::checker::CheckInter
4344
std::string getAcceptedType() override;
4445

4546
struct FastORNoiseInfo {
47+
int mCounts;
4648
int mTRUIndex;
4749
int mFastORIndex;
4850
int mPosPhi;
4951
int mPosEta;
5052

5153
bool operator==(const FastORNoiseInfo& other) const
5254
{
53-
return mTRUIndex == other.mTRUIndex && mFastORIndex == other.mFastORIndex;
55+
return mCounts == other.mCounts && mFastORIndex == other.mFastORIndex;
5456
}
5557
bool operator<(const FastORNoiseInfo& other) const
5658
{
57-
if (mTRUIndex < other.mTRUIndex) {
59+
if (mCounts < other.mCounts) {
5860
return true;
5961
}
6062
if (mTRUIndex == other.mTRUIndex) {
6163
return mFastORIndex < other.mFastORIndex;
6264
}
6365
return false;
6466
}
67+
bool operator>(const FastORNoiseInfo& other) const
68+
{
69+
if (mCounts > other.mCounts) {
70+
return true;
71+
}
72+
if (mTRUIndex == other.mTRUIndex) {
73+
return mFastORIndex > other.mFastORIndex;
74+
}
75+
return false;
76+
}
6577
};
6678

6779
struct FastORNoiseLevel {
@@ -90,14 +102,14 @@ class NumPatchesPerFastORCheck : public o2::quality_control::checker::CheckInter
90102
* threshold cuts *
91103
************************************************/
92104

93-
float mBadSigmaNumPatchesPerFastOR = 5.; ///< Number of sigmas used in the Number of Patches Per FastOR fastORs outside of mean bad check
105+
float mBadSigmaNumPatchesPerFastOR = 5.; ///< Number of sigmas used in the Number of Patches Per FastOR fastORs outside of mean bad check
94106
float mMedSigmaNumPatchesPerFastOR = 999.; ///< Number of sigmas used in the Number of Patches Per FastOR fastORs outside of mean medium check
95-
int mLogLevelIL = 0; ///< Log level on InfoLogger
107+
int mLogLevelIL = 0; ///< Log level on InfoLogger
96108

97109
o2::emcal::Geometry* mGeometry = o2::emcal::Geometry::GetInstanceFromRunNumber(300000); ///< Geometry for mapping position between SM and full EMCAL
98110
std::unique_ptr<o2::emcal::TriggerMappingV2> mTriggerMapping = std::make_unique<o2::emcal::TriggerMappingV2>(mGeometry); ///!<! Trigger mapping
99-
std::set<FastORNoiseInfo> mNoisyTRUPositions; ///< Positions of all found noisy TRUs (bad quality)
100-
std::set<FastORNoiseInfo> mHighCountTRUPositions; ///< Positions of all FastORs with high count rate (medium Quality)
111+
std::set<FastORNoiseInfo, std::greater<FastORNoiseInfo>> mNoisyTRUPositions; ///< Positions of all found noisy TRUs (bad quality)
112+
std::set<FastORNoiseInfo, std::greater<FastORNoiseInfo>> mHighCountTRUPositions; ///< Positions of all FastORs with high count rate (medium Quality)
101113

102114
ClassDefOverride(NumPatchesPerFastORCheck, 1);
103115
};

Modules/EMCAL/src/NumPatchesPerFastORCheck.cxx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@ Quality NumPatchesPerFastORCheck::check(std::map<std::string, std::shared_ptr<Mo
177177
for (std::vector<FastORNoiseLevel>::iterator itFinal = finalBadFastORs.begin(); itFinal != finalBadFastORs.end(); itFinal++) {
178178
auto [truID, fastorTRU] = mTriggerMapping->getTRUFromAbsFastORIndex(itFinal->mFastORID);
179179
auto [truID1, posEta, posPhi] = mTriggerMapping->getPositionInTRUFromAbsFastORIndex(itFinal->mFastORID);
180-
FastORNoiseInfo obj{ static_cast<int>(truID), static_cast<int>(fastorTRU), static_cast<int>(posPhi), static_cast<int>(posEta) };
181-
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.";
180+
FastORNoiseInfo obj{ itFinal->mCounts, static_cast<int>(truID), static_cast<int>(fastorTRU), static_cast<int>(posPhi), static_cast<int>(posEta) };
181+
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)";
182182
messagebuilder << errorMessage << std::endl;
183183
if (mLogLevelIL > 1) {
184184
ILOG(Error, Support) << errorMessage << ENDM;
@@ -220,8 +220,8 @@ Quality NumPatchesPerFastORCheck::check(std::map<std::string, std::shared_ptr<Mo
220220
for (std::vector<FastORNoiseLevel>::iterator itFinal = finalMedFastORs.begin(); itFinal != finalMedFastORs.end(); itFinal++) {
221221
auto [truID, fastorTRU] = mTriggerMapping->getTRUFromAbsFastORIndex(itFinal->mFastORID);
222222
auto [truID1, posEta, posPhi] = mTriggerMapping->getPositionInTRUFromAbsFastORIndex(itFinal->mFastORID);
223-
FastORNoiseInfo obj{ static_cast<int>(truID), static_cast<int>(fastorTRU), static_cast<int>(posPhi), static_cast<int>(posEta) };
224-
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.";
223+
FastORNoiseInfo obj{ itFinal->mCounts, static_cast<int>(truID), static_cast<int>(fastorTRU), static_cast<int>(posPhi), static_cast<int>(posEta) };
224+
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)";
225225
messagebuilder << errorMessage << std::endl;
226226
if (mLogLevelIL > 2) {
227227
ILOG(Warning, Support) << errorMessage << ENDM;
@@ -262,7 +262,7 @@ void NumPatchesPerFastORCheck::beautify(std::shared_ptr<MonitorObject> mo, Quali
262262
int iErr = 0;
263263
for (const auto& noiseinfo : mNoisyTRUPositions) {
264264
stringstream errorMessageIndiv;
265-
errorMessageIndiv << "Position " << noiseinfo.mFastORIndex << " (eta " << noiseinfo.mPosEta << ", phi " << noiseinfo.mPosPhi << ") in TRU " << noiseinfo.mTRUIndex << " is noisy." << std::endl;
265+
errorMessageIndiv << "Position " << noiseinfo.mFastORIndex << " (eta " << noiseinfo.mPosEta << ", phi " << noiseinfo.mPosPhi << ") in TRU " << noiseinfo.mTRUIndex << " is noisy. (" << noiseinfo.mCounts << " counts)" << std::endl;
266266
msg = new TLatex(0.15, 0.8 - iErr / 25., errorMessageIndiv.str().c_str());
267267
msg->SetNDC();
268268
msg->SetTextSize(16);
@@ -277,7 +277,7 @@ void NumPatchesPerFastORCheck::beautify(std::shared_ptr<MonitorObject> mo, Quali
277277
}
278278
for (const auto& noiseinfo : mHighCountTRUPositions) {
279279
stringstream errorMessageIndiv;
280-
errorMessageIndiv << "Position " << noiseinfo.mFastORIndex << " (eta " << noiseinfo.mPosEta << ", phi " << noiseinfo.mPosPhi << ") in TRU " << noiseinfo.mTRUIndex << " has high counts." << std::endl;
280+
errorMessageIndiv << "Position " << noiseinfo.mFastORIndex << " (eta " << noiseinfo.mPosEta << ", phi " << noiseinfo.mPosPhi << ") in TRU " << noiseinfo.mTRUIndex << " has high counts. (" << noiseinfo.mCounts << " counts)" << std::endl;
281281
msg = new TLatex(0.15, 0.8 - iErr / 25., errorMessageIndiv.str().c_str());
282282
msg->SetNDC();
283283
msg->SetTextSize(16);
@@ -301,7 +301,7 @@ void NumPatchesPerFastORCheck::beautify(std::shared_ptr<MonitorObject> mo, Quali
301301
int iErr = 0;
302302
for (const auto& noiseinfo : mHighCountTRUPositions) {
303303
stringstream errorMessageIndiv;
304-
errorMessageIndiv << "Position " << noiseinfo.mFastORIndex << " (eta " << noiseinfo.mPosEta << ", phi " << noiseinfo.mPosPhi << ") in TRU " << noiseinfo.mTRUIndex << " has high counts." << std::endl;
304+
errorMessageIndiv << "Position " << noiseinfo.mFastORIndex << " (eta " << noiseinfo.mPosEta << ", phi " << noiseinfo.mPosPhi << ") in TRU " << noiseinfo.mTRUIndex << " has high counts. (" << noiseinfo.mCounts << " counts)" << std::endl;
305305
msg = new TLatex(0.15, 0.8 - iErr / 25., errorMessageIndiv.str().c_str());
306306
msg->SetNDC();
307307
msg->SetTextSize(16);

0 commit comments

Comments
 (0)