EGS Brachy
An egs++ user code for rapid brachytherapy calculations
|
abstract base class for scoring spectrum information More...
#include <spec_scoring.h>
Public Member Functions | |
BaseSpectrumScorer (EGS_Input *input, EGS_BaseSource *src, GeomInfo *ginfo, Publisher *publisher) | |
virtual | ~BaseSpectrumScorer () |
EGS_Float | getBinWidth () const |
double | getParticleEnergy (const EGS_Particle *p) const |
virtual void | update (EB_Message message, void *data=0) |
Receives messages from application. This method handles NEW_HISTORY messages but delegates all other messages to the score methods of the derived classes. | |
virtual void | score (EB_Message message, void *data=0)=0 |
void | setEffectiveHistories (EGS_Float effective_histories) |
int | outputResults (string root_name) |
, write the scored spectrum to file with filename. Returns 0 on success, all other values indicate a failure | |
virtual string | getInfo () const |
bool | isValid () const |
int | outputData (ostream *ofile) |
int | readData (istream *ifile) |
void | resetCounter () |
int | addState (istream &data) |
![]() | |
virtual | ~Subscriber () |
Static Public Member Functions | |
static BaseSpectrumScorer * | getSpectrumScorer (EGS_Input *inp, EGS_BaseSource *source, GeomInfo *ginfo, Publisher *publisher) |
factory method for creating one of the derived spectrum scoring classes | |
Public Attributes | |
int | nbins |
number of bins to score spectrum in | |
EGS_ScoringArray * | bins |
spectrum scoring array | |
EGS_Float | e_min |
minimum spectrum energy to score | |
EGS_Float | e_max |
maximum spectrum energy to score | |
Static Public Attributes | |
static const int | DEFAULT_NBINS = 100 |
Protected Member Functions | |
string | outputCSV (string filename) |
output results to csv file | |
string | outputXMGR (string filename) |
output results to xmgrace file | |
string | outputEGSnrc (string filename) |
output results to EGSnrc tabulated spectrum format | |
int | getBin (EGS_Float E) const |
get index of bin that that E falls in | |
virtual string | getTitle () const |
virtual string | getSubTitle () const |
virtual string | getYAxisLabel () const |
virtual string | getXAxisLabel () const |
string | getFileName (string root) const |
virtual string | getFileExtension () const |
virtual void | getResult (int bin, EGS_Float &r, EGS_Float &dr) |
set r & dr to result/uncertainty for given bin. Normalization can be done in this routine | |
string | getParticleName () const |
Return name of particle we are scoring. | |
virtual void | outputTotal () |
Protected Attributes | |
string | format |
int | egsnrc_mode |
int | particle_type |
EGS_I64 | cur_history |
EGS_I64 | eff_history |
EGS_Float | bin_width |
EGS_Float | total_scored |
EGS_BaseSource * | source |
bool | valid |
string | fextension |
abstract base class for scoring spectrum information
Inputs:
type - determines which derived class to initialize ('surface count', 'energy weighted surface', 'energy fluence in region') particle type - which kind of particle to score minimum energy - don't score any particles below this energy (defaults to 0.001 MeV) maximum energy - don't score any particles above this energy (defaults to source->getEmax()) number of bins - number of scoring bins to use (bin width = (E_max - E_min) / nbins output format - xmgr, csv, or egsnrc (defaults to xmgr) egsnrc format mode - if esgnrc output format is chosen, which mode to use (see egs++ docs) geometry - for 'energy fluence in region' mode used in conjunction with 'scoring region' input for determining which geometry region to score the spectrum in scoring region - for 'energy fluence in region' mode used in conjunction with 'geometry' input for determining which geometry region to score the spectrum in file extension - if provided the output will be written to sim_input_file.{file extension}.{output format} otherwise the output file will be given a name like sim_input_file.surfcount.agr
Sample input:
:start spectrum scoring: type = surface count # surface count, energy weighted surface, energy fluence in region particle type = photon # photon, electron, positron minimum energy = 0.001 maximum energy = 1.00 number of bins = 1000 output format = xmgr # xmgr (default), csv, egsnrc file extension = my_spectrum # (optional) :stop spectrum scoring:
Definition at line 260 of file spec_scoring.h.
BaseSpectrumScorer::BaseSpectrumScorer | ( | EGS_Input * | input, |
EGS_BaseSource * | src, | ||
GeomInfo * | ginfo, | ||
Publisher * | publisher | ||
) |
Definition at line 115 of file spec_scoring.cpp.
|
virtual |
Definition at line 188 of file spec_scoring.cpp.
int BaseSpectrumScorer::addState | ( | istream & | data | ) |
Definition at line 416 of file spec_scoring.cpp.
|
protected |
get index of bin that that E falls in
Definition at line 198 of file spec_scoring.cpp.
EGS_Float BaseSpectrumScorer::getBinWidth | ( | ) | const |
Definition at line 203 of file spec_scoring.cpp.
|
inlineprotectedvirtual |
Reimplemented in SurfaceCountSpectrum, EnergyWeightedSurfaceSpectrum, FluenceSpectrumInVoxel, and EnergyFluenceSpectrumInVoxel.
Definition at line 312 of file spec_scoring.h.
|
inlineprotected |
Definition at line 308 of file spec_scoring.h.
|
inlinevirtual |
Definition at line 376 of file spec_scoring.h.
double BaseSpectrumScorer::getParticleEnergy | ( | const EGS_Particle * | p | ) | const |
Definition at line 207 of file spec_scoring.cpp.
|
inlineprotected |
Return name of particle we are scoring.
Definition at line 321 of file spec_scoring.h.
|
protectedvirtual |
set r & dr to result/uncertainty for given bin. Normalization can be done in this routine
Reimplemented in SurfaceCountSpectrum, EnergyWeightedSurfaceSpectrum, FluenceSpectrumInVoxel, and EnergyFluenceSpectrumInVoxel.
Definition at line 377 of file spec_scoring.cpp.
|
static |
factory method for creating one of the derived spectrum scoring classes
Definition at line 85 of file spec_scoring.cpp.
|
inlineprotectedvirtual |
Reimplemented in SurfaceCountSpectrum, and EnergyWeightedSurfaceSpectrum.
Definition at line 296 of file spec_scoring.h.
|
inlineprotectedvirtual |
Reimplemented in SurfaceCountSpectrum, EnergyWeightedSurfaceSpectrum, FluenceSpectrumInVoxel, and EnergyFluenceSpectrumInVoxel.
Definition at line 292 of file spec_scoring.h.
|
inlineprotectedvirtual |
Definition at line 304 of file spec_scoring.h.
|
inlineprotectedvirtual |
Reimplemented in SurfaceCountSpectrum, EnergyWeightedSurfaceSpectrum, FluenceSpectrumInVoxel, and EnergyFluenceSpectrumInVoxel.
Definition at line 300 of file spec_scoring.h.
|
inline |
returns true if scorer was initialized correctly, otherwise false
Definition at line 381 of file spec_scoring.h.
|
protected |
output results to csv file
Definition at line 240 of file spec_scoring.cpp.
int BaseSpectrumScorer::outputData | ( | ostream * | ofile | ) |
Definition at line 381 of file spec_scoring.cpp.
|
protected |
output results to EGSnrc tabulated spectrum format
Definition at line 256 of file spec_scoring.cpp.
int BaseSpectrumScorer::outputResults | ( | string | root_name | ) |
, write the scored spectrum to file with filename. Returns 0 on success, all other values indicate a failure
Definition at line 212 of file spec_scoring.cpp.
|
inlineprotectedvirtual |
Reimplemented in SurfaceCountSpectrum, EnergyWeightedSurfaceSpectrum, FluenceSpectrumInVoxel, and EnergyFluenceSpectrumInVoxel.
Definition at line 334 of file spec_scoring.h.
|
protected |
output results to xmgrace file
Definition at line 309 of file spec_scoring.cpp.
int BaseSpectrumScorer::readData | ( | istream * | ifile | ) |
Definition at line 394 of file spec_scoring.cpp.
void BaseSpectrumScorer::resetCounter | ( | ) |
Definition at line 407 of file spec_scoring.cpp.
|
pure virtual |
override in derived classes to do scoring
Implemented in SurfaceCountSpectrum, EnergyWeightedSurfaceSpectrum, FluenceSpectrumInVoxel, and EnergyFluenceSpectrumInVoxel.
void BaseSpectrumScorer::setEffectiveHistories | ( | EGS_Float | effective_histories | ) |
Definition at line 194 of file spec_scoring.cpp.
|
virtual |
Receives messages from application. This method handles NEW_HISTORY messages but delegates all other messages to the score
methods of the derived classes.
Implements Subscriber.
Definition at line 366 of file spec_scoring.cpp.
|
protected |
Definition at line 270 of file spec_scoring.h.
EGS_ScoringArray* BaseSpectrumScorer::bins |
spectrum scoring array
Definition at line 345 of file spec_scoring.h.
|
protected |
keep track of the current history we are on
Definition at line 267 of file spec_scoring.h.
|
static |
Definition at line 341 of file spec_scoring.h.
EGS_Float BaseSpectrumScorer::e_max |
maximum spectrum energy to score
Definition at line 347 of file spec_scoring.h.
EGS_Float BaseSpectrumScorer::e_min |
minimum spectrum energy to score
Definition at line 346 of file spec_scoring.h.
|
protected |
effective histories (for normalization)
Definition at line 268 of file spec_scoring.h.
|
protected |
egsnrc spectrum output format mode
Definition at line 265 of file spec_scoring.h.
|
protected |
file extension to use
Definition at line 277 of file spec_scoring.h.
|
protected |
format to output results in
Definition at line 264 of file spec_scoring.h.
int BaseSpectrumScorer::nbins |
number of bins to score spectrum in
Definition at line 344 of file spec_scoring.h.
|
protected |
What kind of particle are we interested in
Definition at line 266 of file spec_scoring.h.
|
protected |
simulation source, used for limits on energy, normalization etc
Definition at line 273 of file spec_scoring.h.
|
protected |
Definition at line 271 of file spec_scoring.h.
|
protected |
Definition at line 275 of file spec_scoring.h.