Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-08-15 04:54:03

0001 ###############################################################################
0002 # Way to use this:
0003 #   cmsRun dumpHGCalWaferDD4hep_cfg.py type=V17
0004 #
0005 #   Options for type V16, V17, V18, V19
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('type',
0016                  "V17",
0017                   VarParsing.VarParsing.multiplicity.singleton,
0018                   VarParsing.VarParsing.varType.string,
0019                   "type of operations: V16, V17, V18, V19")
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 = "Geometry/HGCalCommonData/data/dd4hep/testHGCalWafer" + options.type + ".xml"
0032 fileName = "hgcalWafer" + options.type + "DD4hep.root"
0033 
0034 print("Geometry file: ", geomFile)
0035 print("Output file:   ", fileName)
0036 
0037 process.load('FWCore.MessageService.MessageLogger_cfi')
0038 process.source = cms.Source("EmptySource")
0039 process.maxEvents = cms.untracked.PSet(
0040     input = cms.untracked.int32(1)
0041     )
0042 
0043 process.MessageLogger.cerr.FwkReport.reportEvery = 5
0044 if hasattr(process,'MessageLogger'):
0045     process.MessageLogger.HGCalGeom=dict()
0046 
0047 process.DDDetectorESProducer = cms.ESSource("DDDetectorESProducer",
0048                                             confGeomXMLFiles = cms.FileInPath(geomFile),
0049                                             appendToDataLabel = cms.string('')
0050                                             )
0051 
0052 process.testDump = cms.EDAnalyzer("DDTestDumpFile",
0053                                   outputFileName = cms.untracked.string(fileName),
0054                                   DDDetector = cms.ESInputTag('','')
0055                                   )
0056 
0057 process.p = cms.Path(process.testDump)