Skip to content

Commit 6283263

Browse files
authored
MCH: added plots per cru link (#2592)
* [MCH] added averaging over SOLAR links Added computation of average quantities over SOLAR links, similar to what is already implemented for the averaging over Detection Elements * [MCH] added helper functions for handling SOLAR indexes and histogram decorations * [MCH] updated Pedestals Task histogram decorations The changes are needed to sync with the updated helper code * [MCH] added plots as function of SOLAR links The commit adds plots with quantities averaged over SOLAR links, similar to the existing ones as function of Detection Elements. It also adds comparisons of DE and SOLAR plots with reference ones, using the code from #2578 * [MCH] added checkers for SOLAR-based plots The code that checks the SOLAR-based plots is similar to that for the DE-based ones. The checkers also fill a summary plot with the overall quality of each SOLAR link, which are then aggregared by a dedicated task. * [MCH] added aggregator task for DE and SOLAR qualities The task combines the summary qualities for each DE and SOLAR link, and uploads a CCDB object with the list of bad DE and SOLAR IDs. The CCDB objects will be used to automatically reconfigure the bad links during the data taking. * [MCH] fixed clang errors * [MCH] added review suggestions
1 parent 364b54a commit 6283263

30 files changed

+2208
-104
lines changed

Modules/MUON/MCH/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ set(SRCS
3535
src/DecodingPostProcessing.cxx
3636
src/DigitsPostProcessing.cxx
3737
src/PreclustersPostProcessing.cxx
38+
src/QualityAggregatorTask.cxx
3839
src/PostProcessingConfigMCH.cxx
3940
src/TrendingTracks.cxx
4041
src/ClustersTask.cxx
@@ -76,6 +77,7 @@ set(HEADERS
7677
include/MCH/DedodingPostProcessing.h
7778
include/MCH/DigitsPostProcessing.h
7879
include/MCH/PreclustersPostProcessing.h
80+
include/MCH/QualityAggregatorTask.h
7981
include/MCH/PostProcessingConfigMCH.h
8082
include/MCH/TrendingTracks.h
8183
include/MCH/ClustersTask.h
@@ -161,6 +163,7 @@ add_root_dictionary(${MODULE_NAME}
161163
include/MCH/DecodingPostProcessing.h
162164
include/MCH/DigitsPostProcessing.h
163165
include/MCH/PreclustersPostProcessing.h
166+
include/MCH/QualityAggregatorTask.h
164167
include/MCH/PostProcessingConfigMCH.h
165168
include/MCH/TrendingTracks.h
166169
include/MCH/ClustersTask.h

Modules/MUON/MCH/include/MCH/DecodingCheck.h

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,40 @@ class DecodingCheck : public o2::quality_control::checker::CheckInterface
4747
std::string getAcceptedType() override;
4848

4949
private:
50-
std::string mGoodFracHistName{ "DecodingErrors/LastCycle/GoodBoardsFractionPerDE" };
51-
std::string mSyncFracHistName{ "SyncErrors/LastCycle/SyncedBoardsFractionPerDE" };
50+
std::string mGoodFracHistName{ "DecodingErrors/GoodBoardsFractionPerDE" };
51+
std::string mGoodFracPerSolarHistName{ "DecodingErrors/GoodBoardsFractionPerSolar" };
52+
std::string mSyncFracHistName{ "SyncErrors/SyncedBoardsFractionPerDE" };
53+
std::string mSyncFracPerSolarHistName{ "SyncErrors/SyncedBoardsFractionPerSolar" };
54+
std::string mGoodFracRefCompHistName{ "DecodingErrors/RefComp/GoodBoardsFractionPerDE" };
55+
std::string mGoodFracPerSolarRefCompHistName{ "DecodingErrors/RefComp/GoodBoardsFractionPerSolar" };
56+
std::string mSyncFracRefCompHistName{ "SyncErrors/RefComp/SyncedBoardsFractionPerDE" };
57+
std::string mSyncFracPerSolarRefCompHistName{ "SyncErrors/RefComp/SyncedBoardsFractionPerSolar" };
5258
int mMaxBadST12{ 2 };
5359
int mMaxBadST345{ 3 };
5460
double mMinGoodErrorFrac{ 0.9 };
5561
std::array<std::optional<double>, 5> mMinGoodErrorFracPerStation;
62+
double mMinGoodErrorFracPerSolar{ 0.5 };
63+
double mMinGoodErrorFracRatio{ 0.9 };
64+
double mMinGoodErrorFracRatioPerSolar{ 0.9 };
65+
5666
double mMinGoodSyncFrac{ 0.9 };
5767
std::array<std::optional<double>, 5> mMinGoodSyncFracPerStation;
68+
double mMinGoodSyncFracPerSolar{ 0.5 };
69+
double mMinGoodSyncFracRatio{ 0.9 };
70+
double mMinGoodSyncFracRatioPerSolar{ 0.9 };
71+
5872
double mMinHeartBeatRate{ 0 };
5973
double mMaxHeartBeatRate{ 2 };
6074

75+
double mGoodFracRatioPlotRange{ 0.2 };
76+
double mGoodFracRatioPerSolarPlotRange{ 0.2 };
77+
double mSyncFracRatioPlotRange{ 0.2 };
78+
double mSyncFracRatioPerSolarPlotRange{ 0.2 };
79+
6180
QualityChecker mQualityChecker;
81+
std::array<Quality, getNumSolar()> mSolarQuality;
6282

63-
ClassDefOverride(DecodingCheck, 1);
83+
ClassDefOverride(DecodingCheck, 2);
6484
};
6585

6686
} // namespace o2::quality_control_modules::muonchambers

Modules/MUON/MCH/include/MCH/DecodingErrorsPlotter.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,12 @@ class DecodingErrorsPlotter : public HistPlotter
5353

5454
std::string mPath;
5555

56-
std::unique_ptr<TH1F> mHistogramGoodBoardsPerDE; ///< fraction of boards with errors per DE
5756
std::unique_ptr<TH2F> mHistogramErrorsPerDE; ///< error codes per DE
5857
std::unique_ptr<TH2F> mHistogramErrorsPerChamber; ///< error codes per chamber
5958
std::unique_ptr<TH2F> mHistogramErrorsPerFeeId; ///< error codes per FEE ID
59+
60+
std::unique_ptr<TH1F> mHistogramGoodBoardsPerDE; ///< fraction of boards without errors per DE
61+
std::unique_ptr<TH1F> mHistogramGoodBoardsPerSolar; ///< fraction of boards with errors per DE
6062
};
6163

6264
} // namespace muonchambers

Modules/MUON/MCH/include/MCH/DecodingPostProcessing.h

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121

2222
#include "MCH/PostProcessingConfigMCH.h"
2323
#include "MCH/Helpers.h"
24-
#include "Common/TH2Ratio.h"
2524
#include "MCH/HistoOnCycle.h"
2625
#include "MCH/DecodingErrorsPlotter.h"
2726
#include "MCH/HeartBeatPacketsPlotter.h"
2827
#include "MCH/FECSyncStatusPlotter.h"
29-
#include "QualityControl/PostProcessingInterface.h"
28+
#include "Common/ReferenceComparatorTask.h"
29+
#include "Common/TH2Ratio.h"
3030

3131
#include <memory>
3232

@@ -43,7 +43,7 @@ namespace o2::quality_control_modules::muonchambers
4343
{
4444

4545
/// \brief A post-processing task which trends MCH hits and stores them in a TTree and produces plots.
46-
class DecodingPostProcessing : public PostProcessingInterface
46+
class DecodingPostProcessing : public ReferenceComparatorTask
4747
{
4848
public:
4949
DecodingPostProcessing() = default;
@@ -73,6 +73,8 @@ class DecodingPostProcessing : public PostProcessingInterface
7373
static std::string hbPacketsSourceName() { return "hbpackets"; }
7474
static std::string syncStatusSourceName() { return "syncstatus"; }
7575

76+
TH1* getHistogram(std::string_view plotName);
77+
7678
bool mFullHistos{ false };
7779
bool mEnableLastCycleHistos{ false };
7880
bool mEnableTrending{ false };
@@ -96,7 +98,10 @@ class DecodingPostProcessing : public PostProcessingInterface
9698
std::unique_ptr<FECSyncStatusPlotter> mSyncStatusPlotter;
9799
std::unique_ptr<FECSyncStatusPlotter> mSyncStatusPlotterOnCycle;
98100

99-
std::unique_ptr<TH2F> mHistogramQualityPerDE; ///< quality flags for each DE, to be filled by checker task
101+
std::unique_ptr<TH2F> mHistogramQualityPerDE; ///< quality flags for each DE, to be filled by checker task
102+
std::unique_ptr<TH2F> mHistogramQualityPerSolar; ///< quality flags for each SOLAR, to be filled by checker task
103+
104+
std::vector<TH1*> mHistogramsAll;
100105
};
101106

102107
template <typename T>

Modules/MUON/MCH/include/MCH/DigitsCheck.h

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,27 +50,58 @@ class DigitsCheck : public o2::quality_control::checker::CheckInterface
5050
std::string getAcceptedType() override;
5151

5252
private:
53-
std::array<Quality, getNumDE()> checkMeanRates(TH1F* h);
54-
std::array<Quality, getNumDE()> checkMeanRatesRatio(TH1F* h);
55-
std::array<Quality, getNumDE()> checkBadChannels(TH1F* h);
56-
std::array<Quality, getNumDE()> checkBadChannelsRatio(TH1F* h);
53+
std::array<Quality, getNumDE()> checkMeanRates(TH1* h);
54+
std::array<Quality, getNumDE()> checkBadChannels(TH1* h);
55+
std::array<Quality, getNumDE()> checkMeanRateRatios(TH1* h);
56+
std::array<Quality, getNumDE()> checkBadChannelRatios(TH1* h);
57+
void checkSolarMeanRates(TH1* h);
58+
void checkSolarBadChannels(TH1* h);
59+
void checkSolarMeanRateRatios(TH1* h);
60+
void checkSolarBadChannelRatios(TH1* h);
5761

58-
std::string mMeanRateHistName{ "RatesSignal/LastCycle/MeanRate" };
59-
std::string mGoodChanFracHistName{ "RatesSignal/LastCycle/GoodChannelsFraction" };
62+
std::string mMeanRateHistName{ "RatesSignal/MeanRate" };
63+
std::string mGoodChanFracHistName{ "RatesSignal/GoodChannelsFraction" };
64+
std::string mMeanRatePerSolarHistName{ "RatesSignal/MeanRatePerSolar" };
65+
std::string mGoodChanFracPerSolarHistName{ "RatesSignal/GoodChannelsFractionPerSolar" };
66+
std::string mMeanRateRefCompHistName{ "RatesSignal/RefComp/MeanRate" };
67+
std::string mGoodChanFracRefCompHistName{ "RatesSignal/RefComp/GoodChannelsFraction" };
68+
std::string mMeanRatePerSolarRefCompHistName{ "RatesSignal/RefComp/MeanRatePerSolar" };
69+
std::string mGoodChanFracPerSolarRefCompHistName{ "RatesSignal/RefComp/GoodChannelsFractionPerSolar" };
6070
int mMaxBadST12{ 2 };
6171
int mMaxBadST345{ 3 };
72+
73+
// Rate lower threshold
6274
double mMinRate{ 0.001 };
6375
std::array<std::optional<double>, 5> mMinRatePerStation;
76+
double mMinRatePerSolar{ 0.001 };
77+
// Rate upper threshold
6478
double mMaxRate{ 10 };
6579
std::array<std::optional<double>, 5> mMaxRatePerStation;
80+
double mMaxRatePerSolar{ 10 };
81+
// Rate ratio threshold
82+
double mMinRateRatio{ 0.9 };
83+
double mMinRateRatioPerSolar{ 0.9 };
84+
85+
// Good channels fraction threshold
6686
double mMinGoodFraction{ 0.9 };
6787
std::array<std::optional<double>, 5> mMinGoodFractionPerStation;
88+
double mMinGoodFractionPerSolar{ 0.5 };
89+
// Good channels ratio threshold
90+
double mMinGoodFractionRatio{ 0.9 };
91+
double mMinGoodFractionRatioPerSolar{ 0.9 };
92+
93+
// Vertical plot ranges
6894
double mRatePlotScaleMin{ 0 };
6995
double mRatePlotScaleMax{ 10 };
96+
double mRateRatioPlotScaleRange{ 0.2 };
97+
double mRateRatioPerSolarPlotScaleRange{ 0.2 };
98+
double mGoodFractionRatioPlotScaleRange{ 0.2 };
99+
double mGoodFractionRatioPerSolarPlotScaleRange{ 0.2 };
70100

71101
QualityChecker mQualityChecker;
102+
std::array<Quality, getNumSolar()> mSolarQuality;
72103

73-
ClassDefOverride(DigitsCheck, 2);
104+
ClassDefOverride(DigitsCheck, 3);
74105
};
75106

76107
} // namespace o2::quality_control_modules::muonchambers

Modules/MUON/MCH/include/MCH/DigitsPostProcessing.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "MCH/RatesPlotter.h"
2525
#include "MCH/RatesTrendsPlotter.h"
2626
#include "MCH/OrbitsPlotter.h"
27+
#include "Common/ReferenceComparatorTask.h"
2728
#include "Common/TH2Ratio.h"
2829
#include "QualityControl/PostProcessingInterface.h"
2930

@@ -40,7 +41,7 @@ namespace o2::quality_control_modules::muonchambers
4041
{
4142

4243
/// \brief A post-processing task which processes and trends MCH digits and produces plots.
43-
class DigitsPostProcessing : public PostProcessingInterface
44+
class DigitsPostProcessing : public ReferenceComparatorTask
4445
{
4546
public:
4647
DigitsPostProcessing() = default;
@@ -62,6 +63,8 @@ class DigitsPostProcessing : public PostProcessingInterface
6263
static std::string orbitsSourceName() { return "orbits"; }
6364
static std::string orbitsSignalSourceName() { return "orbits_signal"; }
6465

66+
TH1* getHistogram(std::string_view plotName);
67+
6568
bool mFullHistos{ false };
6669
bool mEnableLastCycleHistos{ false };
6770
bool mEnableTrending{ false };
@@ -99,7 +102,10 @@ class DigitsPostProcessing : public PostProcessingInterface
99102
std::unique_ptr<OrbitsPlotter> mOrbitsPlotterSignal;
100103
std::unique_ptr<OrbitsPlotter> mOrbitsPlotterSignalOnCycle;
101104

102-
std::unique_ptr<TH2F> mHistogramQualityPerDE; ///< quality flags for each DE, to be filled by checker task
105+
std::unique_ptr<TH2F> mHistogramQualityPerDE; ///< quality flags for each DE, to be filled by checker task
106+
std::unique_ptr<TH2F> mHistogramQualityPerSolar; ///< quality flags for each SOLAR, to be filled by checker task
107+
108+
std::vector<TH1*> mHistogramsAll;
103109
};
104110

105111
} // namespace o2::quality_control_modules::muonchambers

Modules/MUON/MCH/include/MCH/EfficiencyPlotter.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ class EfficiencyPlotter : public HistPlotter
6969
std::unique_ptr<TH2ElecMapReductor> mElecMapReductor;
7070

7171
std::array<std::unique_ptr<TH1F>, 2> mHistogramMeanEfficiencyPerDE;
72+
std::unique_ptr<TH1F> mHistogramMeanEfficiencyPerSolar;
7273

7374
std::array<std::map<int, std::shared_ptr<DetectorHistogram>>, 2> mHistogramEfficiencyDE; // 2D hit rate map for each DE
7475
std::array<std::unique_ptr<GlobalHistogram>, 2> mHistogramEfficiencyGlobal; // Efficiency histogram (global XY view)

Modules/MUON/MCH/include/MCH/FECSyncStatusPlotter.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ class FECSyncStatusPlotter : public HistPlotter
4949
histograms().emplace_back(HistInfo{ h, drawOptions, displayHints });
5050
}
5151

52-
o2::mch::raw::Elec2DetMapper mElec2DetMapper;
53-
o2::mch::raw::FeeLink2SolarMapper mFeeLink2SolarMapper;
52+
o2::mch::raw::Det2ElecMapper mDet2ElecMapper;
5453

5554
std::unique_ptr<TH1F> mGoodBoardsFractionPerDE; ///< fraction of out-of-sync DS boards per detection element
56-
std::unique_ptr<TH1F> mGoodTFFractionPerDE; ///< fraction of out-of-sync DS boards per chamber
55+
std::unique_ptr<TH1F> mGoodTFFractionPerDE; ///< fraction of in-sync TFs per DS boards, averaged on detection elements
56+
std::unique_ptr<TH1F> mGoodTFFractionPerSolar; ///< fraction of in-sync TFs per DS boards, averaged on SOLAR boards
5757
};
5858

5959
} // namespace muonchambers

Modules/MUON/MCH/include/MCH/Helpers.h

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ int getDEindex(int de);
5353
constexpr int getNumDE() { return (4 * 4 + 18 * 2 + 26 * 4); }
5454
int getNumDEinChamber(int chIndex);
5555
std::pair<int, int> getDEindexInChamber(int deId);
56+
int getDEFromIndex(int index);
57+
58+
int getSolarIndex(int solarId);
59+
int getSolarIdFromIndex(int index);
60+
constexpr int getNumSolar() { return 624; }
61+
int getNumSolarPerChamber(int chamberId);
5662

5763
void getThresholdsPerStation(o2::quality_control::core::CustomParameters customParameters,
5864
const o2::quality_control::core::Activity& activity,
@@ -62,10 +68,16 @@ void getThresholdsPerStation(o2::quality_control::core::CustomParameters customP
6268

6369
o2::quality_control::core::Quality checkDetectorQuality(gsl::span<o2::quality_control::core::Quality>& deQuality);
6470

65-
void addChamberDelimiters(TH1F* h, float xmin = 0, float xmax = 0);
66-
void addChamberDelimiters(TH2F* h);
71+
void addChamberLabelsForDE(TH1* h);
72+
void addChamberDelimiters(TH1* h, float xmin = 0, float xmax = 0);
73+
void addChamberDelimiters(TH2* h);
74+
void addChamberLabelsForSolar(TH1* h);
75+
void addChamberDelimitersToSolarHistogram(TH1* h, float xmin = 0, float xmax = 0);
76+
void addChamberDelimitersToSolarHistogram(TH2* h);
77+
void drawThreshold(TH1* histogram, double threshold);
6778
void drawThresholdsPerStation(TH1* histogram, const std::array<std::optional<double>, 5>& thresholdsPerStation, double defaultThreshold);
6879
void addDEBinLabels(TH1* histogram);
80+
void addSolarBinLabels(TH1* histogram);
6981

7082
std::string getHistoPath(int deId);
7183
bool matchHistName(std::string hist, std::string name);

Modules/MUON/MCH/include/MCH/LinkDef.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#pragma link C++ class o2::quality_control_modules::muonchambers::DecodingPostProcessing + ;
1818
#pragma link C++ class o2::quality_control_modules::muonchambers::DigitsPostProcessing + ;
1919
#pragma link C++ class o2::quality_control_modules::muonchambers::PreclustersPostProcessing + ;
20+
#pragma link C++ class o2::quality_control_modules::muonchambers::QualityAggregatorTask + ;
2021
// Trending
2122
#pragma link C++ class o2::quality_control_modules::muonchambers::TrendingTracks + ;
2223
// Checks

0 commit comments

Comments
 (0)