15 #define GAUDI_RANDOMGENSVC_RNDMGENSVC_CPP
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";
62 engine = mgr->createService(TypeNameString(machName,
m_engineName));
68 status = service->sysInitialize();
91 service->finalize().ignore();
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.
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.
#define DECLARE_COMPONENT(type)
virtual StatusCode setSeeds(const std::vector< long > &seeds)
Allow to set new seeds.
Random Generator service definition.
Helper class to parse a string of format "type/name".
bool isValid() const
Allow for check if smart pointer is valid.
virtual StatusCode generator(const IRndmGen::Param &par, IRndmGen *&refpGen)
Retrieve a valid generator from the service.
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.
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.
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).
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).
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
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.