15 #define GAUDI_RANDOMGENSVC_RNDMGENSVC_CPP
21 #include "GaudiKernel/SmartIF.h"
22 #include "GaudiKernel/ObjectFactory.h"
23 #include "GaudiKernel/ISvcManager.h"
24 #include "GaudiKernel/IRndmEngine.h"
26 #include "GaudiKernel/MsgStream.h"
37 : base_class(nam, svc), m_engine(0), m_serialize(0)
39 declareProperty(
"Engine", m_engineName =
"HepRndm::Engine<CLHEP::RanluxEngine>");
50 std::string machName =
name()+
".Engine";
115 log <<
MSG::ERROR <<
"Cannot output serialize Generator settings!" <<
endmsg;
virtual StatusCode initialize(const IRndmGen::Param &par)=0
Initialize the generator.
Definition of the MsgStream class used to transmit messages.
Small smart pointer class with automatic reference counting for IInterface.
virtual StatusCode rndmArray(std::vector< double > &array, long howmany, long start=0) const =0
Multiple shots returning vector with flat random numbers.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
virtual StatusCode seeds(std::vector< long > &seeds) const
Allow to get seeds.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
The stream buffer is a small object collecting object data.
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
virtual const InterfaceID & type() const
Parameter's type.
bool isSuccess() const
Test for a status code of SUCCESS.
Definition of a interface for a generic random number generators.
std::string m_engineName
Engine name.
virtual double rndm() const
Single shot returning single random number.
virtual StatusCode initialize()
Service override: initialization.
virtual StatusCode rndmArray(std::vector< double > &array, long howmany, long start=0) const
Multiple shots returning vector with flat random numbers.
virtual StatusCode setSeeds(const std::vector< long > &seeds)
Allow to set new seeds.
Random Generator service definition.
virtual StatusCode sysInitialize()=0
Initialize Service.
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Helper class to parse a string of format "type/name".
virtual StatusCode generator(const IRndmGen::Param &par, IRndmGen *&refpGen)
Retrieve a valid generator from the service.
#define DECLARE_COMPONENT(type)
This class is used for returning status codes from appropriate routines.
virtual double rndm() const =0
Single shot returning single random number.
virtual SmartIF< IService > & createService(const Gaudi::Utils::TypeNameString &nametype)=0
Creates and instance of a service type that has been declared beforehand and assigns it a name...
virtual StreamBuffer & serialize(StreamBuffer &str)=0
Input serialization from stream buffer.
Definition of the basic interface.
virtual StatusCode finalize()
Service override: finalization.
virtual IRndmEngine * engine()
Retrieve engine.
virtual StatusCode setSeeds(const std::vector< long > &seeds)=0
Allow to set new seeds.
virtual ~RndmGenSvc()
Standard Service destructor.
virtual StatusCode finalize()=0
Finalize (from INITIALIZED to CONFIGURED).
StatusCode setProperties()
Method for setting declared properties to the values specified for the job.
virtual const std::string & name() const
Retrieve name of the service.
IRndmEngine * m_engine
Random number engine.
virtual StreamBuffer & serialize(StreamBuffer &str)
IRndmGenSvc interface implementation.
struct GAUDI_API array
Parametrisation class for redirection array - like implementation.
virtual unsigned long release()=0
Release Interface instance.
virtual StatusCode initialize()
Initialization (from CONFIGURED to INITIALIZED).
bool isValid() const
Allow for check if smart pointer is valid.
virtual unsigned long addRef()=0
Increment the reference count of Interface instance.
StatusCode service(const std::string &name, const T *&psvc, bool createIf=true) const
Access a service by name, creating it if it doesn't already exist.
Definition of a interface for a generic random number generator giving randomly distributed numbers i...
static const InterfaceID & interfaceID()
Return an instance of InterfaceID identifying the interface.
virtual StatusCode seeds(std::vector< long > &seeds) const =0
Allow to retrieve seeds.
virtual StatusCode finalize()
Finalize (from INITIALIZED to CONFIGURED).
ISerialize * m_serialize
Serialization interface of random number engine.
SmartIF< ISvcLocator > & serviceLocator() const
Retrieve pointer to service locator.
virtual StatusCode queryInterface(const InterfaceID &ti, void **pp)=0
Set the void** to the pointer to the requested interface of the instance.