Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:30:30

0001 ###############################################################################
0002 # Way to use this:
0003 #   cmsRun g4OverlapCheck_dd4hep_cfg.py tol=0.1
0004 #
0005 #   Options for tol 0.01, 0.1, 1.0
0006 #
0007 ###############################################################################
0008 import FWCore.ParameterSet.Config as cms
0009 import FWCore.ParameterSet.VarParsing as VarParsing
0010 
0011 from Configuration.Eras.Era_Run3_dd4hep_cff import Run3_dd4hep
0012 process = cms.Process('G4PrintGeometry',Run3_dd4hep)
0013 process.load('Configuration.Geometry.GeometryDD4hepExtended2021Reco_cff')
0014 
0015 process.load('FWCore.MessageService.MessageLogger_cfi')
0016 
0017 #if hasattr(process,'MessageLogger'):
0018 #    process.MessageLogger.HCalGeom=dict()
0019 
0020 options = VarParsing.VarParsing('standard')
0021 options.register('tol',
0022                  0.1,
0023                  VarParsing.VarParsing.multiplicity.singleton,
0024                  VarParsing.VarParsing.varType.float,
0025                  "Tolerance for checking overlaps: 0.01, 0.1, 1.0"
0026 )
0027 options.parseArguments()
0028 print(options)
0029 
0030 from SimG4Core.PrintGeomInfo.g4TestGeometry_cfi import *
0031 process = checkOverlap(process)
0032 
0033 # enable Geant4 overlap check 
0034 process.g4SimHits.CheckGeometry = True
0035 
0036 # Geant4 geometry check 
0037 process.g4SimHits.G4CheckOverlap.OutputBaseName = cms.string("cms2021")
0038 process.g4SimHits.G4CheckOverlap.OverlapFlag = cms.bool(True)
0039 process.g4SimHits.G4CheckOverlap.Tolerance  = cms.double(options.tol)
0040 process.g4SimHits.G4CheckOverlap.Resolution = cms.int32(10000)
0041 process.g4SimHits.G4CheckOverlap.Depth      = cms.int32(-1)
0042 # tells if NodeName is G4Region or G4PhysicalVolume
0043 process.g4SimHits.G4CheckOverlap.RegionFlag = cms.bool(False)
0044 # list of names
0045 process.g4SimHits.G4CheckOverlap.NodeNames  = cms.vstring('cms:OCMS_1')
0046 # enable dump gdml file 
0047 process.g4SimHits.G4CheckOverlap.gdmlFlag   = cms.bool(False)
0048 # if defined a G4PhysicsVolume info is printed
0049 process.g4SimHits.G4CheckOverlap.PVname     = ''
0050 # if defined a list of daughter volumes is printed
0051 process.g4SimHits.G4CheckOverlap.LVname     = ''
0052 
0053 # extra output files, created if a name is not empty
0054 process.g4SimHits.FileNameField   = ''
0055 process.g4SimHits.FileNameGDML    = ''
0056 process.g4SimHits.FileNameRegions = ''
0057 #