CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RandomEngineStateProducer.cc
Go to the documentation of this file.
1 
3 
11 
12 #include <memory>
13 
15  produces<edm::RandomEngineStates, edm::InLumi>("beginLumi");
16  produces<edm::RandomEngineStates>();
17 }
18 
20 }
21 
22 void
25  if(randomService.isAvailable()) {
26  std::auto_ptr<edm::RandomEngineStates> states(new edm::RandomEngineStates);
27  states->setRandomEngineStates(randomService->getEventCache());
28  ev.put(states);
29  }
30 }
31 
32 void
35  if(randomService.isAvailable()) {
36  std::auto_ptr<edm::RandomEngineStates> states(new edm::RandomEngineStates);
37  states->setRandomEngineStates(randomService->getLumiCache());
38  lb.put(states, "beginLumi");
39  }
40 }
41 
42 void
45  descriptions.add("randomEngineStateProducer", desc);
46 }
virtual std::vector< RandomEngineState > const & getLumiCache() const =0
virtual void produce(edm::Event &ev, edm::EventSetup const &es) override
virtual void beginLuminosityBlockProduce(edm::LuminosityBlock &lb, edm::EventSetup const &es) override
RandomEngineStateProducer(edm::ParameterSet const &pset)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:94
bool isAvailable() const
Definition: Service.h:47
void add(std::string const &label, ParameterSetDescription const &psetDescription)
virtual std::vector< RandomEngineState > const & getEventCache() const =0
void put(std::auto_ptr< PROD > product)
Put a new product.
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)