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 ==
"2023Muon":
67 process.GlobalTag.globaltag = autoCond[
'mc']
70 process.load(
'Configuration.Geometry.GeometryExtended2023MuonReco_cff')
76 elif score ==
"GEMDev":
78 process.GlobalTag.globaltag = autoCond[
'mc']
79 process.load(
'Configuration.Geometry.GeometryExtended2015MuonGEMDevReco_cff')
81 elif score ==
"SLHCDB":
82 process.GlobalTag.globaltag =
'DESIGN42_V17::All'
83 process.load(
"Configuration.StandardSequences.GeometryDB_cff")
84 process.load(
"Configuration.StandardSequences.Reconstruction_cff")
86 process.GlobalTag.toGet = cms.VPSet(
87 cms.PSet(record = cms.string(
"GeometryFileRcd"),
88 tag = cms.string(
"XMLFILE_Geometry_428SLHCYV0_Phase1_R30F12_HCal_Ideal_mc"),
89 connect = cms.untracked.string(
"frontier://FrontierProd/CMS_COND_42X_GEOMETRY")
91 cms.PSet(record = cms.string(
'IdealGeometryRecord'),
92 tag = cms.string(
'TKRECO_Geometry_428SLHCYV0'),
93 connect = cms.untracked.string(
"frontier://FrontierProd/CMS_COND_42X_GEOMETRY")),
94 cms.PSet(record = cms.string(
'PGeometricDetExtraRcd'),
95 tag = cms.string(
'TKExtra_Geometry_428SLHCYV0'),
96 connect = cms.untracked.string(
"frontier://FrontierProd/CMS_COND_42X_GEOMETRY")),
99 elif score == varType.valueForKey(
"SLHC"):
101 process.GlobalTag.globaltag = autoCond[
'mc']
102 process.load(
"Configuration.Geometry.GeometrySLHCSimIdeal_cff")
103 process.load(
"Configuration.Geometry.GeometrySLHCReco_cff")
104 process.load(
"Configuration.StandardSequences.Reconstruction_cff")
105 process.trackerSLHCGeometry.applyAlignment =
False
116 defaultOutputFileName=
"cmsRecoGeom.root"
118 options.register (
'tag',
120 VarParsing.VarParsing.multiplicity.singleton,
121 VarParsing.VarParsing.varType.string,
122 "tag info about geometry database conditions")
125 options.register (
'tgeo',
127 VarParsing.VarParsing.multiplicity.singleton,
128 VarParsing.VarParsing.varType.bool,
129 "write geometry in TGeo format")
132 options.register (
'out',
133 defaultOutputFileName,
134 VarParsing.VarParsing.multiplicity.singleton,
135 VarParsing.VarParsing.varType.string,
138 options.parseArguments()
143 process = cms.Process(
"DUMP")
144 process.add_(cms.Service(
"InitRootHandlers", ResetRootErrHandler = cms.untracked.bool(
False)))
145 process.source = cms.Source(
"EmptySource")
146 process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(1))
151 if ( options.tgeo ==
True):
152 if (options.out == defaultOutputFileName ):
153 options.out =
"cmsTGeoRecoGeom-" + str(options.tag) +
".root"
154 process.add_(cms.ESProducer(
"FWTGeoRecoGeometryESProducer"))
155 process.dump = cms.EDAnalyzer(
"DumpFWTGeoRecoGeometry",
156 tagInfo = cms.untracked.string(options.tag),
157 outputFileName = cms.untracked.string(options.out)
160 if (options.out == defaultOutputFileName ):
161 options.out =
"cmsRecoGeom-" + str(options.tag) +
".root"
162 process.add_(cms.ESProducer(
"FWRecoGeometryESProducer"))
163 process.dump = cms.EDAnalyzer(
"DumpFWRecoGeometry",
164 level = cms.untracked.int32(1),
165 tagInfo = cms.untracked.string(options.tag),
166 outputFileName = cms.untracked.string(options.out)
169 print "Dumping geometry in " , options.out,
"\n";
170 process.p = cms.Path(process.dump)