General Particle Source (GPS)
Geant4 provides 3 ways for a user to generate primary particles for a simulation:
- C++: the hardest to learn and use, hence covered intensively in Geant4 User Guide for Application Developers, and demonstrated in most Geant4 official examples.
- particle gun: the easiest to learn and use (no C++, just macro commands), yet limited in its functionality.
- general particle source: as easy as particle gun, yet way more versatile. It’s functionality is demonstrated nicely in the extended Geant4 example exgps.
An outdated webpage contains most demonstrations in exgps. In addition, it shows resulted distribution plots, which are very helpful to visualize effects of GPS macro commands.
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
- Default particle: geantino
- Default energy: 1 MeV
- Default position: (0, 0, 0)
- Default direction: -z