Overview Contents Previous Next Geant4 User's Guide
For Application Developers
Geometry


4.1.8 The Geometry Navigator

Navigation through the geometry at tracking time is implemented by the class G4Navigator. The navigator is used to locate points in the geometry and compute distances to geometry boundaries. At tracking time, the navigator is intended to be the only point of interaction with tracking.
Internally, the G4Navigator has several private helper/utility classes:

In addition, the navigator maintains a set of flags for exiting/entry optimisation. A navigator is not a singleton class; this is mainly to allow a design extension in future (e.g geometrical event biasing).

Navigation and Tracking

The main functions required for tracking in the geometry are described below. Additional functions are provided to return the net transformation of volumes and for the creation of touchables. None of the functions implicitly requires that the geometry be described hierarchically.

As stated previously, the navigator makes use of utility classes to perform location and step computation functions. The different navigation utilities manipulate the G4NavigationHistory object.
In LocateGlobalPointAndSetup() the process of locating a point breaks down into three main stages - optimisation, determination that the point is contained with a subtree (mother and daughters), and determination of the actual containing daughter. The latter two can be thought of as scanning first 'up' the hierarchy until a volume that is guaranteed to contain the point is found, and then scanning 'down' until the actual volume that contains the point is found.
In ComputeStep() three types of computation are treated depending on the current containing volume:

Run-time commands

When running in verbose mode (i.e. the default, G4VERBOSE set while installing the Geant4 kernel libraries), the navigator provides a few commands to control its behavior. It is possible to select different verbosity levels (up to 5), with the command:

     geometry/navigator/verbose [verbose_level]
 
or to force the navigator to run in check mode:
     geometry/navigator/check_mode [true/false]
 
The latter will force more strict and less tolerant checks in step/safety computation to verify the correctness of the solids' response in the geometry.
By combining check_mode with verbosity level-1, additional verbosity checks on the response from the solids can be activated.
About the authors