bug in FTRawBankDecoder?
The following discussion from !3811 (merged) should be addressed:
-
@graven started a discussion: on L722 there is:
if ( std::binary_search( m_ChannelsToSkip[globalQuarterIdx].begin(), m_ChannelsToSkip[globalQuarterIdx].end(), pseudoChannelIdx ) ) {which implies that
m_ChannelsToSkip[globalQuarterIdx]must be ordered -- but there is no guarantee that this is the case, as that depends on howChannelsToSkipwas configured in python. There should at least be a callback here which verifies the ordering:Gaudi::Property<std::array<std::vector<double>, 48>> m_ChannelsToSkip{ this, "ChannelsToSkip", {{}}, "a list of PseudoChannels in Quarters to skip", [this]( auto& ) { if (!std::all_of( m_ChannelsToSkip.begin(), m_ChannelsToSkip.end(), [](const auto& inner) { return std::is_sorted(inner.begin(), inner.end()); } ) { throw GaudiException("ChannelsToSkip is not sorted",__PRETTY_FUNCTION__, StatusCode::FAILURE); } } };Also, I'm confused as the
binary_searchis looking for apseudoChannelIdxwhich is not adouble, but anint-- while the 'payload' ofm_ChannelsToSkipisdouble. So thebinary_searchis looking for anintvalue amongst in a range ofdoubles?