Skip to content

Commit 51ba0ea

Browse files
authored
MCH: improve digits task plots (#1081)
* [MCH] improvements to detector histograms - added visualization of detector contour - added per-DE H/V shifts - improved visualization of quadrants plots - fixed orientation of SLATs - added ad-hoc indexing of DE IDs * [MCH] improvements to digits task and checker - added option for saving the plots to a local ROOT file - improved separation between standard and experts plots - added configurable min and max occupancy levels in checker - improved plotting of per-DE occupancies
1 parent 180429c commit 51ba0ea

7 files changed

Lines changed: 446 additions & 128 deletions

File tree

Modules/MUON/MCH/include/MCH/GlobalHistogram.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ namespace muonchambers
3131

3232
std::string getHistoPath(int deId);
3333

34+
int getDEindex(int de);
35+
int getDEindexMax();
36+
3437
class DetectorHistogram
3538
{
3639
public:
@@ -59,8 +62,11 @@ class DetectorHistogram
5962

6063
bool mFlipX{ false };
6164
bool mFlipY{ false };
65+
float mShiftX{ 0 };
66+
float mShiftY{ 0 };
6267

6368
void init();
69+
void addContour();
6470
};
6571

6672
class GlobalHistogram : public TH2F

Modules/MUON/MCH/include/MCH/MergeableTH1OccupancyPerDE.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#include "MCHMappingInterface/Segmentation.h"
3838
#include "MCHMappingInterface/CathodeSegmentation.h"
3939
#include "MCHMappingSegContour/CathodeSegmentationContours.h"
40+
#include "MCH/GlobalHistogram.h"
4041

4142
using namespace std;
4243
namespace o2::quality_control_modules::muonchambers
@@ -48,7 +49,7 @@ class MergeableTH1OccupancyPerDE : public TH1F, public o2::mergers::MergeInterfa
4849
MergeableTH1OccupancyPerDE() = default;
4950

5051
MergeableTH1OccupancyPerDE(MergeableTH1OccupancyPerDE const& copymerge)
51-
: TH1F("DefaultName", "DefaultTitle", 1100, -0.5, 1099.5), o2::mergers::MergeInterface()
52+
: TH1F("DefaultName", "DefaultTitle", getDEindexMax(), 0, getDEindexMax()), o2::mergers::MergeInterface()
5253
{
5354
Bool_t bStatus = TH1::AddDirectoryStatus();
5455
TH1::AddDirectory(kFALSE);
@@ -58,12 +59,12 @@ class MergeableTH1OccupancyPerDE : public TH1F, public o2::mergers::MergeInterfa
5859
}
5960

6061
MergeableTH1OccupancyPerDE(const char* name, const char* title)
61-
: TH1F(name, title, 1100, -0.5, 1099.5), o2::mergers::MergeInterface()
62+
: TH1F(name, title, getDEindexMax(), 0, getDEindexMax()), o2::mergers::MergeInterface()
6263
{
6364
Bool_t bStatus = TH1::AddDirectoryStatus();
6465
TH1::AddDirectory(kFALSE);
65-
mHistoNum = new TH1F("num", "num", 1100, -0.5, 1099.5);
66-
mHistoDen = new TH1F("den", "den", 1100, -0.5, 1099.5);
66+
mHistoNum = new TH1F("num", "num", getDEindexMax(), 0, getDEindexMax());
67+
mHistoDen = new TH1F("den", "den", getDEindexMax(), 0, getDEindexMax());
6768
TH1::AddDirectory(bStatus);
6869
update();
6970
}
@@ -136,7 +137,6 @@ class MergeableTH1OccupancyPerDE : public TH1F, public o2::mergers::MergeInterfa
136137
for (int biny = 1; biny < horbits->GetYaxis()->GetNbins() + 1; biny++) {
137138

138139
int mNOrbits = horbits->GetBinContent(binx, biny);
139-
//std::cout << fmt::format(" norbits {}", mNOrbits) << std::endl;
140140
if (mNOrbits <= 0) {
141141
// no orbits detected for this channel, skip it
142142
continue;
@@ -163,8 +163,9 @@ class MergeableTH1OccupancyPerDE : public TH1F, public o2::mergers::MergeInterfa
163163
}
164164

165165
for (auto i : o2::mch::raw::deIdsForAllMCH) {
166-
mHistoNum->SetBinContent(i + 1, nHitsDE[i]);
167-
mHistoDen->SetBinContent(i + 1, nOrbitsDE[i]);
166+
auto id = getDEindex(i);
167+
mHistoNum->SetBinContent(id + 1, nHitsDE[i]);
168+
mHistoDen->SetBinContent(id + 1, nOrbitsDE[i]);
168169
}
169170

170171
update();
@@ -180,4 +181,4 @@ class MergeableTH1OccupancyPerDE : public TH1F, public o2::mergers::MergeInterfa
180181

181182
} // namespace o2::quality_control_modules::muonchambers
182183

183-
#endif //O2_MERGEABLETH1OCCUPANCYPERDE_H
184+
#endif // O2_MERGEABLETH1OCCUPANCYPERDE_H

Modules/MUON/MCH/include/MCH/PhysicsCheck.h

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#include "QualityControl/CheckInterface.h"
2121
#include "QualityControl/MonitorObject.h"
2222
#include "QualityControl/Quality.h"
23+
#include "MCHRawCommon/DataFormats.h"
24+
#include "MCHRawElecMap/Mapper.h"
2325
#include <string>
2426

2527
namespace o2::quality_control_modules::muonchambers
@@ -43,9 +45,17 @@ class PhysicsCheck : public o2::quality_control::checker::CheckInterface
4345
std::string getAcceptedType() override;
4446

4547
private:
48+
bool checkPadMapping(uint16_t feeId, uint8_t linkId, uint8_t eLinkId, o2::mch::raw::DualSampaChannelId channel);
49+
4650
int mPrintLevel;
47-
double minOccupancy;
48-
double maxOccupancy;
51+
double mMinOccupancy;
52+
double mMaxOccupancy;
53+
54+
o2::mch::raw::Elec2DetMapper mElec2DetMapper;
55+
o2::mch::raw::Det2ElecMapper mDet2ElecMapper;
56+
o2::mch::raw::FeeLink2SolarMapper mFeeLink2SolarMapper;
57+
o2::mch::raw::Solar2FeeLinkMapper mSolar2FeeLinkMapper;
58+
4959
ClassDefOverride(PhysicsCheck, 2);
5060
};
5161

Modules/MUON/MCH/include/MCH/PhysicsTaskDigits.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ class PhysicsTaskDigits /*final*/ : public TaskInterface // todo add back the "f
7575
static constexpr int sMaxDsId = 40;
7676

7777
bool mDiagnostic{ false };
78+
bool mSaveToRootFile{ false };
7879

7980
o2::mch::raw::Elec2DetMapper mElec2DetMapper;
8081
o2::mch::raw::Det2ElecMapper mDet2ElecMapper;
@@ -89,9 +90,9 @@ class PhysicsTaskDigits /*final*/ : public TaskInterface // todo add back the "f
8990
TH2F* mHistogramNorbitsElec; // Histogram of Number of orbits (Elec view)
9091
std::shared_ptr<MergeableTH2Ratio> mHistogramOccupancyElec; // Mergeable object, Occupancy histogram (Elec view)
9192

92-
std::shared_ptr<TH2F> mDigitsOrbitInTF;
93-
std::shared_ptr<TH2F> mDigitsBcInOrbit;
94-
std::shared_ptr<TH2F> mAmplitudeVsSamples;
93+
std::shared_ptr<TH2F> mHistogramDigitsOrbitInTF;
94+
std::shared_ptr<TH2F> mHistogramDigitsBcInOrbit;
95+
std::shared_ptr<TH2F> mHistogramAmplitudeVsSamples;
9596

9697
std::map<int, std::shared_ptr<TH1F>> mHistogramADCamplitudeDE; // Histogram of ADC distribution per DE
9798
std::map<int, std::shared_ptr<DetectorHistogram>> mHistogramNhitsDE[2]; // Histogram of Number of hits (XY view)

0 commit comments

Comments
 (0)