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

Run3-gem37 Complete construction of MuonGeometryConstants (also for dd4hep) #29831

Merged
merged 2 commits into from May 15, 2020
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
25 changes: 21 additions & 4 deletions Geometry/MuonNumbering/plugins/MuonGeometryConstantsBuild.cc
Expand Up @@ -6,7 +6,7 @@

#include "DetectorDescription/Core/interface/DDValue.h"
#include "DetectorDescription/Core/interface/DDFilteredView.h"
#include "DetectorDescription/DDCMS/interface/DDFilteredView.h"
#include "DetectorDescription/DDCMS/interface/DDSpecParRegistry.h"

//#define EDM_ML_DEBUG

Expand Down Expand Up @@ -41,10 +41,10 @@ bool MuonGeometryConstantsBuild::build(const DDCompactView* cpv, MuonGeometryCon
DDsvalues_type::const_iterator eit = mySpecs.end();
for (; bit != eit; ++bit) {
if (bit->second.isEvaluated()) {
php.addValue(bit->second.name(), int(bit->second.doubles()[0]));
php.addValue(bit->second.name(), static_cast<int>(bit->second.doubles()[0]));
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("Geometry") << "MuonGeometryConstantsBuild::adding DDConstant of " << bit->second.name() << " = "
<< int(bit->second.doubles()[0]);
<< static_cast<int>(bit->second.doubles()[0]);
#endif
}
}
Expand All @@ -56,6 +56,23 @@ bool MuonGeometryConstantsBuild::build(const cms::DDCompactView* cpv, MuonGeomet
edm::LogVerbatim("Geometry")
<< "MuonGeometryConstantsBuild;:build (const cms::DDCompactView* cpv, MuonGeometryConstants& php)";
#endif
cms::DDSpecParRegistry const& registry = cpv->specpars();
auto it = registry.specpars.find("MuonCommonNumbering");
if (it != end(registry.specpars)) {
for (const auto& l : it->second.spars) {
if (l.first == "OnlyForMuonNumbering") {
for (const auto& k : it->second.numpars) {
for (const auto& ik : k.second) {
php.addValue(k.first, static_cast<int>(ik));
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("Geometry") << "MuonGeometryConstantsBuild::adding DDConstant of " << k.first << " = "
<< static_cast<int>(ik);
#endif
}
}
}
}
}

return false;
return true;
}
3 changes: 0 additions & 3 deletions Geometry/MuonNumbering/test/testConstantsFromDD4Hep_cfg.py
Expand Up @@ -6,9 +6,6 @@
process.load("Geometry.MuonNumbering.muonGeometryConstants_cff")
process.load('FWCore.MessageService.MessageLogger_cfi')

if hasattr(process,'MessageLogger'):
process.MessageLogger.categories.append('Geometry')

process.DDDetectorESProducer = cms.ESSource("DDDetectorESProducer",
confGeomXMLFiles = cms.FileInPath('Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D46.xml'),
appendToDataLabel = cms.string('')
Expand Down
3 changes: 0 additions & 3 deletions Geometry/MuonNumbering/test/testConstantsFromDDD_cfg.py
Expand Up @@ -6,9 +6,6 @@
process.load("Geometry.MuonNumbering.muonGeometryConstants_cff")
process.load('FWCore.MessageService.MessageLogger_cfi')

if hasattr(process,'MessageLogger'):
process.MessageLogger.categories.append('Geometry')

process.source = cms.Source("EmptySource")

process.maxEvents = cms.untracked.PSet(
Expand Down