EGSnrc C++ class library
Report PIRS-898 (2021)
Iwan Kawrakow, Ernesto Mainegra-Hing, Frederic Tessier, Reid Townson and Blake Walters
|
A uniform energy spectrum. More...
Public Member Functions | |
EGS_UniformSpectrum (EGS_Float emin, EGS_Float emax) | |
Construct a uniform spectrum between emin and emax. | |
EGS_Float | maxEnergy () const |
EGS_Float | expectedAverage () const |
Public Member Functions inherited from EGS_BaseSpectrum | |
EGS_BaseSpectrum () | |
Constructor. More... | |
virtual | ~EGS_BaseSpectrum () |
Destructor. Does nothing. | |
const string & | getType () const |
Get the spectrum type. More... | |
EGS_Float | sampleEnergy (EGS_RandomGenerator *rndm) |
Sample a particle energy. More... | |
virtual bool | storeState (ostream &data_out) const |
Store the state of the spectrum object into the stream data_out. More... | |
virtual bool | setState (istream &data_in) |
Set the state of the spectrum object from the data in the stream data_in. More... | |
virtual bool | addState (istream &data_in) |
Add to the state of this object the data from the stream data_in. More... | |
virtual void | resetCounter () |
Reset the state of this spectrum object. More... | |
void | getSampledAverage (EGS_Float &e, EGS_Float &de) const |
Get the average sampled energy and its statistical uncertainty. More... | |
void | reportAverageEnergy () const |
Report the average energy (expected and actually sampled). More... | |
Protected Member Functions | |
EGS_Float | sample (EGS_RandomGenerator *rndm) |
Protected Attributes | |
EGS_Float | Emin |
The minimum energy. | |
EGS_Float | Emax |
The maximum energy. | |
EGS_Float | de |
Emax - Emin. | |
Protected Attributes inherited from EGS_BaseSpectrum | |
EGS_I64 | count |
Number of times the sampleEnergy() method was called. | |
double | sum_E |
Sum of energies sampled so far. | |
double | sum_E2 |
Sum of energies squared sampled so far. | |
string | type |
A short string describing the spectrum that must be set by derived classes. | |
Additional Inherited Members | |
Static Public Member Functions inherited from EGS_BaseSpectrum | |
static EGS_BaseSpectrum * | createSpectrum (EGS_Input *inp) |
Create and return a pointer to a spectrum object from the information pointed to by inp. More... | |
A uniform energy spectrum.
A uniform energy spectrum is a spectrum where the probability distribution is uniform between a minimum and a maximum energy and zero outside of the energy interval. This type of spectrum is defined via
:start spectrum: type = uniform range = minimum and maximum energy or minimum energy = Emin maximum energy = Emax :stop spectrum:
Definition at line 301 of file egs_spectra.cpp.