|
8 | 8 |
|
9 | 9 | #include <top/modules/TOPChannelMasker/TOPChannelMaskerModule.h> |
10 | 10 | #include <top/reconstruction_cpp/TOPRecoManager.h> |
| 11 | +#include <top/geometry/TOPGeometryPar.h> |
11 | 12 |
|
12 | 13 | using namespace std; |
13 | 14 |
|
@@ -116,17 +117,32 @@ namespace Belle2 { |
116 | 117 | digit.getHitQuality() == TOPDigit::c_Uncalibrated) { |
117 | 118 | digit.setHitQuality(TOPDigit::c_Good); |
118 | 119 | } |
119 | | - // skip digit if not c_Good |
120 | 120 | if (digit.getHitQuality() != TOPDigit::c_Good) continue; |
| 121 | + |
121 | 122 | // 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)) { |
123 | 126 | digit.setHitQuality(TOPDigit::c_Masked); |
| 127 | + continue; |
124 | 128 | } |
125 | | - if (m_maskUncalibratedChannelT0 and not digit.isChannelT0Calibrated()) { |
| 129 | + if (m_maskUncalibratedChannelT0 and not m_channelT0->isCalibrated(slotID, channel)) { |
126 | 130 | digit.setHitQuality(TOPDigit::c_Uncalibrated); |
| 131 | + continue; |
127 | 132 | } |
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 | + } |
130 | 146 | } |
131 | 147 | } |
132 | 148 |
|
|
0 commit comments