Skip to content

Integer Config Parameters with Units are Converted to UnitType first

Consider

param = 70/um

and

auto param = config_.get<unsigned int>("param");

will result in

param = 69999

Because when treating the unit the value is first converted to UnitType = long double, then range-checked and then back to the requested value.

See https://gitlab.cern.ch/allpix-squared/allpix-squared/-/blob/master/src/core/utils/unit.tpp?ref_type=heads#L21-54

(cc) @hwennlof @jiye

Edited by Simon Spannagel