EGSnrc C++ class library  Report PIRS-898 (2021)
Iwan Kawrakow, Ernesto Mainegra-Hing, Frederic Tessier, Reid Townson and Blake Walters
Public Member Functions | List of all members
EGS_RadionuclideSource Class Reference

A radionuclide source. More...

#include <egs_radionuclide_source.h>

Inheritance diagram for EGS_RadionuclideSource:
EGS_BaseSource EGS_Object

Public Member Functions

 EGS_RadionuclideSource (EGS_Input *, EGS_ObjectFactory *f=0)
 Constructor from input file.
 
 ~EGS_RadionuclideSource ()
 Destructor.
 
EGS_I64 getNextParticle (EGS_RandomGenerator *rndm, int &q, int &latch, EGS_Float &E, EGS_Float &wt, EGS_Vector &x, EGS_Vector &u)
 Gets the next particle from the radionuclide spectra.
 
EGS_Float getEmax () const
 Returns the maximum energy out of all the spectra.
 
EGS_Float getFluence () const
 Returns the current fluence (number of disintegrations) More...
 
double getTime () const
 Returns the emission time of the most recent particle.
 
double getExperimentTime () const
 Get the total possible length of the experiment that is being modelled. More...
 
EGS_I64 getShowerIndex () const
 Returns the shower index of the most recent particle.
 
unsigned int getEmissionType () const
 
void printSampledEmissions ()
 Outputs the emission stats of the spectra.
 
bool isValid () const
 Checks the validity of the source.
 
bool storeState (ostream &data_out) const
 Store the source state to the data stream data_out. More...
 
bool addState (istream &data)
 Add the source state from the stream data to the current state. More...
 
void resetCounter ()
 Reset the source to a state with zero sampled particles. More...
 
bool setState (istream &data)
 Set the source state according to the data in the stream data. More...
 
- Public Member Functions inherited from EGS_BaseSource
 EGS_BaseSource (const string &Name="", EGS_ObjectFactory *f=0)
 Construct a source named Name. More...
 
 EGS_BaseSource (EGS_Input *input, EGS_ObjectFactory *f=0)
 Construct a source from the input pointed to by inp. More...
 
const char * getSourceDescription () const
 Get a short description of this source. More...
 
virtual void setSimulationChunk (EGS_I64 nstart, EGS_I64 nrun)
 Set the next simulation chunk to start at nstart and to consist of nrun particles. More...
 
virtual int getCharge () const
 Get the charge of the source. More...
 
virtual EGS_Float getMu ()
 
- Public Member Functions inherited from EGS_Object
 EGS_Object (const string &Name="", EGS_ObjectFactory *f=0)
 Create an EGS_Object named Name belonging to the object factory f. More...
 
 EGS_Object (EGS_Input *inp, EGS_ObjectFactory *f=0)
 Create an EGS_Object from the information pointed to by inp that belongs to object factory f. More...
 
const string & getObjectName () const
 Get the object name.
 
void setObjectName (const string &Name)
 Set the object name to Name.
 
const string & getObjectType () const
 Get the object type.
 
virtual EGS_ObjectcreateObject (EGS_Input *inp)
 Create an object from the infromation pointed to by inp. More...
 
void setName (EGS_Input *inp)
 Set the name of the object from the information provided by inp. More...
 
int ref ()
 Increase the reference count to this object.
 
int deref ()
 Decrease the reference count to this object.
 
void setFactory (EGS_ObjectFactory *f)
 Set the factory to which the object belongs. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from EGS_BaseSource
static EGS_BaseSourcecreateSource (EGS_Input *)
 Create sources from the information pointed to by input. More...
 
static EGS_BaseSourcegetSource (const string &Name)
 Get a pointer to the source named Name. More...
 
static void addKnownSource (EGS_BaseSource *o)
 Add a known source object to the source factory. More...
 
static void addKnownTypeId (const char *name)
 Add a known source object typeid to the source factory. More...
 
- Static Public Member Functions inherited from EGS_Object
static string getUniqueName (const EGS_Object *o=0)
 Create and return a unique object name. More...
 
static void deleteObject (EGS_Object *o)
 Delete an object. More...
 
- Protected Attributes inherited from EGS_BaseSource
string description
 A short source description. More...
 
- Protected Attributes inherited from EGS_Object
string name
 The object name.
 
string otype
 The object type.
 
int nref
 Number of references to the object.
 
EGS_ObjectFactoryfactory
 The factory this object belongs to.
 

Detailed Description

A radionuclide source.

A radionuclide source is a source that delivers particles according to a radionuclide decay scheme. It follows events decay-by-decay, so that internal transitions and atomic relaxations from decay events are produced in a correlated fashion from the same location.

Note that EGS_RadionuclideSource is an experimental source and only a subset of the available radionuclides have been tested against measurement. Please be aware of the known caveats and how they may affect your results. Report any discrepancies on the EGSnrc github issues page.

Known Caveats:

Emissions are based on decays from the chosen radionuclide and can be a mix of beta+-, electron capture and alpha decays. Metastable radionuclides are supported. Internal transitions are modeled event-by-event. The EGS_RadionuclideSpectrum keeps track of the energy level of excited daughter nuclides so that subsequent transitions and electron shell cascades are correlated with specific disintegration events.

Each emission is assigned a shower index ishower and time to allow for coincidence counting. These properties can be accessed for the most recent emission from the source using something like the following. Note that the time does not include any time-of-flight measures.

source->getShowerIndex();

source->getTime();

Auger and fluorescent photon radiations are also modeled as a part of the source, using the EADL relaxation scheme by default. Alternatively, the user can request to use Auger and fluorescent photons from the ensdf file comments by setting the spectrum input parameter 'atomic relaxations = ensdf'. For more information, see EGS_RadionuclideSpectrum.

Note that results are usually normalized by the source fluence, which is returned by the getFluence() function of the base source. The calculation of the fluence depends on the selected base source, but the N used depends on the number of disintegration events (tracked by ishower ). This is distinct from the ncase input parameter, which is the number of particles returned by the source (includes relaxations etc.).

A radionuclide source is defined using the following input. It imports a base source and uses the base source getNextParticle() invocation to determine decay location and direction. The energy spectrum of the base source is not used, but it is still a required input so must be specified. This implementation leads to increased random number sampling than that strictly required in the simulation, due to the information generated in the base source beyond particle position/direction that is not used in egs_radionuclide_source. For this reason it's recommended to set the base source to use a monoenergetic spectrum.

:start source:
    name                = my_mixture
    library             = egs_radionuclide_source
    base source         = name of the source used to generate decay locations
    activity            = [optional, default=1] total activity of mixture,
                          assumed constant. The activity only affects the
                          emission times assigned to particles.
    charge              = [optional] list including at least one of -1, 0, 1, 2
                          to include electrons, photons, positrons and alphas.
                          Filtering is applied to ALL emissions (including
                          relaxation particles).
                          Omit this option to include all charges - this is
                          recommended.
    experiment time     = [optional, default=0] time length of the experiment,
                          set to 0 for no time limit. Source particles generated
                          after the experiment time are not transported.

    :start spectrum:
        definition of an EGS_RadionuclideSpectrum (see link below)
    :stop spectrum:
:stop source:

The emission spectrum generation is described in EGS_RadionuclideSpectrum.

Note about emission times:

The time of disintegration is sampled based on the total activity of the mixture in EGS_RadionuclideSource. For uniform random number u, we sample the time to the next disintegration, and increment the wall clock as follows:

time += -log(1-u) / activity;

The time of emission of a transition photon is determined by sampling the delay that occurs after disintegration, according to the transition halflife .

time += -halflife * log(1-u) / ln(2);

If you are using 'atomic relaxations = ensdf' in the spectrum, then the relaxation emissions are not correlated with disintegration events. This means that getShowerIndex() and getTime() will not produce correct results for non-disintegration emissions.

A simple example:

:start run control:
    ncase = 1e6
:stop run control:
:start geometry definition:
    :start geometry:
        name        = my_box
        library     = egs_box
        box size    = 1 2 3
        :start media input:
            media   = H2O521ICRU
        :stop media input:
    :stop geometry:
    :start geometry:
        name        = sphere1
        library     = egs_spheres
        midpoint    = 0 0 1
        radii       = 0.3
        :start media input:
            media   = AIR521ICRU
        :stop media input:
    :stop geometry:
    :start geometry:
        name        = sphere2
        library     = egs_spheres
        midpoint    = 0 0 -1
        radii       = 0.3
        :start media input:
            media   = AIR521ICRU
        :stop media input:
    :stop geometry:
    :start geometry:
        name        = my_envelope
        library     = egs_genvelope
        base geometry           = my_box
        inscribed geometries    = sphere1 sphere2
    :stop geometry:
    simulation geometry = my_envelope
:stop geometry definition:
:start source definition:
    :start source:
        name                = my_base_source
        library             = egs_isotropic_source
        geometry            = my_envelope
        region selection    = IncludeSelected
        selected regions    = 1 2
        :start shape:
            type        = box
            box size    = 1 2 3
        :stop shape:
        :start spectrum: # This will not actually be used, but is required
            type = monoenergetic
            energy = 1
        :stop spectrum:
    :stop source:
    :start source:
        name                = my_radionuclide
        library             = egs_radionuclide_source
        base source         = my_base_source
        :start spectrum:
            type        = radionuclide
            nuclide     = Ir-192
        :stop spectrum:
    :stop source:
    simulation source = my_radionuclide
:stop source definition:
egs_radionuclide_source.png
A simple example of two spheres emitting Ir-192 radiations

Definition at line 269 of file egs_radionuclide_source.h.

Member Function Documentation

EGS_Float EGS_RadionuclideSource::getFluence ( ) const
virtual

Returns the current fluence (number of disintegrations)

< Scale ishower+1 return by fluence ratio returned by file

Implements EGS_BaseSource.

Definition at line 304 of file egs_radionuclide_source.h.

double EGS_RadionuclideSource::getExperimentTime ( ) const

Get the total possible length of the experiment that is being modelled.

This method returns the total experiment time specified by the user. This is used to exclude time-delayed source emissions that would occur after the modelled experiment.

Definition at line 319 of file egs_radionuclide_source.h.

bool EGS_RadionuclideSource::storeState ( ostream &  data_out) const
virtual

Store the source state to the data stream data_out.

Uses the storeState() of the spectrum object and the storeFluenceState() virtual function.

Reimplemented from EGS_BaseSource.

Definition at line 301 of file egs_radionuclide_source.cpp.

References egsStoreI64(), and EGS_BaseSource::storeState().

bool EGS_RadionuclideSource::addState ( istream &  data)
virtual

Add the source state from the stream data to the current state.

Uses the addState() of the spectrum object and the addFluenceData() virtual function.

Reimplemented from EGS_BaseSource.

Definition at line 314 of file egs_radionuclide_source.cpp.

References EGS_BaseSource::addState(), egsGetI64(), and setState().

void EGS_RadionuclideSource::resetCounter ( )
virtual

Reset the source to a state with zero sampled particles.

Uses the resetCounter() function of the spectrum object and the virtual function resetFluenceCounter().

Reimplemented from EGS_BaseSource.

Definition at line 331 of file egs_radionuclide_source.cpp.

References EGS_BaseSource::resetCounter().

bool EGS_RadionuclideSource::setState ( istream &  data)
virtual

Set the source state according to the data in the stream data.

Uses the setState() method of the spectrum object and the setFluenceState() virtual function.

Reimplemented from EGS_BaseSource.

Definition at line 341 of file egs_radionuclide_source.cpp.

References egsGetI64(), and EGS_BaseSource::setState().

Referenced by addState().


The documentation for this class was generated from the following files: