gp3m2 is a Geant4 application created to simulate the particle phase-space propagation in a multi-layer material. It gets a phase space as input, and export particle phase space when a particle cross any layer boundary.
The phase space contains following informations :
- Particle statistical weight
- Particle position
- Particle momentum
- Time when the particle has cross the boundary
Notes :
- This G4 app was made for my personal use, to simulate propagation of particles created by laser-plasma interaction (simulation done with a Particle-In-Cell code)
- This app is experimental, no warranty about the physical results you may find
You first need Geant4 installed with data and multi-threading mode. Build options for the cmake
command are:
CMAKE_INSTALL_PREFIX=/path/to/your/install
GEANT4_INSTALL_DATA=ON
GEANT4_BUILD_MULTITHREADED=ON
GEANT4_USE_QT=ON # This is optional, but needed for visualisation
If the GEANT4_USE_QT
tag is set, it requires qt5 and openGL librairies (qt5-default
package on Ubuntu).
source /path/to/your/install/bin/geant4.sh
You can then download the gp3m2 code from github and type the following commands
cd /path/to/gp3m2/
mkdir build
cd build
cmake ../
make
It is possible to use the make
command with multi-thread using make -jN
,
N
being the number of threads you want to use.
The bash script compile
can also be used to compile the source (when cmake
command was done).
I made some benchmarks in order to validate the method.
To launch the benchmark N
from the root dir, you can type
./benchmark [N] [v]
To see the Geant4 output in the terminal, use the keyword v
as a second argument.
By default the benchmark 0 is launched with no verbose mode.
More informations can be found at benchmarks/README.md
.
## Features and usage
...
The geometry is
image
It can be managed with macro commands
/target/
This app uses the G4ParticleGun
class to create primary events.
You then have access to the /gun/
folder of commands.
In addition to native Geant4 commands, this app also define other commands :
- /target/addLayer material size
- /input/setFileName filename
- /input/setParticle particle
- /output/setFileName filename
- /output/setLowEnergyLimit number unit
If you're not familiar with the Geant4 toolkit, you can find documentation here:
You can generate a html documentation with doxygen (class and methods are documented).
In the folder doc/
, type
doxygen doxyfile
or use doxywizard.
The code structure is:
- Infinite statistical weight in diagnostics when the number of events is less than number of lines of the input file (number of configurations)
- Precision of 6 digits in diagnostics (forced by the analysis manager ?)