CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
MTDDigiProducer.cc
Go to the documentation of this file.
8 
9 //
11  edm::ProducesCollector producesCollector,
14  std::vector<std::string> psetNames;
15 
16  pset.getParameterSetNames(psetNames);
17 
18  for (const auto& psname : psetNames) {
19  const auto& ps = pset.getParameterSet(psname);
20  const std::string& digitizerName = ps.getParameter<std::string>("digitizerName");
21  theDigitizers_.emplace_back(MTDDigitizerFactory::get()->create(digitizerName, ps, producesCollector, iC));
22  }
23 }
24 
25 //
27 
28 //
31  randomEngine_ = &rng->getEngine(event.streamID());
32  for (auto& digitizer : theDigitizers_) {
33  digitizer->initializeEvent(event, es);
34  }
35 }
36 
37 //
39  for (auto& digitizer : theDigitizers_) {
40  digitizer->finalizeEvent(event, es, randomEngine_);
41  }
42  randomEngine_ = nullptr; // to prevent access outside event
43 }
44 
45 //
47  for (auto& digitizer : theDigitizers_) {
48  digitizer->accumulate(event, es, randomEngine_);
49  }
50 }
51 
53  edm::EventSetup const& es,
54  edm::StreamID const& streamID) {
55  for (auto& digitizer : theDigitizers_) {
56  digitizer->accumulate(event, es, randomEngine_);
57  }
58 }
~MTDDigiProducer() override
MTDDigiProducer(edm::ParameterSet const &pset, edm::ProducesCollector, edm::ConsumesCollector &iC)
void initializeEvent(edm::Event const &, edm::EventSetup const &) override
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
void finalizeEvent(edm::Event &, edm::EventSetup const &) override
std::vector< std::unique_ptr< MTDDigitizerBase > > theDigitizers_
CLHEP::HepRandomEngine * randomEngine_
void accumulate(edm::Event const &, edm::EventSetup const &) override
ParameterSet const & getParameterSet(std::string const &) const
StreamID streamID() const
Definition: Event.h:98
#define get
size_t getParameterSetNames(std::vector< std::string > &output, bool trackiness=true) const