Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-10-20 23:31:07

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