Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions Modules/EMCAL/include/EMCAL/NumPatchesPerFastORCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "EMCALBase/TriggerMappingV2.h"
#include "EMCALBase/Geometry.h"
#include <set>
#include <functional>

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

struct FastORNoiseInfo {
int mCounts;
int mTRUIndex;
int mFastORIndex;
int mPosPhi;
int mPosEta;

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) {
return mFastORIndex < other.mFastORIndex;
}
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 {
Expand Down Expand Up @@ -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<o2::emcal::TriggerMappingV2> mTriggerMapping = std::make_unique<o2::emcal::TriggerMappingV2>(mGeometry); ///!<! Trigger mapping
std::set<FastORNoiseInfo> mNoisyTRUPositions; ///< Positions of all found noisy TRUs (bad quality)
std::set<FastORNoiseInfo> mHighCountTRUPositions; ///< Positions of all FastORs with high count rate (medium Quality)
std::set<FastORNoiseInfo, std::greater<FastORNoiseInfo>> mNoisyTRUPositions; ///< Positions of all found noisy TRUs (bad quality)
std::set<FastORNoiseInfo, std::greater<FastORNoiseInfo>> mHighCountTRUPositions; ///< Positions of all FastORs with high count rate (medium Quality)

ClassDefOverride(NumPatchesPerFastORCheck, 1);
};
Expand Down
14 changes: 7 additions & 7 deletions Modules/EMCAL/src/NumPatchesPerFastORCheck.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ Quality NumPatchesPerFastORCheck::check(std::map<std::string, std::shared_ptr<Mo
for (std::vector<FastORNoiseLevel>::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<int>(truID), static_cast<int>(fastorTRU), static_cast<int>(posPhi), static_cast<int>(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<int>(truID), static_cast<int>(fastorTRU), static_cast<int>(posPhi), static_cast<int>(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;
Expand Down Expand Up @@ -220,8 +220,8 @@ Quality NumPatchesPerFastORCheck::check(std::map<std::string, std::shared_ptr<Mo
for (std::vector<FastORNoiseLevel>::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<int>(truID), static_cast<int>(fastorTRU), static_cast<int>(posPhi), static_cast<int>(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<int>(truID), static_cast<int>(fastorTRU), static_cast<int>(posPhi), static_cast<int>(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;
Expand Down Expand Up @@ -262,7 +262,7 @@ void NumPatchesPerFastORCheck::beautify(std::shared_ptr<MonitorObject> 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);
Expand All @@ -277,7 +277,7 @@ void NumPatchesPerFastORCheck::beautify(std::shared_ptr<MonitorObject> 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);
Expand All @@ -301,7 +301,7 @@ void NumPatchesPerFastORCheck::beautify(std::shared_ptr<MonitorObject> 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);
Expand Down