Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-07-10 22:33:14

0001 ###############################################################################
0002 # Way to use this:
0003 #   cmsRun dumpHGCalDDD_cfg.py geometry=D88
0004 #
0005 #   Options for geometry D77, D83, D88, D92, D93
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                  "D88",
0017                   VarParsing.VarParsing.multiplicity.singleton,
0018                   VarParsing.VarParsing.varType.string,
0019                   "geometry of operations: D77, D83, D88, D92, D93")
0020 
0021 ### get and parse the command line arguments
0022 options.parseArguments()
0023 
0024 print(options)
0025 
0026 ####################################################################
0027 # Use the options
0028 
0029 if (options.geometry == "D83"):
0030     from Configuration.Eras.Era_Phase2C11M9_cff import Phase2C11M9
0031     process = cms.Process('DUMP',Phase2C11M9)
0032     process.load('Configuration.Geometry.GeometryExtended2026D83Reco_cff')
0033     fileName = 'hgcalV15DDD.root'
0034 elif (options.geometry == "D77"):
0035     from Configuration.Eras.Era_Phase2C11_cff import Phase2C11
0036     process = cms.Process('DUMP',Phase2C11)
0037     process.load('Configuration.Geometry.GeometryExtended2026D77Reco_cff')
0038     fileName = 'hgcalV14DDD.root'
0039 elif (options.geometry == "D92"):
0040     from Configuration.Eras.Era_Phase2C11M9_cff import Phase2C11M9
0041     process = cms.Process('DUMP',Phase2C11M9)
0042     process.load('Configuration.Geometry.GeometryExtended2026D92Reco_cff')
0043     fileName = 'hgcalV17DDD.root'
0044 elif (options.geometry == "D93"):
0045     from Configuration.Eras.Era_Phase2C11M9_cff import Phase2C11M9
0046     process = cms.Process('DUMP',Phase2C11M9)
0047     process.load('Configuration.Geometry.GeometryExtended2026D93Reco_cff')
0048     fileName = 'hgcalV17NDDD.root'
0049 else:
0050     from Configuration.Eras.Era_Phase2C11M9_cff import Phase2C11M9
0051     process = cms.Process('DUMP',Phase2C11M9)
0052     process.load('Configuration.Geometry.GeometryExtended2026D88Reco_cff')
0053     fileName = 'hgcalV16DDD.root'
0054 
0055 print("Output file Name: ", fileName)
0056 
0057 process.load('FWCore.MessageService.MessageLogger_cfi')
0058 
0059 if 'MessageLogger' in process.__dict__:
0060     process.MessageLogger.G4cerr=dict()
0061     process.MessageLogger.G4cout=dict()
0062     process.MessageLogger.HGCalGeom=dict()
0063 
0064 process.source = cms.Source("EmptySource")
0065 
0066 process.maxEvents = cms.untracked.PSet(
0067     input = cms.untracked.int32(1)
0068 )
0069 
0070 process.add_(cms.ESProducer("TGeoMgrFromDdd",
0071         verbose = cms.untracked.bool(False),
0072         level   = cms.untracked.int32(14)
0073 ))
0074 
0075 process.dump = cms.EDAnalyzer("DumpSimGeometry",
0076                               outputFileName = cms.untracked.string(fileName))
0077 
0078 process.p = cms.Path(process.dump)