DiscreteProbabilityVector class.
More...
#include "LArDiscreteProbabilityVector.h"
|
template<typename TX , typename TY > |
| DiscreteProbabilityVector (const InputData< TX, TY > &inputData, const TX xUpperBound, const bool useWidths) |
| Constructor.
|
|
| DiscreteProbabilityVector (const DiscreteProbabilityVector &discreteProbabilityVector, const ResamplingPoints &resamplingPoints) |
| Constructor.
|
|
| DiscreteProbabilityVector (const DiscreteProbabilityVector &discreteProbabilityVector, std::mt19937 &randomNumberGenerator) |
| Constructor.
|
|
float | EvaluateCumulativeProbability (const float x) const |
| Evaluate the cumulative probability at arbitrary x.
|
|
unsigned int | GetSize () const |
| Get the size of the probability vector.
|
|
float | GetX (const unsigned int index) const |
| Get the x value of the element in the vector.
|
|
float | GetProbability (const unsigned int index) const |
| Get the probability value of the element in the vector.
|
|
float | GetProbabilityDensity (const unsigned int index) const |
| Get the probability density value of the element in the vector.
|
|
float | GetCumulativeProbability (const unsigned int index) const |
| Get the cumulative probability value of the element in the vector.
|
|
float | GetWidth (const unsigned int index) const |
| Get the width of the element in the vectorr.
|
|
void | GetAllAtIndex (const unsigned int index, float &x, float &probabilityDensity, float &cumulativeProbability, float &width) const |
| Get all information stored at a particular index.
|
|
|
template<typename TX , typename TY > |
static bool | SortInputDataByX (const InputDatum< TX, TY > &lhs, const InputDatum< TX, TY > &rhs) |
| Sort the input data according to their x value.
|
|
◆ AllFloatInputData
◆ DiscreteProbabilityData
◆ InputData
template<typename TX , typename TY >
◆ InputDatum
template<typename TX , typename TY >
◆ ResamplingPoints
◆ DiscreteProbabilityVector() [1/3]
template<typename TX , typename TY >
lar_content::DiscreteProbabilityVector::DiscreteProbabilityVector |
( |
const InputData< TX, TY > & |
inputData, |
|
|
const TX |
xUpperBound, |
|
|
const bool |
useWidths |
|
) |
| |
Constructor.
- Parameters
-
inputData | the data used to construct the probability vector |
xUpperBound | the upper bound of the probability vector |
useWidths | bool controlling whether the bin widths are used in calculations |
Definition at line 19 of file LArDiscreteProbabilityVector.cc.
◆ DiscreteProbabilityVector() [2/3]
Constructor.
- Parameters
-
discreteProbabilityVector | a discrete probability vector to resample from |
resamplingPoints | the points to resample the discrete probability vector with |
Definition at line 39 of file LArDiscreteProbabilityVector.cc.
◆ DiscreteProbabilityVector() [3/3]
lar_content::DiscreteProbabilityVector::DiscreteProbabilityVector |
( |
const DiscreteProbabilityVector & |
discreteProbabilityVector, |
|
|
std::mt19937 & |
randomNumberGenerator |
|
) |
| |
Constructor.
- Parameters
-
discreteProbabilityVector | a discrete probability vector to randomly rearrange |
randomNumberGenerator | the random number generator for the random reshuffling |
Definition at line 29 of file LArDiscreteProbabilityVector.cc.
◆ CalculateNormalisation()
template<typename TX , typename TY >
template float lar_content::DiscreteProbabilityVector::CalculateNormalisation |
( |
const InputData< TX, TY > & |
inputData | ) |
const |
|
private |
◆ EvaluateCumulativeProbability()
float lar_content::DiscreteProbabilityVector::EvaluateCumulativeProbability |
( |
const float |
x | ) |
const |
◆ GetAllAtIndex()
void lar_content::DiscreteProbabilityVector::GetAllAtIndex |
( |
const unsigned int |
index, |
|
|
float & |
x, |
|
|
float & |
probabilityDensity, |
|
|
float & |
cumulativeProbability, |
|
|
float & |
width |
|
) |
| const |
|
inline |
Get all information stored at a particular index.
- Parameters
-
index | the index in the vector |
x | the x value |
probabilityDensity | the probability density value |
cumulativeProbability | the cumulative probability value |
width | the width of the probability bin |
Definition at line 315 of file LArDiscreteProbabilityVector.h.
◆ GetCumulativeProbability()
float lar_content::DiscreteProbabilityVector::GetCumulativeProbability |
( |
const unsigned int |
index | ) |
const |
|
inline |
Get the cumulative probability value of the element in the vector.
- Parameters
-
index | the index in the vector |
- Returns
- the cumulative probability
Definition at line 297 of file LArDiscreteProbabilityVector.h.
◆ GetProbability()
float lar_content::DiscreteProbabilityVector::GetProbability |
( |
const unsigned int |
index | ) |
const |
|
inline |
Get the probability value of the element in the vector.
- Parameters
-
index | the index in the vector |
- Returns
- the probability
Definition at line 279 of file LArDiscreteProbabilityVector.h.
◆ GetProbabilityDensity()
float lar_content::DiscreteProbabilityVector::GetProbabilityDensity |
( |
const unsigned int |
index | ) |
const |
|
inline |
Get the probability density value of the element in the vector.
- Parameters
-
index | the index in the vector |
- Returns
- the probability density
Definition at line 288 of file LArDiscreteProbabilityVector.h.
◆ GetSize()
unsigned int lar_content::DiscreteProbabilityVector::GetSize |
( |
| ) |
const |
|
inline |
◆ GetWidth()
float lar_content::DiscreteProbabilityVector::GetWidth |
( |
const unsigned int |
index | ) |
const |
|
inline |
Get the width of the element in the vectorr.
- Parameters
-
index | the index in the vector |
- Returns
- the width of the probability bin
Definition at line 306 of file LArDiscreteProbabilityVector.h.
◆ GetX()
float lar_content::DiscreteProbabilityVector::GetX |
( |
const unsigned int |
index | ) |
const |
|
inline |
Get the x value of the element in the vector.
- Parameters
-
index | the index in the vector |
- Returns
- the x value
Definition at line 270 of file LArDiscreteProbabilityVector.h.
◆ InitialiseDiscreteProbabilityData()
template<typename TX , typename TY >
Get a initialised probability data vector from the input data.
- Parameters
-
- Returns
- a fully-initialised discrete probability data vector
Definition at line 82 of file LArDiscreteProbabilityVector.cc.
◆ RandomiseDiscreteProbabilityData()
Get a randomised probability data vector in which the x values are unchanged, the probability density is randomised and the cumulative probability is recalculated.
- Parameters
-
discreteProbabilityVector | another discrete probability vector |
randomNumberGenerator | the random number generator for the random reshuffling |
- Returns
- a resampled probability data vector
Definition at line 159 of file LArDiscreteProbabilityVector.cc.
◆ ResampleDiscreteProbabilityData()
Get a resampled probability data vector by resampling another probability data vector.
- Parameters
-
discreteProbabilityVector | another discrete probability vector |
resamplingPoints | the points to resample the discrete probability vector with |
- Returns
- a resampled probability data vector
Definition at line 119 of file LArDiscreteProbabilityVector.cc.
◆ SortInputDataByX()
template<typename TX , typename TY >
template bool lar_content::DiscreteProbabilityVector::SortInputDataByX |
( |
const InputDatum< TX, TY > & |
lhs, |
|
|
const InputDatum< TX, TY > & |
rhs |
|
) |
| |
|
staticprivate |
Sort the input data according to their x value.
- Parameters
-
lhs | the first InputDatum |
lhs | the second InputDatum |
- Returns
- a bool dictacting swapping the two InputDatums
Definition at line 187 of file LArDiscreteProbabilityVector.cc.
◆ VerifyCompleteData()
void lar_content::DiscreteProbabilityVector::VerifyCompleteData |
( |
| ) |
const |
|
inlineprivate |
◆ VerifyElementRequest()
void lar_content::DiscreteProbabilityVector::VerifyElementRequest |
( |
const unsigned int |
index | ) |
const |
|
inlineprivate |
◆ m_discreteProbabilityData
◆ m_useWidths
bool lar_content::DiscreteProbabilityVector::m_useWidths |
|
private |
◆ m_xUpperBound
float lar_content::DiscreteProbabilityVector::m_xUpperBound |
|
private |
The documentation for this class was generated from the following files: