|
ATLAS Offline Software
|
Go to the documentation of this file.
10 #include "CLHEP/Random/MixMaxRng.h"
11 #include "CLHEP/Random/Ranlux64Engine.h"
12 #include "CLHEP/Random/RanecuEngine.h"
19 declareProperty(
"EngineType",
m_rngType,
"CLHEP RandomEngine type");
25 m_fact = [](void)->CLHEP::HepRandomEngine*{
29 m_fact = [](void)->CLHEP::HepRandomEngine*{
30 return new CLHEP::Ranlux64Engine();
33 m_fact = [](void)->CLHEP::HepRandomEngine*{
34 return new CLHEP::RanecuEngine();
37 m_fact = [](void)->CLHEP::HepRandomEngine*{
38 return new CLHEP::MixMaxRng();
41 ATH_MSG_WARNING(
"Supported Generator types are 'dSFMT', 'Ranlux64', 'Ranecu', 'MixMax'");
43 return StatusCode::FAILURE;
46 return StatusCode::SUCCESS;
56 std::string rngName =
client->name();
60 std::lock_guard<std::mutex> lock(
m_mutex);
67 m_wrappers.insert( std::make_pair(rngName, wrp) );
80 CLHEP::HepRandomEngine* engine( *wrapper );
83 std::vector<unsigned long> rngStates = engine->put();
86 std::string rngName =
client->name();
88 std::lock_guard<std::mutex> lock(
m_mutex);
91 for(
const unsigned long s : rngStates) {
92 msg() << (
s & 0xffffffff
u) <<
" ";
101 delete wrapperPair.second;
AthRNGSvc(const std::string &name, ISvcLocator *svc)
Standard constructor.
virtual ATHRNG::RNGWrapper * getEngine(const INamedInterface *client, const std::string &streamName="") override final
IAthRNGSvc method to retrieve the random number wrapper.
@ u
Enums for curvilinear frames.
::StatusCode StatusCode
StatusCode definition for legacy code.
StatusCode initialize() override final
Initialize the service.
std::string m_rngType
Random number engine type (e.g. dSFMT, ranecu)
AthROOTErrorHandlerSvc * svc
A wrapper class for event-slot-local random engines.
#define ATH_MSG_WARNING(x)
std::unordered_map< std::string, ATHRNG::RNGWrapper * > m_wrappers
The structure for storing the RNGWrappers.
std::mutex m_mutex
Mutex for protecting access to the wrapper structure.
size_t getNSlots()
Return the number of event slots.
Maintain a set of objects, one per slot.
virtual void printEngineState(const INamedInterface *client, const std::string &streamName="") override final
Print engine state.