Threshold distrubutions shifted ~40e from the target threshold
We have been observing an offset of ~40 e when tuning the threshold on the differential FE (sorry, I haven't tried any other FE yet). This seems to be due to the fact that m_vcalPar[0]
is used when converting Vcal to charge in Rd53aCfg::toCharge
, but it's not used when doing the opposite, in Rd53aCfg::toVcal
.
I wonder if there's a specific reason for this mismatch. Changing this line in Rd53aCfg::toVcal
:
unsigned vcal = (unsigned) round((V)/(m_vcalPar[1]*Unit::Milli)); // Note: no offset applied
to
unsigned vcal = (unsigned) round((V - m_vcalPar[0]*Unit::Milli)/(m_vcalPar[1]*Unit::Milli));
seems to be enough to "fix" this issue.