| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Rndm::DefinedPdf Class Reference

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

#include <RndmGenerators.h>

Inheritance diagram for Rndm::DefinedPdf:

[legend]
Collaboration diagram for Rndm::DefinedPdf:
[legend]
List of all members.

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::Paramclone () const
 Clone parameters.
virtual const InterfaceIDtype () const
 Parameter's type.

Static Public Member Functions

static const InterfaceIDtypeID ()
 Identifier for factory.

Protected Attributes

std::vector< double > m_pdf
 Vector containing probability distribution function.
long m_interpolation
 Interpolation type.
const InterfaceID m_type
 Type of the generator.

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


Constructor & Destructor Documentation

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

Standard Constructor.

Definition at line 328 of file RndmGenerators.h.

00329     : IRndmGen::Param(IID_IRndmDefinedPdf),
00330       m_pdf(pdf),
00331       m_interpolation(intpol)  {     }

virtual Rndm::DefinedPdf::~DefinedPdf (  )  [inline, virtual]

Standard Destructor.

Definition at line 333 of file RndmGenerators.h.

00333 {  }


Member Function Documentation

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

Access pdf.

Definition at line 335 of file RndmGenerators.h.

00335 { return m_pdf;                 }

long Rndm::DefinedPdf::interpolation (  )  const [inline]

Access interpolation type.

Definition at line 337 of file RndmGenerators.h.

00337 { return m_interpolation;       }

static const InterfaceID& Rndm::DefinedPdf::typeID (  )  [inline, static]

Identifier for factory.

Definition at line 339 of file RndmGenerators.h.

00339 { return IID_IRndmDefinedPdf;   }

virtual IRndmGen::Param* Rndm::DefinedPdf::clone (  )  const [inline, virtual]

Clone parameters.

Implements IRndmGen::Param.

Definition at line 341 of file RndmGenerators.h.

00341                                             {
00342       return new DefinedPdf(m_pdf,m_interpolation);
00343     }

virtual const InterfaceID& IRndmGen::Param::type (  )  const [inline, virtual, inherited]

Parameter's type.

Definition at line 52 of file IRndmGen.h.

00052                                               {
00053       return m_type;
00054     }


Member Data Documentation

std::vector<double> Rndm::DefinedPdf::m_pdf [protected]

Vector containing probability distribution function.

Definition at line 323 of file RndmGenerators.h.

long Rndm::DefinedPdf::m_interpolation [protected]

Interpolation type.

Definition at line 325 of file RndmGenerators.h.

const InterfaceID IRndmGen::Param::m_type [protected, inherited]

Type of the generator.

Definition at line 43 of file IRndmGen.h.


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 19:57:21 2011 for GaudiKernel by doxygen 1.4.7