Skip to content

Commit 884bb08

Browse files
dstoccopillot
authored andcommitted
Use rejectlist in MID filtering
1 parent e3567aa commit 884bb08

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

Detectors/MUON/MID/Filtering/include/MIDFiltering/ChannelMasksHandler.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ class ChannelMasksHandler
7171
/// Comparison operator
7272
bool operator==(const ChannelMasksHandler& right) const { return mMasks == right.mMasks; }
7373

74+
/// Clear masks
75+
void clear() { mMasks.clear(); }
76+
7477
private:
7578
/// Gets the mask
7679
/// \param deId Detection element ID

Detectors/MUON/MID/Workflow/src/FilteringSpec.cxx

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,28 @@ class FilteringDeviceDPL
7171

7272
void finaliseCCDB(of::ConcreteDataMatcher matcher, void* obj)
7373
{
74+
bool rebuildMasks = false;
7475
if (matcher == of::ConcreteDataMatcher(header::gDataOriginMID, "BAD_CHANNELS", 0)) {
7576
LOG(info) << "Update MID_BAD_CHANNELS";
76-
auto* badChannels = static_cast<std::vector<ColumnData>*>(obj);
77-
mMasksHandler.switchOffChannels(*badChannels);
77+
mBadChannels = *static_cast<std::vector<ColumnData>*>(obj);
78+
rebuildMasks = true;
79+
} else if (matcher == of::ConcreteDataMatcher(header::gDataOriginMID, "REJECTLIST", 0)) {
80+
LOG(info) << "Update MID_REJECTLIST";
81+
mRejectList = *static_cast<std::vector<ColumnData>*>(obj);
82+
rebuildMasks = true;
83+
}
84+
if (rebuildMasks) {
85+
mMasksHandler.clear();
86+
mMasksHandler.switchOffChannels(mBadChannels);
87+
mMasksHandler.switchOffChannels(mRejectList);
7888
}
7989
}
8090

8191
void run(of::ProcessingContext& pc)
8292
{
8393
// Triggers finalizeCCDB
8494
pc.inputs().get<std::vector<ColumnData>*>("mid_bad_channels");
95+
pc.inputs().get<std::vector<ColumnData>*>("mid_rejectlist");
8596

8697
auto data = specs::getData(pc, "mid_filter_in", EventType::Standard);
8798
auto inROFRecords = specs::getRofs(pc, "mid_filter_in", EventType::Standard);
@@ -125,13 +136,16 @@ class FilteringDeviceDPL
125136
bool mUseMC{false};
126137
std::vector<of::Output> mOutputs;
127138
std::function<void(size_t, size_t, const o2::dataformats::MCTruthContainer<MCLabel>*, o2::dataformats::MCTruthContainer<MCLabel>&, const ColumnData& col)> mFillLabels{[](size_t, size_t, const o2::dataformats::MCTruthContainer<MCLabel>*, o2::dataformats::MCTruthContainer<MCLabel>&, const ColumnData&) {}};
139+
std::vector<ColumnData> mBadChannels{};
140+
std::vector<ColumnData> mRejectList{};
128141
};
129142

130143
of::DataProcessorSpec getFilteringSpec(bool useMC, std::string_view inDesc, std::string_view outDesc)
131144
{
132145

133146
auto inputSpecs = specs::buildInputSpecs("mid_filter_in", inDesc, useMC);
134147
inputSpecs.emplace_back("mid_bad_channels", header::gDataOriginMID, "BAD_CHANNELS", 0, of::Lifetime::Condition, of::ccdbParamSpec("MID/Calib/BadChannels"));
148+
inputSpecs.emplace_back("mid_rejectlist", header::gDataOriginMID, "REJECTLIST", 0, of::Lifetime::Condition, of::ccdbParamSpec("MID/Calib/RejectList"));
135149

136150
auto outputSpecs = specs::buildStandardOutputSpecs("mid_filter_out", outDesc, useMC);
137151

0 commit comments

Comments
 (0)