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 }
21 
22 void
25  if(randomService.isAvailable()) {
26  auto states = std::make_unique<edm::RandomEngineStates>();
27  states->setRandomEngineStates(randomService->getEventCache(ev.streamID()));
28  ev.put(std::move(states));
29  }
30 }
31 
32 void
35  if(randomService.isAvailable()) {
36  auto states = std::make_unique<edm::RandomEngineStates>();
37  states->setRandomEngineStates(randomService->getLumiCache(lb.index()));
38  lb.put(std::move(states), "beginLumi");
39  }
40 }
41 
42 void
45  descriptions.add("randomEngineStateProducer", desc);
46 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
LuminosityBlockIndex index() const
virtual std::vector< RandomEngineState > const & getLumiCache(LuminosityBlockIndex const &) const =0
bool ev
void produce(edm::StreamID iID, edm::Event &ev, edm::EventSetup const &es) const override
RandomEngineStateProducer(edm::ParameterSet const &pset)
void put(std::unique_ptr< PROD > product)
Put a new product.
bool isAvailable() const
Definition: Service.h:46
virtual std::vector< RandomEngineState > const & getEventCache(StreamID const &) const =0
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void globalBeginLuminosityBlockProduce(edm::LuminosityBlock &, edm::EventSetup const &) const override
StreamID streamID() const
Definition: Event.h:96
def move(src, dest)
Definition: eostools.py:510
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)