This example makes use of the Geant4 particle-material interaction framework. In this scenario a proton beam is fired against a target of Beryllium.
The example makes use of the tutorial series by Mustafa Schmidt on Youtube and the code available GitHub.