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
Update of the DT migration to DD4HEP #31043
Changes from 15 commits
1b97ff0
38df270
bf86d1c
b897cf6
8baa5ba
37be5c6
fb3e0e6
74fabcd
da18b85
544b4dd
4a6eeab
b347b41
86c028e
2d3b727
278777a
7a02584
57b6f2f
94fbdcf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
// | ||
// Original Author: Ianna Osborne | ||
// Created: Wed, 16 Jan 2019 10:19:37 GMT | ||
// Modified by Sergio Lo Meo (sergio.lo.meo@cern.ch) Tue, 04 August 2020 | ||
// | ||
// | ||
#include "CondFormats/GeometryObjects/interface/RecoIdealGeometry.h" | ||
|
@@ -27,7 +28,6 @@ | |
#include "DataFormats/GeometrySurface/interface/Plane.h" | ||
#include "DataFormats/GeometrySurface/interface/Bounds.h" | ||
#include "DataFormats/GeometrySurface/interface/RectangularPlaneBounds.h" | ||
|
||
#include "FWCore/Framework/interface/ESTransientHandle.h" | ||
#include "FWCore/Framework/interface/ModuleFactory.h" | ||
#include "FWCore/Framework/interface/ESProducer.h" | ||
|
@@ -36,7 +36,8 @@ | |
#include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
#include "FWCore/Utilities/interface/ESGetToken.h" | ||
#include "FWCore/Utilities/interface/ReusableObjectHolder.h" | ||
#include "Geometry/MuonNumbering/interface/DD4hep_MuonNumbering.h" | ||
#include "Geometry/MuonNumbering/interface/MuonGeometryNumbering.h" | ||
#include "Geometry/MuonNumbering/interface/MuonGeometryConstants.h" | ||
#include "Geometry/Records/interface/MuonNumberingRecord.h" | ||
#include "Geometry/Records/interface/MuonGeometryRecord.h" | ||
#include "Geometry/Records/interface/DDSpecParRegistryRcd.h" | ||
|
@@ -78,7 +79,7 @@ class DTGeometryESProducer : public ESProducer { | |
edm::ESGetToken<Alignments, GlobalPositionRcd> m_globalPositionToken; | ||
edm::ESGetToken<Alignments, DTAlignmentRcd> m_alignmentsToken; | ||
edm::ESGetToken<AlignmentErrorsExtended, DTAlignmentErrorExtendedRcd> m_alignmentErrorsToken; | ||
edm::ESGetToken<MuonNumbering, MuonNumberingRecord> m_mdcToken; | ||
edm::ESGetToken<MuonGeometryConstants, IdealGeometryRecord> m_mdcToken; | ||
edm::ESGetToken<DDDetector, IdealGeometryRecord> m_cpvToken; | ||
edm::ESGetToken<DDSpecParRegistry, DDSpecParRegistryRcd> m_registryToken; | ||
const ESInputTag m_tag; | ||
|
@@ -109,7 +110,7 @@ DTGeometryESProducer::DTGeometryESProducer(const ParameterSet& iConfig) | |
} | ||
|
||
if (m_fromDDD) { | ||
m_mdcToken = cc.consumesFrom<MuonNumbering, MuonNumberingRecord>(edm::ESInputTag{}); | ||
m_mdcToken = cc.consumesFrom<MuonGeometryConstants, IdealGeometryRecord>(edm::ESInputTag{}); | ||
m_cpvToken = cc.consumesFrom<DDDetector, IdealGeometryRecord>(m_tag); | ||
m_registryToken = cc.consumesFrom<DDSpecParRegistry, DDSpecParRegistryRcd>(m_tag); | ||
} | ||
|
@@ -137,8 +138,6 @@ std::shared_ptr<DTGeometry> DTGeometryESProducer::produce(const MuonGeometryReco | |
// Called whenever the alignments or alignment errors change | ||
// | ||
if (m_applyAlignment) { | ||
// m_applyAlignment is scheduled for removal. | ||
// Ideal geometry obtained by using 'fake alignment' (with m_applyAlignment = true) | ||
edm::ESHandle<Alignments> globalPosition; | ||
record.getRecord<GlobalPositionRcd>().get(m_alignmentsLabel, globalPosition); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sidetracking a bit, but I want to note that these calls need to be changed to use the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
edm::ESHandle<Alignments> alignments; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,13 +7,15 @@ | |
process.maxEvents = cms.untracked.PSet( | ||
input = cms.untracked.int32(1) | ||
) | ||
process.DDDetectorESProducer = cms.ESSource("DDDetectorESProducer", | ||
confGeomXMLFiles = cms.FileInPath('Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021.xml'), | ||
appendToDataLabel = cms.string('MUON') | ||
) | ||
|
||
process.load('Configuration.StandardSequences.DD4hep_GeometrySim_cff') | ||
process.load("FWCore.MessageLogger.MessageLogger_cfi") | ||
process.load("Geometry.MuonNumbering.muonNumberingInitialization_cfi") | ||
process.load("Geometry.MuonNumbering.muonGeometryConstants_cff") | ||
|
||
|
||
process.DTGeometryESProducer = cms.ESProducer("DTGeometryESProducer", | ||
DDDetector = cms.ESInputTag('','MUON'), | ||
DDDetector = cms.ESInputTag('',''), | ||
appendToDataLabel = cms.string(''), | ||
applyAlignment = cms.bool(False), | ||
alignmentsLabel = cms.string(''), | ||
|
@@ -22,23 +24,20 @@ | |
fromDDD = cms.bool(True) | ||
) | ||
|
||
process.DDCompactViewESProducer = cms.ESProducer("DDCompactViewESProducer", | ||
appendToDataLabel = cms.string('') | ||
) | ||
|
||
process.DDSpecParRegistryESProducer = cms.ESProducer("DDSpecParRegistryESProducer", | ||
appendToDataLabel = cms.string('MUON') | ||
appendToDataLabel = cms.string('') | ||
) | ||
|
||
process.MuonNumberingESProducer = cms.ESProducer("MuonNumberingESProducer", | ||
label = cms.string('MUON'), | ||
key = cms.string('MuonCommonNumbering') | ||
) | ||
|
||
# | ||
# Note: Please, download the geometry file from a location | ||
# specified by Fireworks/Geometry/data/download.url | ||
# | ||
# For example: wget http://cmsdoc.cern.ch/cms/data/CMSSW/Fireworks/Geometry/data/v4/cmsGeom10.root | ||
# | ||
process.muonGeometryConstants.fromDD4Hep = True | ||
|
||
|
||
process.valid = cms.EDAnalyzer("DTGeometryValidate", | ||
infileName = cms.untracked.string('cmsGeom2021.root'), | ||
|
||
# infileName = cms.untracked.string('cmsRecoGeom-2021.root'), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see my comment https://github.com/cms-sw/cmssw/pull/31043/files/2d3b727f5f67fa52bda586c67dc5acbde80f3e77..278777a07be31745322a4ac08abba9488fac5af1#r478965333
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Note that infileName = cms.untracked.FileInPath('Geometry/DTGeometryBuilder/data/cmsRecoGeom-2021.root'), and in the C++ auto fp = iConfig.getUntrackedParameter<edm::FileInPath>("infileName"); |
||
outfileName = cms.untracked.string('validateDTGeometry.root'), | ||
tolerance = cms.untracked.int32(7) | ||
) | ||
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@slomeo , may be you can keep the
infileName
as a configurable parameter in validateDTGeometry_cfg.py and use