From 6c82b42f0729acbb3227ff96e2297f54b50f6981 Mon Sep 17 00:00:00 2001 From: Sunanda Date: Tue, 21 Sep 2021 17:22:33 +0200 Subject: [PATCH] Modify the cfg's in SimG4Core/PrintGeomInfo to simplify running the overlap tools --- .../test/python/g4OverlapCheckBigXML_cfg.py | 13 ++++++++++++- .../test/python/g4OverlapCheckBigXMLdd4hep_cfg.py | 13 ++++++++++++- .../test/python/g4OverlapCheck_cfg.py | 14 +++++++++++++- .../test/python/g4OverlapCheck_dd4hep_cfg.py | 13 ++++++++++++- 4 files changed, 49 insertions(+), 4 deletions(-) diff --git a/SimG4Core/PrintGeomInfo/test/python/g4OverlapCheckBigXML_cfg.py b/SimG4Core/PrintGeomInfo/test/python/g4OverlapCheckBigXML_cfg.py index 53233b548fd16..02a427bc5db68 100644 --- a/SimG4Core/PrintGeomInfo/test/python/g4OverlapCheckBigXML_cfg.py +++ b/SimG4Core/PrintGeomInfo/test/python/g4OverlapCheckBigXML_cfg.py @@ -1,4 +1,5 @@ import FWCore.ParameterSet.Config as cms +import FWCore.ParameterSet.VarParsing as VarParsing from Configuration.Eras.Era_Run3_cff import Run3 process = cms.Process('SIM',Run3) @@ -15,6 +16,16 @@ #if hasattr(process,'MessageLogger'): # process.MessageLogger.HCalGeom=dict() +options = VarParsing.VarParsing('standard') +options.register('tol', + 0.1, + VarParsing.VarParsing.multiplicity.singleton, + VarParsing.VarParsing.varType.float, + "Tolerance for checking overlaps: 0.01, 0.1, 1.0" +) +options.parseArguments() +print(options) + from SimG4Core.PrintGeomInfo.g4TestGeometry_cfi import * process = checkOverlap(process) @@ -24,7 +35,7 @@ # Geant4 geometry check process.g4SimHits.G4CheckOverlap.OutputBaseName = cms.string("cms2021") process.g4SimHits.G4CheckOverlap.OverlapFlag = cms.bool(True) -process.g4SimHits.G4CheckOverlap.Tolerance = cms.double(0.1) +process.g4SimHits.G4CheckOverlap.Tolerance = cms.double(options.tol) process.g4SimHits.G4CheckOverlap.Resolution = cms.int32(10000) process.g4SimHits.G4CheckOverlap.Depth = cms.int32(-1) # tells if NodeName is G4Region or G4PhysicalVolume diff --git a/SimG4Core/PrintGeomInfo/test/python/g4OverlapCheckBigXMLdd4hep_cfg.py b/SimG4Core/PrintGeomInfo/test/python/g4OverlapCheckBigXMLdd4hep_cfg.py index 2161b487dae3c..ff75428b253fa 100644 --- a/SimG4Core/PrintGeomInfo/test/python/g4OverlapCheckBigXMLdd4hep_cfg.py +++ b/SimG4Core/PrintGeomInfo/test/python/g4OverlapCheckBigXMLdd4hep_cfg.py @@ -1,4 +1,5 @@ import FWCore.ParameterSet.Config as cms +import FWCore.ParameterSet.VarParsing as VarParsing from Configuration.Eras.Era_Run3_dd4hep_cff import Run3_dd4hep process = cms.Process('G4PrintGeometry',Run3_dd4hep) @@ -15,6 +16,16 @@ #if hasattr(process,'MessageLogger'): # process.MessageLogger.HCalGeom=dict() +options = VarParsing.VarParsing('standard') +options.register('tol', + 0.1, + VarParsing.VarParsing.multiplicity.singleton, + VarParsing.VarParsing.varType.float, + "Tolerance for checking overlaps: 0.01, 0.1, 1.0" +) +options.parseArguments() +print(options) + from SimG4Core.PrintGeomInfo.g4TestGeometry_cfi import * process = checkOverlap(process) @@ -26,7 +37,7 @@ # Geant4 geometry check process.g4SimHits.G4CheckOverlap.OutputBaseName = cms.string("cms2021") process.g4SimHits.G4CheckOverlap.OverlapFlag = cms.bool(True) -process.g4SimHits.G4CheckOverlap.Tolerance = cms.double(0.1) +process.g4SimHits.G4CheckOverlap.Tolerance = cms.double(options.tol) process.g4SimHits.G4CheckOverlap.Resolution = cms.int32(10000) process.g4SimHits.G4CheckOverlap.Depth = cms.int32(-1) # tells if NodeName is G4Region or G4PhysicalVolume diff --git a/SimG4Core/PrintGeomInfo/test/python/g4OverlapCheck_cfg.py b/SimG4Core/PrintGeomInfo/test/python/g4OverlapCheck_cfg.py index 4aa2003e601bc..81d6b5789a228 100644 --- a/SimG4Core/PrintGeomInfo/test/python/g4OverlapCheck_cfg.py +++ b/SimG4Core/PrintGeomInfo/test/python/g4OverlapCheck_cfg.py @@ -1,4 +1,6 @@ +# cmsRun g4OverlapCheck_cfg.py tol=0.01 import FWCore.ParameterSet.Config as cms +import FWCore.ParameterSet.VarParsing as VarParsing #from Configuration.Eras.Era_Run2_cff import Run2 #process = cms.Process('SIM',Run2) @@ -14,6 +16,16 @@ #if hasattr(process,'MessageLogger'): # process.MessageLogger.HCalGeom=dict() +options = VarParsing.VarParsing('standard') +options.register('tol', + 0.1, + VarParsing.VarParsing.multiplicity.singleton, + VarParsing.VarParsing.varType.float, + "Tolerance for checking overlaps: 0.01, 0.1, 1.0" +) +options.parseArguments() +print(options) + from SimG4Core.PrintGeomInfo.g4TestGeometry_cfi import * process = checkOverlap(process) @@ -23,7 +35,7 @@ # Geant4 geometry check process.g4SimHits.G4CheckOverlap.OutputBaseName = cms.string("cms2021") process.g4SimHits.G4CheckOverlap.OverlapFlag = cms.bool(True) -process.g4SimHits.G4CheckOverlap.Tolerance = cms.double(0.1) +process.g4SimHits.G4CheckOverlap.Tolerance = cms.double(options.tol) process.g4SimHits.G4CheckOverlap.Resolution = cms.int32(10000) process.g4SimHits.G4CheckOverlap.Depth = cms.int32(-1) # tells if NodeName is G4Region or G4PhysicalVolume diff --git a/SimG4Core/PrintGeomInfo/test/python/g4OverlapCheck_dd4hep_cfg.py b/SimG4Core/PrintGeomInfo/test/python/g4OverlapCheck_dd4hep_cfg.py index bb67118d334bd..502c1fac6cb96 100644 --- a/SimG4Core/PrintGeomInfo/test/python/g4OverlapCheck_dd4hep_cfg.py +++ b/SimG4Core/PrintGeomInfo/test/python/g4OverlapCheck_dd4hep_cfg.py @@ -1,4 +1,5 @@ import FWCore.ParameterSet.Config as cms +import FWCore.ParameterSet.VarParsing as VarParsing from Configuration.Eras.Era_Run3_dd4hep_cff import Run3_dd4hep process = cms.Process('G4PrintGeometry',Run3_dd4hep) @@ -9,6 +10,16 @@ #if hasattr(process,'MessageLogger'): # process.MessageLogger.HCalGeom=dict() +options = VarParsing.VarParsing('standard') +options.register('tol', + 0.1, + VarParsing.VarParsing.multiplicity.singleton, + VarParsing.VarParsing.varType.float, + "Tolerance for checking overlaps: 0.01, 0.1, 1.0" +) +options.parseArguments() +print(options) + from SimG4Core.PrintGeomInfo.g4TestGeometry_cfi import * process = checkOverlap(process) @@ -18,7 +29,7 @@ # Geant4 geometry check process.g4SimHits.G4CheckOverlap.OutputBaseName = cms.string("cms2021") process.g4SimHits.G4CheckOverlap.OverlapFlag = cms.bool(True) -process.g4SimHits.G4CheckOverlap.Tolerance = cms.double(0.1) +process.g4SimHits.G4CheckOverlap.Tolerance = cms.double(options.tol) process.g4SimHits.G4CheckOverlap.Resolution = cms.int32(10000) process.g4SimHits.G4CheckOverlap.Depth = cms.int32(-1) # tells if NodeName is G4Region or G4PhysicalVolume