-
Geant4 11.0.0+
-
This project used Geant4 11.1.0 downloaded from here and built from source.
-
Instructions to build Geant4:
wget https://gitlab.cern.ch/geant4/geant4/-/archive/v11.1.0/geant4-v11.1.0.tar.gz tar -xzvf geant4-v11.1.0.tar.gz mkdir geant4-v11.1.0-install geant4-v11.1.0-build cd geant4-v11.1.0-build cmake ../geant4-v11.1.0 -DCMAKE_INSTALL_PREFIX=../geant4-v11.1.0-install -DGEANT4_INSTALL_DATA=ON -DGEANT4_BUILD_TLS_MODEL=global-dynamic make -j8 make install export GEANT_INSTALL_DIR=/path/to/geant4-v11.1.0-install export PATH=$PATH:$GEANT_INSTALL_DIR
-
To set the G4 environment variables (e.g. where the Geant4 data tables are stored), add
source /path/to/geant4-v11.1.0-install/bin/geant4.sh
to .bashrc or .bash_profile.
-
-
- Requires core Geant4 to be already built on the system.
- Note that the
-DGEANT4_BUILD_TLS_MODEL=global-dynamic
flag passed when building Geant4 is required to properly build geant4_pybind.
-
ROOT
- This project used ROOT 6.26/10 cloned from here and built from source.
-
- This is not necessary to run the simulations and make ROOT files, but is used in post-processing to group the ROOT tree data into separate tracks.
- Make an output folder in the g4mu directory:
cd g4mu mkdir output
- Run the simulation script from the g4mu directory as follows:
Arguments:
python simulation/propagate_muons_root_output_geant4_pybind.py -o output/icesim.root -n 1000 -e 20000 -rs 42 -ch
-n
is the number of events-e
is the projectile energy in MeV-rs
is the random seed (optional)-so
is the source particle name (optional; default is 'mu-')-ch
enables Cherenkov photon simulation and counting mode (slows down the simulation significantly, do not use if optical photons are not needed)
The above command will run the Geant4 simulation and save the detailed information (including secondary energies, track lengths, and processes that created them) into ROOT trees (one tree entry per event).
-
Process the ROOT trees and save the relevant data into csv files:
python analysis/process_root_trees.py -id output/ -od output/ -ecut 0.5
Arguments:
-id
is the input directory, i.e. the location of the ROOT files from the previous step-od
is the output directory, i.e. where the csv files should be saved (can be the same asid
)-ecut
is the upper energy threshold (in GeV) for the secondaries to process (optional; default is 0.5)