Skip to content

Round non-integer lumi counter values rather than truncating them

Daniel Charles Craik requested to merge dcraik-lumi-rounding-fix into master

Currently non-integer values to be stored in a lumi counter are simply truncated by static_cast<unsigned>. This can cause problems for the test_lumi test in MooreOnline, which decodes an Allen LumiSummary bank, re-encodes it using the LHCb writer and then re-decodes it. As all values decoded from the initial bank have already been truncated to an integer in the first encoding, any loss of precision in the second encoding (caused by applying the scale and shift) can cause the encoded counter to be reduced by one.

This MR adds a std::round inside the static_cast

Addresses MooreOnline#32 (closed)

Merge request reports