2.8.  Electromagnetic Fields

2.8.1.  Class Design

  • G4TransportationManager - singleton class storing the (volume) navigator used by the transportation process to do the geometrical tracking. It also stores a pointer to the propagator used in a (magnetic) field and to the field manager. The class instance is created before main() is called, and in turn creates the navigator and the rest.

  • G4PropagatorInField - class performing the navigation/propagation of a particle/track in a magnetic field. The field is in general non-uniform. For the calculation of the path, it relies on the class G4ChordFinder.

  • G4FieldManager - class managing (storing) a pointer to the Field subclass that describes the field of a detector (magnetic, electric or other). Also stores a reference to the chord finder. The G4FieldManager class exists to allow the user program to specify the electric, magnetic and/or other field(s) of the detector. A field manager can be set to a logical volume (or to more than one), in order to vary its field from that of the world. In this manner a zero or constant field can override a global field, a more or less exact version can override the external approximation, lower or higher precision for tracking can be specified, a different stepper can be chosen for different volumes, ... It also stores a pointer to the G4ChordFinder object that can do the propagation in this field. G4FieldManager allows the other classes/object (of the MagneticField and other class categories) to find out whether a detector field object exists and what that object is. A default G4FieldManager is created by the singleton class G4NavigatorForTracking and exists before main is called. However a new one can be created and given to G4NavigatorForTracking. Our current design envisions that one G4FieldManager is valid for each region detector.

  • G4ChordFinder - class providing the integration of motion using the ODE solver's driver to find the end-point that satisfies the chord length criterion. It also returns an Approximate point on the curve near to a (chord) point. The G4ChordFinder handles all geometrical track "advancements" in the field. The G4ChordFinder must be created either by calling CreateChordFinder() for a Magnetic Field from G4FieldManageror by the user creating a G4ChordFinder object "manually" and setting the pointer.

The object-oriented design of the classes related to the electromagnetic field is shown in the class diagram of Figure 2.16. The diagram is described in UML notation.

Electromagnetic Field

Figure 2.16.  Electromagnetic Field