EGSnrc C++ class library  Report PIRS-898 (2021)
Iwan Kawrakow, Ernesto Mainegra-Hing, Frederic Tessier, Reid Townson and Blake Walters
Classes | Typedefs | Enumerations | Functions
volcor Namespace Reference

Region discovery/volume correction for auto envelope geometries. More...

Classes

class  VCOptions
 Volume correction initialization helper class. More...
 
struct  VCResults
 Struct used to collect and output results about a volume correction run. More...
 

Typedefs

typedef pair< EGS_BaseGeometry *, int > GeomRegPairT
 
typedef std::map< int, EGS_I64 > HitCounterT
 
typedef map< int, set< EGS_BaseGeometry * > > RegionGeomSetT
 
typedef pair< int, EGS_Float > RegVolume
 RegVolumeT is a pair of the form (RegionNumber, Volume)
 

Enumerations

enum  VolCorMode { DISCOVERY_ONLY , ZERO_VOL , CORRECT_VOLUME }
 

Functions

EGS_Float getShapeVolume (EGS_Input *shape_inp)
 
vector< EGS_Float > applyVolumeCorrections (VCOptions *opts, HitCounterT hit_counter, vector< EGS_Float > uncorrected)
 Apply volume corrections to base regions. More...
 
vector< EGS_Float > applyFileVolumeCorrections (VCOptions *opts, vector< RegVolume > &reg_volumes, vector< EGS_Float > uncorrected)
 Apply file volume corrections to base regions. More...
 
vector< EGS_Float > getUncorrectedVolumes (EGS_BaseGeometry *base)
 
VCResults findRegionsWithInscribed (VCOptions *opts, EGS_BaseGeometry *base, vector< EGS_BaseGeometry * > inscribed, vector< EGS_AffineTransform * > transforms)
 Run the MC simulation. More...
 
bool isGZip (istream &vfile)
 
void readVolumes (istream &vfile, vector< RegVolume > &reg_volumes, RegionGeomSetT &reg_with_inscribed, vector< EGS_BaseGeometry * > inscribed)
 
int loadVolumes (string fname, vector< RegVolume > &reg_volumes, RegionGeomSetT &reg_with_inscribed, vector< EGS_BaseGeometry * > inscribed)
 
VCResults loadFileResults (VCOptions *opts, EGS_BaseGeometry *base, vector< EGS_BaseGeometry * > inscribed, vector< EGS_AffineTransform * > transforms)
 Load volume corrections from external file.
 

Detailed Description

Region discovery/volume correction for auto envelope geometries.

The volcor namespace contains methods for correction of geometry region volumes which have other geometries overlapping them. Volume corrections are done using a simple Monte Carlo method.

Typedef Documentation

◆ GeomRegPairT

typedef pair<EGS_BaseGeometry *, int> volcor::GeomRegPairT

Type for specifying a region (GeomRegPairT.second) within a given geometry (GeomRegPairT.first)

Definition at line 89 of file volcor.h.

◆ HitCounterT

typedef std::map<int, EGS_I64> volcor::HitCounterT

Counter for counting number of times that a base geometry region (HitCounterT.first) gets hit (HitCounterT.second) by random points

Definition at line 94 of file volcor.h.

◆ RegionGeomSetT

typedef map<int, set<EGS_BaseGeometry *> > volcor::RegionGeomSetT

A map from base geomtry region number to the set of geometries inscribed in that region

Definition at line 98 of file volcor.h.

Enumeration Type Documentation

◆ VolCorMode

Available volume correction modes

Enumerator
DISCOVERY_ONLY 

Region discovery only. No volume correction applied

ZERO_VOL 

Set base geometry region volume to zero in regions with inscribed geometries

CORRECT_VOLUME 

Subtract inscribed geometry volume from base geometry region volume

Definition at line 82 of file volcor.h.

Function Documentation

◆ getShapeVolume()

EGS_Float volcor::getShapeVolume ( EGS_Input shape_inp)

getShapeVolume takes an EGS_Input for a shape and returns the volume of the shape. Currently the volume will be calculated automatically for cylinders, spheres and box shapes. Other shapes must specify a volume using the shape volume input key. For example:

:start shape:
    type = my_new_shape
    input key 1 = 1234
    input key 2= 5678
    shape volume = 123456
:stop shape:

If shape volume is present for a cylinder, sphere or box shape that value will be used and the automatic calculation will be ignored

Definition at line 123 of file volcor.h.

References egsFatal, and EGS_Input::getInput().

Referenced by volcor::VCOptions::setBoundsShape().

◆ applyVolumeCorrections()

vector<EGS_Float> volcor::applyVolumeCorrections ( VCOptions opts,
HitCounterT  hit_counter,
vector< EGS_Float >  uncorrected 
)

Apply volume corrections to base regions.

After the MC volume run is complete, use the tallied hits and mode requested to set the correct volume of the base regions.

Definition at line 503 of file volcor.h.

References volcor::VCOptions::bounds_volume, volcor::VCOptions::npoints, and ZERO_VOL.

Referenced by findRegionsWithInscribed().

◆ applyFileVolumeCorrections()

vector<EGS_Float> volcor::applyFileVolumeCorrections ( VCOptions opts,
vector< RegVolume > &  reg_volumes,
vector< EGS_Float >  uncorrected 
)

Apply file volume corrections to base regions.

After volumes are loaded from file use the volumes and mode requested to set the correct volume of the base regions.

Definition at line 529 of file volcor.h.

References ZERO_VOL.

Referenced by loadFileResults().

◆ findRegionsWithInscribed()

VCResults volcor::findRegionsWithInscribed ( VCOptions opts,
EGS_BaseGeometry base,
vector< EGS_BaseGeometry * >  inscribed,
vector< EGS_AffineTransform * >  transforms 
)