|
EGSnrc C++ class library
Report PIRS-898 (2021)
Iwan Kawrakow, Ernesto Mainegra-Hing, Frederic Tessier, Reid Townson and Blake Walters
|
An isotropic source. More...
#include <egs_isotropic_source.h>
Public Types | |
| enum | GeometryConfinement { IncludeAll = 0 , ExcludeAll = 1 , IncludeSelected = 2 , ExcludeSelected = 3 } |
| Geometry confinement options. | |
Public Member Functions | |
| EGS_IsotropicSource (int Q, EGS_BaseSpectrum *Spec, EGS_BaseShape *Shape, EGS_BaseGeometry *geometry, const string &Name="", EGS_ObjectFactory *f=0) | |
| Constructor. More... | |
| EGS_IsotropicSource (EGS_Input *, EGS_ObjectFactory *f=0) | |
| Constructor. More... | |
| void | getPositionDirection (EGS_RandomGenerator *rndm, EGS_Vector &x, EGS_Vector &u, EGS_Float &wt) |
| EGS_Float | getFluence () const |
| bool | storeFluenceState (ostream &) const |
| bool | setFluenceState (istream &) |
| bool | isValid () const |
Public Member Functions inherited from EGS_BaseSimpleSource | |
| EGS_BaseSimpleSource (int Q, EGS_BaseSpectrum *Spec, const string &Name="", EGS_ObjectFactory *f=0) | |
| Constructor. More... | |
| EGS_BaseSimpleSource (EGS_Input *input, EGS_ObjectFactory *f=0) | |
| Construct a 'simple' particle source from the information pointed to by input. More... | |
| ~EGS_BaseSimpleSource () | |
| Destructor. More... | |
| virtual EGS_I64 | getNextParticle (EGS_RandomGenerator *rndm, int &Q, int &latch, EGS_Float &E, EGS_Float &wt, EGS_Vector &x, EGS_Vector &u) |
| Sample the next source particle from the source probability distribution. More... | |
| virtual EGS_Float | getEmax () const |
| Get the maximum energy of the source. More... | |
| int | getCharge () const |
| Get the charge of the source. More... | |
| virtual bool | storeState (ostream &data_out) const |
| Store the source state to the data stream data_out. More... | |
| virtual bool | addState (istream &data) |
| Add the source state from the stream data to the current state. More... | |
| virtual void | resetCounter () |
| Reset the source to a state with zero sampled particles. More... | |
| virtual bool | addFluenceData (istream &data) |
| Add fluence data from the stream data to the current state. More... | |
| virtual void | resetFluenceCounter () |
| Reset the data related to the sampling of positions and directions to a state with zero sampled particles. More... | |
| virtual 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. | |
| 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, int npar, int nchunk) |
| Set the next simulation chunk to start at nstart and to consist of nrun particles. More... | |
| virtual void | printSampledEmissions () |
| Print statistics on what was sampled from the source. | |
| virtual vector< EGS_Ensdf * > | getRadionuclideEnsdf () |
| Get the radionuclide ENSDF object from the source. More... | |
| EGS_Float | getTimeIndex () |
| void | setTimeIndex (EGS_Float temp_time) |
| virtual void | containsDynamic (bool &hasdynamic) |
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_Object * | createObject (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... | |
Protected Member Functions | |
| void | setUp () |
Protected Member Functions inherited from EGS_BaseSimpleSource | |
| virtual void | setLatch (int &latch) |
Protected Attributes | |
| EGS_BaseShape * | shape |
| The shape from which particles are emitted. | |
| EGS_BaseGeometry * | geom |
| int * | regions |
| int * | media |
| EGS_Float | min_theta |
| EGS_Float | max_theta |
| EGS_Float | buf_1 |
| EGS_Float | buf_2 |
| EGS_Float | min_phi |
| avoid multi-calculating cos(min_theta) and cos(max_theta) | |
| EGS_Float | max_phi |
| int | nrs |
| int | nms |
| GeometryConfinement | gc |
| GeometryConfinement | gcm |
Protected Attributes inherited from EGS_BaseSimpleSource | |
| int | q |
| The charge of this simple source. | |
| EGS_BaseSpectrum * | s |
| The energy spectrum of this source. | |
| string | type |
| A short description of the source type. | |
| EGS_I64 | count |
| Number of statistically independent particles delivered so far. | |
Protected Attributes inherited from EGS_BaseSource | |
| string | description |
| A short source description. More... | |
| EGS_Float | time_index |
| time index corresponding to a particle. This stores the current time index for all objects in the simulation (with the potential exception of beam and iaea_phsp source) | |
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_ObjectFactory * | factory |
| The factory this object belongs to. | |
Additional Inherited Members | |
Static Public Member Functions inherited from EGS_BaseSource | |
| static EGS_BaseSource * | createSource (EGS_Input *) |
| Create sources from the information pointed to by input. More... | |
| static EGS_BaseSource * | getSource (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... | |
An isotropic source.
An isotropic source is a source that delivers particles of a given charge with directions uniformly distributed in
emitted from any shape with any spectrum. It is defined most simply using the following input:
:start source:
library = egs_isotropic_source
name = some_name
:start shape:
definition of the shape
:stop shape:
:start spectrum:
definition of the spectrum
:stop spectrum:
charge = -1 or 0 or 1 for electrons or photons or positrons
min theta = 80 [degree] (optional)
max theta = 100 [degree] (optional)
min phi = 80 [degree] (optional)
max phi = 100 [degree] (optional)
geometry = some_name # Optional, only particles inside the geometry
# or inside some of its regions are generated.
region selection = IncludeAll # Optional, only for a valid geometry defined as above.
# Also possible: ExcludeAll, IncludeSelected, ExcludeSelected.
# Defaults to IncludeAll.
selected regions = ir1,... # If IncludeSelected or ExcludeSelected above, then user must
# enter the desired regions to be excluded or included. If
# no region provided, region selection switches to:
# IncludeAll if IncludeSelected
# ExcludeAll if ExcludeSelected
medium selection = IncludeSelected # Optional, only for a valid geometry defined as above. Valid options are IncludeSelected or ExcludeSelected
selected media = med1 med2 # If IncludeSelected or ExcludeSelected is set for medium selection
# enter a list of medium names
:stop source:
It is also possible to generate source particles from a more complex shape by including or excluding geometry regions. This is done by providing the geometry name to operate on, a region selection mode, and selected regions for the region selection operation. The selected regions tag is necessary and used only for IncludeSelected and ExcludeSelected modes.
The available region selection modes are described below. A particle is generated within the defined shape uniformly, and kept only if it meets the corresponding condition:
IncludeAll - particle is inside geometry ExcludeAll - particle is NOT inside geometry IncludeSelected - particle is inside geometry AND in one of selected regions ExcludeSelected - particle is not inside geometry OR not in one of selected regionsAND meets the corresponding condition, for filtering by medium selection:
IncludeSelected - particle is inside geometry AND in one of selected media ExcludeSelected - particle is not inside geometry OR not in one of selected media:start source:
library = egs_isotropic_source
name = some_name
geometry = a geometry to modify particle generation (optional)
region selection = IncludeAll or ExcludeAll or IncludeSelected or ExcludeSelected (optional)
selected regions = regions to use (only for IncludeSelected or ExcludeSelected)
medium selection = IncludeSelected or ExcludeSelected (optional)
selected media = media to use (only for IncludeSelected or ExcludeSelected)
:start shape:
definition of the shape to generate particles within
:stop shape:
:start spectrum:
definition of the spectrum
:stop spectrum:
charge = -1 or 0 or 1 for electrons or photons or positrons
min theta = 80 [degree] (optional)
max theta = 100 [degree] (optional)
min phi = 80 [degree] (optional)
max phi = 100 [degree] (optional)
:stop source:
It is worth noting that the functionality of source 3 in the RZ series of user codes or source 6 in DOSXYZnrc can be reproduced with the isotropic source from the EGSnrc C++ class library.
Here is an example of two spheres in a box emitting isotropic photons. Only the geometry and source blocks are provided:
: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_source
library = egs_isotropic_source
charge = 0
geometry = my_envelope
region selection = IncludeSelected
selected regions = 1 2
:start shape:
type = box
box size = 1 2 3
:start media input:
media = H2O521ICRU
:stop media input:
:stop shape:
:start spectrum:
type = monoenergetic
energy = 1
:stop spectrum:
:stop source:
simulation source = my_source
:stop source definition:
Definition at line 238 of file egs_isotropic_source.h.
| EGS_IsotropicSource::EGS_IsotropicSource | ( | int | Q, |
| EGS_BaseSpectrum * | Spec, | ||
| EGS_BaseShape * | Shape, | ||
| EGS_BaseGeometry * | geometry, | ||
| const string & | Name = "", |
||
| EGS_ObjectFactory * | f = 0 |
||
| ) |
Constructor.
Construct an isotropic source with charge Q, spectrum Spec and emitting particles from the shape Shape
Definition at line 256 of file egs_isotropic_source.h.
| EGS_IsotropicSource::EGS_IsotropicSource | ( | EGS_Input * | input, |
| EGS_ObjectFactory * | f = 0 |
||
| ) |
Constructor.
Construct an isotropic source from the information pointed to by inp.
Definition at line 46 of file egs_isotropic_source.cpp.
1.9.1