Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:14:38

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