Advanced Example gorad
Responsible Geant4 Collaborator and developer: Makoto Asai (JLAB, VA, US)
Short description
Gorad (Geant4 Open-source Radiation Analysis and Design) is developed as a turn-key application for radiation analysis and spacecraft design built on top of Geant4. Simulation geometry should be provided in the form of GDML.
Gorad is controlled by UI commands, and it works both in interactive mode with Qt window and in batch mode with an input macro file.
The current Gorad requires Geant4 version 11.5 (release of December 2026). It does not work with earlier version of Geant4. Geant4 must be installed with multithreading mode and GDML interface enabled. Qt is also recommended for the use of Gorad in interactive mode. Geant4 GDML interface requires Xerces-C++ version 3 or higher. Xerces-C++ must be compiled with the same compiler Geant4 is compiled. Please refer to the Geant4 installation guide for enabling these options.
- First release : September 2020 with Geant4 version 10.7
- Second release : November 2026 with Geant4 version 11.5
Building and running Gorad
To compile and run Gorad, all the Geant4 environment variables must be properly set. Use the shell script in the Geant4 installation directory.
Compilation of Gorad requires cmake and make same as the compilation of Geant4 itself.
source $G4INSTALL/bin/geant4.(c)sh
cmake .
make -f Makefile
To run Gorad in interactive mode:
./gorad
and then, in the keyboard input field, type
/control/execute _macroFile_
The user may also use any UI commands shown in the left side menu of the Qt window.
To run Gorad in batch mode:
./gorad _macroFIle_
Sample macro file
Gorad comes with two sample macro files. These macro files can be used for both interactive mode and batch mode.
run.mac
It uses a simple cone-shaped geometry (simpleCone.gdml) and King Solar Proton Fluence model. It employs both primary particle generation biasing and geometry importance biasing. This sample macro file defines a probe filled by water located at the center of the world volume with dose and flux scorers.
If this sample macro file is used in interactive mode, it sets up
visualization (through vis.mac). After executing this sample macro, the
user can start an event loop with /run/beamOn command.
If this sample macro file is used in batch mode, it defines 4 histograms. After the event loop, these histograms are dumped to corresponding files and also plotted to a Postscript file. Scores of the dose and flux scorers are also dumped into an output file. In batch mode, this macro executes one million events.
Iodine125.mac
It uses a simplified Iodine-125 Brachytherapy seed geometry (Iodine125Source.gdml). It defines a radioactive volume source. Primary vertex position is uniformly sampled within the specified volume. This sample macro file defines both a scoring mesh to score particle flux and dose deposition distribution and a probe scorer to create an output phase-space file for tracks passing through the probe volume.
If this sample macro file is used in interactive mode, it sets up visualization (through vis.mac) and runs 1000 events. After the event loop, dose deposition distribution is visualized.
If this sample macro file is used in batch mode, it runs with one million events. After the evnet loop, scores are dumped into a file and also, a phase-space file is created.
Gorad manual and additional GDML file
Detail description of the sample macro file and available alternative commands are described in the full manual GoradManual_v2.pdf.
Additional sample GDML file of partial and simplified Orion Spacecraft is available here (~22MB). This is a sample input and it is not mandatory to execute Gorad.
Acknowledgements
Development of Gorad is funded by NASA Johnson Space Center (JSC) under the contract NNJ15HK11B and DOE SBIR under the contract DE-SC0020720.
Last updated: 11/30/2026 by M. Asai