View on GitHub

Geant4 Zero to Hero

Definitive Guide for Geant4 End Users

Home

General Particle Source (GPS)

YouTube Shape Direction

Geant4 provides 3 ways for a user to generate primary particles for a simulation:

GEARS and MinGLE example G4 applications accept both particle gun and GPS macro commands. For example, one can save the following macro commands to a file named run.mac and execute them using mingle run.mac.

# specify particle type
/gps/particle gamma
# specify particle energy
/gps/energy 1 keV
# specify particle source position
/gps/position -6 0 0 cm
# specify particle direction
/gps/direction 1 0 0

Default Settings of GPS

/run/beamOn with tracking verbosity of 2 without any setting on GPS reveals the default settings of GPS:

Idle> /tracking/verbose 2
Idle> /run/beamOn
G4WT3 > *********************************************************************************************************
G4WT3 > * G4Track Information:   Particle = geantino,   Track ID = 1,   Parent ID = 0
G4WT3 > *********************************************************************************************************
G4WT3 >
G4WT3 > Step#    X(mm)    Y(mm)    Z(mm) KinE(MeV)  dE(MeV) StepLeng TrackLeng  NextVolume ProcName
G4WT3 >     0        0        0        0         1        0        0         0        hall initStep
G4WT3 >     1        0        0   -1e+03         1        0    1e+03     1e+03  OutOfWorld CoupledTransportation