| The Gaudi Framework v32r1 (f65d50dc)

RndmGenSvc.h
Go to the documentation of this file.
1 //====================================================================
2 // Random Generator service definition
3 //--------------------------------------------------------------------
4 //
5 // Package : Gaudi/RndmGen ( The LHCb Offline System)
6 // Author : M.Frank
7 //====================================================================
8 #ifndef GAUDI_RANDOMGENSVC_RNDMGENSVC_H
9 #define GAUDI_RANDOMGENSVC_RNDMGENSVC_H 1
10
11 // STL include files
12 #include <vector>
13
14 // Framework include files
15 #include "GaudiKernel/IRndmEngine.h"
16 #include "GaudiKernel/IRndmGen.h"
17 #include "GaudiKernel/IRndmGenSvc.h"
18 #include "GaudiKernel/ISerialize.h"
19 #include "GaudiKernel/Service.h"
20
21 // Forward declarations
22 class IRndmGenFactory;
23 class IMessageSvc;
24
49 class RndmGenSvc : public extends<Service, IRndmGenSvc, IRndmEngine, ISerialize> {
50 private:
52 mutable SmartIF<IRndmEngine> m_engine;
54 mutable SmartIF<ISerialize> m_serialize;
55
56 Gaudi::Property<std::string> m_engineName{this, "Engine", "HepRndm::Engine<CLHEP::RanluxEngine>", "engine name"};
57
58 public:
59 // inherits constructor from base class
60 using extends::extends;
61
62 public:
64 StatusCode initialize() override;
66 StatusCode finalize() override;
68 StreamBuffer& serialize( StreamBuffer& str ) override;
71 StreamBuffer& serialize( StreamBuffer& str ) const override;
73 IRndmEngine* engine() override;
75 StatusCode generator( const IRndmGen::Param& par, IRndmGen*& refpGen ) override;
77 double rndm() const override;
84 StatusCode rndmArray( std::vector<double>& array, long howmany, long start = 0 ) const override;
86 StatusCode setSeeds( const std::vector<long>& seeds ) override;
88 StatusCode seeds( std::vector<long>& seeds ) const override;
89 };
90
91 #endif // GAUDI_RANDOMGENSVC_RNDMGENSVC_H
SmartIF< IRndmEngine >
RndmGenSvc::serialize
StreamBuffer & serialize(StreamBuffer &str) override
IRndmGenSvc interface implementation.
Definition: RndmGenSvc.cpp:80
RndmGenSvc::initialize
StatusCode initialize() override
Service override: initialization.
Definition: RndmGenSvc.cpp:34
Gaudi::Property
Implementation of property with value of concrete type.
Definition: Property.h:352
RndmGenSvc::finalize
StatusCode finalize() override
Service override: finalization.
Definition: RndmGenSvc.cpp:68
Service::start
StatusCode start() override
Definition: Service.cpp:129
StreamBuffer
The stream buffer is a small object collecting object data.
Definition: StreamBuffer.h:41
IRndmGen
Definition of a interface for a generic random number generators.
Definition: IRndmGen.h:34
RndmGenSvc::m_engine
SmartIF< IRndmEngine > m_engine
Random number engine.
Definition: RndmGenSvc.h:52
IRndmGen.h
RndmGenSvc::m_engineName
Gaudi::Property< std::string > m_engineName
Definition: RndmGenSvc.h:56
RndmGenSvc
Random Generator service definition.
Definition: RndmGenSvc.h:49
Service.h
IRndmEngine.h
compareOutputFiles.par
string par
Definition: compareOutputFiles.py:465
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
IRndmGen::Param
Definition: IRndmGen.h:39
RndmGenSvc::seeds
StatusCode seeds(std::vector< long > &seeds) const override
Allow to get seeds.
Definition: RndmGenSvc.cpp:127
RndmGenSvc::generator
StatusCode generator(const IRndmGen::Param &par, IRndmGen *&refpGen) override
Retrieve a valid generator from the service.
Definition: RndmGenSvc.cpp:97
IMessageSvc
The IMessage is the interface implemented by the message service.
Definition: IMessageSvc.h:37
RndmGenSvc::rndmArray
StatusCode rndmArray(std::vector< double > &array, long howmany, long start=0) const override
Multiple shots returning vector with flat random numbers.
Definition: RndmGenSvc.cpp:117
RndmGenSvc::rndm
double rndm() const override
Single shot returning single random number.
Definition: RndmGenSvc.cpp:109
Containers::array
struct GAUDI_API array
Parametrisation class for redirection array - like implementation.
Definition: KeyedObjectManager.h:27
std::vector< double >
IRndmGenSvc.h
RndmGenSvc::setSeeds
StatusCode setSeeds(const std::vector< long > &seeds) override
Allow to set new seeds.
Definition: RndmGenSvc.cpp:122
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
ISerialize.h
IRndmEngine
Definition of a interface for a generic random number generator giving randomly distributed numbers i...
Definition: IRndmEngine.h:19
RndmGenSvc::engine
IRndmEngine * engine() override
Retrieve engine.
Definition: RndmGenSvc.cpp:94
RndmGenSvc::m_serialize
SmartIF< ISerialize > m_serialize
Serialization interface of random number engine.
Definition: RndmGenSvc.h:54