CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
dumpSimGeometry_cfg.py
Go to the documentation of this file.
2 import sys
3 import FWCore.ParameterSet.VarParsing as VarParsing
4 from FWCore.Utilities.Enumerate import Enumerate
5 
6 varType = Enumerate ("Run1 Ideal2015 2015 2019 PhaseIPixel Phase1_R34F16 Phase2Tk 2023Muon SLHC DB SLHCDB")
7 
8 def help():
9  print "Usage: cmsRun dumpSimGeometry_cfg.py tag=TAG "
10  print " tag=tagname"
11  print " indentify geometry condition database tag"
12  print " ", varType.keys()
13  print ""
14  print " out=outputFileName"
15  print " default is cmsSimGeom<tag>.root"
16  print
17  exit(1);
18 
19 def simGeoLoad(score):
20  print "Loading configuration for tag ", options.tag ,"...\n"
21  if score == "Run1":
22  process.load("Geometry.CMSCommonData.cmsIdealGeometryXML_cfi")
23 
24  elif score == "2015":
25  process.load("Geometry.CMSCommonData.cmsExtendedGeometry2015XML_cfi")
26 
27  elif score == "Ideal2015":
28  process.load("Geometry.CMSCommonData.cmsIdealGeometry2015XML_cfi")
29 
30  elif score == "2019":
31  process.load('Configuration.Geometry.GeometryExtended2019Reco_cff')
32 
33  elif score == "PhaseIPixel":
34  process.load('Geometry.CMSCommonData.GeometryExtendedPhaseIPixel_cfi')
35 
36  elif score == "Phase1_R34F16":
37  process.load('Geometry.CMSCommonData.Phase1_R34F16_cmsSimIdealGeometryXML_cff')
38 
39  elif score == "Phase2Tk":
40  process.load('Geometry.CMSCommonData.cmsExtendedGeometryPhase2TkBEXML_cfi')
41 
42  elif score == "2023Muon":
43  process.load('Configuration.Geometry.GeometryExtended2023MuonReco_cff')
44 
45 
46  elif score == "SLHC":
47  process.load('SLHCUpgradeSimulations.Geometry.Phase1_R30F12_HCal_cmsSimIdealGeometryXML_cff')
48 
49  elif score == "DB":
50  process.load("Configuration.StandardSequences.GeometryDB_cff")
51  process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
52  from Configuration.AlCa.autoCond import autoCond
53  process.GlobalTag.globaltag = autoCond['mc']
54 
55  elif score == "SLHCDB":
56  process.load("Configuration.StandardSequences.GeometryDB_cff")
57  process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
58  process.GlobalTag.globaltag = 'DESIGN42_V17::All'
59  process.XMLFromDBSource.label=''
60 
61  process.GlobalTag.toGet = cms.VPSet(
62  cms.PSet(record = cms.string("GeometryFileRcd"),
63  tag = cms.string("XMLFILE_Geometry_428SLHCYV0_Phase1_R30F12_HCal_Ideal_mc"),
64  connect = cms.untracked.string("frontier://FrontierProd/CMS_COND_42X_GEOMETRY")
65  )
66  )
67 
68  else:
69  help()
70 
71 
72 
74 
75 defaultTag=str(2015);
76 defaultLevel=14;
77 defaultOutputFileName="cmsSimGeom.root"
78 
79 options.register ('tag',
80  defaultTag, # default value
81  VarParsing.VarParsing.multiplicity.singleton,
82  VarParsing.VarParsing.varType.string,
83  "info about geometry database conditions")
84 options.register ('out',
85  defaultOutputFileName, # default value
86  VarParsing.VarParsing.multiplicity.singleton,
87  VarParsing.VarParsing.varType.string,
88  "Output file name")
89 
90 
91 options.parseArguments()
92 
93 
94 if (options.out == defaultOutputFileName ):
95  options.out = "cmsSimGeom-" + str(options.tag) + ".root"
96 
97 process = cms.Process("SIMDUMP")
98 simGeoLoad(options.tag)
99 
100 process.source = cms.Source("EmptySource")
101 
102 process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(1))
103 
104 process.add_(cms.ESProducer("TGeoMgrFromDdd",
105  verbose = cms.untracked.bool(False),
106  level = cms.untracked.int32(defaultLevel)
107 ))
108 
109 process.dump = cms.EDAnalyzer("DumpSimGeometry",
110  tag = cms.untracked.string(options.tag),
111  outputFileName = cms.untracked.string(options.out))
112 
113 process.p = cms.Path(process.dump)