Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate PFSimParticleProducer to esConsumes() #34938

Merged
merged 1 commit into from
Aug 21, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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