Introduction to the Tracking package

+-------------+                                               +----------##
| Geant 3.10  |               GEANT User's Guide              | TRAK001  ##
+-------------+                                               +----------##
                                   

Author(s) : F.Bruyant Submitted: 15.08.84. Origin : GEANT3 Revised: 20.05.86

The tracking package

In the context of simulation programs, tracking' a particle through matter consists of predicting the spatial coordinates of a set of points which define the trajectory and of computing the components of the momentum at these points. This is usually achieved by integrating the equations of motion' over successive steps and applying corrections when necessary to account for the perturbations introduced by the presence of matter. The tracking package contains mainly a subprogram which controls, and effectively performs, the tracking for all particles in the current event and for the secondary products which they might eventually generate, plus some tools for storing the space point coordinates computed along the corresponding trajectories.

The step size

When tracking particles through a complex medium structure one of the critical tasks is the estimation a priori' of the step size. In first approximation this is performed automatically by the program. For a particle with given energy the step size depends primarily on the intrinsic properties of the particle (mass, charge, lifetime, etc.) and on the characteristics of the current medium. The dependence may be due either to (quasi)continuous processes which usually impose a limit to the interval of integration (energy loss, multiple scattering) or to the occurence of a discrete process which introduces a discontinuity in the trajectory (decay, electromagnetic or hadronic interaction). In addition to these physical effects there are constraints of a geometrical nature, the step being limited by the path length to the medium boundary. In practice, the step size depends ultimately on a set of tolerances and cuts which should be optimized by the user for the given application, such as:

  1. the maximum turning angle due to magnetic field permitted in one step,
  2. the maximum displacement due to multiple scattering in one step,
  3. the maximum fractional energy loss in one step,
  4. the accuracy for crossing medium boundaries and
  5. the minimum step size due to either energy loss or multiple scattering.

These quantities are part of the so called tracking medium' parameters. They have to be provided by the user and stored in the data structure JTMED, through the routine GSTMED [CONS]. Usually, this is done together with the initialisation of the geometrical setup. The optimisation is by no means trivial as the economy of computing time should not lead to an unacceptable loss of accuracy. Other general information required for the computation of the step size is expected to be available in the data structures JPART and JMATE, for the properties of the particles and of the materials, and in the data structure JVOLUM, for the current medium and its geometrical boundaries. The communication between the tracking package and the structure JVOLUM is achieved through the basic subroutines of the geometry package GMEDIA, GNEXT and GINVOL [GEOM]. Some additional information is computed at tracking time such as the probability of occurence of an interaction. For convenience every particle is assigned a tracking type', 1 for the gammas, 2 for the electrons and positrons, 3 for the neutral hadrons (and neutrinos!), 4 for the charged hadrons and 5 for the muons. Which physics processes have potentially to be considered for a given particle depends on its tracking type. For the hadrons it depends also, through the subroutine GUPHAD, on which hadronic processes from GHEISHA, FLUKA have been selected [PHYS 001].

The subroutines GTREVE, GTRACK and GTVOL

At event level the tracking is controlled by the subroutine GTREVE called by the subroutine GUTREV where the user is free to take any other action. GTREVE loops over all vertices and stores all tracks from the current vertex in the stack JSTAK, then for each one in turn, calls GLTRAC to prepare the commons for tracking, and starts tracking through a call to GUTRAK, which calls GTRACK. The subroutine GTRACK tracks the particle up to the end : stop, decay, interaction or escape. During this phase it may happen that secondary products have been generated and stored by the user, as explained below, in the stack, and if wanted in the permanent structure JKINE. The subroutine GTRACK loops over all geometrical volumes seen by the current track, first identifying, through the subroutine GTMEDI, the new volume which the particle has reached and storing the corresponding material and tracking medium constants in the common blocks /GCMATE/ and /GCTMED/; the tracking is controlled by the type-dependent routines GTELEC, GTGAMA, GTHADR, GTMUON, GTNEUT. These compute the physical step size according to the activated physics processes, and compute the geometrical limit for the step, only when necessary, through GTNEXT, and propagate the particle over the computed step.

Magnetic field routines

As mentioned before, the effective propagation of the particles is controlled by the routines GTGAMA, GTELEC, etc., which call GUSWIM. Depending on the value chosen by the user for the tracking medium parameter IFIELD the default routine GUSWIM calls either

  1. GRKUTA (for inhomogeneous fields, IFIELD=1), or
  2. GHELIX (for quasi>-homogeneous fields tilted w.r.t. the reference frame, IFIELD=2), or
  3. GHELX3 (for one>-component fields, IFIELD=3).

GRKUTA and GHELIX call the default user subroutine GUFLD where the components of the field at the given point are computed. GHELX3 takes the value of the field in the tracking medium parameter FIELDM.

Information available at tracking time, and the subroutine GUSTEP

At any moment the current track parameters are available in the common block /GCTRAK/ as well as all variables which have to be preserved by the tracking routines for the control of the step size. In addition a few flags and variables are stored in the common block /GCTRAK/ to record the history of the current step:

  1. The flag INWVOL for instance is initialized to 1 when entering a new volume and set to 0 for all steps inside the volume or to 2 if the particle has reached the volume boundary.
  2. The flag ISTOP is initialized to 0 and set to 1 if the particle looses its identity or to 2 if it stops.
  3. The effect which is responsible for the limitation of the step size as well as the corrective effects which have been applied at the end of the step, if any, are recorded in NMEC words of the mechanism vector LMEC and this is most usefulto understand and debug the program.
  4. The total energy loss for the current step is stored in the variable DESTEP.
  5. This information is necessary for the user to take the proper actions in the subroutine GUSTEP which is called at the end of every step in GTVOL and also when entering a new volume in GTRACK.

In addition, when relevant, the number NGKINE of secondary products which have been generated and their characteristics are stored in the common block /GCKING/ together with an identification (array LMEC) of which process is responsible. Depending on the application and on the particle type, the user may decide in GUSTEP either

  1. to keep track of the newly produced secondary track. The user then will have to store it in the data structure JKINE where its identity will be preserved, or
  2. to enter it in a temporary stack, the data structure JSTAK, from which it will be extracted and track-followed without keeping its identity further, or
  3. to simply forget about it after proper account of its residual energy, at least when the current volume has been declared as a sensitive detector.

Connection with the detector response package

The loop over the volumes in GTRACK makes the interface with the detector response package simple [HITS]. By construction of the geometrical setup there is a correspondance between the volumes seen by the particle and the components of the detectors. When entering a new volume (in GTRACK the subroutine GFINDS is called. If the volume has been declared by the user as a sensitive detector through appropriate calls to GSDET and if the corresponding tracking medium constant ISVOL is non zero, GFINDS returns in the common block /GCSETS/ the information to identify uniquely the detector component. This enables the user in GUSTEP to record the hits in the proper JHITS substructure [HITS].

Connection with the drawing package

The coordinates of the space points generated during the tracking ar e available at each step in the common block/GCTRAK/. In GUSTEPthe user can store them in the structure JXYZ with the help of the subroutine GSXYZ. This information can be used later for debug (subroutine GPJXYZ) or for the graphical representation of the trajectories [DRAW].