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 g4OverlapCheckNoseDDD_cfg.py geometry=D115 tol=0.1
0004 #
0005 #   Options for geometry D115
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                  "D115",
0017                   VarParsing.VarParsing.multiplicity.singleton,
0018                   VarParsing.VarParsing.varType.string,
0019                   "geometry of operations: D115")
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_Phase2C20I13M9_cff import Phase2C20I13M9
0036 process = cms.Process('OverlapCheck',Phase2C20I13M9)
0037 
0038 
0039 baseName = "cms2026" + options.geometry + "DDD"
0040 geomFile = "Configuration.Geometry.GeometryExtended2026" + options.geometry + "Reco_cff"
0041 
0042 
0043 print("Geometry file Name: ", geomFile)
0044 print("Base file Name:     ", baseName)
0045 
0046 process.load('FWCore.MessageService.MessageLogger_cfi')
0047 
0048 if hasattr(process,'MessageLogger'):
0049     process.MessageLogger.HGCalGeom=dict()
0050 
0051 from SimG4Core.PrintGeomInfo.g4TestGeometry_cfi import *
0052 process = checkOverlap(process)
0053 
0054 # enable Geant4 overlap check 
0055 process.g4SimHits.CheckGeometry = True
0056 
0057 # Geant4 geometry check 
0058 process.g4SimHits.G4CheckOverlap.OutputBaseName = cms.string(baseName)
0059 process.g4SimHits.G4CheckOverlap.OverlapFlag = cms.bool(True)
0060 process.g4SimHits.G4CheckOverlap.Tolerance  = cms.double(options.tol)
0061 process.g4SimHits.G4CheckOverlap.Resolution = cms.int32(10000)
0062 process.g4SimHits.G4CheckOverlap.Depth      = cms.int32(-1)
0063 # tells if NodeName is G4Region or G4PhysicalVolume
0064 process.g4SimHits.G4CheckOverlap.RegionFlag = cms.bool(False)
0065 # list of names
0066 process.g4SimHits.G4CheckOverlap.NodeNames  = cms.vstring('OCMS')
0067 # enable dump gdml file 
0068 process.g4SimHits.G4CheckOverlap.gdmlFlag   = cms.bool(False)
0069 # if defined a G4PhysicsVolume info is printed
0070 process.g4SimHits.G4CheckOverlap.PVname     = ''
0071 # if defined a list of daughter volumes is printed
0072 process.g4SimHits.G4CheckOverlap.LVname     = ''
0073 
0074 # extra output files, created if a name is not empty
0075 process.g4SimHits.FileNameField   = ''
0076 process.g4SimHits.FileNameGDML    = ''
0077 process.g4SimHits.FileNameRegions = ''
0078 #