Skip to content

Commit b900cf7

Browse files
committed
[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 AliceO2Group#2578
1 parent 2d09135 commit b900cf7

15 files changed

Lines changed: 406 additions & 35 deletions

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 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/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 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/PreclustersPostProcessing.h

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,17 @@
1919
#ifndef QC_MODULE_MCH_PP_PRECLUSTERS_H
2020
#define QC_MODULE_MCH_PP_PRECLUSTERS_H
2121

22-
#include "QualityControl/PostProcessingInterface.h"
23-
2422
#include "MCH/PostProcessingConfigMCH.h"
2523
#include "MCH/Helpers.h"
26-
#include "Common/TH2Ratio.h"
2724
#include "MCH/HistoOnCycle.h"
2825
#include "MCH/EfficiencyPlotter.h"
2926
#include "MCH/EfficiencyTrendsPlotter.h"
3027
#include "MCH/ClusterSizePlotter.h"
3128
#include "MCH/ClusterSizeTrendsPlotter.h"
3229
#include "MCH/ClusterChargePlotter.h"
3330
#include "MCH/ClusterChargeTrendsPlotter.h"
31+
#include "Common/ReferenceComparatorTask.h"
32+
#include "Common/TH2Ratio.h"
3433

3534
namespace o2::quality_control::repository
3635
{
@@ -45,7 +44,7 @@ namespace o2::quality_control_modules::muonchambers
4544
{
4645

4746
/// \brief A post-processing task which processes and trends MCH pre-clusters and produces plots.
48-
class PreclustersPostProcessing : public PostProcessingInterface
47+
class PreclustersPostProcessing : public ReferenceComparatorTask
4948
{
5049
public:
5150
PreclustersPostProcessing() = default;
@@ -73,6 +72,8 @@ class PreclustersPostProcessing : public PostProcessingInterface
7372
static std::string clusterChargeSourceName() { return "clcharge"; }
7473
static std::string clusterSizeSourceName() { return "clsize"; }
7574

75+
TH1* getHistogram(std::string plotName);
76+
7677
bool mFullHistos{ false };
7778
bool mEnableLastCycleHistos{ false };
7879
bool mEnableTrending{ false };
@@ -102,7 +103,10 @@ class PreclustersPostProcessing : public PostProcessingInterface
102103
std::unique_ptr<ClusterChargeTrendsPlotter> mClusterChargeTrendsPlotter;
103104
std::unique_ptr<ClusterSizeTrendsPlotter> mClusterSizeTrendsPlotter;
104105

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

108112
template <typename T>

Modules/MUON/MCH/include/MCH/RatesPlotter.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,10 @@ class RatesPlotter : public HistPlotter
6969
std::unique_ptr<TH2F> mHistogramRatePerStation;
7070

7171
std::unique_ptr<TH1F> mHistogramMeanRatePerDE;
72+
std::unique_ptr<TH1F> mHistogramMeanRatePerSolar;
7273

7374
std::unique_ptr<TH1F> mHistogramGoodChannelsFractionPerDE;
75+
std::unique_ptr<TH1F> mHistogramGoodChannelsFractionPerSolar;
7476

7577
std::map<int, std::shared_ptr<DetectorHistogram>> mHistogramRateDE[2]; // 2D hit rate map for each DE
7678
std::shared_ptr<GlobalHistogram> mHistogramRateGlobal[2]; // Rate histogram (global XY view)

Modules/MUON/MCH/src/DecodingErrorsPlotter.cxx

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,14 @@ DecodingErrorsPlotter::DecodingErrorsPlotter(std::string path) : mPath(path)
6060
// Number of decoding errors, grouped by FEE ID and normalized to the number of processed TF
6161
mHistogramGoodBoardsPerDE = std::make_unique<TH1F>(TString::Format("%sGoodBoardsFractionPerDE", path.c_str()),
6262
"Fraction of boards not in error", getNumDE(), 0, getNumDE());
63+
addDEBinLabels(mHistogramGoodBoardsPerDE.get());
6364
addHisto(mHistogramGoodBoardsPerDE.get(), false, "", "");
6465

66+
mHistogramGoodBoardsPerSolar = std::make_unique<TH1F>(TString::Format("%sGoodBoardsFractionPerSolar", path.c_str()),
67+
"Fraction of boards not in error per SOLAR board", getNumSolar(), 0, getNumSolar());
68+
addSolarBinLabels(mHistogramGoodBoardsPerSolar.get());
69+
addHisto(mHistogramGoodBoardsPerSolar.get(), false, "", "");
70+
6571
//--------------------------------------------
6672
// Decoding errors per chamber, DE and FEEID
6773
//--------------------------------------------
@@ -122,7 +128,8 @@ void DecodingErrorsPlotter::update(TH2F* h)
122128
mHistogramErrorsPerDE->Reset("ICES");
123129
mHistogramErrorsPerChamber->Reset("ICES");
124130

125-
std::array<std::pair<float, float>, getNumDE()> goodBoardsFraction;
131+
std::array<std::pair<float, float>, getNumDE()> goodBoardsFractionPerDE;
132+
std::array<std::pair<float, float>, getNumSolar()> goodBoardsFractionPerSolar;
126133

127134
// loop over bins in electronics coordinates, and map the channels to the corresponding cathode pads
128135
int nbinsx = h->GetXaxis()->GetNbins();
@@ -144,16 +151,21 @@ void DecodingErrorsPlotter::update(TH2F* h)
144151
// where one bin is one physical pad
145152
// get the unique solar ID and the DS address associated to this digit
146153
int feeId = -1;
154+
int solarId = -1;
147155
std::optional<DsElecId> dsElecId = mDet2ElecMapper(dsDetId);
148156
if (dsElecId) {
149-
uint32_t solarId = dsElecId->solarId();
157+
solarId = dsElecId->solarId();
150158
uint32_t dsAddr = dsElecId->elinkId();
151159

152160
std::optional<FeeLinkId> feeLinkId = mSolar2FeeLinkMapper(solarId);
153161
if (feeLinkId) {
154162
feeId = feeLinkId->feeId();
155163
}
156164
}
165+
int solarIndex = (solarId >= 0) ? getSolarIndex(solarId) : -1;
166+
if (solarIndex < 0) {
167+
continue;
168+
}
157169

158170
bool hasError = false;
159171

@@ -171,21 +183,33 @@ void DecodingErrorsPlotter::update(TH2F* h)
171183
incrementBin(mHistogramErrorsPerChamber.get(), chamber, j, count);
172184
}
173185

174-
goodBoardsFraction[deIndex].first += 1;
186+
goodBoardsFractionPerDE[deIndex].first += 1;
187+
goodBoardsFractionPerSolar[solarIndex].first += 1;
175188
if (!hasError) {
176-
goodBoardsFraction[deIndex].second += 1;
189+
goodBoardsFractionPerDE[deIndex].second += 1;
190+
goodBoardsFractionPerSolar[solarIndex].second += 1;
177191
}
178192
}
179193

180194
// update fraction of good boards per DE
181195
for (int i = 0; i < getNumDE(); i++) {
182-
if (goodBoardsFraction[i].first > 0) {
183-
float frac = goodBoardsFraction[i].second / goodBoardsFraction[i].first;
196+
if (goodBoardsFractionPerDE[i].first > 0) {
197+
float frac = goodBoardsFractionPerDE[i].second / goodBoardsFractionPerDE[i].first;
184198
mHistogramGoodBoardsPerDE->SetBinContent(i + 1, frac);
185199
} else {
186200
mHistogramGoodBoardsPerDE->SetBinContent(i + 1, 0);
187201
}
188202
}
203+
204+
// update fraction of good boards per Solar
205+
for (int i = 0; i < getNumSolar(); i++) {
206+
if (goodBoardsFractionPerSolar[i].first > 0) {
207+
float frac = goodBoardsFractionPerSolar[i].second / goodBoardsFractionPerSolar[i].first;
208+
mHistogramGoodBoardsPerSolar->SetBinContent(i + 1, frac);
209+
} else {
210+
mHistogramGoodBoardsPerSolar->SetBinContent(i + 1, 0);
211+
}
212+
}
189213
}
190214

191215
} // namespace muonchambers

0 commit comments

Comments
 (0)