The Gaudi Framework  v29r0 (ff2e7097)
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:
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
Base class used to implement the interfaces.
Definition: implements.h:9
RndmGen(IInterface *engine)
Standard Constructor.
Definition: RndmGen.cpp:23
virtual const InterfaceID & type() const
Parameter&#39;s type.
Definition: IRndmGen.h:52
const InterfaceID & type() const override
Random number generator type.
Definition: RndmGen.h:62
long ID() const override
Random number generator ID.
Definition: RndmGen.h:64
const IRndmGen::Param * parameters() const override
Access to random number generator parameters.
Definition: RndmGen.h:66
Interface ID class.
Definition: IInterface.h:29
SmartIF< IRndmEngine > m_engine
Hosting service: Access must always be possible.
Definition: RndmGen.h:48
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
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
Definition of the basic interface.
Definition: IInterface.h:277
StatusCode initialize(const IRndmGen::Param &par) override
IRndmGen implementation.
Definition: RndmGen.cpp:26
start
Definition: IOTest.py:99
Random Generator definition.
Definition: RndmGen.h:41
StatusCode finalize() override
Finalize the generator.
Definition: RndmGen.cpp:32
T get(T...args)
struct GAUDI_API array
Parametrisation class for redirection array - like implementation.
std::unique_ptr< IRndmGen::Param > m_params
Generation parameters.
Definition: RndmGen.h:46
Definition of a interface for a generic random number generator giving randomly distributed numbers i...
Definition: IRndmEngine.h:19
~RndmGen() override=default
Standard Destructor.