Skip to content

Commit

Permalink
[MCH] added plot with quality flag for each DE to the Decoding task (#…
Browse files Browse the repository at this point in the history
…2487)

The plot is filled by the Decoding checker, based on the estimated
quality of each Detection Element (DE).
  • Loading branch information
aferrero2707 authored Jan 16, 2025
1 parent 7f61553 commit 005c5f7
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Modules/MUON/MCH/include/MCH/DecodingPostProcessing.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ class DecodingPostProcessing : public PostProcessingInterface
std::unique_ptr<HeartBeatPacketsPlotter> mHBPacketsPlotterOnCycle;
std::unique_ptr<FECSyncStatusPlotter> mSyncStatusPlotter;
std::unique_ptr<FECSyncStatusPlotter> mSyncStatusPlotterOnCycle;

std::unique_ptr<TH2F> mHistogramQualityPerDE; ///< quality flags for each DE, to be filled by checker task
};

template <typename T>
Expand Down
23 changes: 23 additions & 0 deletions Modules/MUON/MCH/src/DecodingCheck.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,29 @@ void DecodingCheck::beautify(std::shared_ptr<MonitorObject> mo, Quality checkRes
drawThresholdsPerStation(h, mMinGoodSyncFracPerStation, mMinGoodSyncFrac);
}
}

// update quality flags for each DE
if (mo->getName().find("QualityFlagPerDE") != std::string::npos) {
TH2F* h = dynamic_cast<TH2F*>(mo->getObject());
if (!h) {
return;
}

for (int deId = 0; deId < mQualityChecker.mQuality.size(); deId++) {
float ybin = 0;
if (mQualityChecker.mQuality[deId] == Quality::Good) {
ybin = 3;
}
if (mQualityChecker.mQuality[deId] == Quality::Medium) {
ybin = 2;
}
if (mQualityChecker.mQuality[deId] == Quality::Bad) {
ybin = 1;
}

h->SetBinContent(deId + 1, ybin, 1);
}
}
}

} // namespace o2::quality_control_modules::muonchambers
15 changes: 15 additions & 0 deletions Modules/MUON/MCH/src/DecodingPostProcessing.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,21 @@ void DecodingPostProcessing::initialize(Trigger t, framework::ServiceRegistryRef
createDecodingErrorsHistos(t, &qcdb);
createHeartBeatPacketsHistos(t, &qcdb);
createSyncStatusHistos(t, &qcdb);

//--------------------------------------------------
// Detector quality histogram
//--------------------------------------------------

mHistogramQualityPerDE.reset();
mHistogramQualityPerDE = std::make_unique<TH2F>("QualityFlagPerDE", "Quality Flag vs DE", getNumDE(), 0, getNumDE(), 3, 0, 3);
mHistogramQualityPerDE->GetYaxis()->SetBinLabel(1, "Bad");
mHistogramQualityPerDE->GetYaxis()->SetBinLabel(2, "Medium");
mHistogramQualityPerDE->GetYaxis()->SetBinLabel(3, "Good");
mHistogramQualityPerDE->SetOption("colz");
mHistogramQualityPerDE->SetStats(0);
getObjectsManager()->startPublishing(mHistogramQualityPerDE.get(), core::PublicationPolicy::ThroughStop);
getObjectsManager()->setDefaultDrawOptions(mHistogramQualityPerDE.get(), "colz");
getObjectsManager()->setDisplayHint(mHistogramQualityPerDE.get(), "gridy");
}

//_________________________________________________________________________________________
Expand Down

0 comments on commit 005c5f7

Please sign in to comment.