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 Ideal2015dev 2015 2015dev 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 == "2015dev":
28  process.load("Geometry.CMSCommonData.cmsExtendedGeometry2015devXML_cfi")
29 
30  elif score == "Ideal2015":
31  process.load("Geometry.CMSCommonData.cmsIdealGeometry2015XML_cfi")
32 
33  elif score == "Ideal2015dev":
34  process.load("Geometry.CMSCommonData.cmsIdealGeometry2015devXML_cfi")
35 
36  elif score == "RPC4RE11":
37  process.load("Geometry.CMSCommonData.cmsExtendedGeometry2015XML_RPC4RE11_cfi")
38 
39  elif score == "2017":
40  process.load('Configuration.Geometry.GeometryExtended2017Reco_cff')
41 
42  elif score == "2019":
43  process.load('Configuration.Geometry.GeometryExtended2019Reco_cff')
44 
45  elif score == "PhaseIPixel":
46  process.load('Geometry.CMSCommonData.GeometryExtendedPhaseIPixel_cfi')
47 
48  elif score == "Phase1_R34F16":
49  process.load('Geometry.CMSCommonData.Phase1_R34F16_cmsSimIdealGeometryXML_cff')
50 
51  elif score == "Phase2Tk":
52  process.load('Geometry.CMSCommonData.cmsExtendedGeometryPhase2TkBEXML_cfi')
53 
54  elif score == "2023Muon":
55  process.load('Configuration.Geometry.GeometryExtended2023MuonReco_cff')
56 
57  elif score == "2023":
58  process.load('Configuration.Geometry.GeometryExtended2023Reco_cff')
59 
60  elif score == "SLHC":
61  process.load('SLHCUpgradeSimulations.Geometry.Phase1_R30F12_HCal_cmsSimIdealGeometryXML_cff')
62 
63  elif score == "DB":
64  process.load("Configuration.StandardSequences.GeometryDB_cff")
65  process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
66  from Configuration.AlCa.autoCond import autoCond
67  process.GlobalTag.globaltag = autoCond['mc']
68 
69  elif score == "SLHCDB":
70  process.load("Configuration.StandardSequences.GeometryDB_cff")
71  process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
72  process.GlobalTag.globaltag = 'DESIGN42_V17::All'
73  process.XMLFromDBSource.label=''
74 
75  process.GlobalTag.toGet = cms.VPSet(
76  cms.PSet(record = cms.string("GeometryFileRcd"),
77  tag = cms.string("XMLFILE_Geometry_428SLHCYV0_Phase1_R30F12_HCal_Ideal_mc"),
78  connect = cms.untracked.string("frontier://FrontierProd/CMS_COND_42X_GEOMETRY")
79  )
80  )
81 
82  else:
83  help()
84 
85 
86 
88 
89 defaultTag=str(2015);
90 defaultLevel=14;
91 defaultOutputFileName="cmsSimGeom.root"
92 
93 options.register ('tag',
94  defaultTag, # default value
95  VarParsing.VarParsing.multiplicity.singleton,
96  VarParsing.VarParsing.varType.string,
97  "info about geometry database conditions")
98 options.register ('out',
99  defaultOutputFileName, # default value
100  VarParsing.VarParsing.multiplicity.singleton,
101  VarParsing.VarParsing.varType.string,
102  "Output file name")
103 
104 
105 options.parseArguments()
106 
107 
108 if (options.out == defaultOutputFileName ):
109  options.out = "cmsSimGeom-" + str(options.tag) + ".root"
110 
111 process = cms.Process("SIMDUMP")
112 simGeoLoad(options.tag)
113 
114 process.source = cms.Source("EmptySource")
115 
116 process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(1))
117 
118 process.add_(cms.ESProducer("TGeoMgrFromDdd",
119  verbose = cms.untracked.bool(False),
120  level = cms.untracked.int32(defaultLevel)
121 ))
122 
123 process.dump = cms.EDAnalyzer("DumpSimGeometry",
124  tag = cms.untracked.string(options.tag),
125  outputFileName = cms.untracked.string(options.out))
126 
127 process.p = cms.Path(process.dump)