EGSnrc C++ class library
Report PIRS-898 (2021)
Iwan Kawrakow, Ernesto Mainegra-Hing, Frederic Tessier, Reid Townson and Blake Walters
|
A Gaussian spectrum. More...
Public Member Functions | |
EGS_GaussianSpectrum (EGS_Float mean_energy, EGS_Float Sigma) | |
Construct a Gaussian spectrum with mean energy mean_energy and width Sigma. More... | |
EGS_Float | expectedAverage () const |
EGS_Float | maxEnergy () const |
EGS_Float | sample (EGS_RandomGenerator *rndm) |
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 Attributes | |
EGS_Float | Eo |
The mean energy. | |
EGS_Float | sigma |
The Gaussian width. | |
EGS_Float | Emax |
The maximum energy. More... | |
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 Gaussian spectrum.
A Gaussian spectrum is defined in the input file via
:start spectrum: type = Gaussian mean energy = the mean kinetic energy sigma = the sigma of the spectrum or fwhm = the full-width-at-half-maximum of the spectrum :stop spectrum:
Definition at line 142 of file egs_spectra.cpp.
EGS_GaussianSpectrum::EGS_GaussianSpectrum | ( | EGS_Float | mean_energy, |
EGS_Float | Sigma | ||
) |
Construct a Gaussian spectrum with mean energy mean_energy and width Sigma.
If Sigma is less than zero, it is interpreted as -FWHM. The mean energy must be greater than zero.
Definition at line 152 of file egs_spectra.cpp.
References egsFatal.
|
protected |
The maximum energy.
If is too close to zero (less than 5 standard deviations) The Gaussian spectrum is truncated to so that it is still symmetric around .
Definition at line 197 of file egs_spectra.cpp.