diff --git a/CondTools/Geometry/test/GeometryTester.cc b/CondTools/Geometry/test/GeometryTester.cc index 2e8a1a8e0ac32..9328fa4aa4c7e 100644 --- a/CondTools/Geometry/test/GeometryTester.cc +++ b/CondTools/Geometry/test/GeometryTester.cc @@ -84,7 +84,7 @@ namespace { bool m_xmltest, m_tktest, m_ecaltest; bool m_hcaltest, m_hgcaltest, m_calotowertest; bool m_castortest, m_zdctest, m_csctest; - bool m_dttest, m_rpctest; + bool m_dttest, m_rpctest, m_round; std::string m_geomLabel; edm::ESGetToken m_xmlGeoToken; edm::ESGetToken m_tkGeoToken; @@ -115,6 +115,7 @@ GeometryTester::GeometryTester(const edm::ParameterSet &iConfig) m_csctest(iConfig.getUntrackedParameter("CSCTest", true)), m_dttest(iConfig.getUntrackedParameter("DTTest", true)), m_rpctest(iConfig.getUntrackedParameter("RPCTest", true)), + m_round(iConfig.getUntrackedParameter("roundValues", false)), m_geomLabel(iConfig.getUntrackedParameter("geomLabel", "Extended")), m_xmlGeoToken(esConsumes(edm::ESInputTag("", m_geomLabel))), m_tkGeoToken(esConsumes()), @@ -191,10 +192,31 @@ void GeometryTester::analyze(const edm::Event &, const edm::EventSetup &iSetup) std::cout << "Translations " << tsee.size() << "\n"; std::cout << "Dimensions " << dimee.size() << "\n"; std::cout << "Indices " << indee.size() << "\n"; - std::cout << "ecale "; - for (auto it : tsee) + std::cout << "ecale " << std::endl; + int cnt = 1; + for (auto it : tsee) { + if (cnt % 6 == 1) { + outStream << "ecale xyz "; + if (m_round) + std::cout << std::defaultfloat << std::setprecision(6); + } else if (cnt % 3 == 1) { + outStream << "ecale phi/theta/psi "; + if (m_round) { + std::cout << std::setprecision(4); + // Angles show fluctuations beyond four digits + if (std::abs(it) < 1.e-4) { + it = 0.0; + // Show tiny phi values as 0 to avoid fluctuations + } + } + } outStream << it; + if ((cnt++) % 3 == 0) + std::cout << "\n"; + } std::cout << "\n"; + if (m_round) + std::cout << std::setprecision(6); std::cout << "ecale "; for (auto it : dimee) outStream << it; diff --git a/CondTools/Geometry/test/geometrytestDD4hep_db.py b/CondTools/Geometry/test/geometrytestDD4hep_db.py new file mode 100644 index 0000000000000..b5d16d6e51d45 --- /dev/null +++ b/CondTools/Geometry/test/geometrytestDD4hep_db.py @@ -0,0 +1,42 @@ +import FWCore.ParameterSet.Config as cms +from Configuration.AlCa.autoCond import autoCond + +from Configuration.Eras.Era_Run3_dd4hep_cff import Run3_dd4hep + +process = cms.Process("GeometryWriter", Run3_dd4hep) + +from Configuration.ProcessModifiers.dd4hep_cff import dd4hep + +process.load('CondCore.CondDB.CondDB_cfi') +process.load('Configuration.StandardSequences.GeometryDB_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +process.GlobalTag.globaltag = autoCond['updgrade2021'] + +process.source = cms.Source("EmptyIOVSource", + lastValue = cms.uint64(1), + timetype = cms.string('runnumber'), + firstValue = cms.uint64(1), + interval = cms.uint64(1) + ) + +process.GeometryTester = cms.EDAnalyzer("GeometryTester", + XMLTest = cms.untracked.bool(True), + TrackerTest = cms.untracked.bool(True), + EcalTest = cms.untracked.bool(True), + HcalTest = cms.untracked.bool(True), + HGCalTest = cms.untracked.bool(False), + CaloTowerTest = cms.untracked.bool(True), + CastorTest = cms.untracked.bool(False), + ZDCTest = cms.untracked.bool(True), + CSCTest = cms.untracked.bool(True), + DTTest = cms.untracked.bool(True), + RPCTest = cms.untracked.bool(True), + geomLabel = cms.untracked.string("Extended"), + roundValues = cms.untracked.bool(False) + ) + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(1) + ) + +process.p1 = cms.Path(process.GeometryTester) diff --git a/CondTools/Geometry/test/geometrytest_local.py b/CondTools/Geometry/test/geometrytest_local.py index a49bc674260bf..fe45071a0c750 100644 --- a/CondTools/Geometry/test/geometrytest_local.py +++ b/CondTools/Geometry/test/geometrytest_local.py @@ -81,12 +81,13 @@ HcalTest = cms.untracked.bool(True), HGCalTest = cms.untracked.bool(False), CaloTowerTest = cms.untracked.bool(True), - CastorTest = cms.untracked.bool(True), + CastorTest = cms.untracked.bool(False), ZDCTest = cms.untracked.bool(True), CSCTest = cms.untracked.bool(True), DTTest = cms.untracked.bool(True), RPCTest = cms.untracked.bool(True), - geomLabel = cms.untracked.string("") + geomLabel = cms.untracked.string(""), + roundValues = cms.untracked.bool(False) ) process.maxEvents = cms.untracked.PSet( diff --git a/DetectorDescription/DDCMS/plugins/test/DDTestDumpGeometry.cc b/DetectorDescription/DDCMS/plugins/test/DDTestDumpGeometry.cc index f3ef7a1e9ca53..913540ad9cdfc 100644 --- a/DetectorDescription/DDCMS/plugins/test/DDTestDumpGeometry.cc +++ b/DetectorDescription/DDCMS/plugins/test/DDTestDumpGeometry.cc @@ -46,7 +46,10 @@ void DDTestDumpGeometry::analyze(const Event&, const EventSetup& iEventSetup) { TString path; while ((node = next())) { next.GetPath(path); - LogVerbatim("Geometry") << path << ": " << node->GetVolume()->GetName(); + path.ReplaceAll("xml-memory-buffer:", ""); // Remove artifact of DB reading + TString nodeName(node->GetVolume()->GetName()); + nodeName.ReplaceAll("xml-memory-buffer:", ""); // Remove artifact of DB reading + LogVerbatim("DumpGeometry") << path << ": " << nodeName; } } diff --git a/DetectorDescription/DDCMS/src/DDDetector.cc b/DetectorDescription/DDCMS/src/DDDetector.cc index 8e6b18bd0048b..60a9f056b804a 100644 --- a/DetectorDescription/DDCMS/src/DDDetector.cc +++ b/DetectorDescription/DDCMS/src/DDDetector.cc @@ -3,6 +3,7 @@ #include "FWCore/MessageLogger/interface/MessageLogger.h" #include #include +#include #include #include #include @@ -24,6 +25,10 @@ namespace cms { makePayload = true; tagStr = ""; } + // Set DD4hep message level to ERROR. The default is INFO, + // but those messages are not necessary for general use. + dd4hep::setPrintLevel(dd4hep::ERROR); + m_description = &dd4hep::Detector::getInstance(tagStr); m_description->addExtension(&m_vectors); //only validate if using XML diff --git a/DetectorDescription/DDCMS/test/python/testTGeoIterator.py b/DetectorDescription/DDCMS/test/python/testTGeoIterator.py index f509432099679..082a0a9301fd1 100644 --- a/DetectorDescription/DDCMS/test/python/testTGeoIterator.py +++ b/DetectorDescription/DDCMS/test/python/testTGeoIterator.py @@ -13,7 +13,7 @@ ), cout = cms.untracked.PSet( enable = cms.untracked.bool(True), - enableStatistics = cms.untracked.bool(True), + enableStatistics = cms.untracked.bool(False), noLineBreaks = cms.untracked.bool(True), threshold = cms.untracked.string('WARNING') ), @@ -25,7 +25,7 @@ ERROR = cms.untracked.PSet( limit = cms.untracked.int32(0) ), - Geometry = cms.untracked.PSet( + DumpGeometry = cms.untracked.PSet( limit = cms.untracked.int32(-1) ), INFO = cms.untracked.PSet( @@ -34,7 +34,7 @@ WARNING = cms.untracked.PSet( limit = cms.untracked.int32(0) ), - enableStatistics = cms.untracked.bool(True), + enableStatistics = cms.untracked.bool(False), noLineBreaks = cms.untracked.bool(True), threshold = cms.untracked.string('INFO') ) diff --git a/DetectorDescription/DDCMS/test/python/testTGeoIteratorDB.py b/DetectorDescription/DDCMS/test/python/testTGeoIteratorDB.py new file mode 100644 index 0000000000000..0d935d778cd31 --- /dev/null +++ b/DetectorDescription/DDCMS/test/python/testTGeoIteratorDB.py @@ -0,0 +1,63 @@ +import FWCore.ParameterSet.Config as cms + +from Configuration.Eras.Era_Run3_dd4hep_cff import Run3_dd4hep + +process = cms.Process("DDCMSDetectorTest", Run3_dd4hep) + +process.source = cms.Source("EmptySource") +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(1) + ) + +process.MessageLogger = cms.Service("MessageLogger", + cerr = cms.untracked.PSet( + enable = cms.untracked.bool(False) + ), + cout = cms.untracked.PSet( + enable = cms.untracked.bool(True), + enableStatistics = cms.untracked.bool(False), + noLineBreaks = cms.untracked.bool(True), + threshold = cms.untracked.string('WARNING') + ), + files = cms.untracked.PSet( + navGeometry = cms.untracked.PSet( + DEBUG = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + ERROR = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + DumpGeometry = cms.untracked.PSet( + limit = cms.untracked.int32(-1) + ), + INFO = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + WARNING = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + enableStatistics = cms.untracked.bool(False), + noLineBreaks = cms.untracked.bool(True), + threshold = cms.untracked.string('INFO') + ) + ) +) + +process.load("Configuration.StandardSequences.GeometryDB_cff") +process.load('CondCore.CondDB.CondDB_cfi') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +from Configuration.AlCa.autoCond import autoCond +process.GlobalTag.globaltag = autoCond['upgrade2021'] + +process.DDDetectorESProducer = cms.ESSource("DDDetectorESProducer", + rootDDName = cms.string('cms:OCMS'), + label = cms.string('Extended'), + fromDB = cms.bool(True), + appendToDataLabel = cms.string('CMS') +) + +process.test = cms.EDAnalyzer("DDTestDumpGeometry", + DDDetector = cms.ESInputTag('','CMS') + ) + +process.p = cms.Path(process.test) diff --git a/DetectorDescription/DDCMS/test/python/testTGeoIteratorLocalDB.py b/DetectorDescription/DDCMS/test/python/testTGeoIteratorLocalDB.py new file mode 100644 index 0000000000000..1e10820513c73 --- /dev/null +++ b/DetectorDescription/DDCMS/test/python/testTGeoIteratorLocalDB.py @@ -0,0 +1,84 @@ +import FWCore.ParameterSet.Config as cms + +from Configuration.Eras.Era_Run3_dd4hep_cff import Run3_dd4hep + +process = cms.Process("DDCMSDetectorTest", Run3_dd4hep) + +process.source = cms.Source("EmptySource") +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(1) + ) + +process.MessageLogger = cms.Service("MessageLogger", + cerr = cms.untracked.PSet( + enable = cms.untracked.bool(False) + ), + cout = cms.untracked.PSet( + enable = cms.untracked.bool(True), + enableStatistics = cms.untracked.bool(False), + noLineBreaks = cms.untracked.bool(True), + threshold = cms.untracked.string('WARNING') + ), + files = cms.untracked.PSet( + navGeometry = cms.untracked.PSet( + DEBUG = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + ERROR = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + DumpGeometry = cms.untracked.PSet( + limit = cms.untracked.int32(-1) + ), + INFO = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + WARNING = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + enableStatistics = cms.untracked.bool(False), + noLineBreaks = cms.untracked.bool(True), + threshold = cms.untracked.string('INFO') + ) + ) +) + +process.load("Configuration.StandardSequences.GeometryDB_cff") +process.load('CondCore.CondDB.CondDB_cfi') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +from Configuration.AlCa.autoCond import autoCond +process.GlobalTag.globaltag = autoCond['upgrade2021'] + +process.DDDetectorESProducer = cms.ESSource("DDDetectorESProducer", + rootDDName = cms.string('cms:OCMS'), + label = cms.string('Extended'), + fromDB = cms.bool(True), + appendToDataLabel = cms.string('CMS') +) + +process.CondDB.timetype = cms.untracked.string('runnumber') +process.CondDB.connect = cms.string('sqlite_file:myfile.db') +process.PoolDBESSourceGeometry = cms.ESSource("PoolDBESSource", + process.CondDB, + toGet = cms.VPSet(cms.PSet(record = cms.string('GeometryFileRcd'),tag = cms.string('XMLFILE_Geometry_TagXX_Extended2021_mc')), + cms.PSet(record = cms.string('IdealGeometryRecord'),tag = cms.string('TKRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PEcalBarrelRcd'), tag = cms.string('EBRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PEcalEndcapRcd'), tag = cms.string('EERECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PEcalPreshowerRcd'),tag = cms.string('EPRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PHcalRcd'), tag = cms.string('HCALRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PCaloTowerRcd'), tag = cms.string('CTRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PZdcRcd'), tag = cms.string('ZDCRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PCastorRcd'), tag = cms.string('CASTORRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('CSCRecoGeometryRcd'),tag = cms.string('CSCRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('CSCRecoDigiParametersRcd'),tag = cms.string('CSCRECODIGI_Geometry_TagXX')), + cms.PSet(record = cms.string('DTRecoGeometryRcd'),tag = cms.string('DTRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('RPCRecoGeometryRcd'),tag = cms.string('RPCRECO_Geometry_TagXX')) + ) + ) + +process.es_prefer_geometry = cms.ESPrefer( "PoolDBESSource", "PoolDBESSourceGeometry" ) +process.test = cms.EDAnalyzer("DDTestDumpGeometry", + DDDetector = cms.ESInputTag('','CMS') + ) + +process.p = cms.Path(process.test) diff --git a/Geometry/CSCGeometry/test/testCSCGeometryDD4hep_cfg.py b/Geometry/CSCGeometry/test/testCSCGeometryDD4hep_cfg.py new file mode 100644 index 0000000000000..f3ed4d115a0bf --- /dev/null +++ b/Geometry/CSCGeometry/test/testCSCGeometryDD4hep_cfg.py @@ -0,0 +1,40 @@ +# Configuration file to run CSCGeometryAnalyzer + +import FWCore.ParameterSet.Config as cms + +from Configuration.Eras.Era_Run3_dd4hep_cff import Run3_dd4hep + +process = cms.Process("CSCGeometryAnalyzer", Run3_dd4hep) + + +# Endcap Muon geometry +# ==================== +process.load('Configuration.Geometry.GeometryDD4hepExtended2021Reco_cff') + +# Fake alignment is/should be ideal geometry +# ========================================== +process.load('Alignment.CommonAlignmentProducer.FakeAlignmentSource_cfi') +process.preferFakeAlign = cms.ESPrefer('FakeAlignmentSource') + +# flags for modelling of CSC layer & strip geometry +# ================================================= +process.load('Geometry.CSCGeometry.cscGeometry_cfi') + +process.source = cms.Source('EmptySource') + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(1) +) + +process.load('FWCore.MessageLogger.MessageLogger_cfi') +process.MessageLogger.debugModules.append('CSCGeometryESModule') +process.MessageLogger.cout = cms.untracked.PSet( + threshold = cms.untracked.string('DEBUG'), + default = cms.untracked.PSet( limit = cms.untracked.int32(0) ), + CSCGeometry = cms.untracked.PSet( limit = cms.untracked.int32(-1) ), + CSCGeometryBuilder = cms.untracked.PSet( limit = cms.untracked.int32(-1) ) +) + +process.producer = cms.EDAnalyzer('CSCGeometryAnalyzer') + +process.p1 = cms.Path(process.producer) diff --git a/Geometry/CSCGeometry/test/testCSCGeometryFromDBDD4hep_cfg.py b/Geometry/CSCGeometry/test/testCSCGeometryFromDBDD4hep_cfg.py new file mode 100644 index 0000000000000..4481ad34389d8 --- /dev/null +++ b/Geometry/CSCGeometry/test/testCSCGeometryFromDBDD4hep_cfg.py @@ -0,0 +1,37 @@ +# Configuration file to run stubs/CSCGeometryAnalyser + +import FWCore.ParameterSet.Config as cms + +from Configuration.Eras.Era_Run3_dd4hep_cff import Run3_dd4hep + +process = cms.Process("GeometryTest", Run3_dd4hep) + +process.load("Configuration.StandardSequences.GeometryRecoDB_cff") +process.load('CondCore.CondDB.CondDB_cfi') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +from Configuration.AlCa.autoCond import autoCond +process.GlobalTag.globaltag = autoCond['upgrade2021'] + +process.load("Alignment.CommonAlignmentProducer.FakeAlignmentSource_cfi") +process.preferFakeAlign = cms.ESPrefer("FakeAlignmentSource") + +process.source = cms.Source("EmptySource") + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(1) +) + +process.load("FWCore.MessageLogger.MessageLogger_cfi") +process.MessageLogger.debugModules.append('CSCGeometryESModule') +process.MessageLogger.cout = cms.untracked.PSet( + threshold = cms.untracked.string('DEBUG'), + default = cms.untracked.PSet( limit = cms.untracked.int32(0) ), + CSCGeometry = cms.untracked.PSet( limit = cms.untracked.int32(-1) ), + CSCGeometryBuilder = cms.untracked.PSet( limit = cms.untracked.int32(-1) ) +) + +process.producer = cms.EDAnalyzer("CSCGeometryAnalyzer") + +process.p1 = cms.Path(process.producer) +process.CSCGeometryESModule.debugV = True + diff --git a/Geometry/CSCGeometry/test/testCSCGeometryFromLocalDBDD4hep_cfg.py b/Geometry/CSCGeometry/test/testCSCGeometryFromLocalDBDD4hep_cfg.py new file mode 100644 index 0000000000000..c74ad917e2022 --- /dev/null +++ b/Geometry/CSCGeometry/test/testCSCGeometryFromLocalDBDD4hep_cfg.py @@ -0,0 +1,94 @@ +# Configuration file to run stubs/CSCGeometryAnalyser +# to dump CSC geometry information +# Tim Cox 11.06.2008 pythonized + +import FWCore.ParameterSet.Config as cms + +from Configuration.Eras.Era_Run3_dd4hep_cff import Run3_dd4hep + +process = cms.Process("GeometryTest", Run3_dd4hep) + + +process.load("Configuration.StandardSequences.GeometryRecoDB_cff") +process.load('CondCore.CondDB.CondDB_cfi') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') + +from Configuration.AlCa.autoCond import autoCond +process.GlobalTag.globaltag = autoCond['upgrade2021'] + +process.source = cms.Source("EmptySource") + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(1) +) + +process.CondDB.timetype = cms.untracked.string('runnumber') +process.CondDB.connect = cms.string('sqlite_file:myfile.db') +process.PoolDBESSourceGeometry = cms.ESSource("PoolDBESSource", + process.CondDB, + toGet = cms.VPSet(cms.PSet(record = cms.string('GeometryFileRcd'),tag = cms.string('XMLFILE_Geometry_TagXX_Extended2021_mc')), + cms.PSet(record = cms.string('IdealGeometryRecord'),tag = cms.string('TKRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PEcalBarrelRcd'), tag = cms.string('EBRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PEcalEndcapRcd'), tag = cms.string('EERECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PEcalPreshowerRcd'),tag = cms.string('EPRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PHcalRcd'), tag = cms.string('HCALRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PCaloTowerRcd'), tag = cms.string('CTRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PZdcRcd'), tag = cms.string('ZDCRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PCastorRcd'), tag = cms.string('CASTORRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('CSCRecoGeometryRcd'),tag = cms.string('CSCRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('CSCRecoDigiParametersRcd'),tag = cms.string('CSCRECODIGI_Geometry_TagXX')), + cms.PSet(record = cms.string('DTRecoGeometryRcd'),tag = cms.string('DTRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('RPCRecoGeometryRcd'),tag = cms.string('RPCRECO_Geometry_TagXX')) + ) + ) + +process.es_prefer_geometry = cms.ESPrefer( "PoolDBESSource", "PoolDBESSourceGeometry" ) + +process.load("Alignment.CommonAlignmentProducer.FakeAlignmentSource_cfi") +process.preferFakeAlign = cms.ESPrefer("FakeAlignmentSource") + +process.MessageLogger = cms.Service("MessageLogger", + cerr = cms.untracked.PSet( + enable = cms.untracked.bool(False) + ), + debugModules = cms.untracked.vstring('*'), + files = cms.untracked.PSet( + debug = cms.untracked.PSet( + CSC = cms.untracked.PSet( + limit = cms.untracked.int32(-1) + ), + CSCGeometryBuilderFromDDD = cms.untracked.PSet( + limit = cms.untracked.int32(-1) + ), + CSCNumbering = cms.untracked.PSet( + limit = cms.untracked.int32(-1) + ), + DEBUG = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + INFO = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + RadialStripTopology = cms.untracked.PSet( + limit = cms.untracked.int32(-1) + ), + extension = cms.untracked.string('.out'), + noLineBreaks = cms.untracked.bool(True), + threshold = cms.untracked.string('DEBUG') + ), + errors = cms.untracked.PSet( + extension = cms.untracked.string('.out'), + threshold = cms.untracked.string('ERROR') + ), + log = cms.untracked.PSet( + extension = cms.untracked.string('.out') + ) + ) +) + +process.producer = cms.EDAnalyzer("CSCGeometryAnalyzer") + +process.CSCGeometryESModule.debugV = True + +process.p1 = cms.Path(process.producer) + diff --git a/Geometry/CaloEventSetup/data/ct.cor.gz b/Geometry/CaloEventSetup/data/ct.cor.gz index b25c801ec599f..b300d0924975c 100644 Binary files a/Geometry/CaloEventSetup/data/ct.cor.gz and b/Geometry/CaloEventSetup/data/ct.cor.gz differ diff --git a/Geometry/CaloEventSetup/data/ct.ctr.gz b/Geometry/CaloEventSetup/data/ct.ctr.gz index 00c0651f9e855..7cf65b7111efa 100644 Binary files a/Geometry/CaloEventSetup/data/ct.ctr.gz and b/Geometry/CaloEventSetup/data/ct.ctr.gz differ diff --git a/Geometry/CaloEventSetup/data/hb.cor.gz b/Geometry/CaloEventSetup/data/hb.cor.gz index e9607475a32e7..68ab00a1f4415 100644 Binary files a/Geometry/CaloEventSetup/data/hb.cor.gz and b/Geometry/CaloEventSetup/data/hb.cor.gz differ diff --git a/Geometry/CaloEventSetup/data/hb.ctr.gz b/Geometry/CaloEventSetup/data/hb.ctr.gz index c63cc0bbc7516..c3a0bce5a1531 100644 Binary files a/Geometry/CaloEventSetup/data/hb.ctr.gz and b/Geometry/CaloEventSetup/data/hb.ctr.gz differ diff --git a/Geometry/CaloEventSetup/data/he.cor.gz b/Geometry/CaloEventSetup/data/he.cor.gz index 615bc7985901e..d7728380e97f8 100644 Binary files a/Geometry/CaloEventSetup/data/he.cor.gz and b/Geometry/CaloEventSetup/data/he.cor.gz differ diff --git a/Geometry/CaloEventSetup/data/he.ctr.gz b/Geometry/CaloEventSetup/data/he.ctr.gz index 7df2011ff199d..6513810ec562f 100644 Binary files a/Geometry/CaloEventSetup/data/he.ctr.gz and b/Geometry/CaloEventSetup/data/he.ctr.gz differ diff --git a/Geometry/CaloEventSetup/data/hf.cor.gz b/Geometry/CaloEventSetup/data/hf.cor.gz index f556c93d078a4..6dfd324fac50a 100644 Binary files a/Geometry/CaloEventSetup/data/hf.cor.gz and b/Geometry/CaloEventSetup/data/hf.cor.gz differ diff --git a/Geometry/CaloEventSetup/data/hf.ctr.gz b/Geometry/CaloEventSetup/data/hf.ctr.gz index 21be2218a2443..4aa26c85d4f4c 100644 Binary files a/Geometry/CaloEventSetup/data/hf.ctr.gz and b/Geometry/CaloEventSetup/data/hf.ctr.gz differ diff --git a/Geometry/CaloEventSetup/data/ho.cor.gz b/Geometry/CaloEventSetup/data/ho.cor.gz index 52e215aa3d3d6..2fd5322d253e1 100644 Binary files a/Geometry/CaloEventSetup/data/ho.cor.gz and b/Geometry/CaloEventSetup/data/ho.cor.gz differ diff --git a/Geometry/CaloEventSetup/data/ho.ctr.gz b/Geometry/CaloEventSetup/data/ho.ctr.gz index 060c3a7da8af9..a23c6f0da637b 100644 Binary files a/Geometry/CaloEventSetup/data/ho.ctr.gz and b/Geometry/CaloEventSetup/data/ho.ctr.gz differ diff --git a/Geometry/CaloEventSetup/test/CaloGeometryAnalyzer.cc b/Geometry/CaloEventSetup/test/CaloGeometryAnalyzer.cc index 1c0607af6c31c..62810c93eca56 100644 --- a/Geometry/CaloEventSetup/test/CaloGeometryAnalyzer.cc +++ b/Geometry/CaloEventSetup/test/CaloGeometryAnalyzer.cc @@ -1018,7 +1018,8 @@ void CaloGeometryAnalyzer::analyze(const edm::Event& /*iEvent*/, const edm::Even buildHcal(cG, pT, DetId::Hcal, HcalOuter, "ho", 5); buildHcal(cG, pT, DetId::Hcal, HcalForward, "hf", 6); build(cG, pT, DetId::Calo, CaloTowerDetId::SubdetId, "ct", 7); - build(cG, pT, DetId::Calo, HcalCastorDetId::SubdetectorId, "ca", 8); + // build(cG, pT, DetId::Calo, HcalCastorDetId::SubdetectorId, "ca", 8); + // Castor has been removed from CMS build(cG, pT, DetId::Calo, HcalZDCDetId::SubdetectorId, "zd", 9); std::cout << "\n\n*********** Validation of cell centers and corners " << (m_allOK ? "SUCCEEDS!! " : "FAILS!! ") diff --git a/Geometry/CaloEventSetup/test/runTestCaloGeometryDBDD4hep_cfg.py b/Geometry/CaloEventSetup/test/runTestCaloGeometryDBDD4hep_cfg.py new file mode 100755 index 0000000000000..d5f8814bd97a6 --- /dev/null +++ b/Geometry/CaloEventSetup/test/runTestCaloGeometryDBDD4hep_cfg.py @@ -0,0 +1,41 @@ +import FWCore.ParameterSet.Config as cms + +from Configuration.Eras.Era_Run3_dd4hep_cff import Run3_dd4hep + +process = cms.Process("GeometryTest", Run3_dd4hep) + + +process = cms.Process("GeometryTest") +process.load("FWCore.MessageLogger.MessageLogger_cfi") +process.load("Configuration.StandardSequences.MagneticField_38T_cff") +process.load("Configuration.StandardSequences.GeometryRecoDB_cff") +process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:upgrade2021', '') + +process.source = cms.Source("EmptySource") +process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(4) ) + + +process.etta = cms.EDAnalyzer("DumpEcalTrigTowerMapping") + +process.ctgw = cms.EDAnalyzer("TestEcalGetWindow") + +process.cga = cms.EDAnalyzer("CaloGeometryAnalyzer", + fullEcalDump = cms.untracked.bool(True) + ) + +process.mfa = cms.EDAnalyzer("testMagneticField") + +process.Timing = cms.Service("Timing") + +process.SimpleMemoryCheck = cms.Service("SimpleMemoryCheck") + +process.TFileService = cms.Service("TFileService", + fileName = cms.string('calogeom.root') + ) + +# process.p1 = cms.Path(process.etta*process.ctgw*process.cga*process.mfa) +process.p1 = cms.Path(process.etta*process.ctgw*process.cga) +# FIXME Restore magnetic field test. Code has to be added to read field record + diff --git a/Geometry/CaloEventSetup/test/runTestCaloGeometryDD4hep_cfg.py b/Geometry/CaloEventSetup/test/runTestCaloGeometryDD4hep_cfg.py new file mode 100644 index 0000000000000..749d1d0892442 --- /dev/null +++ b/Geometry/CaloEventSetup/test/runTestCaloGeometryDD4hep_cfg.py @@ -0,0 +1,38 @@ +import FWCore.ParameterSet.Config as cms + +from Configuration.Eras.Era_Run3_dd4hep_cff import Run3_dd4hep + +process = cms.Process("GeometryTest", Run3_dd4hep) + + +process.load('Configuration.Geometry.GeometryDD4hepExtended2021Reco_cff') + +process.load('FWCore.MessageLogger.MessageLogger_cfi') + +process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(4) ) + +process.source = cms.Source("EmptySource") + +process.etta = cms.EDAnalyzer("DumpEcalTrigTowerMapping") + +process.ctgw = cms.EDAnalyzer("TestEcalGetWindow") + +process.cga = cms.EDAnalyzer("CaloGeometryAnalyzer", + fullEcalDump = cms.untracked.bool(True) + ) + +process.mfa = cms.EDAnalyzer("testMagneticField") + +process.Timing = cms.Service("Timing") + +process.SimpleMemoryCheck = cms.Service("SimpleMemoryCheck") + +process.TFileService = cms.Service("TFileService", + fileName = cms.string('calogeom.root') + ) + +# process.p1 = cms.Path(process.etta*process.ctgw*process.cga*process.mfa) +process.p1 = cms.Path(process.etta*process.ctgw*process.cga) +# FIXME Restore magnetic field test. Code has to be added to read field record + + diff --git a/Geometry/CaloEventSetup/test/runTestCaloGeometryLocalDBDD4hep_cfg.py b/Geometry/CaloEventSetup/test/runTestCaloGeometryLocalDBDD4hep_cfg.py new file mode 100644 index 0000000000000..e940e810d423e --- /dev/null +++ b/Geometry/CaloEventSetup/test/runTestCaloGeometryLocalDBDD4hep_cfg.py @@ -0,0 +1,57 @@ +import FWCore.ParameterSet.Config as cms + +from Configuration.Eras.Era_Run3_dd4hep_cff import Run3_dd4hep + +process = cms.Process("GeometryTest", Run3_dd4hep) + +process.load('Configuration.StandardSequences.GeometryRecoDB_cff') +process.load('CondCore.CondDB.CondDB_cfi') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:upgrade2021', '') + +process.source = cms.Source("EmptySource") + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(4) +) + +process.CondDB.timetype = cms.untracked.string('runnumber') +process.CondDB.connect = cms.string('sqlite_file:myfile.db') +process.PoolDBESSourceGeometry = cms.ESSource("PoolDBESSource", + process.CondDB, + toGet = cms.VPSet(cms.PSet(record = cms.string('PEcalBarrelRcd'), tag = cms.string('EBRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PEcalEndcapRcd'), tag = cms.string('EERECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PEcalPreshowerRcd'), tag = cms.string('EPRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PHcalRcd'), tag = cms.string('HCALRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PCaloTowerRcd'), tag = cms.string('CTRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PZdcRcd'), tag = cms.string('ZDCRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PCastorRcd'), tag = cms.string('CASTORRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('CSCRecoGeometryRcd'), tag = cms.string('CSCRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('CSCRecoDigiParametersRcd'),tag = cms.string('CSCRECODIGI_Geometry_TagXX')), + cms.PSet(record = cms.string('DTRecoGeometryRcd'), tag = cms.string('DTRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('IdealGeometryRecord'), tag = cms.string('TKRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PZdcRcd'), tag = cms.string('ZDCRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('RPCRecoGeometryRcd'), tag = cms.string('RPCRECO_Geometry_TagXX')) + ) + ) + +process.es_prefer_geometry = cms.ESPrefer( "PoolDBESSource", "PoolDBESSourceGeometry" ) + +process.etta = cms.EDAnalyzer("DumpEcalTrigTowerMapping") + +process.ctgw = cms.EDAnalyzer("TestEcalGetWindow") + +process.cga = cms.EDAnalyzer("CaloGeometryAnalyzer", + fullEcalDump = cms.untracked.bool(True) + ) + +process.mfa = cms.EDAnalyzer("testMagneticField") + +process.TFileService = cms.Service("TFileService", + fileName = cms.string('calogeom.root') + ) + +# process.p1 = cms.Path(process.etta*process.ctgw*process.cga*process.mfa) +process.p1 = cms.Path(process.etta*process.ctgw*process.cga) +# FIXME Restore magnetic field test. Code has to be added to read field record diff --git a/Geometry/DTGeometry/test/testDTGeometryDD4hep_cfg.py b/Geometry/DTGeometry/test/testDTGeometryDD4hep_cfg.py new file mode 100644 index 0000000000000..5cde9ca6b56d7 --- /dev/null +++ b/Geometry/DTGeometry/test/testDTGeometryDD4hep_cfg.py @@ -0,0 +1,31 @@ +import FWCore.ParameterSet.Config as cms + +from Configuration.Eras.Era_Run3_dd4hep_cff import Run3_dd4hep + +process = cms.Process("GeometryTest", Run3_dd4hep) + +process.load('Configuration.Geometry.GeometryDD4hepExtended2021Reco_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +# process.load('Geometry.CommonTopologies.globalTrackingGeometry_cfi') +# process.load('Geometry.MuonNumbering.muonNumberingInitialization_cfi') +from Configuration.AlCa.autoCond import autoCond +process.GlobalTag.globaltag = autoCond['upgrade2021'] + +process.load("Alignment.CommonAlignmentProducer.FakeAlignmentSource_cfi") +process.preferFakeAlign = cms.ESPrefer("FakeAlignmentSource") + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(1) +) + +process.source = cms.Source("EmptySource") + +process.out = cms.OutputModule("AsciiOutputModule") + +process.prod = cms.EDAnalyzer("DTGeometryAnalyzer", + tolerance = cms.untracked.double(1.0e-23) + ) + +process.p1 = cms.Path(process.prod) + + diff --git a/Geometry/DTGeometry/test/testDTGeometryFromDBDD4hep_cfg.py b/Geometry/DTGeometry/test/testDTGeometryFromDBDD4hep_cfg.py new file mode 100644 index 0000000000000..897a7bed3689b --- /dev/null +++ b/Geometry/DTGeometry/test/testDTGeometryFromDBDD4hep_cfg.py @@ -0,0 +1,32 @@ +import FWCore.ParameterSet.Config as cms + +from Configuration.Eras.Era_Run3_dd4hep_cff import Run3_dd4hep + +process = cms.Process("GeometryTest", Run3_dd4hep) + +process.load("Configuration.StandardSequences.GeometryRecoDB_cff") +process.load('CondCore.CondDB.CondDB_cfi') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +from Configuration.AlCa.autoCond import autoCond +process.GlobalTag.globaltag = autoCond['upgrade2021'] + +process.source = cms.Source("EmptySource") + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(1) +) + +process.load("Alignment.CommonAlignmentProducer.FakeAlignmentSource_cfi") +process.preferFakeAlign = cms.ESPrefer("FakeAlignmentSource") + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(1) +) + +process.source = cms.Source("EmptySource") + +process.prod = cms.EDAnalyzer("DTGeometryAnalyzer", + tolerance = cms.untracked.double(1.0e-23) + ) + +process.p1 = cms.Path(process.prod) diff --git a/Geometry/DTGeometry/test/testDTGeometryFromLocalDBDD4hep_cfg.py b/Geometry/DTGeometry/test/testDTGeometryFromLocalDBDD4hep_cfg.py new file mode 100644 index 0000000000000..6cbde26328c0d --- /dev/null +++ b/Geometry/DTGeometry/test/testDTGeometryFromLocalDBDD4hep_cfg.py @@ -0,0 +1,54 @@ +import FWCore.ParameterSet.Config as cms + +from Configuration.Eras.Era_Run3_dd4hep_cff import Run3_dd4hep + +process = cms.Process("GeometryTest", Run3_dd4hep) + +process.load('Configuration.StandardSequences.GeometryRecoDB_cff') +process.load('CondCore.CondDB.CondDB_cfi') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +from Configuration.AlCa.autoCond import autoCond +process.GlobalTag.globaltag = autoCond['upgrade2021'] + +process.source = cms.Source("EmptySource") + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(1) +) + +process.CondDB.timetype = cms.untracked.string('runnumber') +process.CondDB.connect = cms.string('sqlite_file:myfile.db') +process.PoolDBESSourceGeometry = cms.ESSource("PoolDBESSource", + process.CondDB, + toGet = cms.VPSet(cms.PSet(record = cms.string('GeometryFileRcd'),tag = cms.string('XMLFILE_Geometry_TagXX_Extended2021_mc')), + cms.PSet(record = cms.string('IdealGeometryRecord'),tag = cms.string('TKRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PEcalBarrelRcd'), tag = cms.string('EBRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PEcalEndcapRcd'), tag = cms.string('EERECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PEcalPreshowerRcd'),tag = cms.string('EPRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PHcalRcd'), tag = cms.string('HCALRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PCaloTowerRcd'), tag = cms.string('CTRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PZdcRcd'), tag = cms.string('ZDCRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PCastorRcd'), tag = cms.string('CASTORRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('CSCRecoGeometryRcd'),tag = cms.string('CSCRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('CSCRecoDigiParametersRcd'),tag = cms.string('CSCRECODIGI_Geometry_TagXX')), + cms.PSet(record = cms.string('DTRecoGeometryRcd'),tag = cms.string('DTRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('RPCRecoGeometryRcd'),tag = cms.string('RPCRECO_Geometry_TagXX')) + ) + ) + +process.es_prefer_geometry = cms.ESPrefer( "PoolDBESSource", "PoolDBESSourceGeometry" ) + +process.load("Alignment.CommonAlignmentProducer.FakeAlignmentSource_cfi") +process.preferFakeAlign = cms.ESPrefer("FakeAlignmentSource") + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(1) +) + +process.source = cms.Source("EmptySource") + +process.prod = cms.EDAnalyzer("DTGeometryAnalyzer", + tolerance = cms.untracked.double(1.0e-23) + ) + +process.p1 = cms.Path(process.prod) diff --git a/Geometry/GEMGeometry/test/GEMGeometryAnalyzer.cc b/Geometry/GEMGeometry/test/GEMGeometryAnalyzer.cc index e3b385e6817d3..63f6160e24699 100644 --- a/Geometry/GEMGeometry/test/GEMGeometryAnalyzer.cc +++ b/Geometry/GEMGeometry/test/GEMGeometryAnalyzer.cc @@ -55,6 +55,12 @@ GEMGeometryAnalyzer::GEMGeometryAnalyzer(const edm::ParameterSet& /*iConfig*/) ofos << "======================== Opening output file" << std::endl; } +namespace { + bool compareSupChm(const GEMSuperChamber* schm1, const GEMSuperChamber* schm2) { + return (schm1->id().v12Form() < schm2->id().v12Form()); + } +} // namespace + GEMGeometryAnalyzer::~GEMGeometryAnalyzer() { ofos.close(); ofos << "======================== Closing output file" << std::endl; @@ -131,7 +137,9 @@ void GEMGeometryAnalyzer::analyze(const edm::Event& /*iEvent*/, const edm::Event ofos << " GEMRing " << ring->region() << " " << ring->station() << " " << ring->ring() << " has " << ring->nSuperChambers() << " super chambers." << endl; int i = 1; - for (auto sch : ring->superChambers()) { + auto supChmSort = ring->superChambers(); + std::sort(supChmSort.begin(), supChmSort.end(), compareSupChm); + for (auto sch : supChmSort) { GEMDetId schId(sch->id()); ofos << " GEMSuperChamber " << i << ", GEMDetId = " << schId.rawId() << ", " << schId << " has " << sch->nChambers() << " chambers." << endl; diff --git a/Geometry/GEMGeometry/test/testGEMGeometryDD4hep_cfg.py b/Geometry/GEMGeometry/test/testGEMGeometryDD4hep_cfg.py new file mode 100644 index 0000000000000..e1a0cc94d3223 --- /dev/null +++ b/Geometry/GEMGeometry/test/testGEMGeometryDD4hep_cfg.py @@ -0,0 +1,39 @@ +import FWCore.ParameterSet.Config as cms + +from Configuration.StandardSequences.Eras import eras +from Configuration.Eras.Era_Run3_dd4hep_cff import Run3_dd4hep + +process = cms.Process("Demo", eras.run3_GEM, Run3_dd4hep) + +process.load('Configuration.Geometry.GeometryDD4hepExtended2021Reco_cff') + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(1) +) +process.source = cms.Source("EmptySource") + +process.test = cms.EDAnalyzer("GEMGeometryAnalyzer") + +process.p = cms.Path(process.test) + +### TO ACTIVATE LogTrace NEED TO COMPILE IT WITH: +### ----------------------------------------------------------- +### --> scram b -j8 USER_CXXFLAGS="-DEDM_ML_DEBUG" +### Make sure that you first cleaned your CMSSW version: +### --> scram b clean +### before issuing the scram command above +############################################################### +process.load("FWCore.MessageLogger.MessageLogger_cfi") +# +# +process.MessageLogger.debugModules = cms.untracked.vstring("*") +process.MessageLogger.cerr.enable = False +process.MessageLogger.files.junk = dict() +process.MessageLogger.cout = cms.untracked.PSet( + enable = cms.untracked.bool(True), + threshold = cms.untracked.string("DEBUG"), + default = cms.untracked.PSet( limit = cms.untracked.int32(0) ), + FwkReport = cms.untracked.PSet( limit = cms.untracked.int32(-1) ), + # GEMGeometryBuilderFromDDD = cms.untracked.PSet( limit = cms.untracked.int32(-1) ), + # GEMNumberingScheme = cms.untracked.PSet( limit = cms.untracked.int32(-1) ), +) diff --git a/Geometry/GEMGeometry/test/testGEMGeometryFromDBDD4hep_cfg.py b/Geometry/GEMGeometry/test/testGEMGeometryFromDBDD4hep_cfg.py new file mode 100644 index 0000000000000..28d25e9430f81 --- /dev/null +++ b/Geometry/GEMGeometry/test/testGEMGeometryFromDBDD4hep_cfg.py @@ -0,0 +1,50 @@ +import FWCore.ParameterSet.Config as cms + +from Configuration.StandardSequences.Eras import eras + +from Configuration.Eras.Era_Run3_dd4hep_cff import Run3_dd4hep + +process = cms.Process("Demo", eras.run3_GEM, Run3_dd4hep) + +process.load("Configuration.StandardSequences.GeometryRecoDB_cff") +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:upgrade2021', '') + +from Configuration.AlCa.autoCond import autoCond +process.load('Geometry.MuonNumbering.muonNumberingInitialization_cfi') + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(1) +) + +process.load("Alignment.CommonAlignmentProducer.FakeAlignmentSource_cfi") +process.preferFakeAlign = cms.ESPrefer("FakeAlignmentSource") + +process.source = cms.Source("EmptySource") + +process.test = cms.EDAnalyzer("GEMGeometryAnalyzer") + +process.p = cms.Path(process.test) + +### TO ACTIVATE LogTrace NEED TO COMPILE IT WITH: +### ----------------------------------------------------------- +### --> scram b -j8 USER_CXXFLAGS="-DEDM_ML_DEBUG" +### Make sure that you first cleaned your CMSSW version: +### --> scram b clean +### before issuing the scram command above +############################################################### +process.load("FWCore.MessageLogger.MessageLogger_cfi") +# +# +process.MessageLogger.debugModules = cms.untracked.vstring("*") +process.MessageLogger.cerr.enable = False +process.MessageLogger.files.junk = dict() +process.MessageLogger.cout = cms.untracked.PSet( + enable = cms.untracked.bool(True), + threshold = cms.untracked.string("DEBUG"), + default = cms.untracked.PSet( limit = cms.untracked.int32(0) ), + FwkReport = cms.untracked.PSet( limit = cms.untracked.int32(-1) ), + # GEMGeometryBuilderFromDDD = cms.untracked.PSet( limit = cms.untracked.int32(-1) ), + # GEMNumberingScheme = cms.untracked.PSet( limit = cms.untracked.int32(-1) ), +) diff --git a/Geometry/GEMGeometry/test/testGEMGeometryFromLocalDBDD4hep_cfg.py b/Geometry/GEMGeometry/test/testGEMGeometryFromLocalDBDD4hep_cfg.py new file mode 100644 index 0000000000000..36c3f339ec4bc --- /dev/null +++ b/Geometry/GEMGeometry/test/testGEMGeometryFromLocalDBDD4hep_cfg.py @@ -0,0 +1,79 @@ +import FWCore.ParameterSet.Config as cms + +from Configuration.StandardSequences.Eras import eras +from Configuration.Eras.Era_Run3_dd4hep_cff import Run3_dd4hep + +process = cms.Process("Demo", eras.run3_GEM, Run3_dd4hep) + +process.load('Configuration.StandardSequences.GeometryRecoDB_cff') +process.load('CondCore.CondDB.CondDB_cfi') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:upgrade2021', '') + +from Configuration.AlCa.autoCond import autoCond +process.load('Geometry.MuonNumbering.muonNumberingInitialization_cfi') + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(1) +) + +process.load("Alignment.CommonAlignmentProducer.FakeAlignmentSource_cfi") +process.preferFakeAlign = cms.ESPrefer("FakeAlignmentSource") + +process.source = cms.Source("EmptySource") + + + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(1) + ) + +process.CondDB.timetype = cms.untracked.string('runnumber') +process.CondDB.connect = cms.string('sqlite_file:myfile.db') +process.PoolDBESSourceGeometry = cms.ESSource("PoolDBESSource", + process.CondDB, + toGet = cms.VPSet(cms.PSet(record = cms.string('GeometryFileRcd'),tag = cms.string('XMLFILE_Geometry_TagXX_Extended2021_mc')), + cms.PSet(record = cms.string('IdealGeometryRecord'),tag = cms.string('TKRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PEcalBarrelRcd'), tag = cms.string('EBRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PEcalEndcapRcd'), tag = cms.string('EERECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PEcalPreshowerRcd'),tag = cms.string('EPRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PHcalRcd'), tag = cms.string('HCALRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PCaloTowerRcd'), tag = cms.string('CTRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PZdcRcd'), tag = cms.string('ZDCRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PCastorRcd'), tag = cms.string('CASTORRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('CSCRecoGeometryRcd'),tag = cms.string('CSCRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('CSCRecoDigiParametersRcd'),tag = cms.string('CSCRECODIGI_Geometry_TagXX')), + cms.PSet(record = cms.string('DTRecoGeometryRcd'),tag = cms.string('DTRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('RPCRecoGeometryRcd'),tag = cms.string('RPCRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('GEMRecoGeometryRcd'),tag = cms.string('GEMRECO_Geometry_TagXX')) + ) + ) +process.es_prefer_geometry = cms.ESPrefer( "PoolDBESSource", "PoolDBESSourceGeometry" ) + + +process.test = cms.EDAnalyzer("GEMGeometryAnalyzer") + +process.p = cms.Path(process.test) + +### TO ACTIVATE LogTrace NEED TO COMPILE IT WITH: +### ----------------------------------------------------------- +### --> scram b -j8 USER_CXXFLAGS="-DEDM_ML_DEBUG" +### Make sure that you first cleaned your CMSSW version: +### --> scram b clean +### before issuing the scram command above +############################################################### +process.load("FWCore.MessageLogger.MessageLogger_cfi") +# +# +process.MessageLogger.debugModules = cms.untracked.vstring("*") +process.MessageLogger.cerr.enable = False +process.MessageLogger.files.junk = dict() +process.MessageLogger.cout = cms.untracked.PSet( + enable = cms.untracked.bool(True), + threshold = cms.untracked.string("DEBUG"), + default = cms.untracked.PSet( limit = cms.untracked.int32(0) ), + FwkReport = cms.untracked.PSet( limit = cms.untracked.int32(-1) ), + # GEMGeometryBuilderFromDDD = cms.untracked.PSet( limit = cms.untracked.int32(-1) ), + # GEMNumberingScheme = cms.untracked.PSet( limit = cms.untracked.int32(-1) ), +) diff --git a/Geometry/RPCGeometry/test/testRPCGeometryDD4hep_cfg.py b/Geometry/RPCGeometry/test/testRPCGeometryDD4hep_cfg.py new file mode 100644 index 0000000000000..60bd17c65dacb --- /dev/null +++ b/Geometry/RPCGeometry/test/testRPCGeometryDD4hep_cfg.py @@ -0,0 +1,22 @@ +import FWCore.ParameterSet.Config as cms + +from Configuration.Eras.Era_Run3_dd4hep_cff import Run3_dd4hep + +process = cms.Process("Demo", Run3_dd4hep) + +process.load('Configuration.Geometry.GeometryDD4hepExtended2021Reco_cff') + +process.load('FWCore.MessageLogger.MessageLogger_cfi') + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(1) +) +process.source = cms.Source("EmptySource") + +process.MessageLogger = cms.Service("MessageLogger") + +process.test1 = cms.EDAnalyzer("RPCGEO") +process.test2 = cms.EDAnalyzer("RPCGeometryAnalyzer") + +process.p = cms.Path(process.test1+process.test2) + diff --git a/Geometry/RPCGeometry/test/testRPCGeometryFromDBDD4hep_cfg.py b/Geometry/RPCGeometry/test/testRPCGeometryFromDBDD4hep_cfg.py new file mode 100644 index 0000000000000..1618d6095a332 --- /dev/null +++ b/Geometry/RPCGeometry/test/testRPCGeometryFromDBDD4hep_cfg.py @@ -0,0 +1,29 @@ +import FWCore.ParameterSet.Config as cms + +from Configuration.Eras.Era_Run3_dd4hep_cff import Run3_dd4hep + +process = cms.Process("Demo", Run3_dd4hep) + +process.load("Configuration.StandardSequences.GeometryRecoDB_cff") + +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') + +from Configuration.AlCa.autoCond import autoCond +process.GlobalTag.globaltag = autoCond['upgrade2021'] + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(1) +) + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(1) +) +process.source = cms.Source("EmptySource") + +process.MessageLogger = cms.Service("MessageLogger") + +process.test1 = cms.EDAnalyzer("RPCGEO") +process.test2 = cms.EDAnalyzer("RPCGeometryAnalyzer") + +process.p = cms.Path(process.test1+process.test2) + diff --git a/Geometry/RPCGeometry/test/testRPCGeometryFromLocalDBDD4hep_cfg.py b/Geometry/RPCGeometry/test/testRPCGeometryFromLocalDBDD4hep_cfg.py new file mode 100644 index 0000000000000..5b3dbc333ed5b --- /dev/null +++ b/Geometry/RPCGeometry/test/testRPCGeometryFromLocalDBDD4hep_cfg.py @@ -0,0 +1,47 @@ +import FWCore.ParameterSet.Config as cms + +from Configuration.Eras.Era_Run3_dd4hep_cff import Run3_dd4hep + +process = cms.Process("GeometryTest", Run3_dd4hep) + +process.load("Configuration.StandardSequences.GeometryRecoDB_cff") + +process.load('CondCore.CondDB.CondDB_cfi') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') + +from Configuration.AlCa.autoCond import autoCond +process.GlobalTag.globaltag = autoCond['upgrade2021'] + +process.source = cms.Source("EmptySource") + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(1) +) + +process.CondDB.timetype = cms.untracked.string('runnumber') +process.CondDB.connect = cms.string('sqlite_file:myfile.db') +process.PoolDBESSourceGeometry = cms.ESSource("PoolDBESSource", + process.CondDB, + toGet = cms.VPSet(cms.PSet(record = cms.string('GeometryFileRcd'),tag = cms.string('XMLFILE_Geometry_TagXX_Extended2021_mc')), + cms.PSet(record = cms.string('IdealGeometryRecord'),tag = cms.string('TKRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PEcalBarrelRcd'), tag = cms.string('EBRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PEcalEndcapRcd'), tag = cms.string('EERECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PEcalPreshowerRcd'),tag = cms.string('EPRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PHcalRcd'), tag = cms.string('HCALRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PCaloTowerRcd'), tag = cms.string('CTRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PZdcRcd'), tag = cms.string('ZDCRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PCastorRcd'), tag = cms.string('CASTORRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('CSCRecoGeometryRcd'),tag = cms.string('CSCRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('CSCRecoDigiParametersRcd'),tag = cms.string('CSCRECODIGI_Geometry_TagXX')), + cms.PSet(record = cms.string('DTRecoGeometryRcd'),tag = cms.string('DTRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('RPCRecoGeometryRcd'),tag = cms.string('RPCRECO_Geometry_TagXX')) + ) + ) + +process.es_prefer_geometry = cms.ESPrefer( "PoolDBESSource", "PoolDBESSourceGeometry" ) + +process.test1 = cms.EDAnalyzer("RPCGEO") +process.test2 = cms.EDAnalyzer("RPCGeometryAnalyzer") + +process.p = cms.Path(process.test1+process.test2) + diff --git a/Geometry/TrackerGeometryBuilder/test/ModuleInfo.cc b/Geometry/TrackerGeometryBuilder/test/ModuleInfo.cc index 54ed55bad9e66..8d5919d798a4a 100644 --- a/Geometry/TrackerGeometryBuilder/test/ModuleInfo.cc +++ b/Geometry/TrackerGeometryBuilder/test/ModuleInfo.cc @@ -37,6 +37,7 @@ #include "Geometry/CommonDetUnit/interface/PixelGeomDetUnit.h" #include "DataFormats/GeometrySurface/interface/BoundSurface.h" +#include "DataFormats/Math/interface/angle_units.h" #include "DataFormats/Math/interface/Rounding.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" @@ -44,12 +45,6 @@ #include "DataFormats/TrackerCommon/interface/TrackerTopology.h" #include "Geometry/TrackerNumberingBuilder/interface/CmsTrackerStringToEnum.h" #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" -#include "DetectorDescription/Core/interface/DDRoot.h" -#include "DetectorDescription/Core/interface/DDExpandedView.h" -#include "DetectorDescription/Core/interface/DDFilter.h" -#include "DetectorDescription/Core/interface/DDFilteredView.h" -#include "DetectorDescription/Core/interface/DDCompactView.h" -#include "DetectorDescription/Core/interface/DDMaterial.h" // output #include @@ -59,6 +54,10 @@ #include using namespace cms_rounding; +using namespace geometric_det_ns; +using namespace angle_units::operators; + +typedef ROOT::Math::DisplacementVector3D > Displ3DVec; class ModuleInfo : public edm::one::EDAnalyzer<> { public: @@ -259,8 +258,9 @@ void ModuleInfo::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup Output << " TID" << side << "\t" << "Disk " << theDisk << " Ring " << theRing << " " << part << "\t" << " module " << tTopo->tidModule(id) << "\t" << name << "\t"; - Output << " " << module->translation().X() << " \t" << module->translation().Y() << " \t" - << module->translation().Z() << std::endl; + Output << " " << roundIfNear0(module->translation().X(), tolerance_) << " \t" + << roundIfNear0(module->translation().Y(), tolerance_) << " \t" + << roundIfNear0(module->translation().Z(), tolerance_) << std::endl; break; } @@ -326,8 +326,9 @@ void ModuleInfo::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup << "\t" << "\t" << " module " << theModule << "\t" << name << "\t"; - Output << " " << module->translation().X() << " \t" << module->translation().Y() << " \t" - << module->translation().Z() << std::endl; + Output << " " << roundIfNear0(module->translation().X(), tolerance_) << " \t" + << roundIfNear0(module->translation().Y(), tolerance_) << " \t" + << roundIfNear0(module->translation().Z(), tolerance_) << std::endl; // TEC output as Martin Weber's int out_side = (tTopo->tecSide(id) == 1) ? -1 : 1; @@ -385,6 +386,10 @@ void ModuleInfo::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup double out_r = sqrt(module->translation().X() * module->translation().X() + module->translation().Y() * module->translation().Y()); double out_phi_rad = roundIfNear0(atan2(module->translation().Y(), module->translation().X()), tolerance_); + if (almostEqual(out_phi_rad, -1._pi, 10)) { + out_phi_rad = 1._pi; + // Standardize phi values of |pi| to be always +pi instead of sometimes -pi. + } TECOutput << out_side << " " << out_disk << " " << out_sector << " " << out_petal << " " << out_ring << " " << out_module << " " << out_sensor << " " << out_x << " " << out_y << " " << out_z << " " << out_r << " " << out_phi_rad << std::endl; @@ -413,20 +418,25 @@ void ModuleInfo::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup Output << "\t" << "thickness " << std::fixed << std::setprecision(0) << thickness << " um \n"; Output << "\tActive Area Center" << std::endl; - Output << "\t O = (" << std::fixed << std::setprecision(4) << module->translation().X() << "," << std::fixed - << std::setprecision(4) << module->translation().Y() << "," << std::fixed << std::setprecision(4) - << module->translation().Z() << ")" << std::endl; + Output << "\t O = (" << std::fixed << std::setprecision(4) << roundIfNear0(module->translation().X(), tolerance_) + << "," << std::fixed << std::setprecision(4) << roundIfNear0(module->translation().Y(), tolerance_) << "," + << std::fixed << std::setprecision(4) << roundIfNear0(module->translation().Z(), tolerance_) << ")" + << std::endl; // double polarRadius = std::sqrt(module->translation().X() * module->translation().X() + module->translation().Y() * module->translation().Y()); - double phiDeg = atan2(module->translation().Y(), module->translation().X()) * 360. / 6.283185307; - double phiRad = atan2(module->translation().Y(), module->translation().X()); + double phiRad = roundIfNear0(atan2(module->translation().Y(), module->translation().X()), tolerance_); + if (almostEqual(phiRad, -1._pi, 10)) { + phiRad = 1._pi; + // Standardize phi values of |pi| to be always +pi instead of sometimes -pi. + } + double phiDeg = convertRadToDeg(phiRad); // Output << "\t\t polar radius " << std::fixed << std::setprecision(4) << polarRadius << "\t" << "phi [deg] " << std::fixed << std::setprecision(4) << phiDeg << "\t" << "phi [rad] " << std::fixed << std::setprecision(4) << phiRad << std::endl; // active area versors (rotation matrix) - DD3Vector x, y, z; + Displ3DVec x, y, z; module->rotation().GetComponents(x, y, z); x = roundVecIfNear0(x, tolerance_); y = roundVecIfNear0(y, tolerance_); @@ -456,9 +466,10 @@ void ModuleInfo::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup if (fromDDD_ && printDDD_) { NumberingOutput << " " << detPos; } - NumberingOutput << " " << std::fixed << std::setprecision(4) << module->translation().X() << " " << std::fixed - << std::setprecision(4) << module->translation().Y() << " " << std::fixed << std::setprecision(4) - << module->translation().Z() << " " << std::endl; + NumberingOutput << " " << std::fixed << std::setprecision(4) << roundIfNear0(module->translation().X(), tolerance_) + << " " << std::fixed << std::setprecision(4) << roundIfNear0(module->translation().Y(), tolerance_) + << " " << std::fixed << std::setprecision(4) << roundIfNear0(module->translation().Z(), tolerance_) + << " " << std::endl; // } diff --git a/Geometry/TrackerGeometryBuilder/test/python/testTrackerModuleInfoDBDD4hep_cfg.py b/Geometry/TrackerGeometryBuilder/test/python/testTrackerModuleInfoDBDD4hep_cfg.py new file mode 100644 index 0000000000000..aae9ee16cf7c8 --- /dev/null +++ b/Geometry/TrackerGeometryBuilder/test/python/testTrackerModuleInfoDBDD4hep_cfg.py @@ -0,0 +1,40 @@ +import FWCore.ParameterSet.Config as cms + +from Configuration.Eras.Era_Run3_dd4hep_cff import Run3_dd4hep + +process = cms.Process("GeometryTest", Run3_dd4hep) + +process.load('FWCore.MessageLogger.MessageLogger_cfi') +process.load('Configuration.Geometry.GeometryRecoDB_cff') +process.load('CondCore.CondDB.CondDB_cfi') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +from Configuration.AlCa.autoCond import autoCond +process.GlobalTag.globaltag = autoCond['upgrade2021'] + +process.source = cms.Source("EmptySource") + + +process.TrackerGeometricDetESModule = cms.ESProducer( "TrackerGeometricDetESModule", + fromDDD = cms.bool( False ) + ) + +process.es_prefer_geomdet = cms.ESPrefer("TrackerGeometricDetESModule","") + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(1) +) + +process.load("Alignment.CommonAlignmentProducer.FakeAlignmentSource_cfi") +process.preferFakeAlign = cms.ESPrefer("FakeAlignmentSource") + +process.out = cms.OutputModule("AsciiOutputModule") + +process.prod = cms.EDAnalyzer("ModuleInfo", + fromDDD = cms.bool(False), + tolerance = cms.untracked.double(1.0e-23) +) + +process.p1 = cms.Path(process.prod) +process.ep = cms.EndPath(process.out) + + diff --git a/Geometry/TrackerGeometryBuilder/test/python/testTrackerModuleInfoDD4hep_cfg.py b/Geometry/TrackerGeometryBuilder/test/python/testTrackerModuleInfoDD4hep_cfg.py new file mode 100644 index 0000000000000..04ceeb6230cc1 --- /dev/null +++ b/Geometry/TrackerGeometryBuilder/test/python/testTrackerModuleInfoDD4hep_cfg.py @@ -0,0 +1,49 @@ +import FWCore.ParameterSet.Config as cms + +from Configuration.Eras.Era_Run3_dd4hep_cff import Run3_dd4hep + +process = cms.Process("GeometryTest", Run3_dd4hep) +process.load("FWCore.MessageLogger.MessageLogger_cfi") + +# Choose Tracker Geometry +process.load('Configuration.Geometry.GeometryDD4hepExtended2021Reco_cff') + +process.TrackerGeometricDetESModule = cms.ESProducer( "TrackerGeometricDetESModule", + fromDDD = cms.bool( False ), + fromDD4hep = cms.bool( True ) + ) + +process.es_prefer_geomdet = cms.ESPrefer("TrackerGeometricDetESModule","") + +process.load("Geometry.TrackerGeometryBuilder.TrackerAdditionalParametersPerDet_cfi") + +process.load("Alignment.CommonAlignmentProducer.FakeAlignmentSource_cfi") +process.preferFakeAlign = cms.ESPrefer("FakeAlignmentSource") + +process.source = cms.Source("EmptySource") + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(1) +) +process.out = cms.OutputModule("AsciiOutputModule") + +process.load("FWCore.MessageLogger.MessageLogger_cfi") +process.MessageLogger.debugModules.append('*') +process.MessageLogger.cout = cms.untracked.PSet( + threshold = cms.untracked.string('DEBUG'), + default = cms.untracked.PSet( limit = cms.untracked.int32(0) ), + TrackerNumberingBuilder = cms.untracked.PSet( limit = cms.untracked.int32(-1) ), + TrackerGeometryBuilder = cms.untracked.PSet( limit = cms.untracked.int32(-1) ), + ModuleInfo = cms.untracked.PSet( limit = cms.untracked.int32(-1) ), + ) + +process.prod = cms.EDAnalyzer("ModuleInfo", + fromDDD = cms.bool(False), + printDDD = cms.untracked.bool(False), + tolerance = cms.untracked.double(1.0e-23) +) + +process.p1 = cms.Path(process.prod) +process.ep = cms.EndPath(process.out) + + diff --git a/Geometry/TrackerGeometryBuilder/test/python/trackerModuleInfoLocalDBDD4hep_cfg.py b/Geometry/TrackerGeometryBuilder/test/python/trackerModuleInfoLocalDBDD4hep_cfg.py new file mode 100644 index 0000000000000..1bf1464571dc6 --- /dev/null +++ b/Geometry/TrackerGeometryBuilder/test/python/trackerModuleInfoLocalDBDD4hep_cfg.py @@ -0,0 +1,54 @@ +import FWCore.ParameterSet.Config as cms + +from Configuration.Eras.Era_Run3_dd4hep_cff import Run3_dd4hep + +process = cms.Process("GeometryTest", Run3_dd4hep) + +process.load('Configuration.Geometry.GeometryRecoDB_cff') +process.load('CondCore.CondDB.CondDB_cfi') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +from Configuration.AlCa.autoCond import autoCond +process.GlobalTag.globaltag = autoCond['upgrade2021'] + +process.source = cms.Source("EmptySource") + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(1) +) + +process.CondDB.timetype = cms.untracked.string('runnumber') +process.CondDB.connect = cms.string('sqlite_file:myfile.db') +process.PoolDBESSourceGeometry = cms.ESSource("PoolDBESSource", + process.CondDB, + toGet = cms.VPSet(cms.PSet(record = cms.string('GeometryFileRcd'),tag = cms.string('XMLFILE_Geometry_TagXX_Extended2021_mc')), + cms.PSet(record = cms.string('IdealGeometryRecord'),tag = cms.string('TKRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PEcalBarrelRcd'), tag = cms.string('EBRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PEcalEndcapRcd'), tag = cms.string('EERECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PEcalPreshowerRcd'),tag = cms.string('EPRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PHcalRcd'), tag = cms.string('HCALRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PCaloTowerRcd'), tag = cms.string('CTRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PZdcRcd'), tag = cms.string('ZDCRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PCastorRcd'), tag = cms.string('CASTORRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('CSCRecoGeometryRcd'),tag = cms.string('CSCRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('CSCRecoDigiParametersRcd'),tag = cms.string('CSCRECODIGI_Geometry_TagXX')), + cms.PSet(record = cms.string('DTRecoGeometryRcd'),tag = cms.string('DTRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('RPCRecoGeometryRcd'),tag = cms.string('RPCRECO_Geometry_TagXX')) + ) + ) + +process.es_prefer_geometry = cms.ESPrefer( "PoolDBESSource", "PoolDBESSourceGeometry" ) + +process.load("Alignment.CommonAlignmentProducer.FakeAlignmentSource_cfi") +process.preferFakeAlign = cms.ESPrefer("FakeAlignmentSource") + +process.out = cms.OutputModule("AsciiOutputModule") + +process.prod = cms.EDAnalyzer("ModuleInfo", + fromDDD = cms.bool(False), + tolerance = cms.untracked.double(1.0e-23) +) + +process.p1 = cms.Path(process.prod) +process.ep = cms.EndPath(process.out) + + diff --git a/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h b/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h index a8f58a46170d5..ff5a04d354d32 100644 --- a/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h +++ b/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h @@ -166,6 +166,9 @@ class GeometricDet { // CUSTOM DESTRUCTOR ~GeometricDet(); + // Utility function + static std::string printNavType(int const* n, size_t sz); + private: std::vector computeLegacyShapeParameters(const cms::DDSolidShape& mySolidShape, const dd4hep::Solid& mySolid) const; @@ -201,5 +204,12 @@ class GeometricDet { ConstGeometricDetContainer container_; }; +namespace geometric_det_ns { + inline std::ostream& operator<<(std::ostream& os, const GeometricDet::NavRange& n) { + os << GeometricDet::printNavType(n.first, n.second); + return os; + } +} // namespace geometric_det_ns + #undef PoolAlloc #endif diff --git a/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc b/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc index 9579db5aef07c..cd51ef67bc3b2 100644 --- a/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc +++ b/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc @@ -343,3 +343,13 @@ std::vector GeometricDet::computeLegacyShapeParameters(const cms::DDSoli return myOldDDShapeParameters; } + +std::string GeometricDet::printNavType(int const* n, size_t sz) { + std::ostringstream oss; + oss << '('; + for (int const* it = n; it != n + sz; ++it) { + oss << *it << ','; + } + oss << ')'; + return oss.str(); +} diff --git a/Geometry/TrackerNumberingBuilder/test/ModuleNumbering.cc b/Geometry/TrackerNumberingBuilder/test/ModuleNumbering.cc index acbf0af618c81..2753ff113003d 100644 --- a/Geometry/TrackerNumberingBuilder/test/ModuleNumbering.cc +++ b/Geometry/TrackerNumberingBuilder/test/ModuleNumbering.cc @@ -44,12 +44,6 @@ #include "Geometry/Records/interface/TrackerTopologyRcd.h" #include "Geometry/TrackerNumberingBuilder/interface/CmsTrackerStringToEnum.h" #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" -#include "DetectorDescription/Core/interface/DDRoot.h" -#include "DetectorDescription/Core/interface/DDExpandedView.h" -#include "DetectorDescription/Core/interface/DDFilter.h" -#include "DetectorDescription/Core/interface/DDFilteredView.h" -#include "DetectorDescription/Core/interface/DDCompactView.h" -#include "DetectorDescription/Core/interface/DDMaterial.h" // output #include @@ -315,7 +309,8 @@ void ModuleNumbering::analyze(const edm::Event& iEvent, const edm::EventSetup& i GeometricDet::nav_type detNavType = mapDetIdToGeometricDet[myDetId]->navType(); // Output << " raw Id = " << rawid << " (" << binary_detid << ")" - << "\t nav type = " << printNavType(&detNavType.front(), detNavType.size()) << std::endl; + << "\t nav type = " << GeometricDet::printNavType(&detNavType.front(), detNavType.size()) + << std::endl; // variables fillModuleVariables(mapDetIdToGeometricDet[myDetId], polarRadius, phiRad, z); @@ -511,7 +506,8 @@ void ModuleNumbering::analyze(const edm::Event& iEvent, const edm::EventSetup& i GeometricDet::nav_type detNavType = mapDetIdToGeometricDet[myDetId]->navType(); // Output << " raw Id = " << rawid << " (" << binary_detid << ")" - << "\t nav type = " << printNavType(&detNavType.front(), detNavType.size()) << std::endl; + << "\t nav type = " << GeometricDet::printNavType(&detNavType.front(), detNavType.size()) + << std::endl; // variables fillModuleVariables(mapDetIdToGeometricDet[myDetId], polarRadius, phiRad, z); @@ -698,7 +694,8 @@ void ModuleNumbering::analyze(const edm::Event& iEvent, const edm::EventSetup& i GeometricDet::nav_type detNavType = mapDetIdToGeometricDet[myDetId]->navType(); // Output << " raw Id = " << rawid << " (" << binary_detid << ")" - << "\t nav type = " << printNavType(&detNavType.front(), detNavType.size()) << std::endl; + << "\t nav type = " << GeometricDet::printNavType(&detNavType.front(), detNavType.size()) + << std::endl; // variables fillModuleVariables(mapDetIdToGeometricDet[myDetId], polarRadius, phiRad, z); @@ -918,7 +915,8 @@ void ModuleNumbering::analyze(const edm::Event& iEvent, const edm::EventSetup& i GeometricDet::nav_type detNavType = mapDetIdToGeometricDet[myDetId]->navType(); // Output << " raw Id = " << rawid << " (" << binary_detid << ")" - << "\t nav type = " << printNavType(&detNavType.front(), detNavType.size()) << std::endl; + << "\t nav type = " << GeometricDet::printNavType(&detNavType.front(), detNavType.size()) + << std::endl; // variables fillModuleVariables(mapDetIdToGeometricDet[myDetId], polarRadius, phiRad, z); diff --git a/SimG4Core/PrintGeomInfo/plugins/PrintGeomInfoAction.cc b/SimG4Core/PrintGeomInfo/plugins/PrintGeomInfoAction.cc index 86c450029458b..af197a0114cfa 100644 --- a/SimG4Core/PrintGeomInfo/plugins/PrintGeomInfoAction.cc +++ b/SimG4Core/PrintGeomInfo/plugins/PrintGeomInfoAction.cc @@ -78,7 +78,7 @@ class PrintGeomInfoAction : public SimWatcher, public Observer("DumpReplica", false); dumpTouch_ = p.getUntrackedParameter("DumpTouch", false); dumpSense_ = p.getUntrackedParameter("DumpSense", false); + dumpParams_ = p.getUntrackedParameter("DumpParams", false); dd4hep_ = p.getUntrackedParameter("DD4hep", false); name_ = p.getUntrackedParameter("Name", "*"); nchar_ = name_.find('*'); @@ -163,8 +164,20 @@ void PrintGeomInfoAction::beginRun(edm::EventSetup const &es) { G4cout << leafDepth << spaces << "### VOLUME = " << lvname << " Copy No"; for (unsigned int k = 0; k < leafDepth; ++k) G4cout << " " << copy[k]; - G4cout << " Centre at " << tran << " (r = " << tran.Rho() << ", phi = " << convertRadToDeg(tran.phi()) << ")" - << G4endl; + if (dumpParams_) { + G4cout << " parameters"; + for (double val : fv.parameters()) { + if (std::abs(val) < 1.0) { + G4cout << std::setprecision(5); + } else + G4cout << std::setprecision(6); + G4cout << " " << val; + } + G4cout << G4endl; + } else { + G4cout << " Centre at " << tran << " (r = " << tran.Rho() << ", phi = " << convertRadToDeg(tran.phi()) + << ")" << G4endl; + } } } } else { diff --git a/SimG4Core/PrintGeomInfo/python/customiseg4PrintGeomInfo.py b/SimG4Core/PrintGeomInfo/python/customiseg4PrintGeomInfo.py index 7fda6685fefac..68d389ec1294d 100644 --- a/SimG4Core/PrintGeomInfo/python/customiseg4PrintGeomInfo.py +++ b/SimG4Core/PrintGeomInfo/python/customiseg4PrintGeomInfo.py @@ -19,6 +19,7 @@ def customise(process): DumpReplica = cms.untracked.bool(False), DumpTouch = cms.untracked.bool(False), DumpSense = cms.untracked.bool(False), + DumpParams = cms.untracked.bool(False), DD4hep = cms.untracked.bool(False), Name = cms.untracked.string('CMS*'), Names = cms.untracked.vstring(' '), diff --git a/SimG4Core/PrintGeomInfo/python/g4PrintGeomInfo_cfi.py b/SimG4Core/PrintGeomInfo/python/g4PrintGeomInfo_cfi.py index 76f944fe87619..02ae60f3475d0 100644 --- a/SimG4Core/PrintGeomInfo/python/g4PrintGeomInfo_cfi.py +++ b/SimG4Core/PrintGeomInfo/python/g4PrintGeomInfo_cfi.py @@ -52,6 +52,7 @@ def printGeomInfo(process): DumpReplica = cms.untracked.bool(False), DumpTouch = cms.untracked.bool(False), DumpSense = cms.untracked.bool(False), + DumpParams = cms.untracked.bool(False), DD4hep = cms.untracked.bool(False), Name = cms.untracked.string('TotemT*'), Names = cms.untracked.vstring(' '), diff --git a/SimG4Core/PrintGeomInfo/test/python/runDD4hepLocalDB_cfg.py b/SimG4Core/PrintGeomInfo/test/python/runDD4hepLocalDB_cfg.py new file mode 100644 index 0000000000000..478ed097ac166 --- /dev/null +++ b/SimG4Core/PrintGeomInfo/test/python/runDD4hepLocalDB_cfg.py @@ -0,0 +1,70 @@ +import FWCore.ParameterSet.Config as cms + +from Configuration.Eras.Era_Run3_dd4hep_cff import Run3_dd4hep +process = cms.Process('G4PrintGeometry',Run3_dd4hep) +process.load('Configuration.StandardSequences.GeometryRecoDB_cff') +process.load('Configuration.StandardSequences.GeometrySimDB_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +process.load('CondCore.CondDB.CondDB_cfi') +from Configuration.AlCa.GlobalTag import GlobalTag + +process.source = cms.Source("EmptySource") + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(1) +) + +process.CondDB.timetype = cms.untracked.string('runnumber') +process.CondDB.connect = cms.string('sqlite_file:myfile.db') +process.PoolDBESSourceGeometry = cms.ESSource("PoolDBESSource", + process.CondDB, + toGet = cms.VPSet(cms.PSet(record = cms.string('GeometryFileRcd'), + tag = cms.string('XMLFILE_Geometry_TagXX_Extended2021_mc'), + label = cms.untracked.string("Extended")), + cms.PSet(record = cms.string('IdealGeometryRecord'),tag = cms.string('TKRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PTrackerParametersRcd'),tag = cms.string('TKParameters_Geometry_TagXX')), + cms.PSet(record = cms.string('PEcalBarrelRcd'), tag = cms.string('EBRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PEcalEndcapRcd'), tag = cms.string('EERECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PEcalPreshowerRcd'),tag = cms.string('EPRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PHcalRcd'), tag = cms.string('HCALRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('HcalParametersRcd'), tag = cms.string('HCALParameters_Geometry_TagXX')), + cms.PSet(record = cms.string('PCaloTowerRcd'), tag = cms.string('CTRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PZdcRcd'), tag = cms.string('ZDCRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('PCastorRcd'), tag = cms.string('CASTORRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('CSCRecoGeometryRcd'),tag = cms.string('CSCRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('CSCRecoDigiParametersRcd'),tag = cms.string('CSCRECODIGI_Geometry_TagXX')), + cms.PSet(record = cms.string('DTRecoGeometryRcd'),tag = cms.string('DTRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('RPCRecoGeometryRcd'),tag = cms.string('RPCRECO_Geometry_TagXX')), + cms.PSet(record = cms.string('GEMRecoGeometryRcd'),tag = cms.string('GEMRECO_Geometry_TagXX')) + ) + ) + +process.es_prefer_geometry = cms.ESPrefer( "PoolDBESSource", "PoolDBESSourceGeometry" ) +from SimG4Core.PrintGeomInfo.g4PrintGeomInfo_cfi import * + +process = printGeomInfo(process) + +if hasattr(process,'MessageLogger'): + process.MessageLogger.G4cout=dict() + process.MessageLogger.G4cerr=dict() + +process.g4SimHits.Watchers = cms.VPSet(cms.PSet( + DumpSummary = cms.untracked.bool(False), + DumpLVTree = cms.untracked.bool(False), + DumpMaterial = cms.untracked.bool(False), + DumpLVList = cms.untracked.bool(False), + DumpLV = cms.untracked.bool(False), + DumpSolid = cms.untracked.bool(False), + DumpAttributes = cms.untracked.bool(False), + DumpPV = cms.untracked.bool(False), + DumpRotation = cms.untracked.bool(False), + DumpReplica = cms.untracked.bool(False), + DumpTouch = cms.untracked.bool(False), + DumpSense = cms.untracked.bool(True), + DumpParams = cms.untracked.bool(True), + DD4hep = cms.untracked.bool(True), + Name = cms.untracked.string(''), + Names = cms.untracked.vstring(''), + FileDetail = cms.untracked.bool(True), + type = cms.string('PrintGeomInfoAction') +)) diff --git a/Validation/Geometry/test/dddvsdb/runDD4hepvsDBGeometryValidation.sh b/Validation/Geometry/test/dddvsdb/runDD4hepvsDBGeometryValidation.sh new file mode 100755 index 0000000000000..8b70f1f9de559 --- /dev/null +++ b/Validation/Geometry/test/dddvsdb/runDD4hepvsDBGeometryValidation.sh @@ -0,0 +1,637 @@ +#! /bin/tcsh + +cmsenv + +echo " START Geometry Validation" + +# $1 is the Global Tag +# $2 is the scenario, like "ExtendedGeometry2021". Omit "DD4hep". +# $3 is "round" to round values in comparisons to 0 if < |1.e7|. +# Omit this option to show differences down to |1.e-23|. + +# Note this script only currently supports Run 3. +# In future, it should be enhanced to support Runs 1-2 and Phase 2. + +set roundFlag = '' +if ($#argv == 0) then + set gtag="auto:upgrade2021" + set geometry="ExtendedGeometry2021" +else if($#argv == 1) then + set gtag=`echo ${1}` + set geometry="ExtendedGeometry2021" +else if ($#argv == 2) then + set gtag=`echo ${1}` + set geometry=`echo ${2}` +else if ($#argv == 3) then + set gtag=`echo ${1}` + set geometry=`echo ${2}` + set roundFlag = `echo ${3}` +endif +echo GlobalTag = ${gtag} +echo geometry = ${geometry} +echo roundFlag = ${roundFlag} + +set tolerance = '1.0e-7' +# If rounding enabled, tolerance for numerical comparisons. Absolute values less than this are set to 0. + +#global tag gtag is assumed to be of the form GeometryWORD such as GeometryExtended or GeometryIdeal +#as of 3.4.X loaded objects in the DB, these correspond to condlabels Extended, Ideal, etc... +# Run 2 Extended condlabel corresponds to GeometryExtended2015 scenario. +set condlabel = `(echo $geometry | sed -e '{s/Geometry//g}' -e '{s/Plan//g}' -e '{s/[0-9]*//g}')` +echo ${condlabel} " geometry label from db" + +set workArea = `(echo $geometry)` +mkdir ${workArea} +cd ${workArea} +set myDir=`pwd` +echo $myDir + +cp $CMSSW_RELEASE_BASE/src/CondTools/Geometry/test/writehelpers/geometryExtended2021DD4hep_xmlwriter.py geometryExtendedDD4hep_xmlwriter.py +echo $geometry +sed -i "{s/ExtendedGeometry2021/${geometry}/}" geometryExtendedDD4hep_xmlwriter.py > GeometryValidation.log +cmsRun geometryExtendedDD4hep_xmlwriter.py >> GeometryValidation.log + +cp $CMSSW_RELEASE_BASE/src/CondTools/Geometry/test/writehelpers/geometryExtended2021DD4hep_writer.py . +# cp $CMSSW_BASE/src/CondTools/Geometry/test/writehelpers/geometryExtended2021DD4hep_writer.py . +# When more Reco writer configs are available, there should be a way to choose the correct version. +# sed -i "{s/GeometryExtended/${geometry}/}" geometrywriter.py >> GeometryValidation.log +cmsRun geometryExtended2021DD4hep_writer.py >> GeometryValidation.log +if ( -e myfile.db ) then + echo "The local DB file is present" | tee -a GeometryValidation.log +else + echo "ERROR the local DB file is not present" | tee -a GeometryValidation.log + exit +endif + +echo "Start compare the content of GT and the local DB" | tee -a GeometryValidation.log + +# (MEC:1) The following two tests with the diff below them actually make +# sure that the Global Tag (GT) and Local DB XML file blobs are fine... +# meaning that the full simulation geometry source is fine (XML blob) +# as well as the reco geometries. +cp $CMSSW_BASE/src/CondTools/Geometry/test/geometrytest_local.py . +# cp $CMSSW_RELEASE_BASE/src/CondTools/Geometry/test/geometrytest_local.py . +sed -i "{/process.GlobalTag.globaltag/d}" geometrytest_local.py >> GeometryValidation.log +sed -i "/FrontierConditions_GlobalTag_cff/ a\from Configuration.AlCa.GlobalTag import GlobalTag\nprocess.GlobalTag = GlobalTag(process.GlobalTag, '${gtag}', '')" geometrytest_local.py >> GeometryValidation.log +set geomabbrev = `(echo $geometry | sed -e '{s/Geometry//g}')` +sed -i "{s/Extended_TagXX/TagXX_${geomabbrev}_mc/}" geometrytest_local.py >> GeometryValidation.log +if ( "${roundFlag}" == round ) then + sed -i "/roundValues/s/False/True/" geometrytest_local.py >> GeometryValidation.log +endif + +cmsRun geometrytest_local.py > outLocalDB.log +if ( -s outLocalDB.log ) then + echo "Local DB access run ok" | tee -a GeometryValidation.log +else + echo "ERROR the output of Local DB access test is empty" | tee -a GeometryValidation.log + exit +endif + +# cp $CMSSW_RELEASE_BASE/src/CondTools/Geometry/test/geometrytestDD4hep_db.py . +cp $CMSSW_BASE/src/CondTools/Geometry/test/geometrytestDD4hep_db.py . +sed -i "{/process.GlobalTag.globaltag/d}" geometrytestDD4hep_db.py >> GeometryValidation.log +sed -i "/FrontierConditions_GlobalTag_cff/ a\from Configuration.AlCa.GlobalTag import GlobalTag\nprocess.GlobalTag = GlobalTag(process.GlobalTag, '${gtag}', '')" geometrytestDD4hep_db.py >> GeometryValidation.log +sed -i "/FrontierConditions_GlobalTag_cff/ a\process.DDDetectorESProducerFromDB.label = cms.string('${condlabel}')" geometrytestDD4hep_db.py >> GeometryValidation.log +if ( "${roundFlag}" == round ) then + sed -i "/roundValues/s/False/True/" geometrytestDD4hep_db.py >> GeometryValidation.log +endif +cmsRun geometrytestDD4hep_db.py > outGTDB.log +if ( -s outGTDB.log ) then + echo "GT DB access run ok" | tee -a GeometryValidation.log +else + echo "ERROR the output of GT DB access test is empty" | tee -a GeometryValidation.log + exit +endif + +diff outLocalDB.log outGTDB.log > logDiffLocalvsGT.log +if ( -s logDiffLocalvsGT.log ) then + echo "WARNING THE CONTENT OF GLOBAL TAG MAY BE DIFFERENT WITH RESPECT TO THE LOCAL DB FILE" | tee -a GeometryValidation.log + cp $CMSSW_BASE/src/Validation/Geometry/test/dddvsdb/sortXML.sh . + cp $CMSSW_BASE/src/Validation/Geometry/test/dddvsdb/sortCompositeMaterials.py . + ./sortXML.sh outLocalDB.log localdb.xml + ./sortXML.sh outGTDB.log gtdb.xml + diff localdb.xml gtdb.xml > logDiffLocXMLvsGTXML.log + sort localdb.xml > localdb.sort + sort gtdb.xml > gtdb.sort + diff localdb.sort gtdb.sort > logDiffLocvsGTSort.log + echo Examine logDiffLocXMLvsGTXML.log to see the differences in the local and GT XML files. | tee -a GeometryValidation.log + echo Examine logDiffLocvsGTSort.log to see the differences in sorted content of the local and GT XML files. | tee -a GeometryValidation.log + echo The two XML files may have real differences, or they may have identical content that is simply re-arranged. | tee -a GeometryValidation.log + echo Examining these log files can help you determine whether the XML files have significant differences. | tee -a GeometryValidation.log +endif + +echo "End compare the content of GT and the local DB" | tee -a GeometryValidation.log + +echo "Start Tracker RECO geometry validation" | tee -a GeometryValidation.log + +mkdir tkdb +mkdir tkdblocal +mkdir tkxml + +cp myfile.db tkdblocal + +cd tkdb +cp $CMSSW_BASE/src/Geometry/TrackerGeometryBuilder/test/python/testTrackerModuleInfoDBDD4hep_cfg.py . +# cp $CMSSW_RELEASE_BASE/src/Geometry/TrackerGeometryBuilder/test/python/testTrackerModuleInfoDBDD4hep_cfg.py . +sed -i "{/process.GlobalTag.globaltag/d}" testTrackerModuleInfoDBDD4hep_cfg.py >> ../GeometryValidation.log +sed -i "/FrontierConditions_GlobalTag_cff/ a\from Configuration.AlCa.GlobalTag import GlobalTag\nprocess.GlobalTag = GlobalTag(process.GlobalTag, '${gtag}', '')" testTrackerModuleInfoDBDD4hep_cfg.py >> ../GeometryValidation.log +if ( "${roundFlag}" == round ) then + sed -i "/tolerance/s/1.0e-23/${tolerance}/" testTrackerModuleInfoDBDD4hep_cfg.py >> GeometryValidation.log +endif +cmsRun testTrackerModuleInfoDBDD4hep_cfg.py >> ../GeometryValidation.log +mv testTrackerModuleInfoDBDD4hep_cfg.py ../ +if ( -s ModuleInfo.log ) then + echo "TK test from DB run ok" | tee -a ../GeometryValidation.log +else + echo "ERROR the output of TK test from DB is empty" | tee -a ../GeometryValidation.log + exit +endif + +cd ../tkdblocal +# cp $CMSSW_RELEASE_BASE/src/Geometry/TrackerGeometryBuilder/test/python/trackerModuleInfoLocalDBDD4hep_cfg.py . +cp $CMSSW_BASE/src/Geometry/TrackerGeometryBuilder/test/python/trackerModuleInfoLocalDBDD4hep_cfg.py . +sed -i "{/process.GlobalTag.globaltag/d}" trackerModuleInfoLocalDBDD4hep_cfg.py >> ../GeometryValidation.log +sed -i "/FrontierConditions_GlobalTag_cff/ a\from Configuration.AlCa.GlobalTag import GlobalTag\nprocess.GlobalTag = GlobalTag(process.GlobalTag, '${gtag}', '')" trackerModuleInfoLocalDBDD4hep_cfg.py >> ../GeometryValidation.log +if ( "${roundFlag}" == round ) then + sed -i "/tolerance/s/1.0e-23/${tolerance}/" trackerModuleInfoLocalDBDD4hep_cfg.py >> GeometryValidation.log +endif +sed -i "{s/Extended2021/${geomabbrev}/}" trackerModuleInfoLocalDBDD4hep_cfg.py >> GeometryValidation.log +cmsRun trackerModuleInfoLocalDBDD4hep_cfg.py >> ../GeometryValidation.log +mv trackerModuleInfoLocalDBDD4hep_cfg.py ../ +if ( -s ModuleInfo.log ) then + echo "TK test from Local DB run ok" | tee -a ../GeometryValidation.log +else + echo "ERROR the output of TK test from Local DB is empty" | tee -a ../GeometryValidation.log + exit +endif + +cd ../tkxml +cp $CMSSW_BASE/src/Geometry/TrackerGeometryBuilder/test/python/testTrackerModuleInfoDD4hep_cfg.py . +# cp $CMSSW_RELEASE_BASE/src/Geometry/TrackerGeometryBuilder/test/python/testTrackerModuleInfoDD4hep_cfg.py . +sed -i "{s/Extended2021/${geomabbrev}/}" testTrackerModuleInfoDD4hep_cfg.py >> GeometryValidation.log +sed -i "{/process.GlobalTag.globaltag/d}" testTrackerModuleInfoDD4hep_cfg.py >> ../GeometryValidation.log +sed -i "/FrontierConditions_GlobalTag_cff/ a\from Configuration.AlCa.GlobalTag import GlobalTag\nprocess.GlobalTag = GlobalTag(process.GlobalTag, '${gtag}', '')" testTrackerModuleInfoDD4hep_cfg.py >> ../GeometryValidation.log +if ( "${roundFlag}" == round ) then + sed -i "/tolerance/s/1.0e-23/${tolerance}/" testTrackerModuleInfoDD4hep_cfg.py >> GeometryValidation.log +endif +cmsRun testTrackerModuleInfoDD4hep_cfg.py >> ../GeometryValidation.log +mv testTrackerModuleInfoDD4hep_cfg.py ../ +if ( -s ModuleInfo.log ) then + echo "TK test from DD4hep XML run ok" | tee -a ../GeometryValidation.log +else + echo "ERROR the output of TK test from DD4hep XML is empty" | tee -a ../GeometryValidation.log + exit +endif + +cd ../ +rm -f tkdblocal/myfile.db +diff -r tkdb/ tkxml/ > logTkDiffGTvsXML.log +if ( -s logTkDiffGTvsXML.log ) then + echo "WARNING THE TRACKER RECO GEOMETRY IS DIFFERENT BETWEEN XML AND GT DB" | tee -a GeometryValidation.log +endif + +diff -r tkdblocal/ tkxml/ > logTkDiffLocalvsXML.log +if ( -s logTkDiffLocalvsXML.log ) then + echo "WARNING THE TRACKER RECO GEOMETRY IS DIFFERENT BETWEEN XML AND LOCAL DB" | tee -a GeometryValidation.log +endif + +diff -r tkdb/ tkdblocal/ > logTkDiffGTvsLocal.log +if ( -s logTkDiffGTvsLocal.log ) then + echo "WARNING THE TRACKER RECO GEOMETRY IS DIFFERENT BETWEEN GT DB AND LOCAL DB" | tee -a GeometryValidation.log +endif + +echo "End Tracker RECO geometry validation" | tee -a GeometryValidation.log + +echo "Start DT RECO geometry validation" | tee -a GeometryValidation.log + +cp $CMSSW_BASE/src/Geometry/DTGeometry/test/testDTGeometryFromDBDD4hep_cfg.py . +# cp $CMSSW_RELEASE_BASE/src/Geometry/DTGeometry/test/testDTGeometryFromDBDD4hep_cfg.py . +sed -i "{/process.GlobalTag.globaltag/d}" testDTGeometryFromDBDD4hep_cfg.py >> GeometryValidation.log +sed -i "/FrontierConditions_GlobalTag_cff/ a\from Configuration.AlCa.GlobalTag import GlobalTag\nprocess.GlobalTag = GlobalTag(process.GlobalTag, '${gtag}', '')" testDTGeometryFromDBDD4hep_cfg.py >> GeometryValidation.log +if ( "${roundFlag}" == round ) then + sed -i "/tolerance/s/1.0e-23/${tolerance}/" testDTGeometryFromDBDD4hep_cfg.py >> GeometryValidation.log +endif +cmsRun testDTGeometryFromDBDD4hep_cfg.py > outDB_DT.log +if ( -s outDB_DT.log ) then + echo "DT test from DB run ok" | tee -a GeometryValidation.log +else + echo "ERROR the output of DT test from DB is empty" | tee -a GeometryValidation.log + exit +endif + +cp $CMSSW_BASE/src/Geometry/DTGeometry/test/testDTGeometryFromLocalDBDD4hep_cfg.py . +# cp $CMSSW_RELEASE_BASE/src/Geometry/DTGeometry/test/testDTGeometryFromLocalDBDD4hep_cfg.py . +sed -i "{s/Extended2021/${geomabbrev}/}" testDTGeometryFromLocalDBDD4hep_cfg.py >> GeometryValidation.log +sed -i "{/process.GlobalTag.globaltag/d}" testDTGeometryFromLocalDBDD4hep_cfg.py >> GeometryValidation.log +sed -i "/FrontierConditions_GlobalTag_cff/ a\from Configuration.AlCa.GlobalTag import GlobalTag\nprocess.GlobalTag = GlobalTag(process.GlobalTag, '${gtag}', '')" testDTGeometryFromLocalDBDD4hep_cfg.py >> GeometryValidation.log +if ( "${roundFlag}" == round ) then + sed -i "/tolerance/s/1.0e-23/${tolerance}/" testDTGeometryFromLocalDBDD4hep_cfg.py >> GeometryValidation.log +endif +cmsRun testDTGeometryFromLocalDBDD4hep_cfg.py > outLocalDB_DT.log +if ( -s outDB_DT.log ) then + echo "DT test from Local DB run ok" | tee -a GeometryValidation.log +else + echo "ERROR the output of DT test from Local DB is empty" | tee -a GeometryValidation.log + exit +endif + +cp $CMSSW_BASE/src/Geometry/DTGeometry/test/testDTGeometryDD4hep_cfg.py . +# cp $CMSSW_RELEASE_BASE/src/Geometry/DTGeometry/test/testDTGeometryDD4hep_cfg.py . +sed -i "{s/Extended2021/${geomabbrev}/}" testDTGeometryDD4hep_cfg.py >> GeometryValidation.log +sed -i "{/process.GlobalTag.globaltag/d}" testDTGeometryDD4hep_cfg.py >> GeometryValidation.log +sed -i "/FrontierConditions_GlobalTag_cff/ a\from Configuration.AlCa.GlobalTag import GlobalTag\nprocess.GlobalTag = GlobalTag(process.GlobalTag, '${gtag}', '')" testDTGeometryDD4hep_cfg.py >> GeometryValidation.log +if ( "${roundFlag}" == round ) then + sed -i "/tolerance/s/1.0e-23/${tolerance}/" testDTGeometryDD4hep_cfg.py >> GeometryValidation.log +endif +cmsRun testDTGeometryDD4hep_cfg.py > outXML_DT.log +if ( -s outXML_DT.log ) then + echo "DT test from XML run ok" | tee -a GeometryValidation.log +else + echo "ERROR the output of DT test from XML is empty" | tee -a GeometryValidation.log + exit +endif + +diff --ignore-matching-lines='Geometry node for DTGeom' outDB_DT.log outXML_DT.log > logDTDiffGTvsXML.log +if ( -s logDTDiffGTvsXML.log ) then + echo "WARNING THE DT RECO GEOMETRY IS DIFFERENT BETWEEN XML AND GT DB" | tee -a GeometryValidation.log +endif + +diff --ignore-matching-lines='Geometry node for DTGeom' outLocalDB_DT.log outXML_DT.log > logDTDiffLocalvsXML.log +if ( -s logDTDiffLocalvsXML.log ) then + echo "WARNING THE DT RECO GEOMETRY IS DIFFERENT BETWEEN XML AND LOCAL DB" | tee -a GeometryValidation.log +endif + +diff --ignore-matching-lines='Geometry node for DTGeom' outDB_DT.log outLocalDB_DT.log > logDTDiffGTvsLocal.log +if ( -s logDTDiffGTvsLocal.log ) then + echo "WARNING THE DT RECO GEOMETRY IS DIFFERENT BETWEEN GT DB AND LOCAL DB" | tee -a GeometryValidation.log +endif + +echo "End DT RECO geometry validation" | tee -a GeometryValidation.log + +echo "Start CSC RECO geometry validation" | tee -a GeometryValidation.log + +# cp $CMSSW_RELEASE_BASE/src/Geometry/CSCGeometry/test/testCSCGeometryFromDBDD4hep_cfg.py . +cp $CMSSW_BASE/src/Geometry/CSCGeometry/test/testCSCGeometryFromDBDD4hep_cfg.py . +sed -i "{/process.GlobalTag.globaltag/d}" testCSCGeometryFromDBDD4hep_cfg.py >> GeometryValidation.log +sed -i "/FrontierConditions_GlobalTag_cff/ a\from Configuration.AlCa.GlobalTag import GlobalTag\nprocess.GlobalTag = GlobalTag(process.GlobalTag, '${gtag}', '')" testCSCGeometryFromDBDD4hep_cfg.py >> GeometryValidation.log +cmsRun testCSCGeometryFromDBDD4hep_cfg.py > outDB_CSC.log +if ( -s outDB_CSC.log ) then + echo "CSC test from GT DB run ok" | tee -a GeometryValidation.log +else + echo "ERROR the output of CSC test from GT DB is empty" | tee -a GeometryValidation.log + exit +endif + +# cp $CMSSW_RELEASE_BASE/src/Geometry/CSCGeometry/test/testCSCGeometryFromLocalDBDD4hep_cfg.py . +cp $CMSSW_BASE/src/Geometry/CSCGeometry/test/testCSCGeometryFromLocalDBDD4hep_cfg.py . +sed -i "{/process.GlobalTag.globaltag/d}" testCSCGeometryFromLocalDBDD4hep_cfg.py >> GeometryValidation.log +sed -i "/FrontierConditions_GlobalTag_cff/ a\from Configuration.AlCa.GlobalTag import GlobalTag\nprocess.GlobalTag = GlobalTag(process.GlobalTag, '${gtag}', '')" testCSCGeometryFromLocalDBDD4hep_cfg.py >> GeometryValidation.log +cmsRun testCSCGeometryFromLocalDBDD4hep_cfg.py > outLocalDB_CSC.log +if ( -s outLocalDB_CSC.log ) then + echo "CSC test from Local DB run ok" | tee -a GeometryValidation.log +else + echo "ERROR the output of CSC test from Local DB is empty" | tee -a GeometryValidation.log + exit +endif + +# cp $CMSSW_RELEASE_BASE/src/Geometry/CSCGeometry/test/testCSCGeometryDD4hep_cfg.py . +cp $CMSSW_BASE/src/Geometry/CSCGeometry/test/testCSCGeometryDD4hep_cfg.py . +sed -i "{s/GeometryExtended/${geometry}/}" testCSCGeometryDD4hep_cfg.py >> GeometryValidation.log +sed -i "{/process.GlobalTag.globaltag/d}" testCSCGeometryDD4hep_cfg.py >> GeometryValidation.log +sed -i "/FrontierConditions_GlobalTag_cff/ a\from Configuration.AlCa.GlobalTag import GlobalTag\nprocess.GlobalTag = GlobalTag(process.GlobalTag, '${gtag}', '')" testCSCGeometryDD4hep_cfg.py >> GeometryValidation.log +cmsRun testCSCGeometryDD4hep_cfg.py > outXML_CSC.log +if ( -s outXML_CSC.log ) then + echo "CSC test from XML run ok" | tee -a GeometryValidation.log +else + echo "ERROR the output of CSC test from XML is empty" | tee -a GeometryValidation.log + exit +endif + +diff --ignore-matching-lines='Geometry node for CSCGeom' outDB_CSC.log outXML_CSC.log > logCSCDiffGTvsXML.log +if ( -s logCSCDiffGTvsXML.log ) then + echo "WARNING THE CSC RECO GEOMETRY IS DIFFERENT BETWEEN XML AND GT DB" | tee -a GeometryValidation.log +endif + +diff --ignore-matching-lines='Geometry node for CSCGeom' outLocalDB_CSC.log outXML_CSC.log > logCSCDiffLocalvsXML.log +if ( -s logCSCDiffLocalvsXML.log ) then + echo "WARNING THE CSC RECO GEOMETRY IS DIFFERENT BETWEEN XML AND LOCAL DB" | tee -a GeometryValidation.log +endif + +diff --ignore-matching-lines='Geometry node for CSCGeom' outLocalDB_CSC.log outDB_CSC.log > logCSCDiffLocalvsGT.log +if ( -s logCSCDiffLocalvsGT.log ) then + echo "WARNING THE CSC RECO GEOMETRY IS DIFFERENT BETWEEN GT DB AND LOCAL DB" | tee -a GeometryValidation.log +endif + +echo "End CSC RECO geometry validation" | tee -a GeometryValidation.log + +echo "Start RPC RECO geometry validation" | tee -a GeometryValidation.log + +cp $CMSSW_BASE/src/Geometry/RPCGeometry/test/testRPCGeometryFromDBDD4hep_cfg.py . +# cp $CMSSW_RELEASE_BASE/src/Geometry/RPCGeometry/test/testRPCGeometryFromDBDD4hep_cfg.py . +sed -i "{/process.GlobalTag.globaltag/d}" testRPCGeometryFromDBDD4hep_cfg.py >> GeometryValidation.log +sed -i "/FrontierConditions_GlobalTag_cff/ a\from Configuration.AlCa.GlobalTag import GlobalTag\nprocess.GlobalTag = GlobalTag(process.GlobalTag, '${gtag}', '')" testRPCGeometryFromDBDD4hep_cfg.py >> GeometryValidation.log +cmsRun testRPCGeometryFromDBDD4hep_cfg.py > outDB_RPC.log +if ( -s outDB_RPC.log ) then + echo "RPC test from GT DB run ok" | tee -a GeometryValidation.log +else + echo "ERROR the output of RPC test from GT DB is empty" | tee -a GeometryValidation.log + exit +endif + +cp $CMSSW_BASE/src/Geometry/RPCGeometry/test/testRPCGeometryFromLocalDBDD4hep_cfg.py . +# cp $CMSSW_RELEASE_BASE/src/Geometry/RPCGeometry/test/testRPCGeometryFromLocalDBDD4hep_cfg.py . +sed -i "{/process.GlobalTag.globaltag/d}" testRPCGeometryFromLocalDBDD4hep_cfg.py >> GeometryValidation.log +sed -i "/FrontierConditions_GlobalTag_cff/ a\from Configuration.AlCa.GlobalTag import GlobalTag\nprocess.GlobalTag = GlobalTag(process.GlobalTag, '${gtag}', '')" testRPCGeometryFromLocalDBDD4hep_cfg.py >> GeometryValidation.log +cmsRun testRPCGeometryFromLocalDBDD4hep_cfg.py > outLocalDB_RPC.log +if ( -s outLocalDB_RPC.log ) then + echo "RPC test from Local DB run ok" | tee -a GeometryValidation.log +else + echo "ERROR the output of RPC test from Local DB is empty" | tee -a GeometryValidation.log + exit +endif + +cp $CMSSW_BASE/src/Geometry/RPCGeometry/test/testRPCGeometryDD4hep_cfg.py . +# cp $CMSSW_RELEASE_BASE/src/Geometry/RPCGeometry/test/testRPCGeometryDD4hep_cfg.py . +sed -i "{s/GeometryExtended/${geometry}/}" testRPCGeometryDD4hep_cfg.py >> GeometryValidation.log +sed -i "{/process.GlobalTag.globaltag/d}" testRPCGeometryDD4hep_cfg.py >> GeometryValidation.log +sed -i "/FrontierConditions_GlobalTag_cff/ a\from Configuration.AlCa.GlobalTag import GlobalTag\nprocess.GlobalTag = GlobalTag(process.GlobalTag, '${gtag}', '')" testRPCGeometryDD4hep_cfg.py >> GeometryValidation.log +cmsRun testRPCGeometryDD4hep_cfg.py > outXML_RPC.log +if ( -s outXML_RPC.log ) then + echo "RPC test from XML run ok" | tee -a GeometryValidation.log +else + echo "ERROR the output of RPC test from XML is empty" | tee -a GeometryValidation.log + exit +endif + +diff --ignore-matching-lines='Geometry node for RPCGeom' outDB_RPC.log outXML_RPC.log > logRPCDiffGTvsXML.log +if ( -s logRPCDiffGTvsXML.log ) then + echo "WARNING THE RPC RECO GEOMETRY IS DIFFERENT BETWEEN XML AND GT DB" | tee -a GeometryValidation.log +endif + +diff --ignore-matching-lines='Geometry node for RPCGeom' outLocalDB_RPC.log outXML_RPC.log > logRPCDiffLocalvsXML.log +if ( -s logRPCDiffLocalvsXML.log ) then + echo "WARNING THE RPC RECO GEOMETRY IS DIFFERENT BETWEEN XML AND LOCAL DB" | tee -a GeometryValidation.log +endif + +diff --ignore-matching-lines='Geometry node for RPCGeom' outLocalDB_RPC.log outDB_RPC.log > logRPCDiffLocalvsDB.log +if ( -s logRPCDiffLocalvsDB.log ) then + echo "WARNING THE RPC RECO GEOMETRY IS DIFFERENT BETWEEN GT DB AND LOCAL DB" | tee -a GeometryValidation.log +endif + +echo "End RPC RECO geometry validation" | tee -a GeometryValidation.log + +echo "Start GEM RECO geometry validation" | tee -a GeometryValidation.log + +cp $CMSSW_BASE/src/Geometry/GEMGeometry/test/testGEMGeometryFromDBDD4hep_cfg.py . +# cp $CMSSW_RELEASE_BASE/src/Geometry/GEMGeometry/test/testGEMGeometryFromDBDD4hep_cfg.py . +sed -i "{/process.GlobalTag.globaltag/d}" testGEMGeometryFromDBDD4hep_cfg.py >> GeometryValidation.log +sed -i "/FrontierConditions_GlobalTag_cff/ a\from Configuration.AlCa.GlobalTag import GlobalTag\nprocess.GlobalTag = GlobalTag(process.GlobalTag, '${gtag}', '')" testGEMGeometryFromDBDD4hep_cfg.py >> GeometryValidation.log +cmsRun testGEMGeometryFromDBDD4hep_cfg.py +mv GEMtestOutput.out outDB_GEM.log +if ( -s outDB_GEM.log ) then + echo "GEM test from GT DB run ok" | tee -a GeometryValidation.log +else + echo "ERROR the output of GEM test from GT DB is empty" | tee -a GeometryValidation.log + exit +endif + +# cp $CMSSW_RELEASE_BASE/src/Geometry/GEMGeometry/test/testGEMGeometryFromLocalDBDD4hep_cfg.py . +cp $CMSSW_BASE/src/Geometry/GEMGeometry/test/testGEMGeometryFromLocalDBDD4hep_cfg.py . +sed -i "{/process.GlobalTag.globaltag/d}" testGEMGeometryFromLocalDBDD4hep_cfg.py >> GeometryValidation.log +sed -i "/FrontierConditions_GlobalTag_cff/ a\from Configuration.AlCa.GlobalTag import GlobalTag\nprocess.GlobalTag = GlobalTag(process.GlobalTag, '${gtag}', '')" testGEMGeometryFromLocalDBDD4hep_cfg.py >> GeometryValidation.log +cmsRun testGEMGeometryFromLocalDBDD4hep_cfg.py +mv GEMtestOutput.out outLocalDB_GEM.log +if ( -s outLocalDB_GEM.log ) then + echo "GEM test from Local DB run ok" | tee -a GeometryValidation.log +else + echo "ERROR the output of GEM test from Local DB is empty" | tee -a GeometryValidation.log + exit +endif + +# cp $CMSSW_RELEASE_BASE/src/Geometry/GEMGeometry/test/testGEMGeometryDD4hep_cfg.py . +cp $CMSSW_BASE/src/Geometry/GEMGeometry/test/testGEMGeometryDD4hep_cfg.py . +sed -i "{s/GeometryExtended/${geometry}/}" testGEMGeometryDD4hep_cfg.py >> GeometryValidation.log +sed -i "{/process.GlobalTag/d}" testGEMGeometryDD4hep_cfg.py >> GeometryValidation.log +sed -i "/FrontierConditions_GlobalTag_cff/ a\from Configuration.AlCa.GlobalTag import GlobalTag\nprocess.GlobalTag = GlobalTag(process.GlobalTag, '${gtag}', '')" testGEMGeometryDD4hep_cfg.py >> GeometryValidation.log +cmsRun testGEMGeometryDD4hep_cfg.py +mv GEMtestOutput.out outXML_GEM.log +if ( -s outXML_GEM.log ) then + echo "GEM test from XML run ok" | tee -a GeometryValidation.log +else + echo "ERROR the output of GEM test from XML is empty" | tee -a GeometryValidation.log + exit +endif + +diff --ignore-matching-lines='Geometry node for GEMGeom' outDB_GEM.log outXML_GEM.log > logGEMDiffGTvsXML.log +if ( -s logGEMDiffGTvsXML.log ) then + echo "WARNING THE GEM RECO GEOMETRY IS DIFFERENT BETWEEN XML AND GT DB" | tee -a GeometryValidation.log +endif + +diff --ignore-matching-lines='Geometry node for GEMGeom' outLocalDB_GEM.log outXML_GEM.log > logGEMDiffLocalvsXML.log +if ( -s logGEMDiffLocalvsXML.log ) then + echo "WARNING THE GEM RECO GEOMETRY IS DIFFERENT BETWEEN XML AND LOCAL DB" | tee -a GeometryValidation.log +endif + +diff --ignore-matching-lines='Geometry node for GEMGeom' outLocalDB_GEM.log outDB_GEM.log > logGEMDiffLocalvsDB.log +if ( -s logGEMDiffLocalvsDB.log ) then + echo "WARNING THE GEM RECO GEOMETRY IS DIFFERENT BETWEEN GT DB AND LOCAL DB" | tee -a GeometryValidation.log +endif + +echo "End GEM RECO geometry validation" | tee -a GeometryValidation.log + +echo "Start CALO RECO geometry validation" | tee -a GeometryValidation.log + +cp myfile.db $CMSSW_BASE/src/Geometry/CaloEventSetup/test/ +cd $CMSSW_BASE/src/Geometry/CaloEventSetup/ +cd data +# wget -i download.url +# wget commented out -- use files in "data" directory instead +cd ../test +source setup.scr >> ${myDir}/GeometryValidation.log +cp runTestCaloGeometryDD4hep_cfg.py ${myDir}/runTestCaloGeometryDD4hep_cfg.py +sed -i "{s/Extended2021/${geomabbrev}/}" ${myDir}/runTestCaloGeometryDD4hep_cfg.py >> ${myDir}/GeometryValidation.log +cmsRun ${myDir}/runTestCaloGeometryDD4hep_cfg.py > GeometryCaloValidationXML.log +if ( -s GeometryCaloValidationXML.log ) then + echo "CALO test from XML run ok" | tee -a ${myDir}/GeometryValidation.log +else + echo "ERROR the output of CALO test from XML is empty" | tee -a ${myDir}/GeometryValidation.log + exit +endif + +cp runTestCaloGeometryDBDD4hep_cfg.py ${myDir}/runTestCaloGeometryDBDD4hep_cfg.py +sed -i "s/auto:upgrade2021/${gtag}/" ${myDir}/runTestCaloGeometryDBDD4hep_cfg.py >> ${myDir}/GeometryValidation.log +cmsRun ${myDir}/runTestCaloGeometryDBDD4hep_cfg.py > GeometryCaloValidationDB.log +if ( -s GeometryCaloValidationDB.log ) then + echo "CALO test from GT DB run ok" | tee -a ${myDir}/GeometryValidation.log +else + echo "ERROR the output of CALO test from GT DB is empty" | tee -a ${myDir}/GeometryValidation.log + exit +endif + +cp runTestCaloGeometryLocalDBDD4hep_cfg.py ${myDir}/runTestCaloGeometryLocalDBDD4hep_cfg.py +sed -i "s/auto:upgrade2021/${gtag}/" ${myDir}/runTestCaloGeometryLocalDBDD4hep_cfg.py >> ${myDir}/GeometryValidation.log +cmsRun ${myDir}/runTestCaloGeometryLocalDBDD4hep_cfg.py > GeometryCaloValidationLocal.log +if ( -s GeometryCaloValidationLocal.log ) then + echo "CALO Local test from Local DB run ok" | tee -a ${myDir}/GeometryValidation.log +else + echo "ERROR the output of CALO test from Local DB is empty" | tee -a ${myDir}/GeometryValidation.log + exit +endif +source clean.scr >> ${myDir}/GeometryValidation.log +rm myfile.db +cd ${myDir} + +grep SUCCEED $CMSSW_BASE/src/Geometry/CaloEventSetup/test/GeometryCaloValidationXML.log >> GeometryValidation.log +grep SUCCEED $CMSSW_BASE/src/Geometry/CaloEventSetup/test/GeometryCaloValidationDB.log >> GeometryValidation.log +grep SUCCEED $CMSSW_BASE/src/Geometry/CaloEventSetup/test/GeometryCaloValidationLocal.log >> GeometryValidation.log +cp $CMSSW_BASE/src/Geometry/CaloEventSetup/test/GeometryCaloValidationXML.log . +cp $CMSSW_BASE/src/Geometry/CaloEventSetup/test/GeometryCaloValidationDB.log . +cp $CMSSW_BASE/src/Geometry/CaloEventSetup/test/GeometryCaloValidationLocal.log . + +grep 'BIG DISAGREEMENT FOUND' $CMSSW_BASE/src/Geometry/CaloEventSetup/test/GeometryCaloValidationXML.log > CALOXMLError.log +grep 'BIG DISAGREEMENT FOUND' $CMSSW_BASE/src/Geometry/CaloEventSetup/test/GeometryCaloValidationDB.log > CALODBError.log +grep 'BIG DISAGREEMENT FOUND' $CMSSW_BASE/src/Geometry/CaloEventSetup/test/GeometryCaloValidationLocal.log > CALOLocalError.log + +rm -f $CMSSW_BASE/src/Geometry/CaloEventSetup/test/GeometryCaloValidationXML.log +rm -f $CMSSW_BASE/src/Geometry/CaloEventSetup/test/GeometryCaloValidationDB.log +rm -f $CMSSW_BASE/src/Geometry/CaloEventSetup/test/GeometryCaloValidationLocal.log + +if ( -s CALOXMLError.log ) then + echo "WARNING THE CALO GEOMETRY IS DIFFERENT BETWEEN XML AND REF" | tee -a GeometryValidation.log +endif + +if ( -s CALODBError.log ) then + echo "WARNING THE CALO GEOMETRY IS DIFFERENT BETWEEN GT DB AND REF" | tee -a GeometryValidation.log +endif + +if ( -s CALOLocalError.log ) then + echo "WARNING THE CALO GEOMETRY IS DIFFERENT BETWEEN LOCAL DB AND REF" | tee -a GeometryValidation.log +endif + +echo "End CALO RECO geometry validation" | tee -a GeometryValidation.log + +echo "Start Simulation geometry validation" | tee -a GeometryValidation.log + +# cp $CMSSW_RELEASE_BASE/src/SimG4Core/PrintGeomInfo/test/python/runDD4hepXML_cfg.py . +cp $CMSSW_BASE/src/SimG4Core/PrintGeomInfo/test/python/runDD4hepXML_cfg.py . +sed -i "{s/Extended2021/${geomabbrev}/}" runDD4hepXML_cfg.py >> GeometryValidation.log +sed -i "{s/DumpSummary = cms.untracked.bool(True/DumpSummary = cms.untracked.bool(False/}" runDD4hepXML_cfg.py >> GeometryValidation.log +sed -i "{s/DumpSense = cms.untracked.bool(False/DumpSense = cms.untracked.bool(True/}" runDD4hepXML_cfg.py >> GeometryValidation.log +sed -i "{s/DumpParams = cms.untracked.bool(False/DumpParams = cms.untracked.bool(True/}" runDD4hepXML_cfg.py >> GeometryValidation.log +sed -i "{/MaterialFileName/d}" runDD4hepXML_cfg.py >> GeometryValidation.log +sed -i "{/SolidFileName/d}" runDD4hepXML_cfg.py >> GeometryValidation.log +sed -i "{/LVFileName/d}" runDD4hepXML_cfg.py >> GeometryValidation.log +sed -i "{/PVFileName/d}" runDD4hepXML_cfg.py >> GeometryValidation.log +sed -i "{/TouchFileName/d}" runDD4hepXML_cfg.py >> GeometryValidation.log +( cmsRun runDD4hepXML_cfg.py > readXMLAndDump.log ) >>& GeometryValidation.log + +# cp $CMSSW_RELEASE_BASE/src/SimG4Core/PrintGeomInfo/test/python/runDD4hepDB_cfg.py . +cp $CMSSW_BASE/src/SimG4Core/PrintGeomInfo/test/python/runDD4hepDB_cfg.py . +sed -i "{s/Extended2021/${geomabbrev}/}" runDD4hepDB_cfg.py >> GeometryValidation.log +sed -i "{s/DumpSummary = cms.untracked.bool(True/DumpSummary = cms.untracked.bool(False/}" runDD4hepDB_cfg.py >> GeometryValidation.log +sed -i "{s/DumpSense = cms.untracked.bool(False/DumpSense = cms.untracked.bool(True/}" runDD4hepDB_cfg.py >> GeometryValidation.log +sed -i "{s/DumpParams = cms.untracked.bool(False/DumpParams = cms.untracked.bool(True/}" runDD4hepDB_cfg.py >> GeometryValidation.log +sed -i "{/MaterialFileName/d}" runDD4hepDB_cfg.py >> GeometryValidation.log +sed -i "{/SolidFileName/d}" runDD4hepDB_cfg.py >> GeometryValidation.log +sed -i "{/LVFileName/d}" runDD4hepDB_cfg.py >> GeometryValidation.log +sed -i "{/PVFileName/d}" runDD4hepDB_cfg.py >> GeometryValidation.log +sed -i "{/TouchFileName/d}" runDD4hepDB_cfg.py >> GeometryValidation.log +sed -i "{/process.GlobalTag.globaltag/d}" runDD4hepDB_cfg.py >> GeometryValidation.log +sed -i "/from Configuration.AlCa.GlobalTag/ a\process.GlobalTag = GlobalTag(process.GlobalTag, '${gtag}', '')" runDD4hepDB_cfg.py >> GeometryValidation.log +( cmsRun runDD4hepDB_cfg.py > readXMLfromGTDB.log) >& /dev/null + +# cp $CMSSW_RELEASE_BASE/src/SimG4Core/PrintGeomInfo/test/python/runDD4hepLocalDB_cfg.py . +cp $CMSSW_BASE/src/SimG4Core/PrintGeomInfo/test/python/runDD4hepLocalDB_cfg.py . +( cmsRun runDD4hepLocalDB_cfg.py > readXMLfromLocDB.log ) >>& GeometryValidation.log + +if ( ! -s readXMLAndDump.log ) then + echo "ERROR THE MULTI-XML FILE GEOMETRY WAS NOT DUMPED PROPERLY." | tee -a GeometryValidation.log + exit 1 +else + echo "Geometry dump from multiple XML files done." +endif + +if ( ! -s readXMLfromGTDB.log ) then + echo "ERROR THE GLOBAL TAG DATABASE GEOMETRY WAS NOT DUMPED PROPERLY." | tee -a GeometryValidation.log + exit 1 +else + echo "Geometry dump from global tag database done." +endif + +if ( ! -s readXMLfromLocDB.log ) then + echo "ERROR THE LOCAL DATABASE GEOMETRY WAS NOT DUMPED PROPERLY." | tee -a GeometryValidation.log + exit 1 +else + echo "Geometry dump from local database done." +endif + +diff readXMLAndDump.log readXMLfromGTDB.log > tcdfXMLvsDB.log +diff readXMLAndDump.log readXMLfromLocDB.log > tcdfXMLvsLocDB.log +diff readXMLfromLocDB.log readXMLfromGTDB.log > tcdfLocDbvsDB.log + + +if ( -s tcdfXMLvsDB.log ) then + echo "WARNING THE GEOMETRYFILE IS DIFFERENT BETWEEN XML FILES AND DB." | tee -a GeometryValidation.log + echo See tcdfXMLvsDB.log for differences | tee -a GeometryValidation.log +endif + +if ( -s tcdfXMLvsLocDB.log ) then + echo "WARNING THE GEOMETRYFILE IS DIFFERENT BETWEEN XML FILES AND LOCAL DATABASE BLOB." | tee -a GeometryValidation.log + echo See tcdfXMLvsLocDB.log for differences | tee -a GeometryValidation.log +endif + +if ( -s tcdfLocDBvsDB.log ) then + echo "WARNING THE GEOMETRYFILE IS DIFFERENT BETWEEN LOCAL AND GLOBALTAG DATABASE BLOBS." | tee -a GeometryValidation.log + echo See tcdfLocDBvsDB.log for differences | tee -a GeometryValidation.log +endif + +# cp $CMSSW_RELEASE_BASE/src/DetectorDescription/DDCMS/test/python/testTGeoIterator.py . +cp $CMSSW_BASE/src/DetectorDescription/DDCMS/test/python/testTGeoIterator.py . +sed -i "{s/ExtendedGeometry2021/${geometry}/}" testTGeoIterator.py >> GeometryValidation.log +cmsRun testTGeoIterator.py +if ( -s navGeometry.log ) then + mv navGeometry.log navGeoXML.log +else + echo Failed to dump paths from XML files | tee -a GeometryValidation.log +endif + +# cp $CMSSW_RELEASE_BASE/src/DetectorDescription/DDCMS/test/python/testTGeoIteratorDB.py . +cp $CMSSW_BASE/src/DetectorDescription/DDCMS/test/python/testTGeoIteratorDB.py . +sed -i "{/process.GlobalTag.globaltag/d}" testTGeoIteratorDB.py >> GeometryValidation.log +sed -i "{/from Configuration.AlCa.autoCond/d}" testTGeoIteratorDB.py >> GeometryValidation.log +sed -i "/FrontierConditions_GlobalTag_cff/ a\from Configuration.AlCa.GlobalTag import GlobalTag\nprocess.GlobalTag = GlobalTag(process.GlobalTag, '${gtag}', '')" testTGeoIteratorDB.py >> GeometryValidation.log +cmsRun testTGeoIteratorDB.py +if ( -s navGeometry.log ) then + mv navGeometry.log navGeoDB.log +else + echo Failed to dump paths from DB | tee -a GeometryValidation.log +endif + +# cp $CMSSW_RELEASE_BASE/src/DetectorDescription/DDCMS/test/python/testTGeoIteratorLocalDB.py . +cp $CMSSW_BASE/src/DetectorDescription/DDCMS/test/python/testTGeoIteratorLocalDB.py . +sed -i "{s/Extended2021/${geomabbrev}/g}" testTGeoIteratorLocalDB.py >> GeometryValidation.log +cmsRun testTGeoIteratorLocalDB.py +if ( -s navGeometry.log ) then + mv navGeometry.log navGeoLocDB.log +else + echo Failed to dump paths from local DB | tee -a GeometryValidation.log +endif + +diff --ignore-matching-lines='Begin processing' navGeoXML.log navGeoDB.log > pathsXMLvsDB.log +diff --ignore-matching-lines='Begin processing' navGeoXML.log navGeoLocDB.log > pathsXMLvsLocDB.log +diff --ignore-matching-lines='Begin processing' navGeoLocDB.log navGeoDB.log > pathsLocDBvsDB.log + +if ( -s pathsXMLvsDB.log ) then + echo "WARNING PATHS ARE DIFFERENT BETWEEN XML FILES AND DB." | tee -a GeometryValidation.log + echo See pathsXMLvsDB.log for differences | tee -a GeometryValidation.log +endif +if ( -s pathsXMLvsLocDB.log ) then + echo "WARNING PATHS ARE DIFFERENT BETWEEN XML FILES AND LOCAL DATABASE BLOB." | tee -a GeometryValidation.log + echo See pathsXMLvsLocDB.log for differences | tee -a GeometryValidation.log +endif +if ( -s pathsLocDBvsDB.log ) then + echo "WARNING PATHS ARE DIFFERENT BETWEEN LOCAL AND GLOBALTAG DATABASE BLOBS." | tee -a GeometryValidation.log + echo See pathsLocDBvsDB.log for differences | tee -a GeometryValidation.log +endif + +echo "End Simulation geometry validation" | tee -a GeometryValidation.log diff --git a/Validation/Geometry/test/dddvsdb/sortCompositeMaterials.py b/Validation/Geometry/test/dddvsdb/sortCompositeMaterials.py index 2b220da16078c..27b7db310c76e 100755 --- a/Validation/Geometry/test/dddvsdb/sortCompositeMaterials.py +++ b/Validation/Geometry/test/dddvsdb/sortCompositeMaterials.py @@ -10,7 +10,7 @@ root = tree.getroot() sortList = [] -elem = root.find('{http://www.cern.ch/cms/DDL}MaterialSection') +elem = root.find('MaterialSection') for subelem in elem : key = subelem.get('name') print (key)