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 2023D17 2023D19 MaPSA")
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" 19 print " include Tracker subdetectors" 22 print " include Muon subdetectors" 25 print " include Calo subdetectors" 28 print " include Timing subdetectors" 34 print "Loading configuration for tag ", options.tag ,
"...\n" 37 process.load(
"Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
39 process.GlobalTag.globaltag = autoCond[
'run1_mc']
40 process.load(
"Configuration.StandardSequences.GeometryDB_cff")
43 process.load(
"Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
45 process.GlobalTag.globaltag = autoCond[
'run2_mc']
46 process.load(
"Configuration.StandardSequences.GeometryDB_cff")
49 process.load(
"Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
51 process.GlobalTag.globaltag = autoCond[
'upgrade2017']
52 process.load(
'Configuration.Geometry.GeometryExtended2017Reco_cff')
55 process.load(
"Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
57 process.GlobalTag.globaltag = autoCond[
'upgrade2019']
59 process.load(
'Geometry.TrackerGeometryBuilder.trackerParameters_cfi')
60 process.load(
'Configuration.Geometry.GeometryExtended2019Reco_cff')
62 process.DTGeometryESModule.applyAlignment = cms.bool(
False)
63 process.CSCGeometryESModule.applyAlignment = cms.bool(
False)
66 process.load(
"Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
68 process.GlobalTag.globaltag = autoCond[
'run2_mc']
69 process.load(
'Configuration.Geometry.GeometryExtended'+score+
'Reco_cff')
71 elif score ==
"MaPSA":
72 process.load(
'Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff')
73 process.load(
'Geometry.TrackerCommonData.mapsaGeometryXML_cfi')
74 process.load(
'Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi')
75 process.load(
'Geometry.TrackerNumberingBuilder.trackerTopology_cfi')
76 process.load(
'Geometry.TrackerGeometryBuilder.trackerParameters_cfi')
77 process.load(
'Geometry.TrackerGeometryBuilder.trackerGeometry_cfi')
78 process.trackerGeometry.applyAlignment = cms.bool(
False)
79 process.load(
'RecoTracker.GeometryESProducer.TrackerRecoGeometryESProducer_cfi')
81 process.load(
'Geometry.CommonDetUnit.bareGlobalTrackingGeometry_cfi')
83 elif score ==
"HGCTB160":
84 process.load(
"Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
86 process.GlobalTag.globaltag = autoCond[
'mc']
87 process.load(
'Geometry.HGCalCommonData.hgcalV6ParametersInitialization_cfi')
88 process.load(
'Geometry.HGCalCommonData.hgcalV6NumberingInitialization_cfi')
89 process.load(
'Geometry.CaloEventSetup.HGCalV6Topology_cfi')
90 process.load(
'Geometry.HGCalGeometry.HGCalV6GeometryESProducer_cfi')
91 process.load(
'Geometry.CaloEventSetup.CaloTopology_cfi')
92 process.load(
'Geometry.CaloEventSetup.CaloGeometryBuilder_cfi')
93 process.CaloGeometryBuilder = cms.ESProducer(
94 "CaloGeometryBuilder",
95 SelectedCalos = cms.vstring(
"HGCalEESensitive")
97 process.load(
"SimG4CMS.HGCalTestBeam.HGCalTB160XML_cfi")
108 defaultOutputFileName=
"cmsRecoGeom.root" 110 options.register (
'tag',
112 VarParsing.VarParsing.multiplicity.singleton,
113 VarParsing.VarParsing.varType.string,
114 "tag info about geometry database conditions")
116 options.register (
'tgeo',
118 VarParsing.VarParsing.multiplicity.singleton,
119 VarParsing.VarParsing.varType.bool,
120 "write geometry in TGeo format")
122 options.register (
'tracker',
124 VarParsing.VarParsing.multiplicity.singleton,
125 VarParsing.VarParsing.varType.bool,
126 "write Tracker geometry")
128 options.register (
'muon',
130 VarParsing.VarParsing.multiplicity.singleton,
131 VarParsing.VarParsing.varType.bool,
132 "write Muon geometry")
134 options.register (
'calo',
136 VarParsing.VarParsing.multiplicity.singleton,
137 VarParsing.VarParsing.varType.bool,
138 "write Calo geometry")
140 options.register (
'timing',
142 VarParsing.VarParsing.multiplicity.singleton,
143 VarParsing.VarParsing.varType.bool,
144 "write Timing geometry")
146 options.register (
'out',
147 defaultOutputFileName,
148 VarParsing.VarParsing.multiplicity.singleton,
149 VarParsing.VarParsing.varType.string,
152 options.parseArguments()
157 process = cms.Process(
"DUMP")
158 process.add_(cms.Service(
"InitRootHandlers", ResetRootErrHandler = cms.untracked.bool(
False)))
159 process.source = cms.Source(
"EmptySource")
160 process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(1))
165 if ( options.tgeo ==
True):
166 if (options.out == defaultOutputFileName ):
167 options.out =
"cmsTGeoRecoGeom-" +
str(options.tag) +
".root" 168 process.add_(cms.ESProducer(
"FWTGeoRecoGeometryESProducer",
169 Tracker = cms.untracked.bool(options.tracker),
170 Muon = cms.untracked.bool(options.muon),
171 Calo = cms.untracked.bool(options.calo),
172 Timing = cms.untracked.bool(options.timing)))
173 process.dump = cms.EDAnalyzer(
"DumpFWTGeoRecoGeometry",
174 tagInfo = cms.untracked.string(options.tag),
175 outputFileName = cms.untracked.string(options.out)
178 if (options.out == defaultOutputFileName ):
179 options.out =
"cmsRecoGeom-" +
str(options.tag) +
".root" 180 process.add_(cms.ESProducer(
"FWRecoGeometryESProducer",
181 Tracker = cms.untracked.bool(options.tracker),
182 Muon = cms.untracked.bool(options.muon),
183 Calo = cms.untracked.bool(options.calo),
184 Timing = cms.untracked.bool(options.timing)))
185 process.dump = cms.EDAnalyzer(
"DumpFWRecoGeometry",
186 level = cms.untracked.int32(1),
187 tagInfo = cms.untracked.string(options.tag),
188 outputFileName = cms.untracked.string(options.out)
191 print "Dumping geometry in " , options.out,
"\n";
192 process.p = cms.Path(process.dump)