Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:14:48

0001 ###############################################################################
0002 # Way to use this:
0003 #   cmsRun dumpGeometryDDD_cfg.py geometry=2021
0004 #
0005 #   Options for geometry 2015, 2016, 2017, 2018, 2021
0006 #
0007 ###############################################################################
0008 import FWCore.ParameterSet.Config as cms
0009 import os, sys, imp, re
0010 import FWCore.ParameterSet.VarParsing as VarParsing
0011 
0012 ####################################################################
0013 ### SETUP OPTIONS
0014 options = VarParsing.VarParsing('standard')
0015 options.register('geometry',
0016                  "2021",
0017                   VarParsing.VarParsing.multiplicity.singleton,
0018                   VarParsing.VarParsing.varType.string,
0019                   "geometry of operations: 2015, 2016, 2017, 2018, 2021")
0020 
0021 ### get and parse the command line arguments
0022 options.parseArguments()
0023 
0024 print(options)
0025 
0026 ####################################################################
0027 # Use the options
0028 
0029 process = cms.Process('GeomDump')
0030 
0031 geomFile = "Configuration.Geometry.GeometryExtended" + options.geometry + "Reco_cff"
0032 fileName = "hcal" + options.geometry + "DDD.root"
0033 
0034 print("Geometry file: ", geomFile)
0035 print("Output file:   ", fileName)
0036 
0037 process.load(geomFile)
0038 process.load('FWCore.MessageService.MessageLogger_cfi')
0039 
0040 if 'MessageLogger' in process.__dict__:
0041     process.MessageLogger.HCalGeom=dict()
0042 
0043 process.source = cms.Source("EmptySource")
0044 
0045 process.maxEvents = cms.untracked.PSet(
0046     input = cms.untracked.int32(1)
0047 )
0048 
0049 process.add_(cms.ESProducer("TGeoMgrFromDdd",
0050         verbose = cms.untracked.bool(False),
0051         level   = cms.untracked.int32(14)
0052 ))
0053 
0054 
0055 process.dump = cms.EDAnalyzer("DumpSimGeometry",
0056                               outputFileName = cms.untracked.string(fileName)
0057 )
0058 
0059 process.p = cms.Path(process.dump)