EGS Brachy
An egs++ user code for rapid brachytherapy calculations
Loading...
Searching...
No Matches
EnergyFluenceSpectrumInVoxel Class Reference

A class for scoring the energy fluence of particles enter a voxel of the scoring phantom geometry. More...

#include <spec_scoring.h>

Inheritance diagram for EnergyFluenceSpectrumInVoxel:
Collaboration diagram for EnergyFluenceSpectrumInVoxel:

Public Member Functions

 EnergyFluenceSpectrumInVoxel (EGS_Input *input, EGS_BaseSource *src, GeomInfo *ginfo, Publisher *publisher)
virtual void score (EB_Message message, void *data=0)
Public Member Functions inherited from BaseSpectrumScorer
 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.
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)
Public Member Functions inherited from Subscriber
virtual ~Subscriber ()

Private Member Functions

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 getTitle () const
string getYAxisLabel () const
void outputTotal ()
string getFileExtension () const

Private Attributes

EGS_BaseGeometry * geometry
EGS_Float region_volume
int local_scoring_region
int scoring_region

Additional Inherited Members

Static Public Member Functions inherited from BaseSpectrumScorer
static BaseSpectrumScorergetSpectrumScorer (EGS_Input *inp, EGS_BaseSource *source, GeomInfo *ginfo, Publisher *publisher)
 factory method for creating one of the derived spectrum scoring classes
Public Attributes inherited from BaseSpectrumScorer
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 inherited from BaseSpectrumScorer
static const int DEFAULT_NBINS = 100
Protected Member Functions inherited from BaseSpectrumScorer
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 getSubTitle () const
virtual string getXAxisLabel () const
string getFileName (string root) const
string getParticleName () const
 Return name of particle we are scoring.
Protected Attributes inherited from BaseSpectrumScorer
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

Detailed Description

A class for scoring the energy fluence of particles enter a voxel of the scoring phantom geometry.

Note: this currently only works if there are no other geometries overlapping the scoring region. If there is, you will get incorrect results!

Sample input:

:start spectrum scoring:
    type = energy weighted surface
    particle type = photon
    minimum energy = 0.001
    maximum energy = 1.00
    number of bins = 1000
    output format = xmgr
    geometry = your_phantom_geom_name
    scoring region =  1 # which region of `your_phantom_geom` to score in (defaults to 0)
:stop spectrum scoring:

Definition at line 636 of file spec_scoring.h.

Constructor & Destructor Documentation

◆ EnergyFluenceSpectrumInVoxel()

EnergyFluenceSpectrumInVoxel::EnergyFluenceSpectrumInVoxel ( EGS_Input * input,
EGS_BaseSource * src,
GeomInfo * ginfo,
Publisher * publisher )
inline

Definition at line 666 of file spec_scoring.h.

Member Function Documentation

◆ getFileExtension()

string EnergyFluenceSpectrumInVoxel::getFileExtension ( ) const
inlineprivatevirtual

Reimplemented from BaseSpectrumScorer.

Definition at line 659 of file spec_scoring.h.

◆ getResult()

void EnergyFluenceSpectrumInVoxel::getResult ( int bin,
EGS_Float & r,
EGS_Float & dr )
privatevirtual

set r & dr to result/uncertainty for given bin. Normalization can be done in this routine

Reimplemented from BaseSpectrumScorer.

Definition at line 573 of file spec_scoring.cpp.

◆ getTitle()

string EnergyFluenceSpectrumInVoxel::getTitle ( ) const
inlineprivatevirtual

Reimplemented from BaseSpectrumScorer.

Definition at line 646 of file spec_scoring.h.

◆ getYAxisLabel()

string EnergyFluenceSpectrumInVoxel::getYAxisLabel ( ) const
inlineprivatevirtual

Reimplemented from BaseSpectrumScorer.

Definition at line 653 of file spec_scoring.h.

◆ outputTotal()

void EnergyFluenceSpectrumInVoxel::outputTotal ( )
privatevirtual

Reimplemented from BaseSpectrumScorer.

Definition at line 583 of file spec_scoring.cpp.

◆ score()

void EnergyFluenceSpectrumInVoxel::score ( EB_Message message,
void * data = 0 )
virtual

override in derived classes to do scoring

Implements BaseSpectrumScorer.

Definition at line 555 of file spec_scoring.cpp.

Member Data Documentation

◆ geometry

EGS_BaseGeometry* EnergyFluenceSpectrumInVoxel::geometry
private

Definition at line 638 of file spec_scoring.h.

◆ local_scoring_region

int EnergyFluenceSpectrumInVoxel::local_scoring_region
private

Definition at line 640 of file spec_scoring.h.

◆ region_volume

EGS_Float EnergyFluenceSpectrumInVoxel::region_volume
private

Definition at line 639 of file spec_scoring.h.

◆ scoring_region

int EnergyFluenceSpectrumInVoxel::scoring_region
private

Definition at line 641 of file spec_scoring.h.


The documentation for this class was generated from the following files: