Channel masking for cbm::algo::UnpackSts
Channel masking was implemented, currently by using the hardcoded values from macro/beamtime/mcbm2022/sts_mask_channels.par
. The processing of these numbers is separate from the rest of the code and easily be made more flexible.
The original file contains a list of pairs (febIdx,channelIdx). Since "febIdx" values in general appear multiple times, this was translated to an explicitly iniatialized std::map<size_t, std::unordered_set<uint16_t>>
(where the first index is the "febIdx") for the hard-coded numbers, which is a bit more economical.
The initialization of the channel mask map in StsReadoutConfigLegacy::Init()
is done in the form of a double loop (loop through channels for each elink, check for each channel if it appears in the lists). This can probably in principle be optimized for speed, by looping directly throught the masked-channel list instead. I chose this version since it is more easy to understand (the other version would require even more complex index conversions). Since whatever performance hit this gives only happens during the init stage, I think prioritizing clarity is appropriate here.
The output was verified against the legacy unpacker on 2391 data. The proper channels seem to be masked.
@fweig This should easily integrate with your work. Switching off channel masking in Unpack.cxx is also simple.