Introduction to GEANT4
From UCL HEP PBT Wiki
GEANT4 is a software toolkit based on C++. In your code you have to define:
- Your experimental setup - geometry, materials and primary particles.
- Which physics process you are interested in.
- You may take actions during the simulation - inspect and store results.
The interaction with GEANT4 is done via base classes. There are eight base classes:
- Mandatory classes
- Describe the experimental setup, geometry and materials
- Define particles, physics processes and range cuts
- Describe particle source, source dimensions, initial position, energy spectrum, angular distributions
- Optional classes
- Define and store histograms
- Event selection and analysis of simulation data
- Customize priority of tracks
- Decide whether a trajectory should be stored or not
- Kill, suspend, postpone a track
You can create your own classes which are derived from the base classes. All of them should be registered with the G4RunManager. In function main() which is the skeleton of your simulation code you instantiate G4RunManager and notify it of your mandatory and optional classes.