1 from __future__
import print_function
2 import FWCore.ParameterSet.Config
as cms
4 import FWCore.ParameterSet.VarParsing
as VarParsing
5 from FWCore.Utilities.Enumerate
import Enumerate
8 varType = Enumerate (
"Run1 2015 2015dev 2017 2017Muon 2021 2026")
12 print(
"Usage: cmsRun dumpSimGeometry_cfg.py tag=TAG version=VERSION ")
14 print(
" identify geometry scenario ")
15 print(
" ", varType.keys())
17 print(
" version=versionNumber")
18 print(
" scenario version from 2026 dictionary")
20 print(
" out=outputFileName")
21 print(
" default is cmsSimGeom<tag><version>.root")
27 print(
"Please, specify 2026 scenario version\n")
28 print(sorted([x[1]
for x
in detectorVersionDict.items()]))
33 print(
"Loading configuration for scenario", options.tag , options.version ,
"...\n")
35 process.load(
"Geometry.CMSCommonData.cmsIdealGeometryXML_cfi")
38 process.load(
"Geometry.CMSCommonData.cmsExtendedGeometry2015XML_cfi")
40 elif score ==
"2015dev":
41 process.load(
"Geometry.CMSCommonData.cmsExtendedGeometry2015devXML_cfi")
44 process.load(
"Geometry.CMSCommonData.cmsExtendedGeometry2017XML_cfi")
46 elif score ==
"2017Muon":
47 process.load(
"Geometry.CMSCommonData.cmsExtendedGeometry2017MuonXML_cfi")
50 process.load(
"Geometry.CMSCommonData.cmsExtendedGeometry2021XML_cfi")
54 process.load(
"Geometry.CMSCommonData.cmsExtendedGeometry2026" + options.version +
"XML_cfi")
63 defaultOutputFileName=
"cmsSimGeom-"+ defaultTag +
".root" 65 options.register (
'tag',
67 VarParsing.VarParsing.multiplicity.singleton,
68 VarParsing.VarParsing.varType.string,
69 "info about geometry scenario")
70 options.register (
'version',
72 VarParsing.VarParsing.multiplicity.singleton,
73 VarParsing.VarParsing.varType.string,
74 "info about 2026 geometry scenario version")
75 options.register (
'out',
76 defaultOutputFileName,
77 VarParsing.VarParsing.multiplicity.singleton,
78 VarParsing.VarParsing.varType.string,
82 options.parseArguments()
85 if (options.out == defaultOutputFileName ):
86 options.out =
"cmsSimGeom-" +
str(options.tag) +
str(options.version) +
".root" 88 process = cms.Process(
"SIMDUMP")
91 process.source = cms.Source(
"EmptySource")
93 process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(1))
95 process.add_(cms.ESProducer(
"TGeoMgrFromDdd",
96 verbose = cms.untracked.bool(
False),
97 level = cms.untracked.int32(defaultLevel)
100 process.dump = cms.EDAnalyzer(
"DumpSimGeometry",
101 tag = cms.untracked.string(options.tag),
102 outputFileName = cms.untracked.string(options.out))
104 process.p = cms.Path(process.dump)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)