View on GitHub

Geant4 Zero to Hero

The Definitive Guide for End Users

Tube Section

YouTube CSG Detector Definition

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

:volu tubs TUBS
 10 // inner r in mm
 15 // outer r in mm
 20 // half z in mm
 0  // phi0 in degree
 90 // dphi in degree
 G4_WATER // material

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/tubs
# generate animated picture, tubs.gif
G4VIS_DEFAULT_DRIVER=TSG_FILE gears gears.mac

Figure of tube