|
Gaudi Framework, version v22r2 |
| Home | Generated: Tue May 10 2011 |
Generate a random number Generator following generally distributed random values, given a user-defined probability distribution function. More...
#include <RndmGenerators.h>


Public Member Functions | |
| DefinedPdf (const std::vector< double > &pdf, long intpol) | |
| Standard Constructor. | |
| virtual | ~DefinedPdf () |
| Standard Destructor. | |
| std::vector< double > & | pdf () |
| Access pdf. | |
| long | interpolation () const |
| Access interpolation type. | |
| virtual IRndmGen::Param * | clone () const |
| Clone parameters. | |
Static Public Member Functions | |
| static const InterfaceID & | typeID () |
| Identifier for factory. | |
Protected Attributes | |
| std::vector< double > | m_pdf |
| Vector containing probability distribution function. | |
| long | m_interpolation |
| Interpolation type. | |
Generate a random number Generator following generally distributed random values, given a user-defined probability distribution function.
The probability distribution function (Pdf) must be provided by the user as an array of positive real number. The array size must also be provided. The Pdf doesn't need to be normalized to 1. if IntType = 0 ( default value ) a uniform random number is generated. The uniform number is then transformed to the user's distribution using the cumulative probability distribution constructed from his histogram. The cumulative distribution is inverted using a binary search for the nearest bin boundary and a linear interpolation within the bin. Therefore a constant density within each bin is generated. if IntType = 1 no interpolation is performed and the result is a discrete distribution.
Definition at line 321 of file RndmGenerators.h.
| Rndm::DefinedPdf::DefinedPdf | ( | const std::vector< double > & | pdf, |
| long | intpol | ||
| ) | [inline] |
Standard Constructor.
Definition at line 329 of file RndmGenerators.h.
: IRndmGen::Param(IID_IRndmDefinedPdf), m_pdf(pdf), m_interpolation(intpol) { }
| virtual Rndm::DefinedPdf::~DefinedPdf | ( | ) | [inline, virtual] |
| virtual IRndmGen::Param* Rndm::DefinedPdf::clone | ( | ) | const [inline, virtual] |
Clone parameters.
Implements IRndmGen::Param.
Definition at line 342 of file RndmGenerators.h.
{
return new DefinedPdf(m_pdf,m_interpolation);
}
| long Rndm::DefinedPdf::interpolation | ( | ) | const [inline] |
Access interpolation type.
Definition at line 338 of file RndmGenerators.h.
{ return m_interpolation; }
| std::vector<double>& Rndm::DefinedPdf::pdf | ( | ) | [inline] |
| static const InterfaceID& Rndm::DefinedPdf::typeID | ( | ) | [inline, static] |
Identifier for factory.
Definition at line 340 of file RndmGenerators.h.
{ return IID_IRndmDefinedPdf; }
long Rndm::DefinedPdf::m_interpolation [protected] |
Interpolation type.
Definition at line 326 of file RndmGenerators.h.
std::vector<double> Rndm::DefinedPdf::m_pdf [protected] |
Vector containing probability distribution function.
Definition at line 324 of file RndmGenerators.h.