EGS Brachy
An egs++ user code for rapid brachytherapy calculations
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
EB_IAEASource Class Reference

A phase space file source for egs_brachy. More...

#include <eb_iaeaphsp_source.h>

Inheritance diagram for EB_IAEASource:
Inheritance graph
[legend]
Collaboration diagram for EB_IAEASource:
Collaboration graph
[legend]

Public Member Functions

 EB_IAEASource (EGS_Input *, EGS_ObjectFactory *f=0)
 Constructor.
 
 ~EB_IAEASource ()
 
EGS_I64 getNextParticle (EGS_RandomGenerator *rndm, int &q, int &latch, EGS_Float &E, EGS_Float &wt, EGS_Vector &x, EGS_Vector &u)
 
EGS_Float getEmax () const
 
EGS_Float getFluence () const
 
void setSimulationChunk (EGS_I64 nstart, EGS_I64 nrun)
 
bool storeState (ostream &data) const
 
bool setState (istream &data)
 
bool addState (istream &data)
 
void resetCounter ()
 
bool isValid () const
 

Protected Member Functions

void openPHSPFile ()
 
void initSourceParams ()
 

Protected Attributes

bool is_valid
 
string phsp_file_name
 The phase space file name.
 
ifstream phsp_file
 Phase space data stream.
 
IAEA_I32 source_id
 
IAEA_I32 * p_source_id
 
EGS_Float Emax
 Maximum energy (obtained from the phsp file)
 
EGS_Float Emin
 Minimum energy (obtained from the phsp file)
 
EGS_Float Nincident
 Number of incident particles that created the file.
 
IAEA_I64 Nparticle
 Number of particles in the file.
 
IAEA_I64 Nphoton
 Number of photons in the file.
 
IAEA_I64 Nused
 Number of particles used so far.
 
IAEA_I64 Npos
 Next record to be read.
 
IAEA_I64 Nfirst
 first record this source can use
 
IAEA_I64 Nlast
 Last record this source can use.
 
IAEA_I64 Nread
 Number of particles read from file so far.
 
IAEA_I64 count
 Particles delivered so far.
 
IAEA_I32 n_parallel
 
IAEA_I32 i_parallel
 

Static Protected Attributes

static IAEA_I32 next_source_id = 0
 
static const string iaea_header_ext = ".IAEAheader"
 

Detailed Description

A phase space file source for egs_brachy.

A phase space file source reads and delivers particles from a an IAEA phase space file. Note this source is an incomplete implementation and may only be suitable for use with egs_brachy.

A phase space file source is defined as follows:

:start source:
    library = eb_iaeaphsp_source
    name = some_name
    header file = path to the phase space header file
    particle type = one of photons, electrons, positrons, all, or charged
:stop source:

Definition at line 101 of file eb_iaeaphsp_source.h.

Constructor & Destructor Documentation

◆ EB_IAEASource()

EB_IAEASource::EB_IAEASource ( EGS_Input *  input,
EGS_ObjectFactory *  f = 0 
)

Constructor.

Construct a phase space file source from the information pointed to by inp.

Definition at line 53 of file eb_iaeaphsp_source.cpp.

◆ ~EB_IAEASource()

EB_IAEASource::~EB_IAEASource ( )

Definition at line 107 of file eb_iaeaphsp_source.cpp.

Member Function Documentation

◆ addState()

bool EB_IAEASource::addState ( istream &  data)

Definition at line 319 of file eb_iaeaphsp_source.cpp.

◆ getEmax()

EGS_Float EB_IAEASource::getEmax ( ) const

Definition at line 232 of file eb_iaeaphsp_source.cpp.

◆ getFluence()

EGS_Float EB_IAEASource::getFluence ( ) const

Definition at line 240 of file eb_iaeaphsp_source.cpp.

◆ getNextParticle()

IAEA_I64 EB_IAEASource::getNextParticle ( EGS_RandomGenerator *  rndm,
int &  q,
int &  latch,
EGS_Float &  E,
EGS_Float &  wt,
EGS_Vector &  x,
EGS_Vector &  u 
)

Definition at line 157 of file eb_iaeaphsp_source.cpp.

◆ initSourceParams()

void EB_IAEASource::initSourceParams ( )
protected

Definition at line 131 of file eb_iaeaphsp_source.cpp.

◆ isValid()

bool EB_IAEASource::isValid ( ) const

Definition at line 236 of file eb_iaeaphsp_source.cpp.

◆ openPHSPFile()

void EB_IAEASource::openPHSPFile ( )
protected

Definition at line 116 of file eb_iaeaphsp_source.cpp.

◆ resetCounter()

void EB_IAEASource::resetCounter ( )

Definition at line 330 of file eb_iaeaphsp_source.cpp.

◆ setSimulationChunk()

void EB_IAEASource::setSimulationChunk ( EGS_I64  nstart,
EGS_I64  nrun 
)

Definition at line 208 of file eb_iaeaphsp_source.cpp.

◆ setState()

bool EB_IAEASource::setState ( istream &  data)

Definition at line 282 of file eb_iaeaphsp_source.cpp.

◆ storeState()

bool EB_IAEASource::storeState ( ostream &  data) const

Definition at line 245 of file eb_iaeaphsp_source.cpp.

Member Data Documentation

◆ count

IAEA_I64 EB_IAEASource::count
protected

Particles delivered so far.

Definition at line 149 of file eb_iaeaphsp_source.h.

◆ Emax

EGS_Float EB_IAEASource::Emax
protected

Maximum energy (obtained from the phsp file)

Definition at line 138 of file eb_iaeaphsp_source.h.

◆ Emin

EGS_Float EB_IAEASource::Emin
protected

Minimum energy (obtained from the phsp file)

Definition at line 139 of file eb_iaeaphsp_source.h.

◆ i_parallel

IAEA_I32 EB_IAEASource::i_parallel
protected

Definition at line 152 of file eb_iaeaphsp_source.h.

◆ iaea_header_ext

const string EB_IAEASource::iaea_header_ext = ".IAEAheader"
staticprotected

Definition at line 159 of file eb_iaeaphsp_source.h.

◆ is_valid

bool EB_IAEASource::is_valid
protected

Definition at line 131 of file eb_iaeaphsp_source.h.

◆ n_parallel

IAEA_I32 EB_IAEASource::n_parallel
protected

Definition at line 151 of file eb_iaeaphsp_source.h.

◆ next_source_id

IAEA_I32 EB_IAEASource::next_source_id = 0
staticprotected

Definition at line 157 of file eb_iaeaphsp_source.h.

◆ Nfirst

IAEA_I64 EB_IAEASource::Nfirst
protected

first record this source can use

Definition at line 146 of file eb_iaeaphsp_source.h.

◆ Nincident

EGS_Float EB_IAEASource::Nincident
protected

Number of incident particles that created the file.

Definition at line 140 of file eb_iaeaphsp_source.h.

◆ Nlast

IAEA_I64 EB_IAEASource::Nlast
protected

Last record this source can use.

Definition at line 147 of file eb_iaeaphsp_source.h.

◆ Nparticle

IAEA_I64 EB_IAEASource::Nparticle
protected

Number of particles in the file.

Definition at line 142 of file eb_iaeaphsp_source.h.

◆ Nphoton

IAEA_I64 EB_IAEASource::Nphoton
protected

Number of photons in the file.

Definition at line 143 of file eb_iaeaphsp_source.h.

◆ Npos

IAEA_I64 EB_IAEASource::Npos
protected

Next record to be read.

Definition at line 145 of file eb_iaeaphsp_source.h.

◆ Nread

IAEA_I64 EB_IAEASource::Nread
protected

Number of particles read from file so far.

Definition at line 148 of file eb_iaeaphsp_source.h.

◆ Nused

IAEA_I64 EB_IAEASource::Nused
protected

Number of particles used so far.

Definition at line 144 of file eb_iaeaphsp_source.h.

◆ p_source_id

IAEA_I32* EB_IAEASource::p_source_id
protected

Definition at line 136 of file eb_iaeaphsp_source.h.

◆ phsp_file

ifstream EB_IAEASource::phsp_file
protected

Phase space data stream.

Definition at line 133 of file eb_iaeaphsp_source.h.

◆ phsp_file_name

string EB_IAEASource::phsp_file_name
protected

The phase space file name.

Definition at line 132 of file eb_iaeaphsp_source.h.

◆ source_id

IAEA_I32 EB_IAEASource::source_id
protected

Definition at line 135 of file eb_iaeaphsp_source.h.


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