1 import FWCore.ParameterSet.Config
as cms
2 import sys, os, operator
3 import FWCore.ParameterSet.VarParsing
as VarParsing
4 from FWCore.Utilities.Enumerate
import Enumerate
5 from pprint
import pprint
8 varType = Enumerate (
"Run1 2015 2015dev 2017 2017Muon 2019 2023")
12 print "Usage: cmsRun dumpSimGeometry_cfg.py tag=TAG version=VERSION " 14 print " indentify geometry scenario " 15 print " ", varType.keys()
17 print " version=versionNumber" 18 print " scenario version from 2023 dictionary:" 20 print " out=outputFileName" 21 print " default is cmsSimGeom<tag><version>.root" 27 print "Please, specify 2023 scenario version\n" 28 pprint(sorted(detectorVersionDict.items(),key=operator.itemgetter(1)))
32 print "Loading configuration for scenario", options.tag , options.version ,
"...\n" 34 process.load(
"Geometry.CMSCommonData.cmsIdealGeometryXML_cfi")
37 process.load(
"Geometry.CMSCommonData.cmsExtendedGeometry2015XML_cfi")
39 elif score ==
"2015dev":
40 process.load(
"Geometry.CMSCommonData.cmsExtendedGeometry2015devXML_cfi")
43 process.load(
"Geometry.CMSCommonData.cmsExtendedGeometry2017XML_cfi")
45 elif score ==
"2017Muon":
46 process.load(
"Geometry.CMSCommonData.cmsExtendedGeometry2017MuonXML_cfi")
49 process.load(
"Geometry.CMSCommonData.cmsExtendedGeometry2019XML_cfi")
53 process.load(
"Geometry.CMSCommonData.cmsExtendedGeometry2023" + options.version +
"XML_cfi")
62 defaultOutputFileName=
"cmsSimGeom-"+ defaultTag +
".root" 64 options.register (
'tag',
66 VarParsing.VarParsing.multiplicity.singleton,
67 VarParsing.VarParsing.varType.string,
68 "info about geometry scenario")
69 options.register (
'version',
71 VarParsing.VarParsing.multiplicity.singleton,
72 VarParsing.VarParsing.varType.string,
73 "info about 2023 geometry scenario version")
74 options.register (
'out',
75 defaultOutputFileName,
76 VarParsing.VarParsing.multiplicity.singleton,
77 VarParsing.VarParsing.varType.string,
81 options.parseArguments()
84 if (options.out == defaultOutputFileName ):
85 options.out =
"cmsSimGeom-" +
str(options.tag) +
str(options.version) +
".root" 87 process = cms.Process(
"SIMDUMP")
90 process.source = cms.Source(
"EmptySource")
92 process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(1))
94 process.add_(cms.ESProducer(
"TGeoMgrFromDdd",
95 verbose = cms.untracked.bool(
False),
96 level = cms.untracked.int32(defaultLevel)
99 process.dump = cms.EDAnalyzer(
"DumpSimGeometry",
100 tag = cms.untracked.string(options.tag),
101 outputFileName = cms.untracked.string(options.out))
103 process.p = cms.Path(process.dump)