Skip to content

Commit

Permalink
Migrate PFSimParticleProducer to esConsumes()
Browse files Browse the repository at this point in the history
  • Loading branch information
makortel committed Aug 18, 2021
1 parent f24ac41 commit 7c5f4bd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions RecoParticleFlow/PFSimProducer/plugins/PFSimParticleProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include "DataFormats/TrackReco/interface/Track.h"
#include "DataFormats/TrackReco/interface/TrackFwd.h"
#include "DataFormats/TrackerRecHit2D/interface/FastTrackerRecHit.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/stream/EDProducer.h"
Expand Down Expand Up @@ -94,6 +93,8 @@ class PFSimParticleProducer : public edm::stream::EDProducer<> {
edm::InputTag inputTagEcalRecHitsEE_;
edm::EDGetTokenT<EcalRecHitCollection> tokenEcalRecHitsEE_;

edm::ESGetToken<HepPDT::ParticleDataTable, edm::DefaultRecord> pdtToken_;

// parameters for retrieving true particles information --

edm::ParameterSet particleFilter_;
Expand Down Expand Up @@ -160,6 +161,8 @@ PFSimParticleProducer::PFSimParticleProducer(const edm::ParameterSet& iConfig) {
inputTagEcalRecHitsEE_ = iConfig.getParameter<InputTag>("ecalRecHitsEE");
tokenEcalRecHitsEE_ = consumes<EcalRecHitCollection>(inputTagEcalRecHitsEE_);

pdtToken_ = esConsumes();

verbose_ = iConfig.getUntrackedParameter<bool>("verbose", false);

// register products
Expand All @@ -172,10 +175,7 @@ PFSimParticleProducer::PFSimParticleProducer(const edm::ParameterSet& iConfig) {

void PFSimParticleProducer::produce(Event& iEvent, const EventSetup& iSetup) {
// init Particle data table (from Pythia)
edm::ESHandle<HepPDT::ParticleDataTable> pdt;
// edm::ESHandle < DefaultConfig::ParticleDataTable > pdt;
iSetup.getData(pdt);
mySimEvent->initializePdt(&(*pdt));
mySimEvent->initializePdt(&iSetup.getData(pdtToken_));

LogDebug("PFSimParticleProducer") << "START event: " << iEvent.id().event() << " in run " << iEvent.id().run()
<< endl;
Expand Down

0 comments on commit 7c5f4bd

Please sign in to comment.