EGSnrc C++ class library
Report PIRS-898 (2021)
Iwan Kawrakow, Ernesto Mainegra-Hing, Frederic Tessier, Reid Townson and Blake Walters
|
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 > ®_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 > ®_volumes, RegionGeomSetT ®_with_inscribed, vector< EGS_BaseGeometry * > inscribed) |
int | loadVolumes (string fname, vector< RegVolume > ®_volumes, RegionGeomSetT ®_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. | |
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 pair<EGS_BaseGeometry *, int> volcor::GeomRegPairT |
typedef std::map<int, EGS_I64> volcor::HitCounterT |
typedef map<int, set<EGS_BaseGeometry *> > volcor::RegionGeomSetT |
enum volcor::VolCorMode |
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 122 of file volcor.h.
References egsFatal, egsWarning, and EGS_Input::getInput().
Referenced by volcor::VCOptions::setBoundsShape().
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 502 of file volcor.h.
References volcor::VCOptions::bounds_volume, volcor::VCOptions::npoints, and ZERO_VOL.
Referenced by findRegionsWithInscribed().
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 528 of file volcor.h.
References ZERO_VOL.
Referenced by loadFileResults().
VCResults volcor::findRegionsWithInscribed | ( | VCOptions * | opts, |
EGS_BaseGeometry * | base, | ||
vector< EGS_BaseGeometry * > | inscribed, | ||
vector< EGS_AffineTransform * > | transforms | ||
) |
Run the MC simulation.
Finds regions with inscribed geometries and corrects the volume of those regions. The algorithm is described on main page of the Auto Envelope documentation.
Definition at line 557 of file volcor.h.
References applyVolumeCorrections(), volcor::VCOptions::bounds_volume, volcor::VCResults::corrected_volumes, DISCOVERY_ONLY, volcor::VCOptions::getRandomPoint(), volcor::VCResults::inscribed_volume, EGS_BaseGeometry::isInside(), EGS_BaseGeometry::isWhere(), volcor::VCOptions::npoints, volcor::VCResults::regions_with_inscribed, EGS_Timer::start(), volcor::VCResults::success, EGS_Timer::time(), volcor::VCResults::time, EGS_AffineTransform::transform(), and volcor::VCResults::uncorrected_volumes.