Implement ByteStream conversion of Run-3 MUCTPI DAQ ROB
Complete rewrite of the MuonRoIByteStreamTool
adapting it for Run-3 system. It was discovered during M11 that Run-3 MUCTPI does not implement a RoI readout path and thus the current implementation of Athena BS conversion which assumes that path is wrong. This MR changes the implementation to decode/encode DAQ readout path data from MUCTPI as decided in a dedicated L1-DAQ-HLT meeting on 3 March and summarised in ATR-25069.
Additional changes included as required for the new implementation:
- Fix include of
MuCTPI_Bits.h
in its only previous client, which incorrectly included it inside a class definition, causing all sorts of unexpected fallout when modified or included elsewhere. - Put all constants defined in
MuCTPI_Bits.h
into a namespaceLVL1::MuCTPIBits
, and add new ones for Run-3 decoding of the DAQ words - Fix all indirect clients of
MuCTPI_Bits.h
following the above two changes and make the use of the header and the namespace explicit - Add a new header with helper functions for bit operations in the
LVL1::MuCTPIBits
namespace - Extend the interface
IL1TriggerByteStreamTool
with additional helpers - Adapt the python configuration to the new tool implementation
- Update the simulation (
MUCTPI_AthTool
) output to consistently produce the same format as decoding. Also needed for ATR-25031.
Features of the new decoding:
- Produces five output collections for bunch crossings [-2, -1, 0, +1, +2] with respect to the triggered BC (the middle one). Allows the real readout window in decoded data to be size 1, 3, or 5 and fills the right containers leaving the others empty.
- Throws errors and aborts event processing if data format is unexpected and doesn't match the decoder logic.
- Provides a lot of debug information if DEBUG logging is enabled, which will be helpful for commissioning and debugging.
- Implements online monitoring histograms to verify data consistency and quality during data taking.
Example online histograms produced by runing over 500 cosmic data events from M11 (run 412343, LB 100) are attached: muctpi-cnv-mon.pdf
Features of the new encoding:
- Adapts the number of time slices to 1, 3 or 5 depending on the number of candidates from simulation (e.g. if no offset candidates are created, then only one timeslice is encoded). The triggered BC timeslice is always encoded even if empty (no candidates).
- Always produces 3 multiplicity words in each timeslice, albeit empty since filling the bits would require extra inputs beyond just the
xAOD::MuonRoIContainer
. - Skips Topo TOB words, as this would also require extra inputs.
- Always produces an "OK" status word.
- Implements online monitoring histograms matching the decoder to facilitate validation of the conversion.
Still to do in other MRs later:
- Adapt downstream clients of the extra BC RoIs (late muon chains) to the new format (ATR-25031)
- Decide on the handling of non-zero status words
- Check timing of the decoding (has to be very short). I'm quite confident the code is fast, but if needed we can always disable the online monitoring to speed it up, or optimise the logic.
Closes ATR-25069
cc @amarzin, @czodrows, @wiedenma, @mark, @astruebi, @palacino
Edited by Rafal Bielski