next up previous index
Next: XINT001 The interactive Up: GEANT Previous: TRAK499 The space

TRAK500 Tracking routines in magnetic field

Routine ID: TRAK500
Author(s): Submitted: 01.10.81
Origin: R.Brun, M.HansroulRevised: 16.12.93

CALL GUSWIM (CHARGE,STEP,VECT,VOUT*)

CHARGE
( REAL) particle charge in e unit;
STEP
( REAL) step size in cm;
VECT
( REAL) array of 7 with the initial coordinates, direction cosines and momentum (x, y, z, px/p , py/p , pz/p , p);
VOUT
( REAL) array of 7 with the final coordinates, direction cosines and momentum after the step.

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*)

FIELD
( REAL) field value in kilo-Gauss multiplied by the charge of the particle in e units;
STEP
( REAL) step size in cm;
VECT
( REAL) array of 7, same as for GUSWIM;
VOUT
( REAL) array of 7, same as for GUSWIM;

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*)

CHARGE
( REAL) particle charge in e units;
STEP
( REAL) step size in cm;
VECT
( REAL) array of 7, same as for GUSWIM;
VOUT
( REAL) array of 7, same as for GUSWIM;

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.

CALL GUFLD ((VECT,F*)

VECT
( REAL) array of 3 with the position in space where the field has to be returned;
F
( REAL) array of 3 with the magnetic field in VECT, in kilo-Gauss units.

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

XINT001


next up previous index
Next: XINT001 The interactive Up: GEANT Previous: TRAK499 The space


Janne Saarela
Mon Apr 3 12:46:29 METDST 1995