Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2025-04-09 02:00:25

0001 ###############################################################################
0002 # Way to use this:
0003 #   cmsRun g4OverlapCheck2025_cfg.py geometry=2025 tol=0.01
0004 #
0005 #   Options for geometry 2025, 2025N, 2025P, 2025Q, 2025R
0006 #           for tol      0.0, 0.01, 0.1, 1.0
0007 #
0008 ###############################################################################
0009 import FWCore.ParameterSet.Config as cms
0010 import os, sys, importlib, re
0011 import FWCore.ParameterSet.VarParsing as VarParsing
0012 
0013 ####################################################################
0014 ### SETUP OPTIONS
0015 options = VarParsing.VarParsing('standard')
0016 options.register('geometry',
0017                  "2025",
0018                   VarParsing.VarParsing.multiplicity.singleton,
0019                   VarParsing.VarParsing.varType.string,
0020                   "geometry of operations: 2025, 2025N,, 2025P, 2025Q, 2025R")
0021 options.register('tol',
0022                  0.01,
0023                  VarParsing.VarParsing.multiplicity.singleton,
0024                  VarParsing.VarParsing.varType.float,
0025                  "Tolerance for checking overlaps: 0.0,0.01, 0.1, 1.0"
0026 )
0027 
0028 ### get and parse the command line arguments
0029 options.parseArguments()
0030 
0031 print(options)
0032 
0033 ####################################################################
0034 # Use the options
0035 geomName = "Geometry.MuonCommonData.testExtendedGeometry" + options.geometry + "Reco_cff"
0036 baseName = "GeometryExtended" + options.geometry + str(options.tol)
0037 
0038 print("Geometry file: ", geomName)
0039 print("Base name:     ", baseName)
0040 
0041 from Configuration.Eras.Era_Run3_DDD_cff import Run3_DDD
0042 process = cms.Process('OverlapCheck',Run3_DDD)
0043 
0044 process.load(geomName)
0045 process.load('FWCore.MessageService.MessageLogger_cfi')
0046 
0047 from SimG4Core.PrintGeomInfo.g4TestGeometry_cfi import *
0048 process = checkOverlap(process)
0049 
0050 #process.MessageLogger.SimG4CoreGeometry=dict()
0051 
0052 # enable Geant4 overlap check 
0053 process.g4SimHits.CheckGeometry = True
0054 
0055 # Geant4 geometry check 
0056 process.g4SimHits.G4CheckOverlap.OutputBaseName = cms.string(baseName)
0057 process.g4SimHits.G4CheckOverlap.OverlapFlag = cms.bool(True)
0058 process.g4SimHits.G4CheckOverlap.Tolerance  = cms.double(options.tol)
0059 process.g4SimHits.G4CheckOverlap.Resolution = cms.int32(10000)
0060 process.g4SimHits.G4CheckOverlap.Depth      = cms.int32(-1)
0061 # tells if NodeName is G4Region or G4PhysicalVolume
0062 process.g4SimHits.G4CheckOverlap.RegionFlag = cms.bool(False)
0063 # list of names
0064 process.g4SimHits.G4CheckOverlap.NodeNames  = cms.vstring('OCMS')
0065 # enable dump gdml file 
0066 process.g4SimHits.G4CheckOverlap.gdmlFlag   = cms.bool(False)
0067 # if defined a G4PhysicsVolume info is printed
0068 process.g4SimHits.G4CheckOverlap.PVname     = ''
0069 # if defined a list of daughter volumes is printed
0070 process.g4SimHits.G4CheckOverlap.LVname     = ''
0071 
0072 # extra output files, created if a name is not empty
0073 process.g4SimHits.FileNameField   = ''
0074 process.g4SimHits.FileNameGDML    = ''
0075 process.g4SimHits.FileNameRegions = ''
0076 #