Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-08-23 03:25:36

0001 #include "FWCore/Framework/interface/Event.h"
0002 #include "FWCore/ServiceRegistry/interface/Service.h"
0003 #include "FWCore/Utilities/interface/RandomNumberGenerator.h"
0004 #include "FWCore/Utilities/interface/StreamID.h"
0005 #include "SimCalorimetry/HcalSimProducers/interface/HcalDigiProducer.h"
0006 
0007 HcalDigiProducer::HcalDigiProducer(edm::ParameterSet const &pset,
0008                                    edm::ProducesCollector producesCollector,
0009                                    edm::ConsumesCollector &iC)
0010     : DigiAccumulatorMixMod(), theDigitizer_(pset, iC) {
0011   producesCollector.produces<HBHEDigiCollection>();
0012   producesCollector.produces<HODigiCollection>();
0013   producesCollector.produces<HFDigiCollection>();
0014   producesCollector.produces<ZDCDigiCollection>();
0015   producesCollector.produces<QIE10DigiCollection>("HFQIE10DigiCollection");
0016   producesCollector.produces<QIE11DigiCollection>("HBHEQIE11DigiCollection");
0017   if (pset.getParameter<bool>("debugCaloSamples")) {
0018     producesCollector.produces<CaloSamplesCollection>("HcalSamples");
0019   }
0020   if (pset.getParameter<bool>("injectTestHits")) {
0021     producesCollector.produces<edm::PCaloHitContainer>("HcalHits");
0022   }
0023 }
0024 
0025 HcalDigiProducer::HcalDigiProducer(edm::ParameterSet const &pset, edm::ConsumesCollector &iC)
0026     : DigiAccumulatorMixMod(), theDigitizer_(pset, iC) {}
0027 
0028 void HcalDigiProducer::initializeEvent(edm::Event const &event, edm::EventSetup const &es) {
0029   edm::Service<edm::RandomNumberGenerator> rng;
0030   randomEngine_ = &rng->getEngine(event.streamID());
0031   theDigitizer_.initializeEvent(event, es);
0032 }
0033 
0034 void HcalDigiProducer::finalizeEvent(edm::Event &event, edm::EventSetup const &es) {
0035   theDigitizer_.finalizeEvent(event, es, randomEngine_);
0036   randomEngine_ = nullptr;  // to prevent access outside event
0037 }
0038 
0039 void HcalDigiProducer::accumulate(edm::Event const &event, edm::EventSetup const &es) {
0040   theDigitizer_.accumulate(event, es, randomEngine_);
0041 }
0042 
0043 void HcalDigiProducer::accumulate(PileUpEventPrincipal const &event,
0044                                   edm::EventSetup const &es,
0045                                   edm::StreamID const &streamID) {
0046   theDigitizer_.accumulate(event, es, randomEngine_);
0047 }
0048 
0049 void HcalDigiProducer::beginRun(edm::Run const &, edm::EventSetup const &es) {}
0050 
0051 void HcalDigiProducer::endRun(edm::Run const &, edm::EventSetup const &) {}
0052 
0053 void HcalDigiProducer::setHBHENoiseSignalGenerator(HcalBaseSignalGenerator *noiseGenerator) {
0054   theDigitizer_.setHBHENoiseSignalGenerator(noiseGenerator);
0055 }
0056 
0057 void HcalDigiProducer::setHFNoiseSignalGenerator(HcalBaseSignalGenerator *noiseGenerator) {
0058   theDigitizer_.setHFNoiseSignalGenerator(noiseGenerator);
0059 }
0060 
0061 void HcalDigiProducer::setHONoiseSignalGenerator(HcalBaseSignalGenerator *noiseGenerator) {
0062   theDigitizer_.setHONoiseSignalGenerator(noiseGenerator);
0063 }
0064 
0065 void HcalDigiProducer::setZDCNoiseSignalGenerator(HcalBaseSignalGenerator *noiseGenerator) {
0066   theDigitizer_.setZDCNoiseSignalGenerator(noiseGenerator);
0067 }
0068 
0069 void HcalDigiProducer::setQIE10NoiseSignalGenerator(HcalBaseSignalGenerator *noiseGenerator) {
0070   theDigitizer_.setQIE10NoiseSignalGenerator(noiseGenerator);
0071 }
0072 
0073 void HcalDigiProducer::setQIE11NoiseSignalGenerator(HcalBaseSignalGenerator *noiseGenerator) {
0074   theDigitizer_.setQIE11NoiseSignalGenerator(noiseGenerator);
0075 }