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)
39 declareProperty(
"Engine", m_engineName =
"HepRndm::Engine<CLHEP::RanluxEngine>");
50 status = setProperties();
54 std::string machName =
name()+
".Engine";
63 if ( serial && service ) {
64 status = service->sysInitialize();
101 log <<
MSG::ERROR <<
"Cannot output serialize Generator settings!" <<
endmsg;
117 refpGen = pGen.get();
virtual StatusCode initialize(const IRndmGen::Param &par)=0
Initialize the generator.
Definition of the MsgStream class used to transmit messages.
StatusCode initialize() override
virtual StatusCode rndmArray(std::vector< double > &array, long howmany, long start=0) const =0
Multiple shots returning vector with flat random numbers.
StreamBuffer & serialize(StreamBuffer &str) override
IRndmGenSvc interface implementation.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
StatusCode initialize() override
Service override: initialization.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
StatusCode finalize() override
StatusCode finalize() override
Service override: finalization.
The ISvcManager is the interface implemented by the Service Factory in the Application Manager to sup...
The stream buffer is a small object collecting object data.
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.
SmartIF< IRndmEngine > m_engine
Random number engine.
Random Generator service definition.
TYPE * get() const
Get interface pointer.
SmartIF< IFace > as() const
return a new SmartIF instance to another interface
Helper class to parse a string of format "type/name".
General service interface definition.
This class is used for returning status codes from appropriate routines.
virtual double rndm() const =0
Single shot returning single random number.
virtual StreamBuffer & serialize(StreamBuffer &str)=0
Input serialization from stream buffer.
#define DECLARE_COMPONENT(type)
StatusCode seeds(std::vector< long > &seeds) const override
Allow to get seeds.
StatusCode generator(const IRndmGen::Param &par, IRndmGen *&refpGen) override
Retrieve a valid generator from the service.
virtual StatusCode setSeeds(const std::vector< long > &seeds)=0
Allow to set new seeds.
StatusCode rndmArray(std::vector< double > &array, long howmany, long start=0) const override
Multiple shots returning vector with flat random numbers.
double rndm() const override
Single shot returning single random number.
struct GAUDI_API array
Parametrisation class for redirection array - like implementation.
StatusCode setSeeds(const std::vector< long > &seeds) override
Allow to set new seeds.
virtual unsigned long addRef()=0
Increment the reference count of Interface instance.
Definition of a interface for a generic random number generator giving randomly distributed numbers i...
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
IRndmEngine * engine() override
Retrieve engine.
SmartIF< ISerialize > m_serialize
Serialization interface of random number engine.
Object serialization interface definition.
virtual StatusCode seeds(std::vector< long > &seeds) const =0
Allow to retrieve seeds.