CMS 3D CMS Logo

RandomIntProducer.cc
Go to the documentation of this file.
5 
10 
11 #include "DataFormats/TestObjects/interface/ToyProducts.h"
12 
13 #include "CLHEP/Random/RandFlat.h"
14 
15 namespace edmtest {
16  class RandomIntProducer : public edm::one::EDProducer<edm::BeginLuminosityBlockProducer> {
17  public:
19 
20  void produce(edm::Event&, edm::EventSetup const&) final;
21 
23 
24  private:
27  };
29  : evToken_{produces<IntProduct>()},
30  lumiToken_{produces<IntProduct, edm::Transition::BeginLuminosityBlock>("lumi")} {}
31 
34  iEvent.emplace(evToken_, CLHEP::RandFlat::shootInt(&gen->getEngine(iEvent.streamID()), 10));
35  }
36 
39  iLumi.emplace(lumiToken_, CLHEP::RandFlat::shootInt(&gen->getEngine(iLumi.index()), 10));
40  }
41 
42 } // namespace edmtest
43 
44 using namespace edmtest;
edm::EDPutTokenT< IntProduct > const evToken_
int iEvent
Definition: GenABIO.cc:224
void produce(edm::Event &, edm::EventSetup const &) final
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
def gen(fragment, howMuch)
Production test section ####.
edm::EDPutTokenT< IntProduct > const lumiToken_
void beginLuminosityBlockProduce(edm::LuminosityBlock &, edm::EventSetup const &) final
void emplace(EDPutTokenT< PROD > token, Args &&... args)
puts a new product
RandomIntProducer(edm::ParameterSet const &iPSet)
LuminosityBlockIndex index() const