CMS 3D CMS Logo

HGCDigiProducer.cc
Go to the documentation of this file.
9 
10 //
14  theDigitizer_(new HGCDigitizer(pset, iC) )
15 {
16  if( theDigitizer_->producesEEDigis() )
17  mixMod.produces<HGCEEDigiCollection>(theDigitizer_->digiCollection());
18  if( theDigitizer_->producesHEfrontDigis() )
19  mixMod.produces<HGCHEDigiCollection>(theDigitizer_->digiCollection());
20  if( theDigitizer_->producesHEbackDigis() )
21  mixMod.produces<HGCBHDigiCollection>(theDigitizer_->digiCollection());
22 }
23 
26  theDigitizer_(new HGCDigitizer(pset, iC)) {
27 }
28 
29 //
31 {
32 }
33 
34 //
36 {
37  theDigitizer_->initializeEvent(event, es);
38 }
39 
40 //
42 {
43  theDigitizer_->finalizeEvent(event, es, randomEngine(event.streamID()));
44 }
45 
46 //
48 {
49  theDigitizer_->accumulate(event, es, randomEngine(event.streamID()));
50 }
51 
53 {
54  theDigitizer_->accumulate(event, es, randomEngine(streamID));
55 }
56 
57 //
59 {
60  theDigitizer_->beginRun(es);
61 }
62 
63 //
65 {
66  theDigitizer_->endRun();
67 }
68 
69 CLHEP::HepRandomEngine* HGCDigiProducer::randomEngine(edm::StreamID const& streamID) {
70  unsigned int index = streamID.value();
71  if(index >= randomEngines_.size()) {
72  randomEngines_.resize(index + 1, nullptr);
73  }
74  CLHEP::HepRandomEngine* ptr = randomEngines_[index];
75  if(!ptr) {
77  ptr = &rng->getEngine(streamID);
78  randomEngines_[index] = ptr;
79  }
80  return ptr;
81 }
82 
virtual void beginRun(edm::Run const &, edm::EventSetup const &) override
CLHEP::HepRandomEngine * randomEngine(edm::StreamID const &streamID)
std::vector< CLHEP::HepRandomEngine * > randomEngines_
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
HGCDigiProducer(edm::ParameterSet const &pset, edm::stream::EDProducerBase &mixMod, edm::ConsumesCollector &iC)
virtual void accumulate(edm::Event const &, edm::EventSetup const &) override
std::unique_ptr< HGCDigitizer > theDigitizer_
unsigned int value() const
Definition: StreamID.h:46
virtual void endRun(edm::Run const &, edm::EventSetup const &) override
#define DEFINE_DIGI_ACCUMULATOR(type)
StreamID streamID() const
Definition: Event.h:81
virtual void finalizeEvent(edm::Event &, edm::EventSetup const &) override
virtual void initializeEvent(edm::Event const &, edm::EventSetup const &) override
Definition: event.py:1
Definition: Run.h:42