CMS 3D CMS Logo

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 }
59 
60 //
62  for (auto& digitizer : theDigitizers_) {
63  digitizer->beginRun(es);
64  }
65 }
66 
67 //
69  for (auto& digitizer : theDigitizers_) {
70  digitizer->endRun();
71  }
72 }
~MTDDigiProducer() override
def create(alignables, pedeDump, additionalData, outputFile, config)
void endRun(edm::Run const &, edm::EventSetup const &) 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_
void beginRun(edm::Run const &, edm::EventSetup const &) override
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:96
size_t getParameterSetNames(std::vector< std::string > &output, bool trackiness=true) const
Definition: event.py:1
Definition: Run.h:45