#include <DiscreteWavelengthDistribution.hpp>
Public Member Functions | |
double | generateWavelength () const override |
double | probability (double wavelength) const override |
DisjointWavelengthGrid * | wavelengthGrid () const |
virtual double | generateWavelength () const =0 |
virtual double | probability (double wavelength) const =0 |
![]() | |
template<class T > | |
T * | find (bool setup=true) const |
template<class T > | |
T * | interface (int levels=-999999, bool setup=true) const |
virtual string | itemName () const |
void | setup () |
string | typeAndName () const |
![]() | |
Item (const Item &)=delete | |
virtual | ~Item () |
void | addChild (Item *child) |
const vector< Item * > & | children () const |
virtual void | clearItemListProperty (const PropertyDef *property) |
void | destroyChild (Item *child) |
virtual bool | getBoolProperty (const PropertyDef *property) const |
virtual vector< double > | getDoubleListProperty (const PropertyDef *property) const |
virtual double | getDoubleProperty (const PropertyDef *property) const |
virtual string | getEnumProperty (const PropertyDef *property) const |
virtual int | getIntProperty (const PropertyDef *property) const |
virtual vector< Item * > | getItemListProperty (const PropertyDef *property) const |
virtual Item * | getItemProperty (const PropertyDef *property) const |
virtual string | getStringProperty (const PropertyDef *property) const |
int | getUtilityProperty (string name) const |
virtual void | insertIntoItemListProperty (const PropertyDef *property, int index, Item *item) |
Item & | operator= (const Item &)=delete |
Item * | parent () const |
virtual void | removeFromItemListProperty (const PropertyDef *property, int index) |
virtual void | setBoolProperty (const PropertyDef *property, bool value) |
virtual void | setDoubleListProperty (const PropertyDef *property, vector< double > value) |
virtual void | setDoubleProperty (const PropertyDef *property, double value) |
virtual void | setEnumProperty (const PropertyDef *property, string value) |
virtual void | setIntProperty (const PropertyDef *property, int value) |
virtual void | setItemProperty (const PropertyDef *property, Item *item) |
virtual void | setStringProperty (const PropertyDef *property, string value) |
void | setUtilityProperty (string name, int value) |
virtual string | type () const |
Protected Member Functions | |
DiscreteWavelengthDistribution () | |
void | setupSelfAfter () override |
![]() | |
WavelengthDistribution () | |
Random * | random () const |
void | setupSelfBefore () override |
![]() | |
SimulationItem () | |
virtual bool | offersInterface (const std::type_info &interfaceTypeInfo) const |
virtual void | setupSelfAfter () |
virtual void | setupSelfBefore () |
![]() | |
Item () | |
Private Types | |
using | BaseType = WavelengthDistribution |
using | ItemType = DiscreteWavelengthDistribution |
Private Attributes | |
int | _beginWavelengthIndex |
int | _endWavelengthIndex |
int | _numWavelengths |
DisjointWavelengthGrid * | _wavelengthGrid |
Friends | |
class | ItemRegistry |
DiscreteWavelengthDistribution is a specialty class for representing discrete wavelength probability distributions derived from a wavelength grid that can be configured by the user. This class is useful for mimicking codes that emit photon packets at discrete wavelengths rather than across a continuous range, perhaps to compare results in the context of a benchmark. One has to take great care when using this class in a simulation configuration, as indicated in more detail below.
When a DiscreteWavelengthDistribution instance is used as the wavelength bias distribution for a source with a composite bias factor of one, the source will emit photon packets only at the characteristic wavelengths of the configured grid, and the photon packets will be distributed with equal probability among those wavelengths. More precisely, the DiscreteWavelengthDistribution instance uses only the characteristic wavelengths of the configured grid that fall inside the wavelength range of the associated source (obtained through the SourceWavelengthRangeInterface). If none of the characteristic wavelengths fall inside the source range, a fatal error is issued.
When sending photon packets at a particular grid of discrete wavelengths, it makes little sense to configure wavelength grids with different bins for detecting photon packets in other areas of the simulation. Doing so might cause unexpected results. For example, some bins might receive no photon packets at all and thus incorrectly report zero influx. It is therefore best to configure the same wavelength grid throughout the simulation.
To configure a simulation that uses discrete wavelengths, follow these guidelines:
|
inlineprotected |
Default constructor for concrete Item subclass DiscreteWavelengthDistribution : "a discrete wavelength probability distribution derived from a wavelength grid" .
|
overridevirtual |
This function draws a random wavelength from the wavelength distribution. For this class, it generates one of the (in-range) characteristic wavelengths of the configured grid, with equal probability. In other words, it implements a Dirac-delta function within each of the (in-range) bins of the configured wavelength grid.
Implements WavelengthDistribution.
|
overridevirtual |
This function returns the probability of the distribution at the given wavelength. It acts as if the wavelengths generated by the generateWavelength() function were spread out over each bin (rather than being concentrated into a single wavelength). The returned probability is zero for wavelengths outside of the (in-range) bins of the configured wavelength grid. For a wavelength that falls inside bin
Implements WavelengthDistribution.
|
overrideprotectedvirtual |
This function determines the grid wavelengths that fall inside the source range.
Reimplemented from SimulationItem.
|
inline |
This function returns the value of the discoverable item property wavelengthGrid : "the wavelength grid defining the discrete distribution" .
The default value for this property is given by the conditional value expression "FileWavelengthGrid" .