Fix for the UT ZS decoder
This MR concerns fixes in the UT ZS decoder:
- UT ZS decoder struggles with decoding the UTError packet whose minimal size is 128b even if empty (to comprise Flag Header). It causes an error because for an empty UT bank 32b are expected. We introduced a condition that skips this checkup for UTError smaller than 128b.
- It also comprises several minor improvements in decoder printouts, changes in the processing of the input (RawEvent to RawBank::View), and rewriting the options file to adjust to changes introduced in the decoder.
Two fixes to UT decoder from !4559 (merged) :
- Suppress UT clusters with 0 ADC charges.
- Use integer to calculate LHCbID instead of float to avoid inconsistent result due to floating point rounding. Related MR: Equivalent Allen MR for LHCbID fix (Allen suppresses 0 ADC charge correctly): Allen!1607 (merged)
** ** patch generated by https://gitlab.cern.ch/lhcb/LHCb/-/jobs/38142817
Merge request reports
Activity
assigned to @wokrupa
added RTA label
- Resolved by Da Yu Tou
mentioned in merge request Allen!1582 (merged)
mentioned in merge request Allen!1444 (merged)
added 1 commit
- a4d26a66 - introducing additional protection against cases when nClusters() == 0
Another protection introduced on @hawu and @tskwarni demand.
pos_range{m_bank.first( ( ( nClusters() + 1 ) / 2 ) * 16 - 4 ), m_nDigits};
posadc_range{m_bank.first( ( ( nClusters() + 1 ) / 2 ) * 16 - 4 ), m_nDigits, positionMethod, stripMax};
are not protected against cases when
nClusters() == 0
. WhennClusters() == 0
, this essentially becomesm_bank.first(-4)
. This memory will never get used since inIterator()
in this case will returnm_iterDigit.end()
(auto PosLane = std::find_if( m_iterDigit.begin(), m_iterDigit.end(), []( unsigned int element ) { return element != 0; } );
). However, ifLHCb::span()
does range checking then this would invokegsl_assert
. The behavior ofgsl_assert
depends on its configuration, as we have learned from this: linkThis in turn may depend on how code is compiled. Anyway, we protect the decoder to be sure it will not happen by:
pos_range{m_bank.first( ( ( (nClusters()?nClusters():1) + 1 ) / 2 ) * 16 - 4 ), m_nDigits};
and similar solution forposadc_range
Edited by Wojciech Krupa- Resolved by Hangyi Wu