This repository is meant for testing a variety of the Geant4 functionality related to optical processes, mainly Cherenkov photon generation and propagation.
It strongly recommended to use the "out of source" build pattern. For example, in the folder optical1 one first creates a folder named "build", then runs CMake and finally the build itself using make, from the build folder itself. This can look as follows:
cd optical1
mkdir build
cmake -B build
cd build/
make # or, you can use the multithreaded -j option to make it work quicker
make -j8
The auxiliary header-only library lyra.hpp
that is used for the CLI argument parsing is
in the include folder of the project.
To run the application, the Geant4 environment needs to be properly set by using its setup scripts in the bin folder of the respective installation.
"./Opt -m run1.mac" then the run1.mac macro is called, otherwise "./Opt" visualizes the event.
To get graphics working when running under WSL2, it may be necessary to apply this setting:
export LIBGL_ALWAYS_INDIRECT=
- Create the G4UIExecutive and the runManager
- Initialize the runManager with the DetectorConstruction
- Create the physicsList which includes optical physics
- Call ActionInitialization
This is created in the "Build" method of ActionInitialization. Various particle generation parameters are stored here, as well as a reference to the ParticleGun.
Generates the "Run" object, and calls "EndOfRun" in the end.
This software is a proposed tool to import CAD models (PLY, OBJ, STL) directly as a "G4TessellatedSolid" without the need for any intermediary conversion (eg. GDML). https://github.com/christopherpoole/CADMesh
CADMesh version 1.1 was tested for this project. Each CAD volume needs to be imported in DetectorConstruction. The material, orientation and position must be specified by the user.
How to build CADMesh:
- Download the source code from https://github.com/christopherpoole/CADMesh/releases/tag/v1.1
- Run cmake, make, make install
- Include CADMesh in CMake (Done for this project)
- When building the G4 executable one can specify the directory where CADMesh was installed by using the -Dcadmesh_DIR=/home/galgoczi/software/CADMesh-1.1 cmake flag
One can pick between csv, root and hdf5 format for file output. The CSV output units are the following:
Energy X Y Z X_dir Y_dir Z_dir
The units:
[MeV] [mm] [mm] [mm] [1] [1] [1]