View on GitHub

Geant4 Zero to Hero

The Definitive Guide for End Users

Parameterized Placement

Detector Definition YouTube

Geant4 basic example B2b demonstrates how to place a series of similar volumes with slight difference along a line in C++. Parameterized placement of a series of volumes does exist in pure text description of Geant4 geometry. However, it only allows the placement of the same volume multiple times without any change of the volume itself, while in B2b, the size of the volume increases with each placement.

A simple for loop in the SHELL script detector.sh is used to achieve the same parameterised placement done with C++ in B2b. Due to its simple syntax, the text description of Geant4 geomtry can be generated by your favorate scripting langurages, such as SHELL, or Python, which makes it even more versatile than C++.