CMS 3D CMS Logo

HcalDigiProducer.cc
Go to the documentation of this file.
7 
10  theDigitizer_(pset, iC) {
11  mixMod.produces<HBHEDigiCollection>();
12  mixMod.produces<HODigiCollection>();
13  mixMod.produces<HFDigiCollection>();
14  mixMod.produces<ZDCDigiCollection>();
15  mixMod.produces<QIE10DigiCollection>("HFQIE10DigiCollection");
16  mixMod.produces<QIE11DigiCollection>("HBHEQIE11DigiCollection");
17  if(pset.getParameter<bool>("debugCaloSamples")){
18  mixMod.produces<CaloSamplesCollection>("HcalSamples");
19  }
20  if(pset.getParameter<bool>("injectTestHits")){
21  mixMod.produces<edm::PCaloHitContainer>("HcalHits");
22  }
23 }
24 
25 
28  theDigitizer_(pset, iC) {
29 }
30 
31 
32 void
34  theDigitizer_.initializeEvent(event, es);
35 }
36 
37 void
39  theDigitizer_.finalizeEvent(event, es, randomEngine(event.streamID()));
40 }
41 
42 void
44  theDigitizer_.accumulate(event, es, randomEngine(event.streamID()));
45 }
46 
47 void
49  theDigitizer_.accumulate(event, es, randomEngine(streamID));
50 }
51 
52 void
54 
55 void
57 
58 void
61 }
62 
63 void
66 }
67 
68 void
71 }
72 
73 void
76 }
77 
78 void
81 }
82 
83 void
86 }
87 
88 CLHEP::HepRandomEngine* HcalDigiProducer::randomEngine(edm::StreamID const& streamID) {
89  unsigned int index = streamID.value();
90  if(index >= randomEngines_.size()) {
91  randomEngines_.resize(index + 1, nullptr);
92  }
93  CLHEP::HepRandomEngine* ptr = randomEngines_[index];
94  if(!ptr) {
96  ptr = &rng->getEngine(streamID);
97  randomEngines_[index] = ptr;
98  }
99  return ptr;
100 }
BranchAliasSetterT< ProductType > produces()
declare what type of product will make and with which optional label
T getParameter(std::string const &) const
std::vector< PCaloHit > PCaloHitContainer
void accumulate(edm::Event const &, edm::EventSetup const &) override
void setQIE10NoiseSignalGenerator(HcalBaseSignalGenerator *noiseGenerator)
std::vector< CaloSamples > CaloSamplesCollection
Definition: CaloSamples.h:88
CLHEP::HepRandomEngine * randomEngine(edm::StreamID const &streamID)
void setQIE10NoiseSignalGenerator(HcalBaseSignalGenerator *noiseGenerator)
void endRun(edm::Run const &, edm::EventSetup const &) override
HcalDigiProducer(edm::ParameterSet const &pset, edm::ProducerBase &mixMod, edm::ConsumesCollector &iC)
void setQIE11NoiseSignalGenerator(HcalBaseSignalGenerator *noiseGenerator)
std::vector< CLHEP::HepRandomEngine * > randomEngines_
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
void initializeEvent(edm::Event const &e, edm::EventSetup const &c)
void accumulate(edm::Event const &e, edm::EventSetup const &c, CLHEP::HepRandomEngine *)
void setQIE11NoiseSignalGenerator(HcalBaseSignalGenerator *noiseGenerator)
void finalizeEvent(edm::Event &, edm::EventSetup const &) override
void setHFNoiseSignalGenerator(HcalBaseSignalGenerator *noiseGenerator)
void initializeEvent(edm::Event const &, edm::EventSetup const &) override
unsigned int value() const
Definition: StreamID.h:46
void setZDCNoiseSignalGenerator(HcalBaseSignalGenerator *noiseGenerator)
void setZDCNoiseSignalGenerator(HcalBaseSignalGenerator *noiseGenerator)
void beginRun(edm::Run const &, edm::EventSetup const &) override
StreamID streamID() const
Definition: Event.h:95
HcalDigitizer theDigitizer_
void setHONoiseSignalGenerator(HcalBaseSignalGenerator *noiseGenerator)
void setHFNoiseSignalGenerator(HcalBaseSignalGenerator *noiseGenerator)
void setHBHENoiseSignalGenerator(HcalBaseSignalGenerator *noiseGenerator)
void setHBHENoiseSignalGenerator(HcalBaseSignalGenerator *noiseGenerator)
Definition: event.py:1
Definition: Run.h:43
void finalizeEvent(edm::Event &e, edm::EventSetup const &c, CLHEP::HepRandomEngine *)
void setHONoiseSignalGenerator(HcalBaseSignalGenerator *noiseGenerator)