| The Gaudi Framework v32r1 (f65d50dc)

RndmGen.h
Go to the documentation of this file.
1 //====================================================================
2 // Random RndmGen class definition
3 //--------------------------------------------------------------------
4 //
5 // Package : Gaudi/RndmGen ( The LHCb Offline System)
6 // Author : M.Frank
7 //====================================================================
8 #ifndef GAUDI_RANDOMGENSVC_RNDMGEN_H
9 #define GAUDI_RANDOMGENSVC_RNDMGEN_H 1
10
11 #include <memory>
12 // Framework include files
13 #include "GaudiKernel/IRndmGen.h"
14 #include "GaudiKernel/SmartIF.h"
15
16 // Forward declarations
17 class IRndmEngine;
18
41 class RndmGen : public implements<IRndmGen> {
42
43 protected:
45 std::unique_ptr<IRndmGen::Param> m_params;
47 SmartIF<IRndmEngine> m_engine;
48
50 RndmGen( IInterface* engine );
51
52 public:
54 StatusCode initialize( const IRndmGen::Param& par ) override;
57 StatusCode finalize() override;
59 const InterfaceID& type() const override { return ( m_params != 0 ) ? m_params->type() : IID_IRndmFlat; }
61 long ID() const override { return long( this ); }
63 const IRndmGen::Param* parameters() const override { return m_params.get(); }
69 StatusCode shootArray( std::vector<double>& array, long howmany, long start ) const override;
70 };
71
72 #endif // GAUDI_RANDOMGENSVC_RNDMGEN_H
SmartIF< IRndmEngine >
implements
Base class used to implement the interfaces.
Definition: implements.h:9
IRndmGen::Param::type
virtual const InterfaceID & type() const
Parameter's type.
Definition: IRndmGen.h:50
RndmGen::RndmGen
RndmGen(IInterface *engine)
Standard Constructor.
Definition: RndmGen.cpp:23
IRndmGen.h
RndmGen::ID
long ID() const override
Random number generator ID.
Definition: RndmGen.h:61
IOTest.start
def start
Definition: IOTest.py:97
InterfaceID
Interface ID class.
Definition: IInterface.h:29
compareOutputFiles.par
string par
Definition: compareOutputFiles.py:465
RndmGen::m_engine
SmartIF< IRndmEngine > m_engine
Hosting service: Access must always be possible.
Definition: RndmGen.h:47
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
IRndmGen::Param
Definition: IRndmGen.h:39
RndmGen::parameters
const IRndmGen::Param * parameters() const override
Access to random number generator parameters.
Definition: RndmGen.h:63
IInterface
Definition of the basic interface.
Definition: IInterface.h:244
SmartIF.h
RndmGen::initialize
StatusCode initialize(const IRndmGen::Param &par) override
IRndmGen implementation.
Definition: RndmGen.cpp:26
RndmGen
Random Generator definition.
Definition: RndmGen.h:41
RndmGen::finalize
StatusCode finalize() override
Finalize the generator.
Definition: RndmGen.cpp:31
std::unique_ptr::get
T get(T... args)
Containers::array
struct GAUDI_API array
Parametrisation class for redirection array - like implementation.
Definition: KeyedObjectManager.h:27
std::vector< double >
RndmGen::type
const InterfaceID & type() const override
Random number generator type.
Definition: RndmGen.h:59
std::unique_ptr< IRndmGen::Param >
RndmGen::shootArray
StatusCode shootArray(std::vector< double > &array, long howmany, long start) const override
Multiple shots returning vector with random number according to specified distribution.
Definition: RndmGen.cpp:34
RndmGen::m_params
std::unique_ptr< IRndmGen::Param > m_params
Generation parameters.
Definition: RndmGen.h:45
IRndmEngine
Definition of a interface for a generic random number generator giving randomly distributed numbers i...
Definition: IRndmEngine.h:19