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

Added EventSetup consumes calls to MuonNumberingESProducer #26706

Merged
merged 1 commit into from May 15, 2019
Merged
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
16 changes: 7 additions & 9 deletions Geometry/MuonNumbering/plugins/MuonNumberingESProducer.cc
Expand Up @@ -39,15 +39,14 @@ class MuonNumberingESProducer : public edm::ESProducer {
private:
const std::string m_label;
const std::string m_key;
const edm::ESGetToken<cms::DDSpecParRegistry,DDSpecParRegistryRcd> m_token;
};

MuonNumberingESProducer::MuonNumberingESProducer(const edm::ParameterSet& iConfig)
: m_label(iConfig.getParameter<std::string>("label")),
m_key(iConfig.getParameter<std::string>("key"))

{
setWhatProduced(this);
}
m_key(iConfig.getParameter<std::string>("key")),
m_token( setWhatProduced(this).consumesFrom<cms::DDSpecParRegistry,DDSpecParRegistryRcd>(edm::ESInputTag("",m_label)) )
{}

MuonNumberingESProducer::~MuonNumberingESProducer()
{}
Expand All @@ -58,10 +57,9 @@ MuonNumberingESProducer::produce(const MuonNumberingRecord& iRecord)
LogDebug("Geometry") << "MuonNumberingESProducer::produce from " << m_label << " with " << m_key;
auto product = std::make_unique<cms::MuonNumbering>();

edm::ESHandle<cms::DDSpecParRegistry> registry;
iRecord.getRecord<DDSpecParRegistryRcd>().get(m_label, registry);
auto it = registry->specpars.find(m_key);
if(it != end(registry->specpars)) {
cms::DDSpecParRegistry const& registry = iRecord.get( m_token );
auto it = registry.specpars.find(m_key);
if(it != end(registry.specpars)) {
for(const auto& l : it->second.spars) {
if(l.first == "OnlyForMuonNumbering") {
for(const auto& k : it->second.numpars) {
Expand Down