@@ -1137,7 +1137,32 @@ WireCell::Waveform::ChannelMaskMap PDHD::FEMBNoiseSub::apply(channel_signals_t&
11371137 const bool pass_p0 = Is_FEMB_noise (chansig_p0, rois_p0, m_width, m_pad_nticks, m_nsigma);
11381138 const bool pass_p1 = Is_FEMB_noise (chansig_p1, rois_p1, m_width, m_pad_nticks, m_nsigma);
11391139 const bool pass_p2 = Is_FEMB_noise (chansig_p2, rois_p2, m_width, m_pad_nticks, m_nsigma);
1140- if (!(pass_p0 && pass_p1 && pass_p2)) {
1140+ const int npass = int (pass_p0) + int (pass_p1) + int (pass_p2);
1141+ if (npass < 2 ) {
1142+ return ret;
1143+ }
1144+
1145+ if (npass == 2 ) {
1146+ // Two of three planes confirm: mask only the two confirming planes,
1147+ // each over the ROIs found on its own projection. The plane that
1148+ // failed confirmation is left untouched.
1149+ const bool passes[3 ] = {pass_p0, pass_p1, pass_p2};
1150+ const channel_signals_t * plane_sigs[3 ] = {&chansig_p0, &chansig_p1, &chansig_p2};
1151+ const WireCell::Waveform::BinRangeList* plane_rois[3 ] = {&rois_p0, &rois_p1, &rois_p2};
1152+ size_t nchan_marked = 0 ;
1153+ for (int p = 0 ; p < 3 ; ++p) {
1154+ if (!passes[p]) continue ;
1155+ for (auto const & cs : *plane_sigs[p]) {
1156+ for (const auto & br : *plane_rois[p]) {
1157+ ret[" femb_noise" ][cs.first ].push_back (br);
1158+ }
1159+ ++nchan_marked;
1160+ }
1161+ }
1162+ if (m_log) {
1163+ m_log->debug (" PDHD FEMBNoiseSub: 2/3 planes confirm, marked {} channels on the two passing planes" ,
1164+ nchan_marked);
1165+ }
11411166 return ret;
11421167 }
11431168
0 commit comments