Skip to content

Commit 0020756

Browse files
authored
TRD: Load Chamber Status from CCDB every instance (#2176)
* TRD: always update mChamberStatus * TRD: apply finaliseCCDB method for Chamber Status update
1 parent b9c327e commit 0020756

File tree

4 files changed

+19
-23
lines changed

4 files changed

+19
-23
lines changed

Modules/TRD/include/TRD/DigitsTask.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class DigitsTask final : public TaskInterface
4545
void monitorData(o2::framework::ProcessingContext& ctx) override;
4646
void endOfCycle() override;
4747
void endOfActivity(const Activity& activity) override;
48+
void finaliseCCDB(o2::framework::ConcreteDataMatcher& matcher, void* obj) override;
4849
void reset() override;
4950
void buildHistograms();
5051
void drawLinesOnPulseHeight(TH1F* h);
@@ -84,7 +85,6 @@ class DigitsTask final : public TaskInterface
8485

8586
// CCDB objects
8687
const o2::trd::NoiseStatusMCM* mNoiseMap = nullptr;
87-
const std::array<int, o2::trd::constants::MAXCHAMBER>* mChamberStatus = nullptr;
8888
};
8989

9090
} // namespace o2::quality_control_modules::trd

Modules/TRD/include/TRD/TrackletsTask.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class TrackletsTask final : public TaskInterface
4343
void monitorData(o2::framework::ProcessingContext& ctx) override;
4444
void endOfCycle() override;
4545
void endOfActivity(const Activity& activity) override;
46+
void finaliseCCDB(o2::framework::ConcreteDataMatcher& matcher, void* obj) override;
4647
void reset() override;
4748
void buildHistograms();
4849

@@ -64,7 +65,6 @@ class TrackletsTask final : public TaskInterface
6465

6566
// data to pull from CCDB
6667
const o2::trd::NoiseStatusMCM* mNoiseMap = nullptr;
67-
const std::array<int, o2::trd::constants::MAXCHAMBER>* mChamberStatus = nullptr;
6868
};
6969

7070
} // namespace o2::quality_control_modules::trd

Modules/TRD/src/DigitsTask.cxx

+9-11
Original file line numberDiff line numberDiff line change
@@ -146,17 +146,7 @@ void DigitsTask::monitorData(o2::framework::ProcessingContext& ctx)
146146
mNoiseMap = ptr.get();
147147
}
148148

149-
if (!mChamberStatus) {
150-
auto ptr = ctx.inputs().get<std::array<int, MAXCHAMBER>*>("fedChamberStatus");
151-
mChamberStatus = ptr.get();
152-
// LB: only draw in plots if it is first instance, e.g. null ptr to non null ptr
153-
if (mChamberStatus) {
154-
// LB: no half chamber distribution map for Digits, pass it as null pointer
155-
TRDHelpers::drawChamberStatusOnHistograms(mChamberStatus, nullptr, mLayers, NCOLUMN);
156-
} else {
157-
ILOG(Info, Support) << "Failed to retrieve ChamberStatus, so it will not show on plots" << ENDM;
158-
}
159-
}
149+
auto ptr = ctx.inputs().get<std::array<int, MAXCHAMBER>*>("fedChamberStatus");
160150

161151
// fill histograms
162152
auto digits = ctx.inputs().get<gsl::span<o2::trd::Digit>>("digits");
@@ -343,6 +333,14 @@ void DigitsTask::endOfActivity(const Activity& /*activity*/)
343333
ILOG(Debug, Devel) << "endOfActivity" << ENDM;
344334
}
345335

336+
void DigitsTask::finaliseCCDB(o2::framework::ConcreteDataMatcher& matcher, void* obj)
337+
{
338+
if (matcher == o2::framework::ConcreteDataMatcher("TRD", "FCHSTATUS", 0)) {
339+
// LB: no half chamber distribution map for Digits, pass it as null pointer
340+
TRDHelpers::drawChamberStatusOnHistograms(static_cast<std::array<int, MAXCHAMBER>*>(obj), nullptr, mLayers, NCOLUMN);
341+
}
342+
}
343+
346344
void DigitsTask::reset()
347345
{
348346
// clean all the monitor objects here

Modules/TRD/src/TrackletsTask.cxx

+8-10
Original file line numberDiff line numberDiff line change
@@ -138,16 +138,7 @@ void TrackletsTask::monitorData(o2::framework::ProcessingContext& ctx)
138138
mNoiseMap = ptr.get();
139139
}
140140

141-
if (!mChamberStatus) {
142-
auto ptr = ctx.inputs().get<std::array<int, MAXCHAMBER>*>("fedChamberStatus");
143-
mChamberStatus = ptr.get();
144-
// LB: only draw in plots if it is first instance, e.g. null ptr to non null ptr
145-
if (mChamberStatus) {
146-
TRDHelpers::drawChamberStatusOnHistograms(mChamberStatus, mTrackletsPerHC2D, mLayers, NCOLUMN / NSECTOR);
147-
} else {
148-
ILOG(Info, Support) << "Failed to retrieve ChamberStatus, so it will not show on plots" << ENDM;
149-
}
150-
}
141+
auto ptr = ctx.inputs().get<std::array<int, MAXCHAMBER>*>("fedChamberStatus");
151142

152143
// Fill histograms
153144
auto tracklets = ctx.inputs().get<gsl::span<o2::trd::Tracklet64>>("tracklets");
@@ -204,6 +195,13 @@ void TrackletsTask::endOfActivity(const Activity& /*activity*/)
204195
ILOG(Debug, Devel) << "endOfActivity" << ENDM;
205196
}
206197

198+
void TrackletsTask::finaliseCCDB(o2::framework::ConcreteDataMatcher& matcher, void* obj)
199+
{
200+
if (matcher == o2::framework::ConcreteDataMatcher("TRD", "FCHSTATUS", 0)) {
201+
TRDHelpers::drawChamberStatusOnHistograms(static_cast<std::array<int, MAXCHAMBER>*>(obj), mTrackletsPerHC2D, mLayers, NCOLUMN / NSECTOR);
202+
}
203+
}
204+
207205
void TrackletsTask::reset()
208206
{
209207
// clean all the monitor objects here

0 commit comments

Comments
 (0)