Geant4 Tracking for Beginners
Tracking in Geant4 proceeds for one particle track at a time, one step at a time. A particle track is
The basic concepts at the core of Geant4 are:
- a step represents how the current particle is being moved - this is the G4Step class;
- a track represents the snapshot of the current state of simulating one particle track, and stores key data about how the particle was created;
- a process is usually a physics process - something which results from the interaction of a particle with an atom of the material it is crossing.
- a trajectory is an optional class that can be used to store information about how the track moved;
- an event represents all the tracks and interaction that result from one or more initial particles;
- a run represents a set of events which share a common setup: geometry, beam type and configuration of physics processes.
Some more context about how these fit into the
categories of Geant4 can be found is in the
Introduction to Geant4.
They are explained in lectures at Geant4 tutorials.
Processes and their uses
The interface of the process
G4VProcess is used for other purposes too:
- decay: particles which are unstable have a decay process which models their break-up.
- the transportation process polls the geometry to find the next boundary, find the next volume on its other side and also propagates a particle in a magnetic or electric field
- a scoring process is used to record the passage of tracks through sampling volumes, and to sample quantities such as the dose or energy deposition.
Tracking
Tracking is the part of Geant4 which applies the physical processes to each particle track, and coordinates the simulation of tracks.
At any time there exist also track which were created before we started to simulate the current one, and a list of tracks which were created by the current track.
Geant4 today has one general tracking 'engine' which dispatches the process for all types of particles. This is the
G4SteppingManager
The
G4SteppingManager coordinates the tracking of each particle track, one step at a time. Its basic functions are:
- it initialises each track;
- it polls all processes (interactions) to see how far each one will occur next;
- it determines the minimum length, which is the length of the next step. This identifies also the winning process, the one which occurs at the step's end point;
- it asks how much energy was lost along the length of the step ( the energy loss for charged particles );
- it calls the winning process and asks it what are the results of its interaction including change in energy, momentum direction, and new particles knocked out of an atom or created;
- it finds out what volume the track enters next at the end of a step (which was on a boundary).
As it is general it behaves similarly whether it is dealing with an electron, a positron, a gamma or any other particle. It fetches the list of processes which apply for this particle type, and then calls them one by one, and records their effects in the current
G4Step and
G4Track objects.
Hits
Another key concept is that of a
hit (
G4VHit ). Basically a hit is our way of emulating the
trace that a particle leaves when it passes through a detector it can represent the bubbles created in a bubble chamber or the charge collected in the cathode of a gaseous or silicon detector, or the light which was emitted in a scintillator.
All detectors are created with parts which are meant to record the passage of some types of particles. In many cases, like the trackers just mentioned, they can record only charged particles ( e.g. electrons and protons ). In other cases, detectors are built to detect also neutral particles, by causing them to interact and to create showers.
An application will use hits to store information during a simulation. This is the key way in which information is extracted during a simulation. Without hits (and a few similar mechanisms) the simulation would run and not produce any output - so it would be useless.
One key attribute is that hit classes are written by users - application writers create derived classes which will store only the relevant information for a particular detector. In the last few years we have added another mechanism to record information ( Primitive Scorers. )
Hits are created by
Sensitive detectors, objects which represent a detector.
When a step occurs in a volume which is a Sensitive Detector, Geant4 tracking must message that sensitive detector to allow it to construct hits - in many cases these are the only recorded information of that step of the particle track.
The relevant Geant4 class is
G4VSensitiveDetector.
The more technical aspects of creating hits can be found in the Applications Developers Guide
ADG section on hits.
Additional information on tracks
A track
- stores the starting location of the track
- stores a reference to which process created this track ( or whether it was an initial 'primary' particle )
- can provide the current snapshot of the track's properties ( position, momentum, energy, etc. )
- does not store the intermediate snapshots of the state after each step.
--
JohnApostolakis - 27-Apr-2012