Back to home page

Project CMSSW displayed by LXR

 
 

    


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

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