Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-11-14 04:15:36

0001 ###############################################################################
0002 # Way to use this:
0003 #   cmsRun dumpHGCalGeometryDD4hep_cfg.py geometry=D110
0004 #
0005 #   Options for geometry D95, D96, D98, D99, D100, D101, D102, D103, D104, D105,
0006 #                        D106, D107, D108, D109, D110, D111, D112, D113, D114,
0007 #                        D115, D116
0008 #
0009 ###############################################################################
0010 import FWCore.ParameterSet.Config as cms
0011 import os, sys, imp, re
0012 import FWCore.ParameterSet.VarParsing as VarParsing
0013 
0014 ####################################################################
0015 ### SETUP OPTIONS
0016 options = VarParsing.VarParsing('standard')
0017 options.register('geometry',
0018                  "D110",
0019                   VarParsing.VarParsing.multiplicity.singleton,
0020                   VarParsing.VarParsing.varType.string,
0021                   "geometry of operations: D95, D96, D98, D99, D100, D101, D102, D103, D104, D105, D106, D107, D108, D109, D110, D111, D112, D113, D114, D115, D116")
0022 
0023 ### get and parse the command line arguments
0024 options.parseArguments()
0025 
0026 print(options)
0027 
0028 ####################################################################
0029 # Use the options
0030 from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9
0031 process = cms.Process('GeomDump',Phase2C17I13M9)
0032 
0033 geomFile = "Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometryRun4" + options.geometry + ".xml"
0034 fileName = "CMSRun4" + options.geometry + "DD4hep.root"
0035 
0036 print("Geometry file: ", geomFile)
0037 print("Output file:   ", fileName)
0038 
0039 process.load('FWCore.MessageService.MessageLogger_cfi')
0040 process.source = cms.Source("EmptySource")
0041 process.maxEvents = cms.untracked.PSet(
0042     input = cms.untracked.int32(1)
0043     )
0044 
0045 process.MessageLogger.cerr.FwkReport.reportEvery = 5
0046 if hasattr(process,'MessageLogger'):
0047     process.MessageLogger.HGCalGeom=dict()
0048 
0049 process.DDDetectorESProducer = cms.ESSource("DDDetectorESProducer",
0050                                             confGeomXMLFiles = cms.FileInPath(geomFile),
0051                                             appendToDataLabel = cms.string('DDHGCal')
0052                                             )
0053 
0054 process.testDump = cms.EDAnalyzer("DDTestDumpFile",
0055                                   outputFileName = cms.untracked.string(fileName),
0056                                   DDDetector = cms.ESInputTag('','DDHGCal')
0057                                   )
0058 
0059 process.p = cms.Path(process.testDump)