CMS 3D CMS Logo

MTDDigiProducer.cc
Go to the documentation of this file.
9 
10 //
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  auto temp = MTDDigitizerFactory::get()->create(digitizerName,ps,iC,mixMod);
22  theDigitizers_.emplace_back(temp);
23  }
24 }
25 
26 //
28 {
29 }
30 
31 //
33 {
35  randomEngine_ = &rng->getEngine(event.streamID());
36  for( auto& digitizer : theDigitizers_ ) {
37  digitizer->initializeEvent(event, es);
38  }
39 }
40 
41 //
43 {
44  for( auto& digitizer : theDigitizers_ ) {
45  digitizer->finalizeEvent(event, es, randomEngine_);
46  }
47  randomEngine_ = nullptr; // to prevent access outside event
48 }
49 
50 //
52 {
53  for( auto& digitizer : theDigitizers_ ) {
54  digitizer->accumulate(event, es, randomEngine_);
55  }
56 }
57 
59 {
60  for( auto& digitizer : theDigitizers_ ) {
61  digitizer->accumulate(event, es, randomEngine_);
62  }
63 }
64 
65 //
67 {
68  for( auto& digitizer : theDigitizers_ ) {
69  digitizer->beginRun(es);
70  }
71 }
72 
73 //
75 {
76  for( auto& digitizer : theDigitizers_ ) {
77  digitizer->endRun();
78  }
79 }
~MTDDigiProducer() override
void endRun(edm::Run const &, edm::EventSetup const &) override
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
MTDDigiProducer(edm::ParameterSet const &pset, edm::ProducerBase &mixMod, edm::ConsumesCollector &iC)
size_t getParameterSetNames(std::vector< std::string > &output, bool trackiness=true) const
T get(const Candidate &c)
Definition: component.h:55
Definition: event.py:1
Definition: Run.h:44