CMS 3D CMS Logo

RandomEngineStateProducer.cc
Go to the documentation of this file.
1 
3 
11 
12 #include <memory>
13 
15  produces<edm::RandomEngineStates, edm::Transition::BeginLuminosityBlock>("beginLumi");
16  produces<edm::RandomEngineStates>();
17 }
18 
20 
23  if (randomService.isAvailable()) {
24  auto states = std::make_unique<edm::RandomEngineStates>();
25  states->setRandomEngineStates(randomService->getEventCache(ev.streamID()));
26  ev.put(std::move(states));
27  }
28 }
29 
31  edm::EventSetup const&) const {
33  if (randomService.isAvailable()) {
34  auto states = std::make_unique<edm::RandomEngineStates>();
35  states->setRandomEngineStates(randomService->getLumiCache(lb.index()));
36  lb.put(std::move(states), "beginLumi");
37  }
38 }
39 
42  descriptions.add("randomEngineStateProducer", desc);
43 }
virtual std::vector< RandomEngineState > const & getLumiCache(LuminosityBlockIndex const &) const =0
RandomEngineStateProducer(edm::ParameterSet const &pset)
void put(std::unique_ptr< PROD > product)
Put a new product.
virtual std::vector< RandomEngineState > const & getEventCache(StreamID const &) const =0
void add(std::string const &label, ParameterSetDescription const &psetDescription)
LuminosityBlockIndex index() const
void globalBeginLuminosityBlockProduce(edm::LuminosityBlock &, edm::EventSetup const &) const override
void produce(edm::StreamID iID, edm::Event &ev, edm::EventSetup const &es) const override
bool isAvailable() const
Definition: Service.h:40
def move(src, dest)
Definition: eostools.py:511
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)