#include <OligoWavelengthDistribution.hpp>
Public Member Functions | |
OligoWavelengthDistribution (OligoWavelengthGrid *wavelengthGrid) | |
double | generateWavelength () const override |
double | probability (double wavelength) const override |
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 |
Private Attributes | |
double | _probability |
const Array & | _wavelengths |
Additional Inherited Members | |
![]() | |
WavelengthDistribution () | |
Random * | random () const |
void | setupSelfBefore () override |
![]() | |
SimulationItem () | |
virtual bool | offersInterface (const std::type_info &interfaceTypeInfo) const |
virtual void | setupSelfAfter () |
virtual void | setupSelfBefore () |
![]() | |
Item () | |
OligoWavelengthDistribution is a subclass of the WavelengthDistribution class representing the wavelength probability distribution of primary-source photon packets emitted in an oligochromatic simulation. In principle, the class implements a probability distribution that has a constant nonzero value inside a set of narrow ranges placed around the oligochromatic wavelengths in the simulation, corresponding to the bins defined by the oligo wavelength grid. These bins all have the same half bin width given by 1/1000 of the shortest wavelength in the list (see the OligoWavelengthGrid class). As a result, after normalization, the constant value of the probability distribution inside each of the bins is given by
In practice, in the interest of performance, rather than distributing the generated wavelengths across each bin, the class always generates exactly one of the discrete oligochromatic wavelengths. Also, the class always returns the normalized constant probability value regardless of the specified wavelength. This is acceptable because in an oligochromatic simulation this value is queried only for one of the discrete wavelengths anyway.
The oligo wavelength distribution in a simulation is created programmatically rather than directly configured by the user. The list of wavelengths and the bin width are specified by passing an OligoWavelengthGrid instance to the constructor, which used the relevant information from this object.
|
explicit |
This constructor can be invoked programmatically to create an oligochromatic wavelength distribution. Before the constructor returns, the newly created object is hooked up as a child to the specified oligochromatic wavelength grid (so it will automatically be deleted), and its setup() function has been called.
|
overridevirtual |
This function draws a random wavelength from the wavelength distribution. For this class, it returns one of the discrete oligochromatic wavelengths with equal probability.
Implements WavelengthDistribution.
|
overridevirtual |
This function returns the probability of the distribution at the given wavelength. For this class, the function always returns the normalized constant probability value
Implements WavelengthDistribution.