Skip to content

Commit 61e134e

Browse files
committed
Merge pull request #829 in B2/basf2 from bugfix/BII-9262-channel-masking-release-06-00 to release/06-00
* commit 'c0bd9e674a7f93634c555ee130b95ad2d74791da': Fixing channel masking
2 parents 3770786 + c0bd9e6 commit 61e134e

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

top/modules/TOPChannelMasker/src/TOPChannelMaskerModule.cc

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#include <top/modules/TOPChannelMasker/TOPChannelMaskerModule.h>
1010
#include <top/reconstruction_cpp/TOPRecoManager.h>
11+
#include <top/geometry/TOPGeometryPar.h>
1112

1213
using namespace std;
1314

@@ -116,17 +117,32 @@ namespace Belle2 {
116117
digit.getHitQuality() == TOPDigit::c_Uncalibrated) {
117118
digit.setHitQuality(TOPDigit::c_Good);
118119
}
119-
// skip digit if not c_Good
120120
if (digit.getHitQuality() != TOPDigit::c_Good) continue;
121+
121122
// now do the new masking of c_Good
122-
if (not m_channelMask->isActive(digit.getModuleID(), digit.getChannel())) {
123+
auto slotID = digit.getModuleID();
124+
auto channel = digit.getChannel();
125+
if (not m_channelMask->isActive(slotID, channel)) {
123126
digit.setHitQuality(TOPDigit::c_Masked);
127+
continue;
124128
}
125-
if (m_maskUncalibratedChannelT0 and not digit.isChannelT0Calibrated()) {
129+
if (m_maskUncalibratedChannelT0 and not m_channelT0->isCalibrated(slotID, channel)) {
126130
digit.setHitQuality(TOPDigit::c_Uncalibrated);
131+
continue;
127132
}
128-
if (m_maskUncalibratedTimebase and not digit.isTimeBaseCalibrated()) {
129-
digit.setHitQuality(TOPDigit::c_Uncalibrated);
133+
if (m_maskUncalibratedTimebase) {
134+
const auto& fe_mapper = TOPGeometryPar::Instance()->getFrontEndMapper();
135+
const auto* fe = fe_mapper.getMap(slotID, channel / 128);
136+
if (not fe) {
137+
B2ERROR("No front-end map found" << LogVar("slotID", slotID) << LogVar("channel", channel));
138+
digit.setHitQuality(TOPDigit::c_Uncalibrated);
139+
continue;
140+
}
141+
auto scrodID = fe->getScrodID();
142+
const auto* sampleTimes = m_timebase->getSampleTimes(scrodID, channel);
143+
if (not sampleTimes->isCalibrated()) {
144+
digit.setHitQuality(TOPDigit::c_Uncalibrated);
145+
}
130146
}
131147
}
132148

0 commit comments

Comments
 (0)