Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-02-06 03:42:39

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