Problem 913 - Time is reset to zero when a field exerts force
Summary: Time is reset to zero when a field exerts force
Status: RESOLVED WORKSFORME
Alias: None
Product: Geant4
Classification: Unclassified
Component: processes/transportation (show other problems)
Version: 7.1
Hardware: PC Linux
: P2 normal
Assignee: John Apostolakis
URL:
Depends on:
Blocks:
 
Reported: 2006-11-28 04:02 CET by Bertalan.Juhasz
Modified: 2006-12-20 15:20 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 Bertalan.Juhasz 2006-11-28 04:02:46 CET
When tracking particles (other than gammas) in an electromagnetic field which
exerts a force on them, the particle's time (both the global and the local) is
reset to zero.
More specifically: I created an inhomogenous magnetic field in which there is a
force on neutral particles with a magnetic moment. Therefore in my field class,
which inherits from G4MagneticField, the DoesFieldChangeEnergy() method returns
true. In that case, both the local and the global times of the tracked particle
are reset to zero after the first step, and afterwards it remains zero. If I
change DoesFieldChangeEnergy() to return false, then the times are calculated
correctly (I believe). But in this case, of course, the calculated trajectories
can be wrong.
Comment 1 John Apostolakis 2006-12-14 11:05:59 CET
Dear Bertalan,

Thank you for the problem report. Your case is unusual, as it involves an
extension to the ability of the Transportation.

Considering this and the likeliest scenario for its implementatation, I
identified a likely cause in the class G4Mag_SpinEqRhs, which does not enable
the integration of the time, using the path length and velocity.

A correction is in preparation, utilising the functionality already available in
the equation for the full Electromagnetic field. I am sharing prototype code for
this via direct contact - and other affected users are encouraged to contact us.

John Apostolakis
Comment 2 John Apostolakis 2006-12-20 15:20:59 CET
Together with the user we have figured out that the origin of the issue was
in a user-written Equation of Motion class.

Two revisions were necessary in the application code:
 - revising the equation of motion to update the time , as is done in equation
for the 'full' electromagnetic field, and
 - ensuring all relevant classes are initialized with all 8 relevant components
(x,y,z, 3p, null, t) chosen for integration.

Many thanks to Bertalan for his feedback.
Best regards,
John Apostolakis