49#include "egs_scoring.h"
50#include "egs_application.h"
51#include "egs_interface2.h"
102 void outputTopDoses(
int top_n, vector<RegionResult> region_results);
108 void output3DDoses(ostream &out, EGS_ScoringArray *score,
string type);
127 void getScoringArrays(vector<EGS_ScoringArray *> &scores, vector<string> &types, vector<string> &descriptions);
174 void scoreTlen(
int ir, EGS_Float dose, EGS_Particle *p);
245 void outputResults(
int top_n=20,
string output_3ddose=
"text",
string output_egsphant=
"text",
246 string output_voxinfo=
"text",
string output_volcor=
"text");
280 void getResult(EGS_ScoringArray *,
int ireg,
string type, EGS_Float &r, EGS_Float &dr);
A class to represent a single phantom for scoring dose in egs_brachy.
@ YDIR
YDIR=1 y dir for rectilinear, r dir for cylindrical.
@ XDIR
XDIR=0 x dir for rectilinear, r dir for spherical, z dir for cylindrical.
@ ZDIR
ZDIR=2 z dir for rectilinear.
void getResult(EGS_ScoringArray *, int ireg, string type, EGS_Float &r, EGS_Float &dr)
get result for region from scoring array and normalize based on the type requested.
void outputEGSPhant(string)
initialize and write an egsphant file for this phantom
void scoreTlen(int ir, EGS_Float dose, EGS_Particle *p)
add tracklength dose to region ir
void output3ddoseResults(string)
write the phantom boundaries, doses and uncertainties to 3ddose file
void outputVoxelInfo(string format)
write voxel volumes, mass, desnity etc
std::map< int, double > volume_uncertainty
int global_reg_stop
ending global region index for this phantom
~EB_Phantom()
EB_Phantom destructor.
void update(EB_Message message, void *data)
bool can_write_3ddose
this phantom can output 3ddose files
EGS_Float getUncorrectedVolume(int ireg)
get corrected volume for a given region
EGS_BaseGeometry * geometry
the phantom geometry object
void getCurrentScore(int ireg, double &sum, double &sum2)
get current tlen score for region
void output3DDoses(ostream &out, EGS_ScoringArray *score, string type)
write input scoring array to 3ddose file
vector< int > getRegionsWithCorrections()
return a vector of all regions which were corrected
bool globalRegIsInPhant(int global_reg)
check whether a global region falls within this phantom
double getTlenNorm(int ireg)
int global_reg_start
starting global region index for this phantom
EGS_Float effective_histories
void outputTopDoses(int top_n, vector< RegionResult > region_results)
write the top_n doses to console
EGS_Float getRealRho(int ireg)
return actual density for region
void writeVolumeCorrection(ostream &)
write voxel volumes to file
void setEffectiveHistories(EGS_Float current_case)
set number of effective histories for normalizing scoring arrays
void enableScatterScoring()
enableInteractionScoring must be called before simulation begins if you want to score dose with inter...
void setHistory(EGS_I64 current_case)
set current history on scoring arrays for proper statistics
bool needs_user_geoms
this phantom requires user specified geometries
static const string threeddose_geom_types[]
int readData(istream *ifile)
void scoreEdep(int ir, EGS_Float dose)
add energy deposition dose to region ir
EGS_Float getRealMass(int ireg)
return (corrected) real mass for region
static const string autovol_phantom_geom_types[]
EGS_Application * app
Parent application instance. Required for constructing filenames.
EGS_ScoringArray * sscat_score
Tracklenth scored dose from single scattered particles.
vector< RegionResult > getRegionResults()
create a vector of RegionResult structs which can then be sorted by dose value. used for output routi...
EGS_Float total_radiant_e
void setCorrectedVolume(int ir, double fraction, double unc=0)
Allow user to tell phantom what the actual volume of a region is.
void getScoringArrays(vector< EGS_ScoringArray * > &scores, vector< string > &types, vector< string > &descriptions)
get all active scoring arrays, their types and descriptions
string medIndex(int medium)
get medium index 1-9A-Z
int globalToLocal(int global_reg)
convert global region to local phantom region
EGS_ScoringArray * mscat_score
Tracklenth scored dose from multiple scattered particles.
static bool canWrite3ddose(const string &geom_type)
function for checking whether a given geometry type can output 3ddose files
void outputResults(int top_n=20, string output_3ddose="text", string output_egsphant="text", string output_voxinfo="text", string output_volcor="text")
tell phantom to output its results.
int addState(istream &ifile)
EGS_ScoringArray * prim_score
Tracklenth scored dose from primary particles.
void writeEGSPhant(ostream &)
write actual egsphant data to file for this phantom
void getEGSdatScoringArrays(vector< EGS_ScoringArray * > &scores)
get all active scoring arrays for writing to egsdat file
void enableTLenScoring()
enableTLenScoring must be called before simulation begins if you want to score dose with tracklength ...
void outputDoseStats(EGS_ScoringArray *score, string type)
write some stats about dose arrays
EGS_ScoringArray * tlen_score
Tracklength dose scoring array.
std::map< int, double > corrected_volumes
Corrected volume in a given region.
void outputVolumeCorrection(string format)
intialize and output write voxel volumes to file
void output3DBounds(ostream &out)
write the phantom bounds to 3ddose file
EGS_Float getCorrectedVolume(int ireg)
get uncorrected volume for a given region
void setDoseScale(EGS_Float)
set dose scaling factor for output
static bool needsUserVolumes(const string &geom_type)
function for checking whether a given geometry type requires user specified volumes
void writeVoxelInfo(ostream &)
write voxel info file
int outputData(ostream *ofile)
set< int > global_regions
the set of all global regions contained in this phantom
EGS_Float getUncorrectedMass(int ireg)
return uncorrected for region
EGS_Float getVolumeUncertainty(int ireg)
get volume unc
void enableInteractionScoring()
enableInteractionScoring must be called before simulation begins if you want to score dose with inter...
EGS_Float avgVoxelVol()
return average voxel volume
EGS_ScoringArray * edep_score
Interaction scored dose scoring array.
A simple pub/sub module to allow various egs_brachy classes to subscribe to particle events.