Skip to content

SiHitCollectionCnv_p3(_p2) Protect against values stored std::vector<unsigned short> exceeding USHRT_MAX

This was a "fun" one.

As part of the compression of SiHitCollection properties which are shared between successive SiHit objects are only recorded once in the persistent format. Other vectors in the persistent format keep track of how many SiHit instances share the current value. These vectors are std::vector<unsigned short>. There was an implicit assumption that we would never get more than USHRT_MAX consecutive SiHit objects with a matching property. The logic in SiHitCollectionCnv_p2/p3 has been unchanged for a long time, but the samples requested in ATLMCPROD-10454 managed to break it. The fix is to check if the number of consecutive SiHit objects with a matching property has reached USHRT_MAX and behave as if the value of the property has changed in that case. NB TRT_HitCollectionCnv_p3/p4 already have this protection, so no changes are required there.

This fixes ATLASSIM-6398, needed by ATLMCPROD-10454 - a new 22.0.X release will be required unfortunately. Tagging @jmaurer and @strichte.

Merge request reports

Loading