| The Gaudi Framework v28r2p1 (f1a77ff4)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
Rndm::DefinedPdf Class Reference

Generate a random number Generator following generally distributed random values, given a user-defined probability distribution function. More...

`#include <GaudiKernel/RndmGenerators.h>`

Inheritance diagram for Rndm::DefinedPdf:
[legend]
Collaboration diagram for Rndm::DefinedPdf:
[legend]

## Public Member Functions
| DefinedPdf (const std::vector< double > &pdf, long intpol)
| Standard Constructor. More...
| ~DefinedPdf () override=default
| Standard Destructor. More...
std::vector< double > & | pdf ()
| Access pdf. More...
long | interpolation () const
| Access interpolation type. More...
DefinedPdf * | clone () const override
| Clone parameters. More...
Public Member Functions inherited from IRndmGen::Param
| Param (const InterfaceID &type=IID_IRndmFlat)
| Standard constructor. More...
virtual | ~Param ()=default
| Standard Destructor. More...
virtual const InterfaceID & | type () const
| Parameter's type. More...

## Static Public Member Functions
static const InterfaceID & | typeID ()
| Identifier for factory. More...

## Protected Attributes
std::vector< double > | m_pdf
| Vector containing probability distribution function. More...
long | m_interpolation
| Interpolation type. More...
Protected Attributes inherited from IRndmGen::Param
const InterfaceID | m_type
| Type of the generator. More...

## Detailed Description

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 306 of file RndmGenerators.h.

## Constructor & Destructor Documentation

Rndm::DefinedPdf::DefinedPdf | ( | const std::vector< double > & | pdf,
|  | long | intpol
| ) |  |
| inline

Standard Constructor.

Definition at line 314 of file RndmGenerators.h.

315 : IRndmGen::Param(IID_IRndmDefinedPdf),
316 m_pdf(pdf),
317 m_interpolation(intpol) { }
IRndmGen::Param
Definition: IRndmGen.h:40
Rndm::DefinedPdf::m_pdf
std::vector< double > m_pdf
Vector containing probability distribution function.
Definition: RndmGenerators.h:309
Rndm::DefinedPdf::m_interpolation
long m_interpolation
Interpolation type.
Definition: RndmGenerators.h:311

Rndm::DefinedPdf::~DefinedPdf | ( |  | ) |
| override default

Standard Destructor.

## Member Function Documentation

DefinedPdf* Rndm::DefinedPdf::clone | ( |  | ) | const
| inline override virtual

Clone parameters.

Implements IRndmGen::Param.

Definition at line 327 of file RndmGenerators.h.

327 { return new DefinedPdf(m_pdf,m_interpolation); }
Rndm::DefinedPdf::DefinedPdf
DefinedPdf(const std::vector< double > &pdf, long intpol)
Standard Constructor.
Definition: RndmGenerators.h:314
Rndm::DefinedPdf::m_pdf
std::vector< double > m_pdf
Vector containing probability distribution function.
Definition: RndmGenerators.h:309
Rndm::DefinedPdf::m_interpolation
long m_interpolation
Interpolation type.
Definition: RndmGenerators.h:311

long Rndm::DefinedPdf::interpolation | ( |  | ) | const
| inline

Access interpolation type.

Definition at line 323 of file RndmGenerators.h.

323 { return m_interpolation; }
Rndm::DefinedPdf::m_interpolation
long m_interpolation
Interpolation type.
Definition: RndmGenerators.h:311

std::vector<double>& Rndm::DefinedPdf::pdf | ( |  | ) |
| inline

Access pdf.

Definition at line 321 of file RndmGenerators.h.

321 { return m_pdf; }
Rndm::DefinedPdf::m_pdf
std::vector< double > m_pdf
Vector containing probability distribution function.
Definition: RndmGenerators.h:309

static const InterfaceID& Rndm::DefinedPdf::typeID | ( |  | ) |
| inline static

Identifier for factory.

Definition at line 325 of file RndmGenerators.h.

325 { return IID_IRndmDefinedPdf; }

## Member Data Documentation

long Rndm::DefinedPdf::m_interpolation
| protected

Interpolation type.

Definition at line 311 of file RndmGenerators.h.

std::vector<double> Rndm::DefinedPdf::m_pdf
| protected

Vector containing probability distribution function.

Definition at line 309 of file RndmGenerators.h.

The documentation for this class was generated from the following file:

- GaudiKernel/GaudiKernel/RndmGenerators.h