EGSnrc C++ class library  Report PIRS-898 (2021)
Iwan Kawrakow, Ernesto Mainegra-Hing, Frederic Tessier, Reid Townson and Blake Walters
Introduction

Every Monte Carlo simulation of a particle transport problem requires the following ingredients

  1. A particle source
  2. A geometry in which the particles are being transported
  3. Cross sections, interaction and transport methods of the particles being simulated
  4. Means for scoring (accumulating) the results for the quantities of interest

Some general purpose codes such as MCNP provide a monolithic code that takes care of all 4 aspects. This approach has the obvious advantage that the user only needs to learn the syntax of the input and data files controlling the program flow and can then immediately use the package without additional programming. However, if some aspect of the simulation can not be realized with the methods provided, it is typically very hard to extend the package with the necessary additions due to its size and complexity. The EGS series of electron/photon simulation packages, on the other side, only provide item 3 from the above list. It is the responsibility of the user to program the particle source, geometry and scoring for the task at hand. The advantage of this approach is that, due to the lightweight of EGS, one can very quickly put together EGS applications for the simulation of a variety of problems. However, if the geometry and/or the particle source are complex, the creation of a corresponding application may turn into a lengthy and tedious exercise. This drawback is somewhat alleviated by the fact that the EGSnrc package provides a series of applications for a variety of tasks. Nevertheless, the availability of flexible and general geometry and particle source packages would greatly reduce the amount of work needed to perform simulations that can not be done with the standard set of applications.

The EGSnrc C++ class library egspp provides

Flexibility and extendibility were important factors in the design of the EGSnrc C++ class library. It should therefore be a relatively easy task to implement additional geometry and particle source classes, should the provided set be not able to model a certain simulation problem.

For instructions on the installation of egspp see here.

For more details on the design of egspp see here.

For a detailed description of the geometry package see the geometry module.

For a detailed description of particle sources see the sources module.

For a description of the main egspp library see the egspp module.

For a description of the steps needed to program a simple EGSnrc C++ application see the tutor2pp example.

For a description of the steps needed to program an advanced EGSnrc C++ application see the tutor7pp example.

Discussion of the implementation of additional geometries can be found here.

The implementation of a particle source class is discussed here.