15 #define GAUDI_RANDOMGENSVC_RNDMGENSVC_CPP
36 : base_class(nam, svc)
38 declareProperty(
"Engine", m_engineName =
"HepRndm::Engine<CLHEP::RanluxEngine>");
61 if ( serial && service ) {
62 status = service->sysInitialize();
90 error() <<
"Cannot input serialize Generator settings!" <<
endmsg;
97 error() <<
"Cannot output serialize Generator settings!" <<
endmsg;
113 refpGen = pGen.get();
virtual StatusCode initialize(const IRndmGen::Param &par)=0
Initialize the generator.
StatusCode initialize() override
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
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.
StatusCode finalize() override
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
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.
#define DECLARE_COMPONENT(type)
Random Generator service definition.
TYPE * get() const
Get interface pointer.
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
const std::string & name() const override
Retrieve name of the service.
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
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.
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.
StatusCode setProperties()
Method for setting declared properties to the values specified for the job.
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.
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...
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.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.