View on GitHub

Geant4 Zero to Hero

The Definitive Guide for End Users

Spherical Shell Section

YouTube CSG

A sphere can be constructed using C++ or some simple text:

:volu sphere SPHERE
 20 // inner r in mm
 40 // outer r in mm
 70 // phi0 in degree
 80 // dphi in degree
 30 // theta0 in degree
 90 // dtheta in degree
 G4_WATER

The full source code is in detector.tg, which can be visualized using the macro file mingle.mac or gears.mac, assuming an universal Geant4 application, such as MinGLE or GEARS, is available:

git clone https://github.com/jintonic/geant4
cd geant4/detector/CSG/sphere
# generate animated picture, sphere.gif
G4VIS_DEFAULT_DRIVER=TSG_FILE gears gears.mac

Figure of Sphere