DiscreteSpectrum

This class represents a spectrum of discrete emission lines, for instance corresponding to one or more radioactive isotopes. It can be used for sourcing the energies of Monte Carlo states.

Constructor

class DiscreteSpectrum(energies, intensities=None, background=None, energy_min=None)

This function creates a spectrum of distinct emission lines at specified energies, in MeV, which must be a sequence of float. The corresponding intensities can also be specified as a sequence of floats. By default, all emission lines have equal probability.

The optional background and energy_min arguments are only applicable when sampling the spectrum in backward mode (refer to the corresponding attributes below).

Attributes

DiscreteSpectrum.background: float

The fraction (in [0,1]) of background events when sampling backwards.

DiscreteSpectrum.energies: numpy.ndarray

The energies, in MeV, of emission lines.

DiscreteSpectrum.energy_min: numpy.ndarray

The minimum energy of background events, in MeV, when sampling backwards.

DiscreteSpectrum.intensities: numpy.ndarray | None

The relative intensities of emissin lines.

Methods

DiscreteSpectrum.sample(states, engine=None, mode=None)

Samples Monte Carlo state energies according to the spectrum emission lines. The mode argument indicates wether a conventional (forward) sampling should be performed or not. Possible values are "Backward" or "Forward".

If a TransportEngine is provided (using the engine argument), then the sampling is configured based one the simulation mode.

Note

At return from the sample method, the energies (and weights in backward mode) of Monte Carlo states are modified in-place.