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 ED modules to use esConsumes in Validation/MuonIdentification #34423

Merged
merged 2 commits into from Jul 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions Validation/MuonIdentification/interface/MuonIdVal.h
Expand Up @@ -104,7 +104,9 @@ class MuonIdVal : public DQMEDAnalyzer {
edm::Handle<reco::MuonTimeExtraMap> dtMuonTimeExtraValueMapH_;
edm::Handle<edm::ValueMap<reco::MuonCosmicCompatibility>> muonCosmicCompatibilityValueMapH_;
edm::Handle<edm::ValueMap<reco::MuonShower>> muonShowerInformationValueMapH_;

edm::ESHandle<GlobalTrackingGeometry> geometry_;
const edm::ESGetToken<GlobalTrackingGeometry, GlobalTrackingGeometryRecord> trackingGeomToken_;

// trackerMuon == 0; globalMuon == 1
// energy deposits
Expand Down
5 changes: 3 additions & 2 deletions Validation/MuonIdentification/src/MuonIdVal.cc
@@ -1,6 +1,7 @@
#include "Validation/MuonIdentification/interface/MuonIdVal.h"

MuonIdVal::MuonIdVal(const edm::ParameterSet &ps) {
MuonIdVal::MuonIdVal(const edm::ParameterSet &ps)
: trackingGeomToken_(esConsumes<GlobalTrackingGeometry, GlobalTrackingGeometryRecord>()) {
iConfig = ps;
inputMuonCollection_ = iConfig.getParameter<edm::InputTag>("inputMuonCollection");
inputDTRecSegment4DCollection_ = iConfig.getParameter<edm::InputTag>("inputDTRecSegment4DCollection");
Expand Down Expand Up @@ -425,7 +426,7 @@ void MuonIdVal::analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup)
iEvent.getByToken(inputMuonShowerInformationValueMapToken_, muonShowerInformationValueMapH_);
iEvent.getByToken(inputMuonCosmicCompatibilityValueMapToken_, muonCosmicCompatibilityValueMapH_);

iSetup.get<GlobalTrackingGeometryRecord>().get(geometry_);
geometry_ = iSetup.getHandle(trackingGeomToken_);

unsigned int muonIdx = 0;
for (MuonCollection::const_iterator muon = muonCollectionH_->begin(); muon != muonCollectionH_->end(); ++muon) {
Expand Down