#include <RandomEngineStateProducer.h>
Public Member Functions | |
RandomEngineStateProducer (edm::ParameterSet const &pset) | |
~RandomEngineStateProducer () | |
Static Public Member Functions | |
static void | fillDescriptions (edm::ConfigurationDescriptions &descriptions) |
Private Member Functions | |
virtual void | beginLuminosityBlock (edm::LuminosityBlock &lb, edm::EventSetup const &es) |
virtual void | produce (edm::Event &ev, edm::EventSetup const &es) |
Description: Gets the state of the random number engines from the related service and stores it in the event.
Implementation: This simply copies from the cache in the service and puts the product in the Event and LuminosityBlock. The cache is filled at the beginning of processing for eac event or lumi by a call from the InputSource to the service. This module gets called later.
Definition at line 28 of file RandomEngineStateProducer.h.
RandomEngineStateProducer::RandomEngineStateProducer | ( | edm::ParameterSet const & | pset | ) | [explicit] |
Definition at line 14 of file RandomEngineStateProducer.cc.
{
produces<edm::RandomEngineStates, edm::InLumi>("beginLumi");
produces<edm::RandomEngineStates>();
}
RandomEngineStateProducer::~RandomEngineStateProducer | ( | ) |
Definition at line 19 of file RandomEngineStateProducer.cc.
{ }
void RandomEngineStateProducer::beginLuminosityBlock | ( | edm::LuminosityBlock & | lb, |
edm::EventSetup const & | es | ||
) | [private, virtual] |
Reimplemented from edm::EDProducer.
Definition at line 33 of file RandomEngineStateProducer.cc.
References edm::Service< T >::isAvailable(), and edm::LuminosityBlock::put().
{ edm::Service<edm::RandomNumberGenerator> randomService; if(randomService.isAvailable()) { std::auto_ptr<edm::RandomEngineStates> states(new edm::RandomEngineStates); states->setRandomEngineStates(randomService->getLumiCache()); lb.put(states, "beginLumi"); } }
void RandomEngineStateProducer::fillDescriptions | ( | edm::ConfigurationDescriptions & | descriptions | ) | [static] |
Reimplemented from edm::EDProducer.
Definition at line 43 of file RandomEngineStateProducer.cc.
References edm::ConfigurationDescriptions::add().
{ edm::ParameterSetDescription desc; descriptions.add("randomEngineStateProducer", desc); }
void RandomEngineStateProducer::produce | ( | edm::Event & | ev, |
edm::EventSetup const & | es | ||
) | [private, virtual] |
Implements edm::EDProducer.
Definition at line 23 of file RandomEngineStateProducer.cc.
References edm::Service< T >::isAvailable(), and edm::Event::put().
{ edm::Service<edm::RandomNumberGenerator> randomService; if(randomService.isAvailable()) { std::auto_ptr<edm::RandomEngineStates> states(new edm::RandomEngineStates); states->setRandomEngineStates(randomService->getEventCache()); ev.put(states); } }