9 #include "CLHEP/Random/engineIDulong.h"
10 #include "CLHEP/Random/JamesRandom.h"
11 #include "CLHEP/Random/RanecuEngine.h"
12 #include "CLHEP/Random/MixMaxRng.h"
19 const std::vector<RandomEngineState> s_dummyStates;
40 std::vector<unsigned long> stateL =
engine_->put();
42 long seedL =
engine_->getSeed();
47 std::vector<unsigned long>
const& stateL,
long seedL)
const {
48 std::unique_ptr<CLHEP::HepRandomEngine> newEngine;
49 if (stateL[0] == CLHEP::engineIDulong<CLHEP::HepJamesRandom>()) {
50 newEngine = std::make_unique<CLHEP::HepJamesRandom>(seedL);
51 }
else if (stateL[0] == CLHEP::engineIDulong<CLHEP::RanecuEngine>()) {
52 newEngine = std::make_unique<CLHEP::RanecuEngine>();
53 }
else if (stateL[0] == CLHEP::engineIDulong<CLHEP::MixMaxRng>()) {
54 newEngine = std::make_unique<CLHEP::MixMaxRng>(seedL);
60 <<
"The ExternalRandomNumberGeneratorService is trying to clone unknown engine type\n";
62 if (stateL[0] != CLHEP::engineIDulong<CLHEP::RanecuEngine>()) {
63 newEngine->setSeed(seedL, 0);
65 newEngine->get(stateL);
76 std::vector<RandomEngineState>
const& iStates) {}
std::unique_ptr< CLHEP::HepRandomEngine > engine_
void print(std::ostream &os) const final
For debugging purposes only.
std::unique_ptr< CLHEP::HepRandomEngine > cloneEngine(LuminosityBlockIndex const &) final
void setState(std::vector< unsigned long > const &, long seed)
void setLumiCache(LuminosityBlockIndex, std::vector< RandomEngineState > const &iStates) final
CLHEP::HepRandomEngine & getEngine(StreamID const &) final
Use this engine in event methods.
std::vector< RandomEngineState > const & getEventCache(StreamID const &) const final
std::vector< RandomEngineState > const & getLumiCache(LuminosityBlockIndex const &) const final
std::vector< unsigned long > getState() const
void consumes(ConsumesCollector &&iC) const final
std::uint32_t mySeed() const final
void preBeginLumi(LuminosityBlock const &lumi) final
std::unique_ptr< CLHEP::HepRandomEngine > createFromState(std::vector< unsigned long > const &, long seed) const
ExternalRandomNumberGeneratorService()
void postEventRead(Event const &event) final
void setEventCache(StreamID, std::vector< RandomEngineState > const &iStates) final