Problem 2037 - Passing momentum^2 instead of momentum to equations of motion
Summary: Passing momentum^2 instead of momentum to equations of motion
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: geometry/navigation (show other problems)
Version: 10.3
Hardware: All All
: P4 normal
Assignee: John Apostolakis
URL:
Depends on:
Blocks:
 
Reported: 2018-02-26 15:29 CET by Renee Fatemi
Modified: 2018-03-05 08:45 CET (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description Renee Fatemi 2018-02-26 15:29:51 CET
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.
Comment 1 John Apostolakis 2018-02-26 21:22:51 CET
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.
Comment 2 Gabriele Cosmo 2018-03-05 08:45:25 CET
Thanks, the fix is included in the patch release 10.4.p01.