Routine ID: TRAK500 | |
---|---|
Author(s): | Submitted: 01.10.81 |
Origin: R.Brun, M.Hansroul | Revised: 16.12.93 |
CALL GUSWIM (CHARGE,STEP,VECT,VOUT*)
This is the steering routine for calculating the deviation of a charged particle in magnetic field. It is called by the GEANT tracking routines: GTELEC, GTHADR, GTMUON and GTHION. Even if this routine follows the naming conventions of the user routines, the version provided in the GEANT library is quite adequate for most situation, and users should have a very good reason to modify it.
It calls GRKUTA, GHELIX, GHELX3 according to the value 1, 2 or 3 of IFIELD in common /GCTMED/. IFIELD correspond to the argument to the GSTMED routine (see [CONS200]). IFIELD = -1 is reserved for user decision in case GUSWIM is modified by the user.
CALL GHELX3 (FIELD,STEP,VECT,VOUT*)
Transport the particle by a length STEP in a magnetic field. The field is assumed to be uniform and parallel to the z axis. The value of the field is the FIELDM argument to the GSTMED routine (see [CONS200]). The particle is transported along an helix. The call to this routine is selected by GUSWIM when IFIELD=3 in the call to GSTMED.
CALL GHELIX (CHARGE,STEP,VECT,VOUT*)
Transport the particle by a length STEP in a magnetic field. The magnetic field is calculated in the middle of the step (along a straight line) and it is supposed to be constant along the step and the particle is transported along an helix. The call to this routine is selected by GUSWIM when IFIELD=2 in the call to GSTMED. This routine is intended for magnetic fields with a small gradient. The value of the field is obtained from the routine GUFLD which must be coded by the user.
CALL GRKUTA (CHARGE,STEP,VECT,VOUT*)
The arguments have the same meaning than those of GHELIX. Transport a particle in magnetic field using Runge-Kutta method for solving the kinematic equations (Nystroem algorithm [], procedure 25.5.20). The call to this routine is selected by GUSWIM when IFIELD=1 in the call to GSTMED. This method is the slower of the three and it must be used for magnetic fields with strong gradient. Again the magnetic field is obtained from the GUFLD routine which the user has to code.
User routine to return the three components of the magnetic field at point VECT expressed in kilo-Gauss. This routine must be provided by the user for all tracking media where IFIELD is 1 or 2. This routine will be called very often, at least three times at each step, so all the care must be put in its optimisation.
R.Brun