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")
26 from Configuration.AlCa.autoCond
import autoCond
27 process.GlobalTag.globaltag = autoCond[
'mc']
28 process.load(
"Configuration.StandardSequences.GeometryDB_cff")
29 process.load(
"Configuration.StandardSequences.Reconstruction_cff")
32 from Configuration.AlCa.autoCond
import autoCond
33 process.GlobalTag.globaltag = autoCond[
'mc']
34 process.load(
"Configuration.Geometry.GeometryExtended2015Reco_cff");
37 from Configuration.AlCa.GlobalTag
import GlobalTag
38 process.GlobalTag =
GlobalTag(process.GlobalTag,
'auto:upgrade2017',
'')
39 process.load(
'Configuration.Geometry.GeometryExtended2017Reco_cff')
41 from SLHCUpgradeSimulations.Configuration.combinedCustoms
import cust_2017
45 from Configuration.AlCa.GlobalTag
import GlobalTag
46 process.GlobalTag =
GlobalTag(process.GlobalTag,
'auto:upgrade2019',
'')
47 process.load(
'Configuration.Geometry.GeometryExtended2019Reco_cff')
49 elif score ==
"PhaseIPixel":
50 from Configuration.AlCa.GlobalTag
import GlobalTag
51 process.GlobalTag =
GlobalTag(process.GlobalTag,
'auto:mc',
'')
52 process.load(
'Configuration.Geometry.GeometryExtendedPhaseIPixelReco_cff')
54 elif score ==
"2023Muon":
55 from Configuration.AlCa.GlobalTag
import GlobalTag
56 process.GlobalTag =
GlobalTag(process.GlobalTag,
'auto:upgradePLS3',
'')
57 process.load(
'Configuration.Geometry.GeometryExtended2023MuonReco_cff')
59 from SLHCUpgradeSimulations.Configuration.combinedCustoms
import cust_2023Muon
63 elif score ==
"SLHCDB":
64 process.GlobalTag.globaltag =
'DESIGN42_V17::All'
65 process.load(
"Configuration.StandardSequences.GeometryDB_cff")
66 process.load(
"Configuration.StandardSequences.Reconstruction_cff")
68 process.GlobalTag.toGet = cms.VPSet(
69 cms.PSet(record = cms.string(
"GeometryFileRcd"),
70 tag = cms.string(
"XMLFILE_Geometry_428SLHCYV0_Phase1_R30F12_HCal_Ideal_mc"),
71 connect = cms.untracked.string(
"frontier://FrontierProd/CMS_COND_42X_GEOMETRY")
73 cms.PSet(record = cms.string(
'IdealGeometryRecord'),
74 tag = cms.string(
'TKRECO_Geometry_428SLHCYV0'),
75 connect = cms.untracked.string(
"frontier://FrontierProd/CMS_COND_42X_GEOMETRY")),
76 cms.PSet(record = cms.string(
'PGeometricDetExtraRcd'),
77 tag = cms.string(
'TKExtra_Geometry_428SLHCYV0'),
78 connect = cms.untracked.string(
"frontier://FrontierProd/CMS_COND_42X_GEOMETRY")),
81 elif score == varType.valueForKey(
"SLHC"):
82 from Configuration.AlCa.autoCond
import autoCond
83 process.GlobalTag.globaltag = autoCond[
'mc']
84 process.load(
"Configuration.Geometry.GeometrySLHCSimIdeal_cff")
85 process.load(
"Configuration.Geometry.GeometrySLHCReco_cff")
86 process.load(
"Configuration.StandardSequences.Reconstruction_cff")
87 process.trackerSLHCGeometry.applyAlignment =
False
98 defaultOutputFileName=
"cmsRecoGeom.root"
100 options.register (
'tag',
102 VarParsing.VarParsing.multiplicity.singleton,
103 VarParsing.VarParsing.varType.string,
104 "tag info about geometry database conditions")
107 options.register (
'tgeo',
109 VarParsing.VarParsing.multiplicity.singleton,
110 VarParsing.VarParsing.varType.bool,
111 "write geometry in TGeo format")
114 options.register (
'out',
115 defaultOutputFileName,
116 VarParsing.VarParsing.multiplicity.singleton,
117 VarParsing.VarParsing.varType.string,
120 options.parseArguments()
125 process = cms.Process(
"DUMP")
126 process.add_(cms.Service(
"InitRootHandlers", ResetRootErrHandler = cms.untracked.bool(
False)))
127 process.source = cms.Source(
"EmptySource")
128 process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(1))
133 if ( options.tgeo ==
True):
134 if (options.out == defaultOutputFileName ):
135 options.out =
"cmsTGeoRecoGeom-" + str(options.tag) +
".root"
136 process.add_(cms.ESProducer(
"FWTGeoRecoGeometryESProducer"))
137 process.dump = cms.EDAnalyzer(
"DumpFWTGeoRecoGeometry",
138 tagInfo = cms.untracked.string(options.tag),
139 outputFileName = cms.untracked.string(options.out)
142 if (options.out == defaultOutputFileName ):
143 options.out =
"cmsRecoGeom-" + str(options.tag) +
".root"
144 process.add_(cms.ESProducer(
"FWRecoGeometryESProducer"))
145 process.dump = cms.EDAnalyzer(
"DumpFWRecoGeometry",
146 level = cms.untracked.int32(1),
147 tagInfo = cms.untracked.string(options.tag),
148 outputFileName = cms.untracked.string(options.out)
151 print "Dumping geometry in " , options.out,
"\n";
152 process.p = cms.Path(process.dump)