File indexing completed on 2024-11-14 04:15:38
0001
0002
0003
0004
0005
0006 import FWCore.ParameterSet.Config as cms
0007 import FWCore.ParameterSet.VarParsing as VarParsing
0008
0009
0010
0011 options = VarParsing.VarParsing('standard')
0012 options.register('geometry',
0013 "",
0014 VarParsing.VarParsing.multiplicity.singleton,
0015 VarParsing.VarParsing.varType.string,
0016 "Geometry name: e.g. D102"
0017 )
0018 options.register('tol',
0019 0.01,
0020 VarParsing.VarParsing.multiplicity.singleton,
0021 VarParsing.VarParsing.varType.float,
0022 "Overlap tolerance [mm]: 0.01, 0.1, 1.0"
0023 )
0024 options.register('full',
0025 False,
0026 VarParsing.VarParsing.multiplicity.singleton,
0027 VarParsing.VarParsing.varType.bool,
0028 "Check full CMS detector instead of just Tracker"
0029 )
0030
0031
0032 options.parseArguments()
0033
0034
0035
0036 from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9
0037 process = cms.Process('OverlapCheck',Phase2C17I13M9)
0038
0039 baseName = "GeometryExtendedRun4" + options.geometry
0040 geomFile = "Configuration.Geometry." + baseName + "_cff"
0041
0042 print("Base file Name: ", baseName)
0043 print("Geometry file Name: ", geomFile)
0044
0045 process.load(geomFile)
0046 process.load('FWCore.MessageService.MessageLogger_cfi')
0047
0048 from SimG4Core.PrintGeomInfo.g4TestGeometry_cfi import *
0049 process = checkOverlap(process)
0050
0051
0052 process.g4SimHits.CheckGeometry = True
0053
0054
0055 process.g4SimHits.G4CheckOverlap.OutputBaseName = cms.string(baseName)
0056 process.g4SimHits.G4CheckOverlap.OverlapFlag = cms.bool(True)
0057 process.g4SimHits.G4CheckOverlap.Tolerance = cms.double(options.tol)
0058 process.g4SimHits.G4CheckOverlap.Resolution = cms.int32(10000)
0059 process.g4SimHits.G4CheckOverlap.Depth = cms.int32(-1)
0060
0061 process.g4SimHits.G4CheckOverlap.RegionFlag = cms.bool(False)
0062
0063 if options.full:
0064 print('Checking the whole CMS detector')
0065 process.g4SimHits.G4CheckOverlap.NodeNames = cms.vstring('OCMS')
0066 else:
0067 print('Checking only Tracker volume')
0068 process.g4SimHits.G4CheckOverlap.NodeNames = cms.vstring('Tracker')
0069
0070 process.g4SimHits.G4CheckOverlap.gdmlFlag = cms.bool(False)
0071
0072 process.g4SimHits.G4CheckOverlap.PVname = ''
0073
0074 process.g4SimHits.G4CheckOverlap.LVname = ''
0075
0076
0077 process.g4SimHits.FileNameField = ''
0078 process.g4SimHits.FileNameGDML = ''
0079 process.g4SimHits.FileNameRegions = ''
0080