Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-11-22 02:45:26

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