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

Shapes are objects that can pick random points within a certain area or volume. More...

Modules

 Surface Shapes
 Surface shapes are shapes that support the getPointSourceDirection() method.
 

Classes

class  EGS_BaseShape
 Base shape class. All shapes in the EGSnrc C++ class library are derived from EGS_BaseShape. More...
 
class  EGS_SurfaceShape
 A surface shape. More...
 
class  EGS_PointShape
 A point shape. This is the simplest shape possible: it simply always returns the same point. More...
 
class  EGS_BoxShape
 A box shape. More...
 
class  EGS_SphereShape
 A sphere shape. More...
 
class  EGS_CylinderShape
 A cylinder shape. More...
 
class  EGS_CircleShape
 A circle shape. More...
 
class  EGS_CirclePerpendicularShape
 A circle shape perpendicular to source particles. More...
 
class  EGS_EllipseShape
 An elliptical shape. More...
 
class  EGS_ExtendedShape
 An extended shape. More...
 
class  EGS_GaussianShape
 A Gaussian shape. More...
 
class  EGS_LineShape
 A line shape. More...
 
class  EGS_TriangleShape
 A triangular shape. More...
 
class  EGS_PolygonShape
 A polygon shape. More...
 
class  EGS_RectangleShape
 A rectangular shape. More...
 
class  EGS_RectangularRing
 A "rectangular ring". More...
 
class  EGS_ShapeCollection
 A shape collection. More...
 
class  EGS_VoxelizedShape
 A "voxelized shape". More...
 

Detailed Description

Shapes are objects that can pick random points within a certain area or volume.

Many of the sources used in the standard set of EGSnrc user codes and provided as classes derived from EGS_BaseSimpleSource determine the direction and position of a particle from the following generic algorithm:

This algorithm does not depend on the details of selecting the random positions and is therefore ideally implemented using abstract objects that are able to deliver a random position. Such objects are called 'shapes' in the egspp framework. All concrete shapes available in the EGSnrc C++ class library are derived from the abstract EGS_BaseShape class, which specifies the interface to shape objects. The most important method defined is getPoint() , which takes a random number generator as input and delivers a random 3D vector. All shapes can have an affine transformation $T$, which is applied to the random position before returning it to the caller.

A large number of shapes is provided with the egspp package. Most shapes are implemented as small DSOs, which are loaded dynamically as needed. Such shapes require the library key to be present in their definition in the input file. A few of the most frequently used shapes are compiled into egspp and therefore require a type key instead of a library key.