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 2015 PhaseIPixel Phase1_R34F16 Phase2Tk SLHCDB SLHC DB")
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 " load=filename"
15  print " a single load instruction, this option excludes 'tag' option"
16  print " e.g load=Geometry.CMSCommonData.Phase1_R34F16_cmsSimIdealGeometryXML_cff"
17  print
18  exit(1);
19 
20 def simGeoLoad(score):
21  print "Loading configuration for tag ", options.tag ,"...\n"
22  if score == "Run1":
23  process.load("Geometry.CMSCommonData.cmsIdealGeometryXML_cfi")
24 
25  elif score == "2015":
26  process.load("Geometry.CMSCommonData.cmsExtendedGeometry2015XML_cfi")
27 
28  elif score == "PhaseIPixel":
29  process.load('Geometry.CMSCommonData.GeometryExtendedPhaseIPixel_cfi')
30 
31  elif score == "Phase2Tk":
32  process.load('Geometry.CMSCommonData.cmsExtendedGeometryPhase2TkBEXML_cfi')
33 
34  elif score == "SLHCDB":
35  process.load("Configuration.StandardSequences.GeometryDB_cff")
36  process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
37  process.GlobalTag.globaltag = 'DESIGN42_V17::All'
38  process.XMLFromDBSource.label=''
39 
40  process.GlobalTag.toGet = cms.VPSet(
41  cms.PSet(record = cms.string("GeometryFileRcd"),
42  tag = cms.string("XMLFILE_Geometry_428SLHCYV0_Phase1_R30F12_HCal_Ideal_mc"),
43  connect = cms.untracked.string("frontier://FrontierProd/CMS_COND_42X_GEOMETRY")
44  )
45  )
46 
47  elif score == "DB":
48  process.load("Configuration.StandardSequences.GeometryDB_cff")
49  process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
50  from Configuration.AlCa.autoCond import autoCond
51  process.GlobalTag.globaltag = autoCond['mc']
52 
53  elif score == "SLHC":
54  process.load('SLHCUpgradeSimulations.Geometry.Phase1_R30F12_HCal_cmsSimIdealGeometryXML_cff')
55 
56 
57  elif score == "Phase1_R34F16":
58  process.load('Geometry.CMSCommonData.Phase1_R34F16_cmsSimIdealGeometryXML_cff')
59 
60  else:
61  help()
62 
63 
64 
66 
67 options.register ('tag',
68  "2015", # default value
69  VarParsing.VarParsing.multiplicity.singleton,
70  VarParsing.VarParsing.varType.string,
71  "info about geometry database conditions")
72 
73 options.register ('load',
74  "", # default value
75  VarParsing.VarParsing.multiplicity.singleton,
76  VarParsing.VarParsing.varType.string,
77  "load path e.g Geometry.CMSCommonData.Phase1_R34F16_cmsSimIdealGeometryXML_cff")
78 
79 
80 options.parseArguments()
81 
82 
83 process = cms.Process("SIMDUMP")
84 
85 if not options.load:
86  simGeoLoad(options.tag)
87 else:
88  process.load(options.load)
89 
90 process.source = cms.Source("EmptySource")
91 
92 process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(1))
93 
94 process.add_(cms.ESProducer("TGeoMgrFromDdd",
95  verbose = cms.untracked.bool(False),
96  level = cms.untracked.int32(14)
97 ))
98 
99 process.dump = cms.EDAnalyzer("DumpSimGeometry")
100 
101 process.p = cms.Path(process.dump)