Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-01-24 01:14:55

0001 ###############################################################################
0002 # Way to use this:
0003 #   cmsRun g4OverlapCheckCalo_cfg.py geometry=2021 tol=0.1
0004 #
0005 #   Options for geometry 2016, 2017, 2021, 2026D77, 2026D86, 2026D88
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                  "2021",
0017                   VarParsing.VarParsing.multiplicity.singleton,
0018                   VarParsing.VarParsing.varType.string,
0019                   "geometry of operations: 2016, 2017, 2021, 2026D77, 2026D86, 2026D88")
0020 options.register('tol',
0021                  0.1,
0022                  VarParsing.VarParsing.multiplicity.singleton,
0023                  VarParsing.VarParsing.varType.float,
0024                  "Tolerance for checking overlaps: 0.0, 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 if (options.geometry == "2026D88"):
0036     from Configuration.Eras.Era_Phase2C11M9_cff import Phase2C11M9
0037     process = cms.Process('G4PrintGeometry',Phase2C11M9)
0038     process.load('Configuration.Geometry.GeometryExtended2026D88Reco_cff')
0039     baseName = 'Hcal2026D88'
0040 elif (options.geometry == "2026D86"):
0041     from Configuration.Eras.Era_Phase2C11M9_cff import Phase2C11M9
0042     process = cms.Process('G4PrintGeometry',Phase2C11M9)
0043     process.load('Configuration.Geometry.GeometryExtended2026D86Reco_cff')
0044     baseName = 'Hcal2026D86'
0045 elif (options.geometry == "2026D77"):
0046     from Configuration.Eras.Era_Phase2C11_cff import Phase2C11
0047     process = cms.Process('G4PrintGeometry',Phase2C11)
0048     process.load('Configuration.Geometry.GeometryExtended2026D77Reco_cff')
0049     baseName = 'Hcal2026D77'
0050 elif (options.geometry == "2016"):
0051     from Configuration.Eras.Era_Run2_2016_cff import Run2_2016
0052     process = cms.Process('G4PrintGeometry',Run2_2016)
0053     process.load('Configuration.Geometry.GeometryExtended2016Reco_cff')
0054     baseName = 'Hcal2016'
0055 elif (options.geometry == "2017"):
0056     from Configuration.Eras.Era_Run2_2017_cff import Run2_2017
0057     process = cms.Process('G4PrintGeometry',Run2_2017)
0058     process.load('Configuration.Geometry.GeometryExtended2017Reco_cff')
0059     baseName = 'Hcal2017'
0060 else:
0061     from Configuration.Eras.Era_Run3_DDD_cff import Run3_DDD
0062     process = cms.Process('G4PrintGeometry',Run3_DDD)
0063     process.load('Configuration.Geometry.GeometryExtended2021Reco_cff')
0064     baseName = 'Hcal2021'
0065 
0066 print("Base file Name: ", baseName)
0067 
0068 from SimG4Core.PrintGeomInfo.g4TestGeometry_cfi import *
0069 process = checkOverlap(process)
0070 
0071 # enable Geant4 overlap check 
0072 process.g4SimHits.CheckGeometry = True
0073 
0074 # Geant4 geometry check 
0075 process.g4SimHits.G4CheckOverlap.OutputBaseName = cms.string(baseName)
0076 process.g4SimHits.G4CheckOverlap.OverlapFlag = cms.bool(True)
0077 process.g4SimHits.G4CheckOverlap.Tolerance  = cms.double(options.tol)
0078 process.g4SimHits.G4CheckOverlap.Resolution = cms.int32(10000)
0079 process.g4SimHits.G4CheckOverlap.Depth      = cms.int32(-1)
0080 # tells if NodeName is G4Region or G4PhysicalVolume
0081 process.g4SimHits.G4CheckOverlap.RegionFlag = cms.bool(True)
0082 # list of names
0083 process.g4SimHits.G4CheckOverlap.NodeNames  = cms.vstring('HcalRegion')
0084 # enable dump gdml file 
0085 process.g4SimHits.G4CheckOverlap.gdmlFlag   = cms.bool(True)
0086 # if defined a G4PhysicsVolume info is printed
0087 process.g4SimHits.G4CheckOverlap.PVname     = ''
0088 # if defined a list of daughter volumes is printed
0089 process.g4SimHits.G4CheckOverlap.LVname     = 'HCAL'
0090 
0091 # extra output files, created if a name is not empty
0092 process.g4SimHits.FileNameField   = ''
0093 process.g4SimHits.FileNameGDML    = ''
0094 process.g4SimHits.FileNameRegions = ''
0095 #