Skip to content

Rec[Em|Jet|Energy]RoI + L1TopoTOB: Avoid unnecessary narrowing casts between signed and unsigned integers

Rafal Bielski requested to merge rbielski/athena:trigt1-narrowing-cast into master

Fix interfaces of Rec[Em|Jet|Energy]RoI (the passed*Threshold methods) and L1TopoTOB (constructor) which expected a signed integer argument only to compare / assign it to an unsigned integer. Most clients already passed unsigned integers, so we had a conversion unsigned -> signed -> unsigned. Such conversions may change the value (i.e. they are narrowing) and this behaviour depends on the architecture and compiler. Better to avoid it where it's not necessary.

Also make sure the clients pass the right type explicitly.

Merge request reports