There is a bug at line 1165 in /geometry/navigation/src/G4PathFinder.cc caused by passing the magnitude squared of the momentum, instead of just the momentum, into the equation of motion. When G4EqEMFieldWithSpin is used for the equations of motion this error will result in gamma becoming very very large which effectively removes all 1/gamma terms in the BMT equation that governs the spin precession of the muon in a magnetic field. Existing: equationOfMotion->SetChargeMomentumMass(*(initialState.GetChargeState()), initialState.GetMomentum().mag2(), initialState.GetRestMass() ); Corrected: equationOfMotion->SetChargeMomentumMass(*(initialState.GetChargeState()), initialState.GetMomentum().mag(), initialState.GetRestMass() ); I have verified that the spin precession of the muon is right once the momentum is passed instead of momentum squared.
I agree with the diagnosis. Many thanks for pointing out the problem and the correction. I have committed the requested fix in the Geant4 repository, for inclusion in the development and patching.
Thanks, the fix is included in the patch release 10.4.p01.