| The Gaudi Framework v28r2-patches (bc4ad17a)

- 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 protected:
45 std::unique_ptr<IRndmGen::Param> m_params;
47 SmartIF<IRndmEngine> m_engine;
48
50 RndmGen(IInterface* engine);
52 ~RndmGen() override = default;
53
54 public:
55
57 StatusCode initialize(const IRndmGen::Param& par) override;
60 StatusCode finalize() override;
62 const InterfaceID& type() const override {
63 return (m_params != 0) ? m_params->type() : IID_IRndmFlat;
64 }
66 long ID() const override {
67 return long(this);
68 }
70 const IRndmGen::Param* parameters() const override {
71 return m_params.get();
72 }
78 StatusCode shootArray( std::vector<double>& array, long howmany, long start) const override;
79 };
80
81 #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:50
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:66
RndmGen::parameters
const IRndmGen::Param * parameters() const override
Access to random number generator parameters.
Definition: RndmGen.h:70
InterfaceID
Interface ID class.
Definition: IInterface.h:30
compareOutputFiles.par
string par
Definition: compareOutputFiles.py:386
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: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:38
IInterface
Definition of the basic interface.
Definition: IInterface.h:234
SmartIF.h
RndmGen::initialize
StatusCode initialize(const IRndmGen::Param &par) override
IRndmGen implementation.
Definition: RndmGen.cpp:28
IOTest.start
start
Definition: IOTest.py:88
RndmGen
Random Generator definition.
Definition: RndmGen.h:41
RndmGen::finalize
StatusCode finalize() override
Finalize the generator.
Definition: RndmGen.cpp:33
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 >
std::unique_ptr< IRndmGen::Param >
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
RndmGen::~RndmGen
~RndmGen() override=default
Standard Destructor.