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
3 changes: 3 additions & 0 deletions Modules/MUON/MCH/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ set(SRCS
src/DecodingPostProcessing.cxx
src/DigitsPostProcessing.cxx
src/PreclustersPostProcessing.cxx
src/QualityAggregatorTask.cxx
src/PostProcessingConfigMCH.cxx
src/TrendingTracks.cxx
src/ClustersTask.cxx
Expand Down Expand Up @@ -76,6 +77,7 @@ set(HEADERS
include/MCH/DedodingPostProcessing.h
include/MCH/DigitsPostProcessing.h
include/MCH/PreclustersPostProcessing.h
include/MCH/QualityAggregatorTask.h
include/MCH/PostProcessingConfigMCH.h
include/MCH/TrendingTracks.h
include/MCH/ClustersTask.h
Expand Down Expand Up @@ -161,6 +163,7 @@ add_root_dictionary(${MODULE_NAME}
include/MCH/DecodingPostProcessing.h
include/MCH/DigitsPostProcessing.h
include/MCH/PreclustersPostProcessing.h
include/MCH/QualityAggregatorTask.h
include/MCH/PostProcessingConfigMCH.h
include/MCH/TrendingTracks.h
include/MCH/ClustersTask.h
Expand Down
26 changes: 23 additions & 3 deletions Modules/MUON/MCH/include/MCH/DecodingCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,40 @@ class DecodingCheck : public o2::quality_control::checker::CheckInterface
std::string getAcceptedType() override;

private:
std::string mGoodFracHistName{ "DecodingErrors/LastCycle/GoodBoardsFractionPerDE" };
std::string mSyncFracHistName{ "SyncErrors/LastCycle/SyncedBoardsFractionPerDE" };
std::string mGoodFracHistName{ "DecodingErrors/GoodBoardsFractionPerDE" };
std::string mGoodFracPerSolarHistName{ "DecodingErrors/GoodBoardsFractionPerSolar" };
std::string mSyncFracHistName{ "SyncErrors/SyncedBoardsFractionPerDE" };
std::string mSyncFracPerSolarHistName{ "SyncErrors/SyncedBoardsFractionPerSolar" };
std::string mGoodFracRefCompHistName{ "DecodingErrors/RefComp/GoodBoardsFractionPerDE" };
std::string mGoodFracPerSolarRefCompHistName{ "DecodingErrors/RefComp/GoodBoardsFractionPerSolar" };
std::string mSyncFracRefCompHistName{ "SyncErrors/RefComp/SyncedBoardsFractionPerDE" };
std::string mSyncFracPerSolarRefCompHistName{ "SyncErrors/RefComp/SyncedBoardsFractionPerSolar" };
int mMaxBadST12{ 2 };
int mMaxBadST345{ 3 };
double mMinGoodErrorFrac{ 0.9 };
std::array<std::optional<double>, 5> mMinGoodErrorFracPerStation;
double mMinGoodErrorFracPerSolar{ 0.5 };
double mMinGoodErrorFracRatio{ 0.9 };
double mMinGoodErrorFracRatioPerSolar{ 0.9 };

double mMinGoodSyncFrac{ 0.9 };
std::array<std::optional<double>, 5> mMinGoodSyncFracPerStation;
double mMinGoodSyncFracPerSolar{ 0.5 };
double mMinGoodSyncFracRatio{ 0.9 };
double mMinGoodSyncFracRatioPerSolar{ 0.9 };

double mMinHeartBeatRate{ 0 };
double mMaxHeartBeatRate{ 2 };

double mGoodFracRatioPlotRange{ 0.2 };
double mGoodFracRatioPerSolarPlotRange{ 0.2 };
double mSyncFracRatioPlotRange{ 0.2 };
double mSyncFracRatioPerSolarPlotRange{ 0.2 };

QualityChecker mQualityChecker;
std::array<Quality, getNumSolar()> mSolarQuality;

ClassDefOverride(DecodingCheck, 1);
ClassDefOverride(DecodingCheck, 2);
};

} // namespace o2::quality_control_modules::muonchambers
Expand Down
4 changes: 3 additions & 1 deletion Modules/MUON/MCH/include/MCH/DecodingErrorsPlotter.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,12 @@ class DecodingErrorsPlotter : public HistPlotter

std::string mPath;

std::unique_ptr<TH1F> mHistogramGoodBoardsPerDE; ///< fraction of boards with errors per DE
std::unique_ptr<TH2F> mHistogramErrorsPerDE; ///< error codes per DE
std::unique_ptr<TH2F> mHistogramErrorsPerChamber; ///< error codes per chamber
std::unique_ptr<TH2F> mHistogramErrorsPerFeeId; ///< error codes per FEE ID

std::unique_ptr<TH1F> mHistogramGoodBoardsPerDE; ///< fraction of boards without errors per DE
std::unique_ptr<TH1F> mHistogramGoodBoardsPerSolar; ///< fraction of boards with errors per DE
};

} // namespace muonchambers
Expand Down
13 changes: 9 additions & 4 deletions Modules/MUON/MCH/include/MCH/DecodingPostProcessing.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@

#include "MCH/PostProcessingConfigMCH.h"
#include "MCH/Helpers.h"
#include "Common/TH2Ratio.h"
#include "MCH/HistoOnCycle.h"
#include "MCH/DecodingErrorsPlotter.h"
#include "MCH/HeartBeatPacketsPlotter.h"
#include "MCH/FECSyncStatusPlotter.h"
#include "QualityControl/PostProcessingInterface.h"
#include "Common/ReferenceComparatorTask.h"
#include "Common/TH2Ratio.h"

#include <memory>

Expand All @@ -43,7 +43,7 @@ namespace o2::quality_control_modules::muonchambers
{

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

TH1* getHistogram(std::string_view plotName);

bool mFullHistos{ false };
bool mEnableLastCycleHistos{ false };
bool mEnableTrending{ false };
Expand All @@ -96,7 +98,10 @@ class DecodingPostProcessing : public PostProcessingInterface
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
std::unique_ptr<TH2F> mHistogramQualityPerDE; ///< quality flags for each DE, to be filled by checker task
std::unique_ptr<TH2F> mHistogramQualityPerSolar; ///< quality flags for each SOLAR, to be filled by checker task

std::vector<TH1*> mHistogramsAll;
};

template <typename T>
Expand Down
45 changes: 38 additions & 7 deletions Modules/MUON/MCH/include/MCH/DigitsCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,27 +50,58 @@ class DigitsCheck : public o2::quality_control::checker::CheckInterface
std::string getAcceptedType() override;

private:
std::array<Quality, getNumDE()> checkMeanRates(TH1F* h);
std::array<Quality, getNumDE()> checkMeanRatesRatio(TH1F* h);
std::array<Quality, getNumDE()> checkBadChannels(TH1F* h);
std::array<Quality, getNumDE()> checkBadChannelsRatio(TH1F* h);
std::array<Quality, getNumDE()> checkMeanRates(TH1* h);
std::array<Quality, getNumDE()> checkBadChannels(TH1* h);
std::array<Quality, getNumDE()> checkMeanRateRatios(TH1* h);
std::array<Quality, getNumDE()> checkBadChannelRatios(TH1* h);
void checkSolarMeanRates(TH1* h);
void checkSolarBadChannels(TH1* h);
void checkSolarMeanRateRatios(TH1* h);
void checkSolarBadChannelRatios(TH1* h);

std::string mMeanRateHistName{ "RatesSignal/LastCycle/MeanRate" };
std::string mGoodChanFracHistName{ "RatesSignal/LastCycle/GoodChannelsFraction" };
std::string mMeanRateHistName{ "RatesSignal/MeanRate" };
std::string mGoodChanFracHistName{ "RatesSignal/GoodChannelsFraction" };
std::string mMeanRatePerSolarHistName{ "RatesSignal/MeanRatePerSolar" };
std::string mGoodChanFracPerSolarHistName{ "RatesSignal/GoodChannelsFractionPerSolar" };
std::string mMeanRateRefCompHistName{ "RatesSignal/RefComp/MeanRate" };
std::string mGoodChanFracRefCompHistName{ "RatesSignal/RefComp/GoodChannelsFraction" };
std::string mMeanRatePerSolarRefCompHistName{ "RatesSignal/RefComp/MeanRatePerSolar" };
std::string mGoodChanFracPerSolarRefCompHistName{ "RatesSignal/RefComp/GoodChannelsFractionPerSolar" };
int mMaxBadST12{ 2 };
int mMaxBadST345{ 3 };

// Rate lower threshold
double mMinRate{ 0.001 };
std::array<std::optional<double>, 5> mMinRatePerStation;
double mMinRatePerSolar{ 0.001 };
// Rate upper threshold
double mMaxRate{ 10 };
std::array<std::optional<double>, 5> mMaxRatePerStation;
double mMaxRatePerSolar{ 10 };
// Rate ratio threshold
double mMinRateRatio{ 0.9 };
double mMinRateRatioPerSolar{ 0.9 };

// Good channels fraction threshold
double mMinGoodFraction{ 0.9 };
std::array<std::optional<double>, 5> mMinGoodFractionPerStation;
double mMinGoodFractionPerSolar{ 0.5 };
// Good channels ratio threshold
double mMinGoodFractionRatio{ 0.9 };
double mMinGoodFractionRatioPerSolar{ 0.9 };

// Vertical plot ranges
double mRatePlotScaleMin{ 0 };
double mRatePlotScaleMax{ 10 };
double mRateRatioPlotScaleRange{ 0.2 };
double mRateRatioPerSolarPlotScaleRange{ 0.2 };
double mGoodFractionRatioPlotScaleRange{ 0.2 };
double mGoodFractionRatioPerSolarPlotScaleRange{ 0.2 };

QualityChecker mQualityChecker;
std::array<Quality, getNumSolar()> mSolarQuality;

ClassDefOverride(DigitsCheck, 2);
ClassDefOverride(DigitsCheck, 3);
};

} // namespace o2::quality_control_modules::muonchambers
Expand Down
10 changes: 8 additions & 2 deletions Modules/MUON/MCH/include/MCH/DigitsPostProcessing.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "MCH/RatesPlotter.h"
#include "MCH/RatesTrendsPlotter.h"
#include "MCH/OrbitsPlotter.h"
#include "Common/ReferenceComparatorTask.h"
#include "Common/TH2Ratio.h"
#include "QualityControl/PostProcessingInterface.h"

Expand All @@ -40,7 +41,7 @@ namespace o2::quality_control_modules::muonchambers
{

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

TH1* getHistogram(std::string_view plotName);

bool mFullHistos{ false };
bool mEnableLastCycleHistos{ false };
bool mEnableTrending{ false };
Expand Down Expand Up @@ -99,7 +102,10 @@ class DigitsPostProcessing : public PostProcessingInterface
std::unique_ptr<OrbitsPlotter> mOrbitsPlotterSignal;
std::unique_ptr<OrbitsPlotter> mOrbitsPlotterSignalOnCycle;

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

std::vector<TH1*> mHistogramsAll;
};

} // namespace o2::quality_control_modules::muonchambers
Expand Down
1 change: 1 addition & 0 deletions Modules/MUON/MCH/include/MCH/EfficiencyPlotter.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class EfficiencyPlotter : public HistPlotter
std::unique_ptr<TH2ElecMapReductor> mElecMapReductor;

std::array<std::unique_ptr<TH1F>, 2> mHistogramMeanEfficiencyPerDE;
std::unique_ptr<TH1F> mHistogramMeanEfficiencyPerSolar;

std::array<std::map<int, std::shared_ptr<DetectorHistogram>>, 2> mHistogramEfficiencyDE; // 2D hit rate map for each DE
std::array<std::unique_ptr<GlobalHistogram>, 2> mHistogramEfficiencyGlobal; // Efficiency histogram (global XY view)
Expand Down
6 changes: 3 additions & 3 deletions Modules/MUON/MCH/include/MCH/FECSyncStatusPlotter.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ class FECSyncStatusPlotter : public HistPlotter
histograms().emplace_back(HistInfo{ h, drawOptions, displayHints });
}

o2::mch::raw::Elec2DetMapper mElec2DetMapper;
o2::mch::raw::FeeLink2SolarMapper mFeeLink2SolarMapper;
o2::mch::raw::Det2ElecMapper mDet2ElecMapper;

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

} // namespace muonchambers
Expand Down
16 changes: 14 additions & 2 deletions Modules/MUON/MCH/include/MCH/Helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ int getDEindex(int de);
constexpr int getNumDE() { return (4 * 4 + 18 * 2 + 26 * 4); }
int getNumDEinChamber(int chIndex);
std::pair<int, int> getDEindexInChamber(int deId);
int getDEFromIndex(int index);

int getSolarIndex(int solarId);
int getSolarIdFromIndex(int index);
constexpr int getNumSolar() { return 624; }
int getNumSolarPerChamber(int chamberId);

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

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

void addChamberDelimiters(TH1F* h, float xmin = 0, float xmax = 0);
void addChamberDelimiters(TH2F* h);
void addChamberLabelsForDE(TH1* h);
void addChamberDelimiters(TH1* h, float xmin = 0, float xmax = 0);
void addChamberDelimiters(TH2* h);
void addChamberLabelsForSolar(TH1* h);
void addChamberDelimitersToSolarHistogram(TH1* h, float xmin = 0, float xmax = 0);
void addChamberDelimitersToSolarHistogram(TH2* h);
void drawThreshold(TH1* histogram, double threshold);
void drawThresholdsPerStation(TH1* histogram, const std::array<std::optional<double>, 5>& thresholdsPerStation, double defaultThreshold);
void addDEBinLabels(TH1* histogram);
void addSolarBinLabels(TH1* histogram);

std::string getHistoPath(int deId);
bool matchHistName(std::string hist, std::string name);
Expand Down
1 change: 1 addition & 0 deletions Modules/MUON/MCH/include/MCH/LinkDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#pragma link C++ class o2::quality_control_modules::muonchambers::DecodingPostProcessing + ;
#pragma link C++ class o2::quality_control_modules::muonchambers::DigitsPostProcessing + ;
#pragma link C++ class o2::quality_control_modules::muonchambers::PreclustersPostProcessing + ;
#pragma link C++ class o2::quality_control_modules::muonchambers::QualityAggregatorTask + ;
// Trending
#pragma link C++ class o2::quality_control_modules::muonchambers::TrendingTracks + ;
// Checks
Expand Down
24 changes: 18 additions & 6 deletions Modules/MUON/MCH/include/MCH/PreclustersCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,33 @@ class PreclustersCheck : public o2::quality_control::checker::CheckInterface
std::string getAcceptedType() override;

private:
std::array<Quality, getNumDE()> checkMeanEfficiencies(TH1F* h);
std::array<Quality, getNumDE()> checkMeanEfficienciesRatio(TH1F* h);
std::array<Quality, getNumDE()> checkMeanEfficiencies(TH1* h);
std::array<Quality, getNumDE()> checkMeanEfficiencyRatios(TH1* h);
void checkSolarMeanEfficiencies(TH1* h);
void checkSolarMeanEfficiencyRatios(TH1* h);

std::string mMeanEffHistNameB{ "Efficiency/LastCycle/MeanEfficiencyB" };
std::string mMeanEffHistNameNB{ "Efficiency/LastCycle/MeanEfficiencyNB" };
std::string mMeanEffHistNameB{ "Efficiency/MeanEfficiencyB" };
std::string mMeanEffHistNameNB{ "Efficiency/MeanEfficiencyNB" };
std::string mMeanEffPerSolarHistName{ "Efficiency/MeanEfficiencyPerSolar" };
std::string mMeanEffRefCompHistNameB{ "Efficiency/RefComp/MeanEfficiencyB" };
std::string mMeanEffRefCompHistNameNB{ "Efficiency/RefComp/MeanEfficiencyNB" };
std::string mMeanEffPerSolarRefCompHistName{ "Efficiency/RefComp/MeanEfficiencyPerSolar" };
int mMaxBadST12{ 2 };
int mMaxBadST345{ 3 };
double mMinEfficiency{ 0.8 };
std::array<std::optional<double>, 5> mMinEfficiencyPerStation;
double mMinEfficiencyPerSolar{ 0.5 };
double mMinEfficiencyRatio{ 0.9 };
double mMinEfficiencyRatioPerSolar{ 0.9 };
double mPseudoeffPlotScaleMin{ 0.0 };
double mPseudoeffPlotScaleMax{ 1.0 };
double mPseudoeffPlotScaleMax{ 1.05 };
double mEfficiencyRatioScaleRange{ 0.2 };
double mEfficiencyRatioPerSolarScaleRange{ 0.2 };

QualityChecker mQualityChecker;
std::array<Quality, getNumSolar()> mSolarQuality;

ClassDefOverride(PreclustersCheck, 2);
ClassDefOverride(PreclustersCheck, 3);
};

} // namespace o2::quality_control_modules::muonchambers
Expand Down
14 changes: 9 additions & 5 deletions Modules/MUON/MCH/include/MCH/PreclustersPostProcessing.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,17 @@
#ifndef QC_MODULE_MCH_PP_PRECLUSTERS_H
#define QC_MODULE_MCH_PP_PRECLUSTERS_H

#include "QualityControl/PostProcessingInterface.h"

#include "MCH/PostProcessingConfigMCH.h"
#include "MCH/Helpers.h"
#include "Common/TH2Ratio.h"
#include "MCH/HistoOnCycle.h"
#include "MCH/EfficiencyPlotter.h"
#include "MCH/EfficiencyTrendsPlotter.h"
#include "MCH/ClusterSizePlotter.h"
#include "MCH/ClusterSizeTrendsPlotter.h"
#include "MCH/ClusterChargePlotter.h"
#include "MCH/ClusterChargeTrendsPlotter.h"
#include "Common/ReferenceComparatorTask.h"
#include "Common/TH2Ratio.h"

namespace o2::quality_control::repository
{
Expand All @@ -45,7 +44,7 @@ namespace o2::quality_control_modules::muonchambers
{

/// \brief A post-processing task which processes and trends MCH pre-clusters and produces plots.
class PreclustersPostProcessing : public PostProcessingInterface
class PreclustersPostProcessing : public ReferenceComparatorTask
{
public:
PreclustersPostProcessing() = default;
Expand Down Expand Up @@ -73,6 +72,8 @@ class PreclustersPostProcessing : public PostProcessingInterface
static std::string clusterChargeSourceName() { return "clcharge"; }
static std::string clusterSizeSourceName() { return "clsize"; }

TH1* getHistogram(std::string_view plotName);

bool mFullHistos{ false };
bool mEnableLastCycleHistos{ false };
bool mEnableTrending{ false };
Expand Down Expand Up @@ -102,7 +103,10 @@ class PreclustersPostProcessing : public PostProcessingInterface
std::unique_ptr<ClusterChargeTrendsPlotter> mClusterChargeTrendsPlotter;
std::unique_ptr<ClusterSizeTrendsPlotter> mClusterSizeTrendsPlotter;

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

std::vector<TH1*> mHistogramsAll;
};

template <typename T>
Expand Down
Loading