Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2025-01-18 03:42:25

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 geomName = "Run4" + options.geometry
0036 geomFile = "Configuration.Geometry.GeometryExtended" + geomName + "Reco_cff"
0037 import Configuration.Geometry.defaultPhase2ConditionsEra_cff as _settings
0038 GLOBAL_TAG, ERA = _settings.get_era_and_conditions(geomName)
0039 baseName = "HGCalRun4" + options.geometry
0040 print("Geometry Name:   ", geomName)
0041 print("Geom file Name:  ", geomFile)
0042 print("Global Tag Name: ", GLOBAL_TAG)
0043 print("Era Name:        ", ERA)
0044 print("Base file Name:  ", baseName)
0045 
0046 process = cms.Process('G4PrintGeometry',ERA)
0047 
0048 process.load(geomFile)
0049 from SimG4Core.PrintGeomInfo.g4TestGeometry_cfi import *
0050 process = checkOverlap(process)
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(True)
0063 # list of names
0064 process.g4SimHits.G4CheckOverlap.NodeNames  = cms.vstring('HGCalRegion')
0065 # enable dump gdml file 
0066 process.g4SimHits.G4CheckOverlap.gdmlFlag   = cms.bool(True)
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 #