| The Gaudi Framework v27r1

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

- File List
- File Members

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/Service.h"
16 #include "GaudiKernel/ISerialize.h"
17 #include "GaudiKernel/IRndmGen.h"
18 #include "GaudiKernel/IRndmEngine.h"
19 #include "GaudiKernel/IRndmGenSvc.h"
20
21 // Forward declarations
22 class IRndmGenFactory;
23 class IMessageSvc;
24
49 class RndmGenSvc : public extends<Service,
50 IRndmGenSvc,
51 IRndmEngine,
52 ISerialize> {
53 private:
55 mutable SmartIF<IRndmEngine> m_engine;
57 mutable SmartIF<ISerialize> m_serialize;
59 std::string m_engineName;
60 public:
62 RndmGenSvc(const std::string& name, ISvcLocator* svc);
64 ~RndmGenSvc() override = default;
65 public:
67 StatusCode initialize() override;
69 StatusCode finalize() override;
71 StreamBuffer& serialize(StreamBuffer& str) override;
74 StreamBuffer& serialize(StreamBuffer& str) const override;
76 IRndmEngine* engine() override;
78 StatusCode generator(const IRndmGen::Param& par, IRndmGen*& refpGen) override;
80 double rndm() const override;
87 StatusCode rndmArray( std::vector<double>& array, long howmany, long start = 0) const override;
89 StatusCode setSeeds(const std::vector<long>& seeds) override;
91 StatusCode seeds(std::vector<long>& seeds) const override;
92 };
93
94 #endif // GAUDI_RANDOMGENSVC_RNDMGENSVC_H
RndmGenSvc::RndmGenSvc
RndmGenSvc(const std::string &name, ISvcLocator *svc)
Standard Service constructor.
Definition: RndmGenSvc.cpp:35
SmartIF< IRndmEngine >
RndmGenSvc::serialize
StreamBuffer & serialize(StreamBuffer &str) override
IRndmGenSvc interface implementation.
Definition: RndmGenSvc.cpp:88
ISvcLocator
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
RndmGenSvc::initialize
StatusCode initialize() override
Service override: initialization.
Definition: RndmGenSvc.cpp:42
RndmGenSvc::finalize
StatusCode finalize() override
Service override: finalization.
Definition: RndmGenSvc.cpp:76
Service::start
StatusCode start() override
Definition: Service.cpp:152
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:35
RndmGenSvc::m_engineName
std::string m_engineName
Engine name.
Definition: RndmGenSvc.h:59
RndmGenSvc::m_engine
SmartIF< IRndmEngine > m_engine
Random number engine.
Definition: RndmGenSvc.h:55
IRndmGen.h
RndmGenSvc::~RndmGenSvc
~RndmGenSvc() override=default
Standard Service destructor.
std::string
STL class.
RndmGenSvc
Random Generator service definition.
Definition: RndmGenSvc.h:49
Service.h
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:319
IRndmEngine.h
compareOutputFiles.par
string par
Definition: compareOutputFiles.py:386
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
IRndmGen::Param
Definition: IRndmGen.h:40
RndmGenSvc::seeds
StatusCode seeds(std::vector< long > &seeds) const override
Allow to get seeds.
Definition: RndmGenSvc.cpp:141
RndmGenSvc::generator
StatusCode generator(const IRndmGen::Param &par, IRndmGen *&refpGen) override
Retrieve a valid generator from the service.
Definition: RndmGenSvc.cpp:107
IMessageSvc
The IMessage is the interface implemented by the message service.
Definition: IMessageSvc.h:57
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:129
RndmGenSvc::rndm
double rndm() const override
Single shot returning single random number.
Definition: RndmGenSvc.cpp:119
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:135
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:102
RndmGenSvc::m_serialize
SmartIF< ISerialize > m_serialize
Serialization interface of random number engine.
Definition: RndmGenSvc.h:57