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  theDigitizers_.emplace_back(MTDDigitizerFactory::get()->create(digitizerName,ps,iC,mixMod));
22  }
23 }
24 
25 //
27 {
28 }
29 
30 //
32 {
34  randomEngine_ = &rng->getEngine(event.streamID());
35  for( auto& digitizer : theDigitizers_ ) {
36  digitizer->initializeEvent(event, es);
37  }
38 }
39 
40 //
42 {
43  for( auto& digitizer : theDigitizers_ ) {
44  digitizer->finalizeEvent(event, es, randomEngine_);
45  }
46  randomEngine_ = nullptr; // to prevent access outside event
47 }
48 
49 //
51 {
52  for( auto& digitizer : theDigitizers_ ) {
53  digitizer->accumulate(event, es, randomEngine_);
54  }
55 }
56 
58 {
59  for( auto& digitizer : theDigitizers_ ) {
60  digitizer->accumulate(event, es, randomEngine_);
61  }
62 }
63 
64 //
66 {
67  for( auto& digitizer : theDigitizers_ ) {
68  digitizer->beginRun(es);
69  }
70 }
71 
72 //
74 {
75  for( auto& digitizer : theDigitizers_ ) {
76  digitizer->endRun();
77  }
78 }
~MTDDigiProducer() override
def create(alignables, pedeDump, additionalData, outputFile, config)
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:95
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:45