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