| The Gaudi Framework v30r0 (c919700c)

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

- File List
- File Members

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
44 protected:
46 std::unique_ptr<IRndmGen::Param> m_params;
48 SmartIF<IRndmEngine> m_engine;
49
51 RndmGen( IInterface* engine );
53 ~RndmGen() override = default;
54
55 public:
57 StatusCode initialize( const IRndmGen::Param& par ) override;
60 StatusCode finalize() override;
62 const InterfaceID& type() const override { return ( m_params != 0 ) ? m_params->type() : IID_IRndmFlat; }
64 long ID() const override { return long( this ); }
66 const IRndmGen::Param* parameters() const override { return m_params.get(); }
72 StatusCode shootArray( std::vector<double>& array, long howmany, long start ) const override;
73 };
74
75 #endif // GAUDI_RANDOMGENSVC_RNDMGEN_H
SmartIF< IRndmEngine >
implements
Base class used to implement the interfaces.
Definition: implements.h:9
RndmGen::RndmGen
RndmGen(IInterface *engine)
Standard Constructor.
Definition: RndmGen.cpp:23
IRndmGen::Param::type
virtual const InterfaceID & type() const
Parameter&#39;s type.
Definition: IRndmGen.h:52
RndmGen::type
const InterfaceID & type() const override
Random number generator type.
Definition: RndmGen.h:62
IRndmGen.h
RndmGen::ID
long ID() const override
Random number generator ID.
Definition: RndmGen.h:64
RndmGen::parameters
const IRndmGen::Param * parameters() const override
Access to random number generator parameters.
Definition: RndmGen.h:66
InterfaceID
Interface ID class.
Definition: IInterface.h:29
compareOutputFiles.par
string par
Definition: compareOutputFiles.py:437
RndmGen::m_engine
SmartIF< IRndmEngine > m_engine
Hosting service: Access must always be possible.
Definition: RndmGen.h:48
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
IRndmGen::Param
Definition: IRndmGen.h:40
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:35
IInterface
Definition of the basic interface.
Definition: IInterface.h:277
SmartIF.h
RndmGen::initialize
StatusCode initialize(const IRndmGen::Param &par) override
IRndmGen implementation.
Definition: RndmGen.cpp:26
IOTest.start
start
Definition: IOTest.py:99
RndmGen
Random Generator definition.
Definition: RndmGen.h:41
RndmGen::finalize
StatusCode finalize() override
Finalize the generator.
Definition: RndmGen.cpp:32
std::unique_ptr::get
T get(T...args)
Containers::array
struct GAUDI_API array
Parametrisation class for redirection array - like implementation.
Definition: KeyedObjectManager.h:28
std::vector< double >
std::unique_ptr< IRndmGen::Param >
RndmGen::m_params
std::unique_ptr< IRndmGen::Param > m_params
Generation parameters.
Definition: RndmGen.h:46
IRndmEngine
Definition of a interface for a generic random number generator giving randomly distributed numbers i...
Definition: IRndmEngine.h:19
RndmGen::~RndmGen
~RndmGen() override=default
Standard Destructor.