4848class Phase2L1CaloPFClusterEmulator : public edm ::stream::EDProducer<> {
4949public:
5050 explicit Phase2L1CaloPFClusterEmulator (const edm::ParameterSet&);
51- ~Phase2L1CaloPFClusterEmulator () override ;
51+ ~Phase2L1CaloPFClusterEmulator () override = default ;
5252
5353 static void fillDescriptions (edm::ConfigurationDescriptions& descriptions);
5454
5555private:
5656 void produce (edm::Event&, const edm::EventSetup&) override ;
5757
5858 // ----------member data ---------------------------
59- edm::EDGetTokenT<l1tp2::CaloTowerCollection> caloTowerToken_;
59+ const edm::EDGetTokenT<l1tp2::CaloTowerCollection> caloTowerToken_;
6060};
6161
62- //
63- // constants, enums and typedefs
64- //
65-
66- //
67- // static data member definitions
68- //
69-
7062//
7163// constructors and destructor
7264//
@@ -75,8 +67,6 @@ Phase2L1CaloPFClusterEmulator::Phase2L1CaloPFClusterEmulator(const edm::Paramete
7567 produces<l1tp2::CaloPFClusterCollection>(" GCTPFCluster" );
7668}
7769
78- Phase2L1CaloPFClusterEmulator::~Phase2L1CaloPFClusterEmulator () {}
79-
8070//
8171// member functions
8272//
@@ -87,10 +77,10 @@ void Phase2L1CaloPFClusterEmulator::produce(edm::Event& iEvent, const edm::Event
8777 std::unique_ptr<l1tp2::CaloPFClusterCollection> pfclusterCands (make_unique<l1tp2::CaloPFClusterCollection>());
8878
8979 edm::Handle<std::vector<l1tp2::CaloTower>> caloTowerCollection;
90- if (!iEvent.getByToken (caloTowerToken_, caloTowerCollection))
80+ iEvent.getByToken (caloTowerToken_, caloTowerCollection);
81+ if (!caloTowerCollection.isValid ())
9182 cms::Exception (" Phase2L1CaloPFClusterEmulator" ) << " Failed to get towers from caloTowerCollection!" ;
9283
93- iEvent.getByToken (caloTowerToken_, caloTowerCollection);
9484 float GCTintTowers[nTowerEta][nTowerPhi];
9585 float realEta[nTowerEta][nTowerPhi];
9686 float realPhi[nTowerEta][nTowerPhi];
@@ -155,7 +145,7 @@ void Phase2L1CaloPFClusterEmulator::produce(edm::Event& iEvent, const edm::Event
155145 if (k > 1 && k % 2 == 0 )
156146 phioffset = phioffset + 4 ;
157147
158- gctpf::GCTPfcluster_t tempPfclusters;
148+ gctpf::PFcluster_t tempPfclusters;
159149 tempPfclusters = gctpf::pfcluster (temporary, etaoffset, phioffset);
160150
161151 for (int i = 0 ; i < nPFClusterSLR; i++) {
0 commit comments