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 dumpHGCalDD4hep_cfg.py geometry=D92
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 from Configuration.ProcessModifiers.dd4hep_cff import dd4hep
0030 if (options.geometry == "D83"):
0031     from Configuration.Eras.Era_Phase2C11M9_cff import Phase2C11M9
0032     process = cms.Process('DUMP',Phase2C11M9,dd4hep)
0033     geomFile = 'Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D83.xml'
0034     fileName = 'hgcalV15DD4hep.root'
0035 elif (options.geometry == "D77"):
0036     from Configuration.Eras.Era_Phase2C11_cff import Phase2C11
0037     process = cms.Process('DUMP',Phase2C11,dd4hep)
0038     geomFile = 'Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D77.xml'
0039     fileName = 'hgcalV14DD4hep.root'
0040 elif (options.geometry == "D92"):
0041     from Configuration.Eras.Era_Phase2C11M9_cff import Phase2C11M9
0042     process = cms.Process('DUMP',Phase2C11M9,dd4hep)
0043     geomFile = 'Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D92.xml'
0044     fileName = 'hgcalV17DD4hep.root'
0045 elif (options.geometry == "D93"):
0046     from Configuration.Eras.Era_Phase2C11M9_cff import Phase2C11M9
0047     process = cms.Process('DUMP',Phase2C11M9,Run3_dd4hep)
0048     geomFile = 'Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D93.xml'
0049     fileName = 'hgcalV17nDD4hep.root'
0050 else:
0051     from Configuration.Eras.Era_Phase2C11M9_cff import Phase2C11M9
0052     process = cms.Process('DUMP',Phase2C11M9,dd4hep)
0053     geomFile = 'Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D88.xml'
0054     fileName = 'hgcalV16DD4hep.root'
0055 
0056 print("Geometry file Name: ", geomFile)
0057 print("Dump file Name: ", fileName)
0058 
0059 process.load('FWCore.MessageService.MessageLogger_cfi')
0060 
0061 process.source = cms.Source("EmptySource")
0062 process.maxEvents = cms.untracked.PSet(
0063     input = cms.untracked.int32(1)
0064     )
0065 
0066 process.MessageLogger.cerr.FwkReport.reportEvery = 5
0067 if hasattr(process,'MessageLogger'):
0068     process.MessageLogger.HGCalGeom=dict()
0069 
0070 process.DDDetectorESProducer = cms.ESSource("DDDetectorESProducer",
0071                                             confGeomXMLFiles = cms.FileInPath(geomFile),
0072                                             appendToDataLabel = cms.string('DDHGCal')
0073                                             )
0074 
0075 process.testDump = cms.EDAnalyzer("DDTestDumpFile",
0076                                   outputFileName = cms.untracked.string(fileName),
0077                                   DDDetector = cms.ESInputTag('','DDHGCal')
0078                                   )
0079 
0080 process.p = cms.Path(process.testDump)