1 import FWCore.ParameterSet.Config
as cms
3 import FWCore.ParameterSet.VarParsing
as VarParsing
4 from FWCore.Utilities.Enumerate
import Enumerate
6 varType = Enumerate (
"Run1 2015 2017 2019 PhaseIPixel 2023Muon SLHC SLHCDB")
9 print "Usage: cmsRun dumpFWRecoGeometry_cfg.py tag=TAG "
11 print " indentify geometry condition database tag"
12 print " ", varType.keys()
15 print " dump in TGeo format to borwse it geomtery viewer"
16 print " import this will in Fireworks with option --sim-geom-file"
22 print "Loading configuration for tag ", options.tag ,
"...\n"
23 process.load(
"Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
27 process.GlobalTag.globaltag = autoCond[
'mc']
28 process.load(
"Configuration.StandardSequences.GeometryDB_cff")
29 process.load(
"Configuration.StandardSequences.Reconstruction_cff")
33 process.GlobalTag.globaltag = autoCond[
'mc']
34 process.load(
"Configuration.Geometry.GeometryExtended2015Reco_cff");
38 process.GlobalTag =
GlobalTag(process.GlobalTag,
'auto:upgrade2017',
'')
39 process.load(
'Configuration.Geometry.GeometryExtended2017Reco_cff')
47 process.GlobalTag =
GlobalTag(process.GlobalTag,
'auto:upgrade2019',
'')
48 process.load(
'Configuration.Geometry.GeometryExtended2019Reco_cff')
51 elif score ==
"PhaseIPixel":
53 process.GlobalTag =
GlobalTag(process.GlobalTag,
'auto:mc',
'')
54 process.load(
'Configuration.Geometry.GeometryExtendedPhaseIPixelReco_cff')
58 process.GlobalTag.globaltag = autoCond[
'mc']
61 process.load(
'Configuration.Geometry.GeometryExtended2023Reco_cff')
65 elif score ==
"2023Dev":
67 process.GlobalTag.globaltag = autoCond[
'mc']
70 process.load(
'Configuration.Geometry.GeometryExtended2023DevReco_cff')
74 elif score ==
"2023Muon":
76 process.GlobalTag.globaltag = autoCond[
'mc']
79 process.load(
'Configuration.Geometry.GeometryExtended2023MuonReco_cff')
85 elif score ==
"GEMDev":
87 process.GlobalTag.globaltag = autoCond[
'mc']
88 process.load(
'Configuration.Geometry.GeometryExtended2015MuonGEMDevReco_cff')
90 elif score ==
"SLHCDB":
91 process.GlobalTag.globaltag =
'DESIGN42_V17::All'
92 process.load(
"Configuration.StandardSequences.GeometryDB_cff")
93 process.load(
"Configuration.StandardSequences.Reconstruction_cff")
95 process.GlobalTag.toGet = cms.VPSet(
96 cms.PSet(record = cms.string(
"GeometryFileRcd"),
97 tag = cms.string(
"XMLFILE_Geometry_428SLHCYV0_Phase1_R30F12_HCal_Ideal_mc"),
98 connect = cms.untracked.string(
"frontier://FrontierProd/CMS_COND_42X_GEOMETRY")
100 cms.PSet(record = cms.string(
'IdealGeometryRecord'),
101 tag = cms.string(
'TKRECO_Geometry_428SLHCYV0'),
102 connect = cms.untracked.string(
"frontier://FrontierProd/CMS_COND_42X_GEOMETRY")),
103 cms.PSet(record = cms.string(
'PGeometricDetExtraRcd'),
104 tag = cms.string(
'TKExtra_Geometry_428SLHCYV0'),
105 connect = cms.untracked.string(
"frontier://FrontierProd/CMS_COND_42X_GEOMETRY")),
108 elif score == varType.valueForKey(
"SLHC"):
110 process.GlobalTag.globaltag = autoCond[
'mc']
111 process.load(
"Configuration.Geometry.GeometrySLHCSimIdeal_cff")
112 process.load(
"Configuration.Geometry.GeometrySLHCReco_cff")
113 process.load(
"Configuration.StandardSequences.Reconstruction_cff")
114 process.trackerSLHCGeometry.applyAlignment =
False
125 defaultOutputFileName=
"cmsRecoGeom.root"
127 options.register (
'tag',
129 VarParsing.VarParsing.multiplicity.singleton,
130 VarParsing.VarParsing.varType.string,
131 "tag info about geometry database conditions")
134 options.register (
'tgeo',
136 VarParsing.VarParsing.multiplicity.singleton,
137 VarParsing.VarParsing.varType.bool,
138 "write geometry in TGeo format")
141 options.register (
'out',
142 defaultOutputFileName,
143 VarParsing.VarParsing.multiplicity.singleton,
144 VarParsing.VarParsing.varType.string,
147 options.parseArguments()
152 process = cms.Process(
"DUMP")
153 process.add_(cms.Service(
"InitRootHandlers", ResetRootErrHandler = cms.untracked.bool(
False)))
154 process.source = cms.Source(
"EmptySource")
155 process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(1))
160 if ( options.tgeo ==
True):
161 if (options.out == defaultOutputFileName ):
162 options.out =
"cmsTGeoRecoGeom-" + str(options.tag) +
".root"
163 process.add_(cms.ESProducer(
"FWTGeoRecoGeometryESProducer"))
164 process.dump = cms.EDAnalyzer(
"DumpFWTGeoRecoGeometry",
165 tagInfo = cms.untracked.string(options.tag),
166 outputFileName = cms.untracked.string(options.out)
169 if (options.out == defaultOutputFileName ):
170 options.out =
"cmsRecoGeom-" + str(options.tag) +
".root"
171 process.add_(cms.ESProducer(
"FWRecoGeometryESProducer"))
172 process.dump = cms.EDAnalyzer(
"DumpFWRecoGeometry",
173 level = cms.untracked.int32(1),
174 tagInfo = cms.untracked.string(options.tag),
175 outputFileName = cms.untracked.string(options.out)
178 print "Dumping geometry in " , options.out,
"\n";
179 process.p = cms.Path(process.dump)