Skip to content

Commit

Permalink
Call setEventSetup() only in Event functions in EcalDigiProducer and …
Browse files Browse the repository at this point in the history
…..._Ph2

The call was already there for premixing.
  • Loading branch information
makortel committed Aug 19, 2021
1 parent 71492b2 commit 9ebd1a9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ class EcalDigiProducer : public DigiAccumulatorMixMod {
void accumulate(PileUpEventPrincipal const &e, edm::EventSetup const &c, edm::StreamID const &) override;
void finalizeEvent(edm::Event &e, edm::EventSetup const &c) override;
void beginLuminosityBlock(edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) override;
void beginRun(edm::Run const &run, edm::EventSetup const &setup) override;

void setEBNoiseSignalGenerator(EcalBaseSignalGenerator *noiseGenerator);
void setEENoiseSignalGenerator(EcalBaseSignalGenerator *noiseGenerator);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ class EcalDigiProducer_Ph2 : public DigiAccumulatorMixMod {
void accumulate(PileUpEventPrincipal const& e, edm::EventSetup const& c, edm::StreamID const&) override;
void finalizeEvent(edm::Event& e, edm::EventSetup const& c) override;
void beginLuminosityBlock(edm::LuminosityBlock const& lumi, edm::EventSetup const& setup) override;
void beginRun(edm::Run const& run, edm::EventSetup const& setup) override;

void setEBNoiseSignalGenerator(EcalBaseSignalGenerator* noiseGenerator);

Expand Down
14 changes: 3 additions & 11 deletions SimCalorimetry/EcalSimProducers/src/EcalDigiProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -312,17 +312,15 @@ void EcalDigiProducer::accumulate(edm::Event const &e, edm::EventSetup const &ev
// Step A: Get Inputs
edm::Handle<std::vector<PCaloHit>> ebHandle;
if (m_doEB) {
m_EBShape.setEventSetup(eventSetup); // need to set the eventSetup here, otherwise pre-mixing
// module will not wrk
m_APDShape.setEventSetup(eventSetup); //
m_EBShape.setEventSetup(eventSetup);
m_APDShape.setEventSetup(eventSetup);
edm::InputTag ebTag(m_hitsProducerTag, "EcalHitsEB");
e.getByLabel(ebTag, ebHandle);
}

edm::Handle<std::vector<PCaloHit>> eeHandle;
if (m_doEE) {
m_EEShape.setEventSetup(eventSetup); // need to set the eventSetup here, otherwise pre-mixing
// module will not work
m_EEShape.setEventSetup(eventSetup);
edm::InputTag eeTag(m_hitsProducerTag, "EcalHitsEE");
e.getByLabel(eeTag, eeHandle);
}
Expand Down Expand Up @@ -572,9 +570,3 @@ void EcalDigiProducer::setESNoiseSignalGenerator(EcalBaseSignalGenerator *noiseG
if (nullptr != m_ESDigitizer)
m_ESDigitizer->setNoiseSignalGenerator(noiseGenerator);
}

void EcalDigiProducer::beginRun(edm::Run const &run, edm::EventSetup const &setup) {
m_EBShape.setEventSetup(setup);
m_EEShape.setEventSetup(setup);
m_APDShape.setEventSetup(setup);
}
9 changes: 2 additions & 7 deletions SimCalorimetry/EcalSimProducers/src/EcalDigiProducer_Ph2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@ void EcalDigiProducer_Ph2::accumulate(edm::Event const& e, edm::EventSetup const
// Step A: Get Inputs
edm::Handle<std::vector<PCaloHit>> ebHandle;

m_EBShape.setEventSetup(eventSetup); // need to set the eventSetup here, otherwise pre-mixing module will not wrk
m_APDShape.setEventSetup(eventSetup); //
m_EBShape.setEventSetup(eventSetup);
m_APDShape.setEventSetup(eventSetup);
edm::InputTag ebTag(m_hitsProducerTag, "EcalHitsEB");
e.getByLabel(ebTag, ebHandle);

Expand Down Expand Up @@ -325,8 +325,3 @@ void EcalDigiProducer_Ph2::updateGeometry() {
void EcalDigiProducer_Ph2::setEBNoiseSignalGenerator(EcalBaseSignalGenerator* noiseGenerator) {
m_BarrelDigitizer->setNoiseSignalGenerator(noiseGenerator);
}

void EcalDigiProducer_Ph2::beginRun(edm::Run const& run, edm::EventSetup const& setup) {
m_EBShape.setEventSetup(setup);
m_APDShape.setEventSetup(setup);
}

0 comments on commit 9ebd1a9

Please sign in to comment.