View on GitHub

Geant4 Zero to Hero

The Definitive Guide for End Users

Home Visualization YouTube

RayTracer

The RayTracer visualization driver is included in any Geant4 installation, and can be used for geometries that other tools may fail to visualize. Detailed instructions on RayTracer related built-in commands can be found here.

A sample RayTracer [macro] file is shipped with this guide. It can be tried out if you have GEARS or MinGLE installed:

$ git clone https://github.com/jintonic/geant4
$ cd /path/to/geant4/vis/RayTracer
$ gears RayTracer.mac
# or mingle RayTracer.mac

It generates a g4RayTracer.viewer-0_0000.jpeg file in the same directory. Note that the working principle of RayTracer is to shoot many rays (360000 by default) through the detector geometry and draw their intersecting points to reveal the geometry surfaces. Because of this, it takes more time than other methods to finish. It cannot be used to show particle trajectories, the world geometry, nor any cross section. Its advantage is to show complex geometry that other visualization method may fail.