Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-07-10 22:33:26

0001 ###############################################################################
0002 # Way to use this:
0003 #   cmsRun g4OverlapCheck2026DD4hep_cfg.py geometry=D92 tol=0.1
0004 #
0005 #   Options for geometry D77, D83, D88, D92, D93
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('geometry',
0016                  "D88",
0017                   VarParsing.VarParsing.multiplicity.singleton,
0018                   VarParsing.VarParsing.varType.string,
0019                   "geometry of operations: D77, D83, D88, D92, D93")
0020 options.register('tol',
0021                  0.1,
0022                  VarParsing.VarParsing.multiplicity.singleton,
0023                  VarParsing.VarParsing.varType.float,
0024                  "Tolerance for checking overlaps: 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.ProcessModifiers.dd4hep_cff import dd4hep
0036 if (options.geometry == "D83"):
0037     from Configuration.Eras.Era_Phase2C11M9_cff import Phase2C11M9
0038     process = cms.Process('PROD',Phase2C11M9,dd4hep)
0039     process.load('Configuration.Geometry.GeometryDD4hepExtended2026D83Reco_cff')
0040     baseName = 'cms2026D83DD4hep'
0041 elif (options.geometry == "D77"):
0042     from Configuration.Eras.Era_Phase2C11_cff import Phase2C11
0043     process = cms.Process('PROD',Phase2C11,dd4hep)
0044     process.load('Configuration.Geometry.GeometryDD4hepExtended2026D77Reco_cff')
0045     baseName = 'cms2026D77DD4hep'
0046 elif (options.geometry == "D92"):
0047     from Configuration.Eras.Era_Phase2C11M9_cff import Phase2C11M9
0048     process = cms.Process('PROD',Phase2C11M9,dd4hep)
0049     process.load('Configuration.Geometry.GeometryDD4hepExtended2026D92Reco_cff')
0050     baseName = 'cms2026D92DD4hep'
0051 elif (options.geometry == "D93"):
0052     from Configuration.Eras.Era_Phase2C11M9_cff import Phase2C11M9
0053     process = cms.Process('PROD',Phase2C11M9,Run3_dd4hep)
0054     process.load('Configuration.Geometry.GeometryDD4hepExtended2026D93Reco_cff')
0055     baseName = 'cms2026D93DD4hep'
0056 else:
0057     from Configuration.Eras.Era_Phase2C11M9_cff import Phase2C11M9
0058     process = cms.Process('PROD',Phase2C11M9,dd4hep)
0059     process.load('Configuration.Geometry.GeometryDD4hepExtended2026D88Reco_cff')
0060     baseName = 'cms2026D88DD4hep'
0061 
0062 print("Base file Name: ", baseName)
0063 
0064 process.load('FWCore.MessageService.MessageLogger_cfi')
0065 
0066 #if hasattr(process,'MessageLogger'):
0067 #    process.MessageLogger.HGCalGeom=dict()
0068 
0069 from SimG4Core.PrintGeomInfo.g4TestGeometry_cfi import *
0070 process = checkOverlap(process)
0071 
0072 # enable Geant4 overlap check 
0073 process.g4SimHits.CheckGeometry = True
0074 
0075 # Geant4 geometry check 
0076 process.g4SimHits.G4CheckOverlap.OutputBaseName = cms.string(baseName)
0077 process.g4SimHits.G4CheckOverlap.OverlapFlag = cms.bool(True)
0078 process.g4SimHits.G4CheckOverlap.Tolerance  = cms.double(options.tol)
0079 process.g4SimHits.G4CheckOverlap.Resolution = cms.int32(10000)
0080 process.g4SimHits.G4CheckOverlap.Depth      = cms.int32(-1)
0081 # tells if NodeName is G4Region or G4PhysicalVolume
0082 process.g4SimHits.G4CheckOverlap.RegionFlag = cms.bool(False)
0083 # list of names
0084 process.g4SimHits.G4CheckOverlap.NodeNames  = cms.vstring('cms:OCMS_1')
0085 # enable dump gdml file 
0086 process.g4SimHits.G4CheckOverlap.gdmlFlag   = cms.bool(False)
0087 # if defined a G4PhysicsVolume info is printed
0088 process.g4SimHits.G4CheckOverlap.PVname     = ''
0089 # if defined a list of daughter volumes is printed
0090 process.g4SimHits.G4CheckOverlap.LVname     = ''
0091 
0092 # extra output files, created if a name is not empty
0093 process.g4SimHits.FileNameField   = ''
0094 process.g4SimHits.FileNameGDML    = ''
0095 process.g4SimHits.FileNameRegions = ''
0096 #