Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-11-07 06:13:05

0001 ###############################################################################
0002 # Way to use this:
0003 #   cmsRun runDD4hepRun4_cfg.py geometry=D110
0004 #
0005 #   Options for geometry D95, D96, D98, D99, D100, D101, D102, D103, D104,
0006 #                        D105, D106, D107, D108, D109, D110, D111, D112, D113,
0007 #                        D114, D115
0008 #
0009 ###############################################################################
0010 import FWCore.ParameterSet.Config as cms
0011 import os, sys, importlib, 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")
0022 
0023 ### get and parse the command line arguments
0024 options.parseArguments()
0025 
0026 print(options)
0027 
0028 ####################################################################
0029 # Use the options
0030 
0031 from Configuration.ProcessModifiers.dd4hep_cff import dd4hep
0032 if (options.geometry == "D115"):
0033     from Configuration.Eras.Era_Phase2C20I13M9_cff import Phase2C20I13M9
0034     process = cms.Process('G4PrintGeometry',Phase2C20I13M9,dd4hep)
0035 else:
0036     from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9
0037     process = cms.Process('G4PrintGeometry',Phase2C17I13M9,dd4hep)
0038 
0039 geomFile = "Configuration.Geometry.GeometryDD4hepExtendedRun4" + options.geometry + "Reco_cff"
0040 materialFileName = "matfile" + options.geometry + "DD4hep.txt"
0041 solidFileName    = "solidfile" + options.geometry + "DD4hep.txt"
0042 lvFileName       = "lvfile" + options.geometry + "DD4hep.txt"
0043 pvFileName       = "pvfile" + options.geometry + "DD4hep.txt"
0044 touchFileName    = "touchfile" + options.geometry + "DD4hep.txt"
0045 regionFileName   = "regionfile" + options.geometry + "DD4hep.txt"
0046 
0047 print("Geometry file Name: ", geomFile)
0048 print("Material file Name: ", materialFileName)
0049 print("Solid file Name:    ", solidFileName)
0050 print("LV file Name:       ", lvFileName)
0051 print("PV file Name:       ", pvFileName)
0052 print("Touch file Name:    ", touchFileName)
0053 print("Region file Name:   ", regionFileName)
0054 
0055 process.load(geomFile)
0056 process.load('FWCore.MessageService.MessageLogger_cfi')
0057 
0058 from SimG4Core.PrintGeomInfo.g4PrintGeomInfo_cfi import *
0059 
0060 process = printGeomInfo(process)
0061 
0062 if hasattr(process,'MessageLogger'):
0063     process.MessageLogger.G4cerr=dict()
0064     process.MessageLogger.G4cout=dict()
0065 
0066 process.g4SimHits.Watchers = cms.VPSet(cms.PSet(
0067     DumpSummary      = cms.untracked.bool(True),
0068     DumpLVTree       = cms.untracked.bool(False),
0069     DumpMaterial     = cms.untracked.bool(False),
0070     DumpLVList       = cms.untracked.bool(False),
0071     DumpLV           = cms.untracked.bool(False),
0072     DumpSolid        = cms.untracked.bool(True),
0073     DumpAttributes   = cms.untracked.bool(False),
0074     DumpPV           = cms.untracked.bool(False),
0075     DumpRotation     = cms.untracked.bool(False),
0076     DumpReplica      = cms.untracked.bool(False),
0077     DumpTouch        = cms.untracked.bool(False),
0078     DumpSense        = cms.untracked.bool(False),
0079     DumpRegion       = cms.untracked.bool(False),
0080     DD4hep           = cms.untracked.bool(False),
0081     Name             = cms.untracked.string(''),
0082     Names            = cms.untracked.vstring(''),
0083     MaterialFileName = cms.untracked.string(materialFileName),
0084     SolidFileName    = cms.untracked.string(solidFileName),
0085     LVFileName       = cms.untracked.string(lvFileName),
0086     PVFileName       = cms.untracked.string(pvFileName),
0087     TouchFileName    = cms.untracked.string(touchFileName),
0088     RegionFileName   = cms.untracked.string(regionFileName),
0089     FileDetail       = cms.untracked.bool(True),
0090     type             = cms.string('PrintGeomInfoAction')
0091 ))