Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2025-06-06 01:33:42

0001 ###############################################################################
0002 # Way to use this:
0003 #   cmsRun runDDDRun4_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, D116, D117, D118, D119, D120, D121, D122,
0008 #                        D123
0009 #
0010 ###############################################################################
0011 import FWCore.ParameterSet.Config as cms
0012 import os, sys, importlib, re
0013 import FWCore.ParameterSet.VarParsing as VarParsing
0014 
0015 ####################################################################
0016 ### SETUP OPTIONS
0017 options = VarParsing.VarParsing('standard')
0018 options.register('geometry',
0019                  "D110",
0020                   VarParsing.VarParsing.multiplicity.singleton,
0021                   VarParsing.VarParsing.varType.string,
0022                   "geometry of operations: D95, D96, D98, D99, D100, D101, D102, D103, D104, D105, D106, D107, D108, D109, D110, D111, D112, D113, D114, D115, D116, D117, D118, D119, D120, D121, D122, D123")
0023 
0024 ### get and parse the command line arguments
0025 options.parseArguments()
0026 
0027 print(options)
0028 
0029 ####################################################################
0030 # Use the options
0031 
0032 geomName = "Run4" + options.geometry
0033 geomFile = "Configuration.Geometry.GeometryExtended" + geomName + "Reco_cff"
0034 import Configuration.Geometry.defaultPhase2ConditionsEra_cff as _settings
0035 GLOBAL_TAG, ERA = _settings.get_era_and_conditions(geomName)
0036 print("Geometry Name:   ", geomName)
0037 print("Geom file Name:  ", geomFile)
0038 print("Global Tag Name: ", GLOBAL_TAG)
0039 print("Era Name:        ", ERA)
0040 
0041 process = cms.Process('G4PrintGeometry',ERA)
0042 
0043 materialFileName = "matfile" + options.geometry + "DDD.txt"
0044 solidFileName    = "solidfile" + options.geometry + "DDD.txt"
0045 lvFileName       = "lvfile" + options.geometry + "DDD.txt"
0046 pvFileName       = "pvfile" + options.geometry + "DDD.txt"
0047 touchFileName    = "touchfile" + options.geometry + "DDD.txt"
0048 regionFileName   = "regionfile" + options.geometry + "DDD.txt"
0049 
0050 print("Material file Name: ", materialFileName)
0051 print("Solid file Name:    ", solidFileName)
0052 print("LV file Name:       ", lvFileName)
0053 print("PV file Name:       ", pvFileName)
0054 print("Touch file Name:    ", touchFileName)
0055 print("Region file Name:   ", regionFileName)
0056 
0057 process.load(geomFile)
0058 process.load('FWCore.MessageService.MessageLogger_cfi')
0059 
0060 from SimG4Core.PrintGeomInfo.g4PrintGeomInfo_cfi import *
0061 
0062 process = printGeomInfo(process)
0063 
0064 if hasattr(process,'MessageLogger'):
0065     process.MessageLogger.G4cerr=dict()
0066     process.MessageLogger.G4cout=dict()
0067 
0068 process.g4SimHits.Watchers = cms.VPSet(cms.PSet(
0069     DumpSummary      = cms.untracked.bool(True),
0070     DumpLVTree       = cms.untracked.bool(False),
0071     DumpMaterial     = cms.untracked.bool(False),
0072     DumpLVList       = cms.untracked.bool(False),
0073     DumpLV           = cms.untracked.bool(False),
0074     DumpSolid        = cms.untracked.bool(True),
0075     DumpAttributes   = cms.untracked.bool(False),
0076     DumpPV           = cms.untracked.bool(False),
0077     DumpRotation     = cms.untracked.bool(False),
0078     DumpReplica      = cms.untracked.bool(False),
0079     DumpTouch        = cms.untracked.bool(False),
0080     DumpSense        = cms.untracked.bool(False),
0081     DumpRegion       = cms.untracked.bool(False),
0082     DD4hep           = cms.untracked.bool(False),
0083     Name             = cms.untracked.string(''),
0084     Names            = cms.untracked.vstring(''),
0085     MaterialFileName = cms.untracked.string(materialFileName),
0086     SolidFileName    = cms.untracked.string(solidFileName),
0087     LVFileName       = cms.untracked.string(lvFileName),
0088     PVFileName       = cms.untracked.string(pvFileName),
0089     TouchFileName    = cms.untracked.string(touchFileName),
0090     RegionFileName   = cms.untracked.string(regionFileName),
0091     FileDetail       = cms.untracked.bool(True),
0092     type             = cms.string('PrintGeomInfoAction')
0093 ))