EGSnrc C++ class library  Report PIRS-898 (2021)
Iwan Kawrakow, Ernesto Mainegra-Hing, Frederic Tessier, Reid Townson and Blake Walters
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
EGS_DoubleGaussianSpectrum Class Reference

A double-Gaussian spectrum. More...

Inheritance diagram for EGS_DoubleGaussianSpectrum:
EGS_BaseSpectrum

Public Member Functions

 EGS_DoubleGaussianSpectrum (EGS_Float mean_energy, EGS_Float sig_left, EGS_Float sig_right)
 Construct a double-Gaussian spectrum with mean energy mean_energy and widths sig_left and sig_right.
 
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 Eo
 The mean energy.
 
EGS_Float Emax
 The maximum energy.
 
EGS_Float sleft
 The width of the spectrum left of Eo.
 
EGS_Float sright
 The width of the spectrum right of Eo.
 
EGS_Float p
 
- 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_BaseSpectrumcreateSpectrum (EGS_Input *inp)
 Create and return a pointer to a spectrum object from the information pointed to by inp. More...
 

Detailed Description

A double-Gaussian spectrum.

A double-Gaussian spectrum is a spectrum that consists of two Gaussian distributions with the same mean energy $E_0$ but different widths smoothly joined together at $E_0$ so that for $E < E_0$ the probability distribution is given by the first Gaussian and for $E < E_0$ by the second. This type of spectrum has been used to describe the spectrum of electrons impinging on the bremsstrahlung target of some medical linear accelerators. It is defined via

:start spectrum:
    type = Double Gaussian
    mean energy = the mean kinetic energy Eo
    sigma = the two sigmas of the spectrum
    or
    fwhm = the two fwhms of the spectrum
:stop spectrum:

Definition at line 222 of file egs_spectra.cpp.

Member Data Documentation

EGS_Float EGS_DoubleGaussianSpectrum::p
protected

The probability for picking energies from the left or right Gaussian

Definition at line 261 of file egs_spectra.cpp.


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