Skip to content

Commit f2efd5e

Browse files
committed
get rid of CMS deprecation warnings in AnalysisAlgos/TrackInfoProducer
1 parent 4177f30 commit f2efd5e

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

AnalysisAlgos/TrackInfoProducer/test/TrackInfoAnalyzer.cc

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include <memory>
22

3-
#include "FWCore/Framework/interface/EDAnalyzer.h"
3+
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
44

55
#include "FWCore/Framework/interface/ESHandle.h"
66
#include "FWCore/Framework/interface/Event.h"
@@ -21,7 +21,7 @@
2121

2222
using namespace edm;
2323

24-
class TrackInfoAnalyzer : public edm::EDAnalyzer {
24+
class TrackInfoAnalyzer : public edm::one::EDAnalyzer<> {
2525
public:
2626
TrackInfoAnalyzer(const edm::ParameterSet& pset);
2727
void beginJob() {
@@ -47,9 +47,7 @@ class TrackInfoAnalyzer : public edm::EDAnalyzer {
4747
using namespace reco;
4848

4949
//Retrieve tracker topology from geometry
50-
edm::ESHandle<TrackerTopology> tTopoHandle;
51-
setup.get<TrackerTopologyRcd>().get(tTopoHandle);
52-
const TrackerTopology* const tTopo = tTopoHandle.product();
50+
const TrackerTopology* const tTopo = &setup.getData(tkTopoToken);
5351

5452
//std::cout << "\nEvent ID = "<< event.id() << std::endl ;
5553
edm::Handle<reco::TrackInfoCollection> trackCollection;
@@ -124,12 +122,14 @@ class TrackInfoAnalyzer : public edm::EDAnalyzer {
124122
TH1F* tib3ext;
125123
TH1F* tib4int;
126124
TH1F* tib4ext;
127-
std::string filename;
128-
edm::EDGetTokenT<reco::TrackInfoCollection> trackCollectionToken;
125+
const std::string filename;
126+
const edm::EDGetTokenT<reco::TrackInfoCollection> trackCollectionToken;
127+
const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> tkTopoToken;
129128
};
130129

131130
TrackInfoAnalyzer::TrackInfoAnalyzer(const edm::ParameterSet& pset)
132131
: filename(pset.getParameter<std::string>("OutFileName")),
133-
trackCollectionToken(consumes<reco::TrackInfoCollection>(pset.getParameter<edm::InputTag>("TrackInfo"))) {}
132+
trackCollectionToken(consumes<reco::TrackInfoCollection>(pset.getParameter<edm::InputTag>("TrackInfo"))),
133+
tkTopoToken(esConsumes()) {}
134134

135135
DEFINE_FWK_MODULE(TrackInfoAnalyzer);

AnalysisAlgos/TrackInfoProducer/test/TrackInfoAnalyzerExample.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include <memory>
22

3-
#include "FWCore/Framework/interface/EDAnalyzer.h"
3+
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
44

55
#include "FWCore/Framework/interface/Event.h"
66
#include "FWCore/Framework/interface/MakerMacros.h"
@@ -17,7 +17,7 @@
1717

1818
using namespace edm;
1919

20-
class TrackInfoAnalyzerExample : public edm::EDAnalyzer {
20+
class TrackInfoAnalyzerExample : public edm::one::EDAnalyzer<> {
2121
edm::EDGetTokenT<reco::TrackInfoTrackAssociationCollection> TItkassociatorCollectionToken;
2222
edm::EDGetTokenT<reco::TrackCollection> tkCollectionToken;
2323

0 commit comments

Comments
 (0)