Fix charge for momentum determination with pT kick
Fix charge for momentum determination with pT kick.
In TrackPtKick
the charge sign was wrongly estimated for Magnet Down, for StandaloneMuonRec
for Magnet Up. This came from a double usage of the field information in the following lines:
// charge
int sign = 1;
if ( curv < TrackParameters::hiTolerance ) { sign *= -1; }
if ( bdl.x() < TrackParameters::hiTolerance ) { sign *= -1; }
q = -1. * ( magnet.isDown() ? -1 : 1 ) * sign;
where bdl.x()
and magnet.isDown()
are both sensitive to the orientation of the magnetic field. Given that the original TrackPtKick
has been used for a while I tried to trace back to source of the code. Looking at the original code in @erodrigu repository in 2005 (and thanks for keeping this page alive for almost 20 years!) I already see that the magnet polarity information was used twice. Unless I am missing something, this was wrong for quite some time, or some definition changed in the background and it was not taken into account by modifying the code.
@needham for the original author.