Skip to content

Commit

Permalink
migrate Phase2TrackerRecHits to esConsumes
Browse files Browse the repository at this point in the history
  • Loading branch information
mmusich committed Mar 9, 2021
1 parent c0eb377 commit 0754a5d
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,16 @@ class Phase2TrackerRecHits : public edm::global::EDProducer<> {
void produce(edm::StreamID sid, edm::Event& event, const edm::EventSetup& eventSetup) const final;

private:
edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> const tTrackerGeom_;
edm::ESGetToken<ClusterParameterEstimator<Phase2TrackerCluster1D>, TkPhase2OTCPERecord> const tCPE_;

edm::EDGetTokenT<Phase2TrackerCluster1DCollectionNew> token_;
edm::ESInputTag cpeTag_;
};

Phase2TrackerRecHits::Phase2TrackerRecHits(edm::ParameterSet const& conf)
: token_(consumes<Phase2TrackerCluster1DCollectionNew>(conf.getParameter<edm::InputTag>("src"))),
cpeTag_(conf.getParameter<edm::ESInputTag>("Phase2StripCPE")) {
: tTrackerGeom_(esConsumes<TrackerGeometry, TrackerDigiGeometryRecord>()),
tCPE_(esConsumes(conf.getParameter<edm::ESInputTag>("Phase2StripCPE"))),
token_(consumes<Phase2TrackerCluster1DCollectionNew>(conf.getParameter<edm::InputTag>("src"))) {
produces<Phase2TrackerRecHit1DCollectionNew>();
}

Expand All @@ -50,13 +53,10 @@ void Phase2TrackerRecHits::produce(edm::StreamID sid, edm::Event& event, const e
event.getByToken(token_, clusters);

// load the cpe via the eventsetup
edm::ESHandle<ClusterParameterEstimator<Phase2TrackerCluster1D> > cpe;
eventSetup.get<TkPhase2OTCPERecord>().get(cpeTag_, cpe);
const auto& cpe = &eventSetup.getData(tCPE_);

// Get the geometry
edm::ESHandle<TrackerGeometry> geomHandle;
eventSetup.get<TrackerDigiGeometryRecord>().get(geomHandle);
const TrackerGeometry* tkGeom(&(*geomHandle));
const TrackerGeometry* tkGeom = &eventSetup.getData(tTrackerGeom_);

// Global container for the RecHits of each module
auto outputRecHits = std::make_unique<Phase2TrackerRecHit1DCollectionNew>();
Expand Down

0 comments on commit 0754a5d

Please sign in to comment.