|
Gaudi Framework, version v21r8 |
| Home | Generated: 17 Mar 2010 |
#include <RndmGen.h>


Public Member Functions | |
| virtual StatusCode | initialize (const IRndmGen::Param &par) |
| IRndmGen implementation. | |
| virtual StatusCode | finalize () |
| Initialize the generator. | |
| virtual const InterfaceID & | type () const |
| Random number generator type. | |
| virtual long | ID () const |
| Random number generator ID. | |
| virtual const IRndmGen::Param * | parameters () 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::Param * | m_params |
| Generation parameters. | |
| IRndmEngine * | m_engine |
| Hosting service: Access must always be possible. | |
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.
| RndmGen::RndmGen | ( | IInterface * | engine | ) | [protected] |
Standard Constructor.
Definition at line 22 of file RndmGen.cpp.
00022 : m_params(0), m_engine(0) { 00023 if ( 0 != engine ) { 00024 engine->queryInterface(IRndmEngine::interfaceID(), pp_cast<void>(&m_engine)).ignore(); 00025 } 00026 }
| RndmGen::~RndmGen | ( | ) | [protected, virtual] |
| StatusCode RndmGen::initialize | ( | const IRndmGen::Param & | par | ) | [virtual] |
IRndmGen implementation.
Initialize the generator.
Initialize the generator
Implements IRndmGen.
Reimplemented in HepRndm::Generator< TYPE >, and HepRndm::Generator< Rndm::DefinedPdf >.
Definition at line 37 of file RndmGen.cpp.
00037 { 00038 m_params = par.clone(); 00039 return (0==m_engine) ? StatusCode::FAILURE : StatusCode::SUCCESS; 00040 }
| StatusCode RndmGen::finalize | ( | void | ) | [virtual] |
Initialize the generator.
Initialize the RndmGen.
Implements IRndmGen.
Reimplemented in HepRndm::Generator< Rndm::DefinedPdf >.
Definition at line 43 of file RndmGen.cpp.
00043 { 00044 return StatusCode::SUCCESS; 00045 }
| virtual const InterfaceID& RndmGen::type | ( | ) | const [inline, virtual] |
| virtual long RndmGen::ID | ( | ) | const [inline, virtual] |
| virtual const IRndmGen::Param* RndmGen::parameters | ( | ) | const [inline, virtual] |
| double RndmGen::shoot | ( | ) | const [virtual] |
Single shot returning single random number according to specified distribution.
Implements IRndmGen.
Reimplemented in HepRndm::Generator< TYPE >, HepRndm::Generator< Rndm::DefinedPdf >, HepRndm::Generator< TYPE >, HepRndm::Generator< TYPE >, HepRndm::Generator< TYPE >, HepRndm::Generator< TYPE >, HepRndm::Generator< TYPE >, HepRndm::Generator< TYPE >, HepRndm::Generator< TYPE >, HepRndm::Generator< TYPE >, HepRndm::Generator< TYPE >, HepRndm::Generator< TYPE >, HepRndm::Generator< TYPE >, HepRndm::Generator< TYPE >, and HepRndm::Generator< TYPE >.
Definition at line 48 of file RndmGen.cpp.
| StatusCode RndmGen::shootArray | ( | std::vector< double > & | array, | |
| long | howmany, | |||
| long | start | |||
| ) | const [virtual] |
Multiple shots returning vector with random number according to specified distribution.
| array | Array containing random numbers | |
| howmany | fill 'howmany' random numbers into array | |
| start | ... starting at position start |
Implements IRndmGen.
Definition at line 53 of file RndmGen.cpp.
00053 { 00054 if ( 0 != m_engine ) { 00055 long cnt = start; 00056 array.resize(start+howmany); 00057 for ( long i = start, num = start+howmany; i < num; i++ ) { 00058 array[cnt++] = shoot(); 00059 } 00060 return StatusCode::SUCCESS; 00061 } 00062 return StatusCode::FAILURE; 00063 }
IRndmGen::Param* RndmGen::m_params [protected] |
IRndmEngine* RndmGen::m_engine [protected] |