21 #include "CLHEP/Random/engineIDulong.h" 22 #include "CLHEP/Random/JamesRandom.h" 23 #include "CLHEP/Random/RanecuEngine.h" 24 #include "CLHEP/Random/MixMaxRng.h" 27 std::unique_ptr<CLHEP::HepRandomEngine>
cloneEngine(CLHEP::HepRandomEngine
const& existingEngine) {
28 std::vector<unsigned long> stateL = existingEngine.put();
29 long seedL = existingEngine.getSeed();
30 std::unique_ptr<CLHEP::HepRandomEngine> newEngine;
31 if (stateL[0] == CLHEP::engineIDulong<CLHEP::HepJamesRandom>()) {
32 newEngine = std::make_unique<CLHEP::HepJamesRandom>(seedL);
33 }
else if (stateL[0] == CLHEP::engineIDulong<CLHEP::RanecuEngine>()) {
34 newEngine = std::make_unique<CLHEP::RanecuEngine>();
35 }
else if (stateL[0] == CLHEP::engineIDulong<CLHEP::MixMaxRng>()) {
36 newEngine = std::make_unique<CLHEP::MixMaxRng>(seedL);
37 }
else if (stateL[0] == CLHEP::engineIDulong<TRandomAdaptor>()) {
38 newEngine = std::make_unique<TRandomAdaptor>(seedL);
43 newEngine->get(stateL);
std::unique_ptr< CLHEP::HepRandomEngine > cloneEngine(CLHEP::HepRandomEngine const &)