2 The Geant4 User Interface

The Geant4 simulation toolkit [8] implements a very complex machinery to simulate the energy deposition of particles traversing materials. To ease its usage for the clients and to shield clients from the complex internals when actually implementing a simulation applications for a given detector design, it provides several user hooks as shown in Figure 1. Each of these hooks serves a well specialized purpose, but unfortunately also leads to very specialized applications. One aim of DDG4 is to formalize these user actions so that the invocation at the appropriate time may be purely data driven.


PIC

Figure 1: The various user hooks provided by Geant4. Not shown here is the callback system interfacing to the active elements of the detector design.


In detail the following object-hooks allow the client to define user provided actions:

  • The User Physics List allows the client to customize and define the underlying physics process(es) which define the particle interactions inside the detector defined with the geometry description. These interactions define the detector response in terms of energy depositions.
  • The Run Action is called once at the start and end of a run. i.e. a series of generated events. These two callbacks allow clients to define run-dependent actions such as statistics summaries etc.
  • The Primary Generator Action is called for every event. During the callback all particles are created which form the microscopic kinematic action of the particle collision. This input may either origin directly from an event generator program or come from file.
  • The Event Action is called once at the start and the end of each event. It is typically used for a simple analysis of the processed event. If the simulated data should be written to some persistent medium, the call at the end of the event processing is the appropriate place.
  • The Tracking Action
  • The Stepping Action
  • The Stacking Action

Geant4 provides all callbacks with the necessary information in the form of appropriate arguments.

Besides the callback system, Geant4 provides callbacks whenever a particle traverses a sensitive volume. These callbacks are called - similar to event actions - once at the start and the end of the event, but in addition, if either the energy deposit of a particle in the sensitive volume exceeds some threshold. The callbacks are formalized within the base class G4VSensitiveDetector.