65#include "egs_functions.h"
68#include "egs_shapes.h"
74#include "egs_autoenvelope/egs_sobol.h"
246 egsFatal(
"%s volume correction requested but failed. %s\n", extra.c_str(),
status.c_str());
249 egsInformation(
"%s volume correction not requested.\n", extra.c_str());
253 egsInformation(
"Time taken = %.2G s\n",
time);
254 egsInformation(
"Density of points used = %.0E points/cm^-3\n",
density);
255 egsInformation(
"Number of source points used = %G\n",
npoints);
256 egsInformation(
"Bounding shape volume = %.4E cm^3\n",
bounds_volume);
258 egsInformation(
"Volume of %-10s = %.4E cm^3\n", extra.c_str(),
other_volume);
286 egsFatal(
"File volume correction requested but failed: %s.\n",
status.c_str());
289 egsInformation(
"File volume correction not requested.\n");
292 egsInformation(
"Time taken = %.2G s\n",
time);
293 for (map<string, int>::iterator it=
nreg.begin(); it !=
nreg.end(); it++) {
294 string phant_name = it->first;
295 int npoints = it->second;
298 egsInformation(
"Read %d voxel volumes for '%s' from %s\n", npoints, phant_name.c_str(), file_name.c_str());
335 GeomInfo *geom_info, vector<EGS_AffineTransform *>
transforms = vector<EGS_AffineTransform *>()):
367 timer.
addTimer(
"VolumeCorrector::runSourceCorrection");
372 results.
status =
"Invalid source correction options";
377 results.
status =
"Not requested";
382 clock_t start_time = clock();
384 clock_t end_time = clock();
385 results.
time = (end_time-start_time)/(
double)CLOCKS_PER_SEC;
388 results.
status =
"Completed";
395 timer.
addTimer(
"VolumeCorrector::runGeneralCorrection");
400 results.
status =
"Invalid general correction options";
405 results.
status =
"Not requested";
410 clock_t start_time = clock();
412 clock_t end_time = clock();
414 results.
time = (end_time-start_time)/(
double)CLOCKS_PER_SEC;
415 results.
status =
"Completed";
423 timer.
addTimer(
"VolumeCorrector::runFileCorrection");
424 vector<int> nreg_corrected;
429 results.
status =
"Not requested";
434 clock_t start_time = clock();
436 clock_t end_time = clock();
437 results.
time = (end_time-start_time)/(
double)CLOCKS_PER_SEC;
439 results.
status =
"Completed";
void addTimer(string name)
a container for organizing meta data about the geometries
Volume correction initialization helper class.
static const unsigned long DEFAULT_RAND_POINT_DENSITY
EGS_Float covered_threshold
int setBoundsShape()
create bounding shape from the shape input and calculate its volume
void setCoveredThreshold()
EGS_Vector getRandomPoint()
void setMode()
read mode from input
EGS_RandomGenerator * rng
An object for controlling the volume correction routine.
map< string, int > loadFileVolumeCorrections()
Results runSourceCorrection(EB_TimingTree &timer)
EGS_BaseGeometry * base_geom
vector< EGS_AffineTransform * > transforms
void applyVolumeCorrections(Options *options, HitCounterT hit_counter)
EGS_AffineTransform * base_transform_inv
Results runGeneralCorrection(EB_TimingTree &timer)
double correctPhantomVolumesForSources()
VolumeCorrector(EGS_Input *volcor_input, vector< EB_Phantom * > phantoms, EGS_BaseGeometry *base_geom, GeomInfo *geom_info, vector< EGS_AffineTransform * > transforms=vector< EGS_AffineTransform * >())
vector< EB_Phantom * > phantoms
FileResults runFileCorrection(EB_TimingTree &timer)
EGS_AffineTransform * base_transform
double correctGeneralVolumes()
map< string, string > phantom_files
ginfo contains classes for organizing information about the geometries present in an egs_brachy simul...
pair< int, int > PhantRegT
PhantRegT is a pair of the form (PhantomNumber, PhantomRegion) e.g. a pair of (2, 12) would represent...
std::map< PhantRegT, EGS_I64 > HitCounterT
HitCounterT is used for counting how many random points land in a given phantoms region.
EGS_Float getShapeVolume(EGS_Input *shape_inp)
get shape volume from a shape input item
Header file for phantom objects.
map< string, string > phantom_files
FileResults(map< string, string > phant_files)
RegVolumeT sruct with members (ir=RegionNumber, vol=Volume, unc=Unc)
Struct used to collect and output results about a volume correction run.
void outputResults(string extra="")
map< int, vector< int > > regions_corrected