Skip to content

Commit dd20cce

Browse files
peressounkoDmitri Peresunko
andauthored
mergable histos implemented; separate HG/LG pedestal histos (#1245)
Co-authored-by: Dmitri Peresunko <Dmitri.Peresunko@cern.ch>
1 parent b75dfd0 commit dd20cce

File tree

11 files changed

+599
-201
lines changed

11 files changed

+599
-201
lines changed

Modules/PHOS/CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
add_library(O2QcPHOS)
44

5-
target_sources(O2QcPHOS PRIVATE src/RawQcTask.cxx
5+
target_sources(O2QcPHOS PRIVATE src/TH2FMean.cxx
6+
src/TH2SBitmask.cxx
7+
src/RawQcTask.cxx
68
src/RawCheck.cxx
79
src/ClusterQcTask.cxx
810
src/ClusterCheck.cxx
@@ -17,7 +19,9 @@ target_include_directories(
1719
target_link_libraries(O2QcPHOS PUBLIC O2QualityControl O2::PHOSBase O2::PHOSReconstruction ROOT::Spectrum)
1820

1921
add_root_dictionary(O2QcPHOS
20-
HEADERS include/PHOS/ClusterQcTask.h
22+
HEADERS include/PHOS/TH2FMean.h
23+
include/PHOS/TH2SBitmask.h
24+
include/PHOS/ClusterQcTask.h
2125
include/PHOS/ClusterCheck.h
2226
include/PHOS/RawQcTask.h
2327
include/PHOS/RawCheck.h

Modules/PHOS/include/PHOS/LinkDef.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
#pragma link off all classes;
44
#pragma link off all functions;
55

6+
#pragma link C++ class o2::quality_control_modules::phos::TH2SBitmask + ;
7+
8+
#pragma link C++ class o2::quality_control_modules::phos::TH2FMean + ;
9+
610
#pragma link C++ class o2::quality_control_modules::phos::ClusterQcTask + ;
711

812
#pragma link C++ class o2::quality_control_modules::phos::ClusterCheck + ;

Modules/PHOS/include/PHOS/RawCheck.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class RawCheck final : public o2::quality_control::checker::CheckInterface
4141
// Override interface
4242
void configure() override;
4343
Quality check(std::map<std::string, std::shared_ptr<MonitorObject>>* moMap) override;
44-
void beautify(std::shared_ptr<MonitorObject> mo, Quality checkResult = Quality::Null) override;
44+
void beautify(std::shared_ptr<MonitorObject> mo, Quality checkResult = Quality::Null) override {}
4545
std::string getAcceptedType() override;
4646

4747
protected:

Modules/PHOS/include/PHOS/RawQcTask.h

Lines changed: 70 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
class TH2F;
3030
#include "DataFormatsPHOS/BadChannelsMap.h"
3131
#include <TSpectrum.h>
32+
#include "PHOS/TH2FMean.h"
33+
#include "PHOS/TH2SBitmask.h"
3234

3335
using namespace o2::quality_control::core;
3436

@@ -54,7 +56,7 @@ class RawQcTask final : public TaskInterface
5456
void reset() override;
5557

5658
protected:
57-
static constexpr short kNhist1D = 23;
59+
static constexpr short kNhist1D = 27;
5860
enum histos1D { kTotalDataVolume,
5961
kMessageCounter,
6062
kBadMapSummary,
@@ -74,15 +76,18 @@ class RawQcTask final : public TaskInterface
7476
kLGrmsSummaryM2,
7577
kLGrmsSummaryM3,
7678
kLGrmsSummaryM4,
77-
kCellSpM1,
78-
kCellSpM2,
79-
kCellSpM3,
80-
kCellSpM4
79+
kCellHGSpM1,
80+
kCellHGSpM2,
81+
kCellHGSpM3,
82+
kCellHGSpM4,
83+
kCellLGSpM1,
84+
kCellLGSpM2,
85+
kCellLGSpM3,
86+
kCellLGSpM4
8187
};
8288

83-
static constexpr short kNhist2D = 51;
89+
static constexpr short kNhist2D = 42;
8490
enum histos2D { kErrorNumber,
85-
kErrorType,
8691
kPayloadSizePerDDL,
8792
kChi2M1,
8893
kChi2M2,
@@ -92,22 +97,6 @@ class RawQcTask final : public TaskInterface
9297
kChi2NormM2,
9398
kChi2NormM3,
9499
kChi2NormM4,
95-
kHGmeanM1,
96-
kHGmeanM2,
97-
kHGmeanM3,
98-
kHGmeanM4,
99-
kLGmeanM1,
100-
kLGmeanM2,
101-
kLGmeanM3,
102-
kLGmeanM4,
103-
kHGrmsM1,
104-
kHGrmsM2,
105-
kHGrmsM3,
106-
kHGrmsM4,
107-
kLGrmsM1,
108-
kLGrmsM2,
109-
kLGrmsM3,
110-
kLGrmsM4,
111100
kHGoccupM1,
112101
kHGoccupM2,
113102
kHGoccupM3,
@@ -116,22 +105,60 @@ class RawQcTask final : public TaskInterface
116105
kLGoccupM2,
117106
kLGoccupM3,
118107
kLGoccupM4,
119-
kCellOccupM1,
120-
kCellOccupM2,
121-
kCellOccupM3,
122-
kCellOccupM4,
123-
kCellEM1,
124-
kCellEM2,
125-
kCellEM3,
126-
kCellEM4,
127108
kTimeEM1,
128109
kTimeEM2,
129110
kTimeEM3,
130111
kTimeEM4,
131-
kLEDNpeaksM1,
132-
kLEDNpeaksM2,
133-
kLEDNpeaksM3,
134-
kLEDNpeaksM4 };
112+
kTRUSTOccupM1,
113+
kTRUSTOccupM2,
114+
kTRUSTOccupM3,
115+
kTRUSTOccupM4,
116+
kTRUDGOccupM1,
117+
kTRUDGOccupM2,
118+
kTRUDGOccupM3,
119+
kTRUDGOccupM4,
120+
kTRUSTMatchM1,
121+
kTRUSTMatchM2,
122+
kTRUSTMatchM3,
123+
kTRUSTMatchM4,
124+
kTRUSTFakeM1,
125+
kTRUSTFakeM2,
126+
kTRUSTFakeM3,
127+
kTRUSTFakeM4,
128+
kTRUDGFakeM1,
129+
kTRUDGFakeM2,
130+
kTRUDGFakeM3,
131+
kTRUDGFakeM4 };
132+
133+
static constexpr short kNhist2DMean = 24;
134+
enum histos2DMean { kHGmeanM1,
135+
kHGmeanM2,
136+
kHGmeanM3,
137+
kHGmeanM4,
138+
kLGmeanM1,
139+
kLGmeanM2,
140+
kLGmeanM3,
141+
kLGmeanM4,
142+
kHGrmsM1,
143+
kHGrmsM2,
144+
kHGrmsM3,
145+
kHGrmsM4,
146+
kLGrmsM1,
147+
kLGrmsM2,
148+
kLGrmsM3,
149+
kLGrmsM4,
150+
kCellEM1,
151+
kCellEM2,
152+
kCellEM3,
153+
kCellEM4,
154+
kLEDNpeaksM1,
155+
kLEDNpeaksM2,
156+
kLEDNpeaksM3,
157+
kLEDNpeaksM4
158+
};
159+
160+
static constexpr short kNhist2DBitmask = 1;
161+
enum histos2DBitmask { kErrorType };
135162

136163
void InitHistograms();
137164

@@ -142,6 +169,9 @@ class RawQcTask final : public TaskInterface
142169
void CreateLEDHistograms();
143170
void FillLEDHistograms(const gsl::span<const o2::phos::Cell>& cells, const gsl::span<const o2::phos::TriggerRecord>& tr);
144171

172+
void CreateTRUHistograms();
173+
void FillTRUHistograms(const gsl::span<const o2::phos::Cell>& cells, const gsl::span<const o2::phos::TriggerRecord>& tr);
174+
145175
private:
146176
static constexpr short kNmod = 6;
147177
static constexpr short kMaxErr = 5;
@@ -150,9 +180,12 @@ class RawQcTask final : public TaskInterface
150180
int mMode = 0; ///< Possible modes: 0(def): Physics, 1: Pedestals, 2: LED
151181
bool mFinalized = false; ///< if final histograms calculated
152182
bool mCheckChi2 = false; ///< scan Chi2 distributions
183+
bool mTrNoise = false; ///< check mathing of trigger summary tables and tr.digits
153184

154-
std::array<TH1F*, kNhist1D> mHist1D = { nullptr }; ///< Array of 1D histograms
155-
std::array<TH2F*, kNhist2D> mHist2D = { nullptr }; ///< Array of 2D histograms
185+
std::array<TH1F*, kNhist1D> mHist1D = { nullptr }; ///< Array of 1D histograms
186+
std::array<TH2F*, kNhist2D> mHist2D = { nullptr }; ///< Array of 2D histograms
187+
std::array<TH2FMean*, kNhist2DMean> mHist2DMean = { nullptr }; ///< Array of 2D mean histograms
188+
std::array<TH2SBitmask*, kNhist2DBitmask> mHist2DBitmask = { nullptr }; ///< Array of 2D mean histograms
156189

157190
bool mInitBadMap = true; //! BadMap had to be initialized
158191
const o2::phos::BadChannelsMap* mBadMap = nullptr; //! Bad map for comparison
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
12+
///
13+
/// \file TH2FMean.h
14+
/// \author Dmitri Peresunko
15+
///
16+
17+
#ifndef QC_MODULE_PHOS_TH2FMEAN_H
18+
#define QC_MODULE_PHOS_TH2FMEAN_H
19+
20+
#include "QualityControl/TaskInterface.h"
21+
#include <TH2F.h>
22+
#include "Mergers/MergeInterface.h"
23+
24+
namespace o2::quality_control_modules::phos
25+
{
26+
27+
/// \brief Custom TH2F class with special merger
28+
29+
class TH2FMean : public TH2F, public o2::mergers::MergeInterface
30+
{
31+
public:
32+
/// \brief Constructor.
33+
TH2FMean() = default;
34+
TH2FMean(const char* name, const char* title, Int_t nbinsx, Double_t xlow, Double_t xup, Int_t nbinsy, Double_t ylow, Double_t yup) : TH2F(name, title, nbinsx, xlow, xup, nbinsy, ylow, yup) {}
35+
/// \brief Default destructor
36+
virtual ~TH2FMean() = default;
37+
38+
void merge(MergeInterface* const other) override;
39+
40+
private:
41+
std::string mTreatMeAs = "TH2F"; // the name of the class this object should be considered as when drawing in QCG.
42+
43+
ClassDefOverride(TH2FMean, 1);
44+
};
45+
46+
} // namespace o2::quality_control_modules::phos
47+
48+
#endif // QC_MODULE_PHOS_TH2FMEAN_H
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
12+
///
13+
/// \file TH2SBitmask.h
14+
/// \author Dmitri Peresunko
15+
///
16+
17+
#ifndef QC_MODULE_PHOS_TH2FBITMASK_H
18+
#define QC_MODULE_PHOS_TH2FBITMASK_H
19+
20+
#include "QualityControl/TaskInterface.h"
21+
#include <TH2S.h>
22+
#include "Mergers/MergeInterface.h"
23+
24+
namespace o2::quality_control_modules::phos
25+
{
26+
27+
/// \brief Custom TH2S class with special merger combining bit masks
28+
29+
class TH2SBitmask : public TH2S, public o2::mergers::MergeInterface
30+
{
31+
public:
32+
/// \brief Constructor.
33+
TH2SBitmask() = default;
34+
TH2SBitmask(const char* name, const char* title, Int_t nbinsx, Double_t xlow, Double_t xup, Int_t nbinsy, Double_t ylow, Double_t yup) : TH2S(name, title, nbinsx, xlow, xup, nbinsy, ylow, yup) {}
35+
/// \brief Default destructor
36+
~TH2SBitmask() = default;
37+
38+
void merge(MergeInterface* const other) override;
39+
40+
private:
41+
std::string mTreatMeAs = "TH2S"; // the name of the class this object should be considered as when drawing in QCG.
42+
43+
ClassDefOverride(TH2SBitmask, 1);
44+
};
45+
46+
} // namespace o2::quality_control_modules::phos
47+
48+
#endif // QC_MODULE_PHOS_TH2FBITMASK_H

Modules/PHOS/src/ClusterQcTask.cxx

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include "DataFormatsPHOS/TriggerRecord.h"
2727
#include "Framework/InputRecord.h"
2828

29-
//using namespace o2::phos;
29+
// using namespace o2::phos;
3030

3131
namespace o2::quality_control_modules::phos
3232
{
@@ -61,13 +61,13 @@ void ClusterQcTask::initialize(o2::framework::InitContext& /*ctx*/)
6161
ILOG(Info, Support) << "Custom parameter - myOwnKey : " << param->second << AliceO2::InfoLogger::InfoLogger::endm;
6262
}
6363

64-
//read alignment to calculate cluster global coordinates
64+
// read alignment to calculate cluster global coordinates
6565
mGeom = o2::phos::Geometry::GetInstance("Run3");
6666

67-
//TODO: configure reading bad map from CCDB
67+
// TODO: configure reading bad map from CCDB
6868
mBadMap.reset(new o2::phos::BadChannelsMap());
6969

70-
//Prepare histograms
70+
// Prepare histograms
7171
for (Int_t mod = 0; mod < 4; mod++) {
7272
if (!mHist2D[kOccupancyM1 + mod]) {
7373
mHist2D[kOccupancyM1 + mod] = new TH2F(Form("ClusterOccupancyM%d", mod + 1), Form("Cluster occupancy, mod %d", mod + 1), 64, 0., 64., 56, 0., 56.);
@@ -84,11 +84,11 @@ void ClusterQcTask::initialize(o2::framework::InitContext& /*ctx*/)
8484
}
8585

8686
if (!mHist2D[kTimeEM1 + mod]) {
87-
mHist2D[kTimeEM1 + mod] = new TH2F(Form("TimevsE%d", mod + 1), Form("Cell time vs energy, mod %d", mod + 1), 50, 0., 10., 50, -2.e-7, 2.e-7);
87+
mHist2D[kTimeEM1 + mod] = new TH2F(Form("TimevsE%d", mod + 1), Form("Cluster time vs energy, mod %d", mod + 1), 50, 0., 10., 50, -5.e-7, 5.e-7);
8888
mHist2D[kTimeEM1 + mod]->GetXaxis()->SetNdivisions(508, kFALSE);
8989
mHist2D[kTimeEM1 + mod]->GetYaxis()->SetNdivisions(514, kFALSE);
90-
mHist2D[kTimeEM1 + mod]->GetXaxis()->SetTitle("x, cells");
91-
mHist2D[kTimeEM1 + mod]->GetYaxis()->SetTitle("z, cells");
90+
mHist2D[kTimeEM1 + mod]->GetXaxis()->SetTitle("E, GeV");
91+
mHist2D[kTimeEM1 + mod]->GetYaxis()->SetTitle("t-t_{0}, ns");
9292
mHist2D[kTimeEM1 + mod]->SetStats(0);
9393
mHist2D[kTimeEM1 + mod]->SetMinimum(0);
9494
// mHist2D[kTimeEM1 + mod]->SetMaximum(100);
@@ -151,13 +151,11 @@ void ClusterQcTask::monitorData(o2::framework::ProcessingContext& ctx)
151151
}
152152

153153
int mod = clu.module();
154-
//Fill occupancy and time-E histos
154+
// Fill occupancy and time-E histos
155155
float posX, posZ;
156156
clu.getLocalPosition(posX, posZ);
157-
short absId;
158-
mGeom->relPosToAbsId(mod, posX, posZ, absId);
159157
char relid[3];
160-
mGeom->absToRelNumbering(absId, relid);
158+
mGeom->relPosToRelId(mod, posX, posZ, relid);
161159

162160
if (e > mOccCut) {
163161
mHist2D[kOccupancyM1 + mod - 1]->Fill(relid[1] - 0.5, relid[2] - 0.5);
@@ -183,7 +181,7 @@ void ClusterQcTask::monitorData(o2::framework::ProcessingContext& ctx)
183181
}
184182
}
185183

186-
} //function monitor data
184+
} // function monitor data
187185

188186
void ClusterQcTask::endOfCycle()
189187
{
@@ -212,7 +210,7 @@ void ClusterQcTask::reset()
212210
}
213211
bool ClusterQcTask::checkCluster(const o2::phos::Cluster& clu)
214212
{
215-
//First check BadMap
213+
// First check BadMap
216214
float posX, posZ;
217215
clu.getLocalPosition(posX, posZ);
218216
short absId;

0 commit comments

Comments
 (0)