Gaudi Framework, version v24r2

Home   Generated: Wed Dec 4 2013
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
RndmGen Class Reference

Random Generator definition. More...

#include <RndmGen.h>

Inheritance diagram for RndmGen:
Inheritance graph
[legend]
Collaboration diagram for RndmGen:
Collaboration graph
[legend]

Public Member Functions

virtual StatusCode initialize (const IRndmGen::Param &par)
 IRndmGen implementation.
 
virtual StatusCode finalize ()
 Initialize the generator.
 
virtual const InterfaceIDtype () const
 Random number generator type.
 
virtual long ID () const
 Random number generator ID.
 
virtual const IRndmGen::Paramparameters () const
 Access to random number generator parameters.
 
virtual double shoot () const
 Single shot returning single random number according to specified distribution.
 
virtual StatusCode shootArray (std::vector< double > &array, long howmany, long start) const
 Multiple shots returning vector with random number according to specified distribution.
 

Protected Member Functions

 RndmGen (IInterface *engine)
 Standard Constructor.
 
virtual ~RndmGen ()
 Standard Destructor.
 

Protected Attributes

IRndmGen::Paramm_params
 Generation parameters.
 
IRndmEnginem_engine
 Hosting service: Access must always be possible.
 

Additional Inherited Members

- Public Types inherited from implements1< IRndmGen >
typedef implements1 base_class
 Typedef to this class.
 
typedef extend_interfaces1
< IRndmGen
extend_interfaces_base
 Typedef to the base of this class.
 
typedef
extend_interfaces_base::ext_iids 
interfaces
 MPL set of all the implemented interfaces.
 
- Static Public Member Functions inherited from IInterface
static const InterfaceIDinterfaceID ()
 Return an instance of InterfaceID identifying the interface.
 

Detailed Description

Random Generator definition.

Description: Definition of a interface for a generic random number generators.

Dependencies:

History :

+---------+----------------------------------------------+--------+
|    Date |                 Comment                      | Who    |
+---------+----------------------------------------------+--------+
| 21/11/99| Initial version.                             | MF     |
+---------+----------------------------------------------+--------+

Author: M.Frank Version: 1.0

Definition at line 39 of file RndmGen.h.

Constructor & Destructor Documentation

RndmGen::RndmGen ( IInterface engine)
protected

Standard Constructor.

Definition at line 22 of file RndmGen.cpp.

: m_params(0), m_engine(0) {
if ( 0 != engine ) {
engine->queryInterface(IRndmEngine::interfaceID(), pp_cast<void>(&m_engine)).ignore();
}
}
RndmGen::~RndmGen ( )
protectedvirtual

Standard Destructor.

Definition at line 29 of file RndmGen.cpp.

{
m_engine = 0;
if ( m_params ) delete m_params;
m_params = 0;
}

Member Function Documentation

StatusCode RndmGen::finalize ( )
virtual

Initialize the generator.

Initialize the RndmGen.

Implements IRndmGen.

Reimplemented in HepRndm::Generator< Rndm::DefinedPdf >.

Definition at line 43 of file RndmGen.cpp.

{
}
virtual long RndmGen::ID ( ) const
inlinevirtual

Random number generator ID.

Implements IRndmGen.

Definition at line 64 of file RndmGen.h.

{
return long(this);
}
StatusCode RndmGen::initialize ( const IRndmGen::Param par)
virtual

IRndmGen implementation.

Initialize the generator.

Initialize the generator

Implements IRndmGen.

Reimplemented in HepRndm::Generator< Rndm::DefinedPdf >, and HepRndm::Generator< TYPE >.

Definition at line 37 of file RndmGen.cpp.

virtual const IRndmGen::Param* RndmGen::parameters ( ) const
inlinevirtual

Access to random number generator parameters.

Implements IRndmGen.

Definition at line 68 of file RndmGen.h.

{
return m_params;
}
double RndmGen::shoot ( ) const
virtual

Single shot returning single random number according to specified distribution.

Implements IRndmGen.

Reimplemented in HepRndm::Generator< Rndm::DefinedPdf >, and HepRndm::Generator< TYPE >.

Definition at line 48 of file RndmGen.cpp.

{
return DBL_MAX;
}
StatusCode RndmGen::shootArray ( std::vector< double > &  array,
long  howmany,
long  start 
) const
virtual

Multiple shots returning vector with random number according to specified distribution.

Parameters
arrayArray containing random numbers
howmanyfill 'howmany' random numbers into array
start... starting at position start

Implements IRndmGen.

Definition at line 53 of file RndmGen.cpp.

{
if ( 0 != m_engine ) {
long cnt = start;
array.resize(start+howmany);
for ( long i = start, num = start+howmany; i < num; i++ ) {
array[cnt++] = shoot();
}
}
}
virtual const InterfaceID& RndmGen::type ( ) const
inlinevirtual

Random number generator type.

Implements IRndmGen.

Definition at line 60 of file RndmGen.h.

{
return (m_params != 0) ? m_params->type() : IID_IRndmFlat;
}

Member Data Documentation

IRndmEngine* RndmGen::m_engine
protected

Hosting service: Access must always be possible.

Definition at line 45 of file RndmGen.h.

IRndmGen::Param* RndmGen::m_params
protected

Generation parameters.

Definition at line 43 of file RndmGen.h.


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

Generated at Wed Dec 4 2013 14:33:18 for Gaudi Framework, version v24r2 by Doxygen version 1.8.2 written by Dimitri van Heesch, © 1997-2004