Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-07-16 02:43:16

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