EGS Brachy
An egs++ user code for rapid brachytherapy calculations
|
The main egs_brachy application class. See the Main Page for full documentation. More...
#include <egs_brachy.h>
Public Member Functions | |
EB_Application (int argc, char **argv) | |
egs_brachy constructor | |
~EB_Application () | |
egs_brachy destructor | |
void | describeUserCode () const |
Print information about the egs_brachy user code. | |
void | describeSimulation () |
Describe the simulation. | |
void | printIncludedFiles () |
int | initSimulation () |
set the run mode and then call EGS_AdvancedApplication::initSimulation | |
int | initRunControl () |
egs_brachy specific run control initialization | |
int | initRunMode () |
Get run mode from the input file. | |
int | initScoring () |
initialze all scoring and variance reduction parameters | |
int | initVarianceReduction () |
initialze all variance reduction parameters | |
int | initRussianRoulette (EGS_Input *) |
Initialize Russian roulette variance reduction if requested. | |
int | initBCSE (EGS_Input *) |
Initialize BCSE variance reduction if requested. | |
int | ausgab (int iarg) |
user scoring of dose, spectra etc | |
int | outputData () |
Output intermediate results. The egs_brachy version outputs the standard egs++ data along with egs_brachy specific information such as phantom and spectrum scoring information. egs_brachy also allows you to output data in gzip format. | |
int | outputDataHelper (ostream *) |
helper function for outputData | |
int | egsApplicationOutputData (ostream *) |
helper function for outputData | |
int | egsAdvApplicationOutputData (ostream *) |
helper function for outputData | |
int | egsBrachyOutputData (ostream *) |
helper function for outputData | |
int | readData () |
Read data required for restarting simulations. | |
int | readDataHelper (istream *) |
helper function for outputData | |
int | egsApplicationReadData (istream *) |
helper function for outputData | |
int | egsAdvApplicationReadData (istream *) |
helper function for outputData | |
int | egsBrachyReadData (istream *) |
helper function for outputData | |
int | combineResults () |
void | resetCounter () |
Reset the application to a 'pristine' state. Adapted from egs_application.cpp to allow combining in text or gzip format. | |
int | addState (istream &data) |
Add data from a parallel job. Add standard egs++ data as well as egs_brachy specific scoring information. | |
void | outputResults () |
void | getCurrentResult (double &sum, double &sum2, double &norm, double &count) |
Reports the current results for this batch of the simulation. | |
EB_Phantom * | getPhantomByName (string name) |
takes a phantom geometry name and returns the EB_Phantom object | |
virtual void | startNewParticle () |
Set source ecut/pcut if different from global ecut/pcut. | |
virtual void | enterNewRegion () |
virtual int | runSimulation () |
string | getOutputVolcorFormat () |
int | howManyJobsDone () |
Public Attributes | |
int | nsources |
total number of particle sources in current simulation | |
EGS_Float | effective_histories |
Latch | latch_control |
Protected Member Functions | |
void | addRecycledParticlesToStack (EGS_Particle *p, bool new_hist=false) |
void | copyParticleToSourceLoc (EGS_Particle *p, int source, bool kill_orig, bool rotate, EGS_Float new_wt) |
void | doPhotonSplitting (int) |
int | simulateSingleShower () |
int | startNewShower () |
int | initGeometry () |
override default initGeometry so we can manually create our own geometry. | |
int | initSource () |
int | initSourceTransforms () |
read in the location of all particle sources | |
vector< EGS_AffineTransform * > | createTransforms (EGS_Input *input) |
Private Types | |
enum | RunMode { RM_NORMAL , RM_SUPERPOSITION , RM_VC_ONLY } |
Private Member Functions | |
int | createPhantoms () |
set up Phantom objects for any geometries that user has requested scoring for | |
int | correctVolumes () |
run the volume correction routines | |
int | checkSourceOverlaps (EGS_Input *) |
void | initTrackLengthScoring (EGS_Input *) |
track length scoring initialization | |
void | initMuenData (EGS_Input *) |
load muen data for requested media | |
void | initOutputFiles (EGS_Input *) |
set up whether to output extra info files | |
void | initPHSPScoring (EGS_Input *) |
set up phsp scoring | |
void | initEDepScoring (EGS_Input *) |
energy deposition scoring initialization | |
void | initScatScoring (EGS_Input *) |
energy deposition scoring initialization | |
void | clearAusgabCalls () |
disable all ausgab calls | |
void | enableAusgabCalls (int ncalls, AusgabCall calls[]) |
enable an array of ausgab calls | |
void | initGCRScoring (EGS_Input *) |
setup which phantom/region will be used for getCurrentResult | |
void | initAusgabCalls () |
setup any required ausgab calls | |
void | initDoseScaling (EGS_Input *) |
Initialize dose scaling factor if requested. | |
void | initXCCScaling (EGS_Input *) |
Initialize cross section scaling if requested. | |
void | initSpectrumScoring (EGS_Input *) |
Initialize all spectrum scoring objects. | |
int | initCrossSections () |
void | discardTopParticle (int idisc=1) |
void | calcEffectiveHistories () |
bool | isStuck () |
Private Attributes | |
RunMode | run_mode |
Which run mode are we using (RM_NORMAL, RM_SUPERPOSITION or RM_VC_ONLY */. | |
string | run_mode_name |
EnergyScoringStats * | escoring |
Energy related scoring/stats. | |
vector< BaseSpectrumScorer * > | spectrum_scorers |
RecycleOpts * | recycle_opts |
bool | single_generator |
bool | is_phsp_source |
vector< EGS_Float > | source_weights |
int | active_source |
PHSPControl * | phsp |
bool | score_tlen |
true when tracklength estimator is enabled | |
bool | score_edep |
true when energy deposition is enabled | |
bool | score_scat |
true when scatter scoring is enabled | |
string | output_egsdat_format |
text or gzip | |
bool | output_3ddose_files |
false if run mode is 'volume correction only' | |
string | output_dose_format |
text or gzip | |
bool | output_egsphant |
true if user requests egsphant ouput | |
string | output_egsphant_format |
text or gzip | |
bool | output_voxinfo |
true if user requests voxel info file | |
string | output_voxinfo_format |
text or gzip | |
vector< string > | output_volcor_phantoms |
vector of phantom names to output volume correctino files for | |
string | output_volcor_format |
text or gzip | |
int | record_n_init |
if > 0 write initial pos of record_n_init particles to {input_file}.pinit | |
vector< EGS_Vector > | p_init_locs |
EGS_Vector | last_position |
EGS_Float | last_R |
EGS_Float | cur_R |
int | steps_at_same_loc |
EGS_I64 | n_stuck |
EGS_BaseGeometry * | source_envelope_geom |
geometry that the sources are embedded in | |
EGS_ASwitchedEnvelope * | superpos_geom |
an ASwitchedEnv cast of simulation geometry. | |
vector< EB_Phantom * > | phantom_geoms |
pointers to all of the phantom objects | |
vector< EGS_AffineTransform * > | source_transforms |
transforms to locations of all sources | |
EGS_AffineTransform * | base_transform |
same as source_transforms[0] | |
EGS_AffineTransform * | base_transform_inv |
same as source_transforms[0].inverse() | |
map< int, EGS_Interpolator * > | media_muen |
Map from medium index to muen interpolator for that medium. | |
map< string, string > | media_muen_names |
bool | do_brem_split |
int | nbr_split |
Number of times to split bremstrahlung phtons. | |
bool | do_bcse |
int | bcse_med_num |
EGS_Float | bcse_factor |
EGS_Float | flu_cutoff |
fluorescent photon cutoff energy | |
EGS_Float | source_ecut |
ecut for source objects | |
EGS_Float | source_pcut |
pcut for source objects | |
EGS_Float | global_ecut |
ecut for source objects | |
EGS_Float | global_pcut |
pcut for source objects | |
bool | global_i_do_rr |
enable range rejection outside of sources | |
EGS_Float | global_e_max_rr |
max range rejection energy globally | |
bool | source_i_do_rr |
enable range rejection in sources | |
EGS_Float | source_e_max_rr |
max range rejection energy for source objects | |
GeomInfo | ginfo |
meta data about the geometries | |
EB_Phantom * | gcr_phantom |
phantom object to use in getCurrentResult (defaults to 1st phantom) | |
int | gcr_phantom_reg |
region of phantom to use for getCurrentResult (default to 0) | |
map< string, vector< int > > | extra_scoring_reg |
map< string, vector< EGS_Float > > | extra_scoring_vols |
map< string, vector< EGS_Float > > | extra_scoring_mass |
map< string, EGS_ScoringArray * > | extra_scoring_doses |
map< string, EGS_ScoringArray * > | extra_scoring_doses_edep |
ebvolcor::Results | source_vc_results |
results from source volume correctio box phantom | |
ebvolcor::Results | gen_vc_results |
results from general volume correction | |
ebvolcor::FileResults | file_vc_results |
results from precomputed volume correction | |
Publisher | pevent_pub |
Particle event publisher. | |
EB_TimingTree | timing_blocks |
Track CPU times of various functions. | |
map< int, EGS_I64 > | steps_in_sources |
map< int, EGS_I64 > | steps_in_phantoms |
map< int, EGS_I64 > | steps_in_other |
ogzstream * | gz_data_out |
GZip file for outputing egsdat. | |
igzstream * | gz_data_in |
GZip file for outputing egsdat. | |
Static Private Attributes | |
static const EGS_Float | DEFAULT_BCSE_FACTOR = 100 |
static string | revision = "$Revision: 0.9.1 $" |
the usercode revision number | |
The main egs_brachy application class. See the Main Page for full documentation.
Definition at line 91 of file egs_brachy.h.
|
private |
Enumerator | |
---|---|
RM_NORMAL | Standard running mode. |
RM_SUPERPOSITION | Superposition mode for intersource effects. |
RM_VC_ONLY | Run volume correction routines then quit. |
Definition at line 93 of file egs_brachy.h.
|
inline |
egs_brachy constructor
Definition at line 270 of file egs_brachy.h.
|
inline |
egs_brachy destructor
Definition at line 307 of file egs_brachy.h.
|
protected |
Definition at line 1595 of file egs_brachy.cpp.
int EB_Application::addState | ( | istream & | data | ) |
Add data from a parallel job. Add standard egs++ data as well as egs_brachy specific scoring information.
Definition at line 2561 of file egs_brachy.cpp.
int EB_Application::ausgab | ( | int | iarg | ) |
user scoring of dose, spectra etc
Definition at line 1657 of file egs_brachy.cpp.
|
private |
Definition at line 1915 of file egs_brachy.cpp.
|
private |
Definition at line 448 of file egs_brachy.cpp.
|
private |
disable all ausgab calls
Definition at line 1254 of file egs_brachy.cpp.
int EB_Application::combineResults | ( | ) |
Definition at line 2472 of file egs_brachy.cpp.
|
protected |
Definition at line 1494 of file egs_brachy.cpp.
|
private |
run the volume correction routines
Definition at line 597 of file egs_brachy.cpp.
|
private |
set up Phantom objects for any geometries that user has requested scoring for
Definition at line 688 of file egs_brachy.cpp.
|
protected |
Definition at line 385 of file egs_brachy.cpp.
void EB_Application::describeSimulation | ( | ) |
Describe the simulation.
Add extra information to egs_applications describeSimulation
Definition at line 128 of file egs_brachy.cpp.
void EB_Application::describeUserCode | ( | ) | const |
Print information about the egs_brachy user code.
Definition at line 114 of file egs_brachy.cpp.
|
private |
Definition at line 1587 of file egs_brachy.cpp.
|
protected |
Definition at line 1863 of file egs_brachy.cpp.
int EB_Application::egsAdvApplicationOutputData | ( | ostream * | out | ) |
helper function for outputData
Definition at line 2207 of file egs_brachy.cpp.
int EB_Application::egsAdvApplicationReadData | ( | istream * | in | ) |
helper function for outputData
Definition at line 2352 of file egs_brachy.cpp.
int EB_Application::egsApplicationOutputData | ( | ostream * | out | ) |
helper function for outputData
Definition at line 2183 of file egs_brachy.cpp.
int EB_Application::egsApplicationReadData | ( | istream * | in | ) |
helper function for outputData
Definition at line 2329 of file egs_brachy.cpp.
int EB_Application::egsBrachyOutputData | ( | ostream * | out | ) |
helper function for outputData
Definition at line 2234 of file egs_brachy.cpp.
int EB_Application::egsBrachyReadData | ( | istream * | in | ) |
helper function for outputData
Definition at line 2380 of file egs_brachy.cpp.
|
private |
enable an array of ausgab calls
Definition at line 1382 of file egs_brachy.cpp.
|
virtual |
Definition at line 1568 of file egs_brachy.cpp.
void EB_Application::getCurrentResult | ( | double & | sum, |
double & | sum2, | ||
double & | norm, | ||
double & | count | ||
) |
Reports the current results for this batch of the simulation.
Definition at line 2054 of file egs_brachy.cpp.
|
inline |
Definition at line 478 of file egs_brachy.h.
EB_Phantom * EB_Application::getPhantomByName | ( | string | name | ) |
takes a phantom geometry name and returns the EB_Phantom object
Definition at line 968 of file egs_brachy.cpp.
int EB_Application::howManyJobsDone | ( | ) |
Definition at line 2616 of file egs_brachy.cpp.
|
private |
setup any required ausgab calls
For efficiency, only those ausgab calls which are strictly neccessary should be enabled
Definition at line 1261 of file egs_brachy.cpp.
int EB_Application::initBCSE | ( | EGS_Input * | inp | ) |
Initialize BCSE variance reduction if requested.
Definition at line 1196 of file egs_brachy.cpp.
|
private |
Definition at line 848 of file egs_brachy.cpp.
|
private |
Initialize dose scaling factor if requested.
Definition at line 1445 of file egs_brachy.cpp.
|
private |
energy deposition scoring initialization
Definition at line 1389 of file egs_brachy.cpp.
|
private |
setup which phantom/region will be used for getCurrentResult
Definition at line 924 of file egs_brachy.cpp.
|
protected |
override default initGeometry so we can manually create our own geometry.
This allows us to track region numbers for each geometry object individually
Definition at line 307 of file egs_brachy.cpp.
|
private |
load muen data for requested media
Definition at line 1325 of file egs_brachy.cpp.
|
private |
set up whether to output extra info files
Definition at line 979 of file egs_brachy.cpp.
|
private |
set up phsp scoring
Definition at line 1008 of file egs_brachy.cpp.
int EB_Application::initRunControl | ( | ) |
egs_brachy specific run control initialization
Definition at line 788 of file egs_brachy.cpp.
int EB_Application::initRunMode | ( | ) |
Get run mode from the input file.
Definition at line 815 of file egs_brachy.cpp.
int EB_Application::initRussianRoulette | ( | EGS_Input * | scoring_options | ) |
Initialize Russian roulette variance reduction if requested.
Definition at line 1170 of file egs_brachy.cpp.
|
private |
energy deposition scoring initialization
Definition at line 1408 of file egs_brachy.cpp.
int EB_Application::initScoring | ( | ) |
initialze all scoring and variance reduction parameters
Definition at line 890 of file egs_brachy.cpp.
int EB_Application::initSimulation | ( | ) |
set the run mode and then call EGS_AdvancedApplication::initSimulation
Definition at line 768 of file egs_brachy.cpp.
|
protected |
Definition at line 725 of file egs_brachy.cpp.
|
protected |
read in the location of all particle sources
Definition at line 407 of file egs_brachy.cpp.
|
private |
Initialize all spectrum scoring objects.
Definition at line 1233 of file egs_brachy.cpp.
|
private |
track length scoring initialization
Definition at line 1273 of file egs_brachy.cpp.
int EB_Application::initVarianceReduction | ( | ) |
initialze all variance reduction parameters
Definition at line 1019 of file egs_brachy.cpp.
|
private |
Initialize cross section scaling if requested.
Definition at line 1458 of file egs_brachy.cpp.
|
private |
Definition at line 1627 of file egs_brachy.cpp.
int EB_Application::outputData | ( | ) |
Output intermediate results. The egs_brachy version outputs the standard egs++ data along with egs_brachy specific information such as phantom and spectrum scoring information. egs_brachy also allows you to output data in gzip format.
Definition at line 2287 of file egs_brachy.cpp.
int EB_Application::outputDataHelper | ( | ostream * | out | ) |
helper function for outputData
Definition at line 2273 of file egs_brachy.cpp.
void EB_Application::outputResults | ( | ) |
Definition at line 1934 of file egs_brachy.cpp.
void EB_Application::printIncludedFiles | ( | ) |
Definition at line 287 of file egs_brachy.cpp.
int EB_Application::readData | ( | ) |
Read data required for restarting simulations.
Definition at line 2430 of file egs_brachy.cpp.
int EB_Application::readDataHelper | ( | istream * | in | ) |
helper function for outputData
Definition at line 2415 of file egs_brachy.cpp.
void EB_Application::resetCounter | ( | ) |
Reset the application to a 'pristine' state. Adapted from egs_application.cpp to allow combining in text or gzip format.
Definition at line 2534 of file egs_brachy.cpp.
|
virtual |
Definition at line 2064 of file egs_brachy.cpp.
|
protected |
Definition at line 2072 of file egs_brachy.cpp.
|
virtual |
Set source ecut/pcut if different from global ecut/pcut.
Definition at line 1553 of file egs_brachy.cpp.
|
protected |
Definition at line 2157 of file egs_brachy.cpp.
|
private |
Definition at line 112 of file egs_brachy.h.
|
private |
same as source_transforms[0]
Definition at line 148 of file egs_brachy.h.
|
private |
same as source_transforms[0].inverse()
Definition at line 149 of file egs_brachy.h.
|
private |
Definition at line 160 of file egs_brachy.h.
|
private |
Definition at line 159 of file egs_brachy.h.
|
private |
Definition at line 138 of file egs_brachy.h.
|
staticprivate |
Definition at line 161 of file egs_brachy.h.
|
private |
Definition at line 158 of file egs_brachy.h.
|
private |
Definition at line 155 of file egs_brachy.h.
EGS_Float EB_Application::effective_histories |
Definition at line 370 of file egs_brachy.h.
|
private |
Energy related scoring/stats.
Definition at line 103 of file egs_brachy.h.
|
private |
Definition at line 183 of file egs_brachy.h.
|
private |
Definition at line 184 of file egs_brachy.h.
|
private |
Definition at line 182 of file egs_brachy.h.
|
private |
Definition at line 180 of file egs_brachy.h.
|
private |
Definition at line 181 of file egs_brachy.h.
|
private |
results from precomputed volume correction
Definition at line 188 of file egs_brachy.h.
|
private |
fluorescent photon cutoff energy
Definition at line 163 of file egs_brachy.h.
|
private |
phantom object to use in getCurrentResult (defaults to 1st phantom)
Definition at line 177 of file egs_brachy.h.
|
private |
region of phantom to use for getCurrentResult (default to 0)
Definition at line 178 of file egs_brachy.h.
|
private |
results from general volume correction
Definition at line 187 of file egs_brachy.h.
|
private |
meta data about the geometries
Definition at line 175 of file egs_brachy.h.
|
private |
max range rejection energy globally
Definition at line 170 of file egs_brachy.h.
|
private |
ecut for source objects
Definition at line 166 of file egs_brachy.h.
|
private |
enable range rejection outside of sources
Definition at line 169 of file egs_brachy.h.
|
private |
pcut for source objects
Definition at line 167 of file egs_brachy.h.
|
private |
GZip file for outputing egsdat.
Definition at line 199 of file egs_brachy.h.
|
private |
GZip file for outputing egsdat.
Definition at line 198 of file egs_brachy.h.
|
private |
Definition at line 109 of file egs_brachy.h.
|
private |
Definition at line 136 of file egs_brachy.h.
|
private |
Definition at line 137 of file egs_brachy.h.
Latch EB_Application::latch_control |
Definition at line 372 of file egs_brachy.h.
|
private |
Map from medium index to muen interpolator for that medium.
Definition at line 151 of file egs_brachy.h.
|
private |
Definition at line 152 of file egs_brachy.h.
|
private |
Definition at line 140 of file egs_brachy.h.
|
private |
Number of times to split bremstrahlung phtons.
Definition at line 156 of file egs_brachy.h.
int EB_Application::nsources |
total number of particle sources in current simulation
Definition at line 368 of file egs_brachy.h.
|
private |
false if run mode is 'volume correction only'
Definition at line 122 of file egs_brachy.h.
|
private |
text or gzip
Definition at line 123 of file egs_brachy.h.
|
private |
text or gzip
Definition at line 120 of file egs_brachy.h.
|
private |
true if user requests egsphant ouput
Definition at line 124 of file egs_brachy.h.
|
private |
text or gzip
Definition at line 125 of file egs_brachy.h.
|
private |
text or gzip
Definition at line 131 of file egs_brachy.h.
|
private |
vector of phantom names to output volume correctino files for
Definition at line 130 of file egs_brachy.h.
|
private |
true if user requests voxel info file
Definition at line 127 of file egs_brachy.h.
|
private |
text or gzip
Definition at line 128 of file egs_brachy.h.
|
private |
Definition at line 134 of file egs_brachy.h.
|
private |
Particle event publisher.
Definition at line 190 of file egs_brachy.h.
|
private |
pointers to all of the phantom objects
Definition at line 145 of file egs_brachy.h.
|
private |
Definition at line 114 of file egs_brachy.h.
|
private |
if > 0 write initial pos of record_n_init particles to {input_file}.pinit
Definition at line 133 of file egs_brachy.h.
|
private |
Definition at line 107 of file egs_brachy.h.
|
staticprivate |
the usercode revision number
Definition at line 201 of file egs_brachy.h.
|
private |
Which run mode are we using (RM_NORMAL, RM_SUPERPOSITION or RM_VC_ONLY */.
Definition at line 100 of file egs_brachy.h.
|
private |
Definition at line 101 of file egs_brachy.h.
|
private |
true when energy deposition is enabled
Definition at line 117 of file egs_brachy.h.
|
private |
true when scatter scoring is enabled
Definition at line 118 of file egs_brachy.h.
|
private |
true when tracklength estimator is enabled
Definition at line 116 of file egs_brachy.h.
|
private |
Definition at line 108 of file egs_brachy.h.
|
private |
max range rejection energy for source objects
Definition at line 173 of file egs_brachy.h.
|
private |
ecut for source objects
Definition at line 164 of file egs_brachy.h.
|
private |
geometry that the sources are embedded in
Definition at line 142 of file egs_brachy.h.
|
private |
enable range rejection in sources
Definition at line 172 of file egs_brachy.h.
|
private |
pcut for source objects
Definition at line 165 of file egs_brachy.h.
|
private |
transforms to locations of all sources
Definition at line 147 of file egs_brachy.h.
|
private |
results from source volume correctio box phantom
Definition at line 186 of file egs_brachy.h.
|
private |
Definition at line 111 of file egs_brachy.h.
|
private |
Definition at line 104 of file egs_brachy.h.
|
private |
Definition at line 139 of file egs_brachy.h.
|
private |
Definition at line 196 of file egs_brachy.h.
|
private |
Definition at line 195 of file egs_brachy.h.
|
private |
Definition at line 194 of file egs_brachy.h.
|
private |
an ASwitchedEnv cast of simulation geometry.
Definition at line 143 of file egs_brachy.h.
|
private |
Track CPU times of various functions.
Definition at line 192 of file egs_brachy.h.