Skip to content

Commit

Permalink
Merge pull request #37201 from bsunanda/Run3-sim112
Browse files Browse the repository at this point in the history
Run3-sim112 Take care of deprecated code in FastSimulation/ForwardDetectors
  • Loading branch information
cmsbuild committed Mar 18, 2022
2 parents 8294370 + 2f0d8e1 commit 032221e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 16 deletions.
Expand Up @@ -28,7 +28,6 @@

// user include files
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EDProducer.h"

#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/MakerMacros.h"
Expand All @@ -44,14 +43,14 @@

// genCandidate particle includes
#include "DataFormats/Candidate/interface/Candidate.h"
#include "DataFormats/HepMCCandidate/interface/GenParticle.h"

#include "FastSimulation/ForwardDetectors/plugins/CastorFastClusterProducer.h"

//
// constructors and destructor
//
CastorFastClusterProducer::CastorFastClusterProducer(const edm::ParameterSet& iConfig) {
CastorFastClusterProducer::CastorFastClusterProducer(const edm::ParameterSet& iConfig)
: tokGenPart_(consumes<reco::GenParticleCollection>(edm::InputTag{"genParticles"})) {
//register your products
produces<CastorClusterCollection>();

Expand Down Expand Up @@ -80,8 +79,7 @@ void CastorFastClusterProducer::produce(edm::Event& iEvent, const edm::EventSetu

//cout << "entering event" << endl;

Handle<GenParticleCollection> genParticles;
iEvent.getByLabel("genParticles", genParticles);
const edm::Handle<reco::GenParticleCollection>& genParticles = iEvent.getHandle(tokGenPart_);

// make pointer to towers that will be made
unique_ptr<CastorClusterCollection> CastorClusters(new CastorClusterCollection);
Expand Down
Expand Up @@ -2,12 +2,12 @@
#define FastSimulation_ForwardDetectors_CastorFastClusterProducer_h

#include "FWCore/Framework/interface/stream/EDProducer.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Utilities/interface/EDGetToken.h"

// Castorobject includes
#include "DataFormats/CastorReco/interface/CastorCluster.h"

#include "FWCore/ParameterSet/interface/ParameterSet.h"

#include "DataFormats/HepMCCandidate/interface/GenParticle.h"
#include "DataFormats/Math/interface/Point3D.h"

//
Expand All @@ -27,6 +27,7 @@ class CastorFastClusterProducer : public edm::stream::EDProducer<> {
typedef math::XYZPointD Point;
typedef ROOT::Math::RhoEtaPhiPoint ClusterPoint;
typedef std::vector<reco::CastorCluster> CastorClusterCollection;
const edm::EDGetTokenT<reco::GenParticleCollection> tokGenPart_;
};

#endif
Expand Up @@ -28,7 +28,6 @@

// user include files
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EDProducer.h"

#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/MakerMacros.h"
Expand All @@ -44,14 +43,14 @@

// genCandidate particle includes
#include "DataFormats/Candidate/interface/Candidate.h"
#include "DataFormats/HepMCCandidate/interface/GenParticle.h"

#include "FastSimulation/ForwardDetectors/plugins/CastorFastTowerProducer.h"

//
// constructors and destructor
//
CastorFastTowerProducer::CastorFastTowerProducer(const edm::ParameterSet& iConfig) {
CastorFastTowerProducer::CastorFastTowerProducer(const edm::ParameterSet& iConfig)
: tokGenPart_(consumes<reco::GenParticleCollection>(edm::InputTag{"genParticles"})) {
//register your products
produces<CastorTowerCollection>();

Expand Down Expand Up @@ -80,8 +79,7 @@ void CastorFastTowerProducer::produce(edm::Event& iEvent, const edm::EventSetup&

//cout << "entering event" << endl;

Handle<GenParticleCollection> genParticles;
iEvent.getByLabel("genParticles", genParticles);
const edm::Handle<GenParticleCollection>& genParticles = iEvent.getHandle(tokGenPart_);

// make pointer to towers that will be made
unique_ptr<CastorTowerCollection> CastorTowers(new CastorTowerCollection);
Expand Down
Expand Up @@ -3,12 +3,12 @@

// Castorobject includes
#include "DataFormats/CastorReco/interface/CastorTower.h"

#include "FWCore/ParameterSet/interface/ParameterSet.h"

#include "DataFormats/Math/interface/Point3D.h"
#include "DataFormats/HepMCCandidate/interface/GenParticle.h"

#include "FWCore/Framework/interface/stream/EDProducer.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Utilities/interface/EDGetToken.h"

//
// class decleration
Expand All @@ -27,6 +27,7 @@ class CastorFastTowerProducer : public edm::stream::EDProducer<> {
typedef math::XYZPointD Point;
typedef ROOT::Math::RhoEtaPhiPoint TowerPoint;
typedef std::vector<reco::CastorTower> CastorTowerCollection;
const edm::EDGetTokenT<reco::GenParticleCollection> tokGenPart_;
};

#endif

0 comments on commit 032221e

Please sign in to comment.