Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2025-03-10 00:37:05

0001 ###############################################################################
0002 # Way to use this:
0003 #   cmsRun g4OverlapCheckPassive_cfg.py geometry=V18 tol=0.01
0004 #
0005 #   Options for geometry V18, V19, V19c
0006 #
0007 ###############################################################################
0008 import FWCore.ParameterSet.Config as cms
0009 import os, sys, importlib, re
0010 import FWCore.ParameterSet.VarParsing as VarParsing
0011 
0012 ####################################################################
0013 ### SETUP OPTIONS
0014 options = VarParsing.VarParsing('standard')
0015 options.register('geometry',
0016                  "V19",
0017                   VarParsing.VarParsing.multiplicity.singleton,
0018                   VarParsing.VarParsing.varType.string,
0019                   "type of operations: V18, V19, V19c")
0020 options.register('tol',
0021                  0.01,
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 ### get and parse the command line arguments
0027 options.parseArguments()
0028 print(options)
0029 
0030 from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9
0031 process = cms.Process('OverlapCheck',Phase2C17I13M9)
0032 #from Configuration.Eras.Modifier_hgcaltb_cff import hgcaltb
0033 #process = cms.Process('OverlapCheck',Phase2C17I13M9,hgcaltb)
0034 
0035 ####################################################################
0036 # Use the options
0037 
0038 geomFile = "Geometry.HGCalCommonData.testHGCalPassive" + options.geometry + "XML_cfi"
0039 outFile = "hgcal" + options.geometry + str(options.tol)
0040 
0041 print("Geometry file: ", geomFile)
0042 print("Output file:   ", outFile)
0043 
0044 process.load('FWCore.MessageService.MessageLogger_cfi')
0045 process.load(geomFile)
0046 #process.load('Geometry.HGCalCommonData.hgcalParametersInitialization_cfi')
0047 #process.load('Geometry.HGCalCommonData.hgcalNumberingInitialization_cfi')
0048 
0049 if hasattr(process,'MessageLogger'):
0050 #    process.MessageLogger.SimG4CoreGeometry=dict()
0051 #    process.MessageLogger.SimG4CoreApplication=dict()
0052      process.MessageLogger.HGCalGeom=dict()
0053 
0054 from SimG4Core.PrintGeomInfo.g4TestGeometry_cfi import *
0055 process = checkOverlap(process)
0056 
0057 # enable Geant4 overlap check 
0058 process.g4SimHits.CheckGeometry = True
0059 process.g4SimHits.OnlySDs = ["NONE"]
0060 process.g4SimHits.CaloHits = []
0061 process.g4SimHits.TrackHits = []
0062 
0063 # Geant4 geometry check 
0064 process.g4SimHits.G4CheckOverlap.OutputBaseName = outFile
0065 process.g4SimHits.G4CheckOverlap.OverlapFlag = True
0066 process.g4SimHits.G4CheckOverlap.Tolerance  = options.tol
0067 process.g4SimHits.G4CheckOverlap.Resolution = 10000
0068 process.g4SimHits.G4CheckOverlap.Depth      = -1
0069 # tells if NodeName is G4Region or G4PhysicalVolume
0070 process.g4SimHits.G4CheckOverlap.RegionFlag = False
0071 # list of names
0072 process.g4SimHits.G4CheckOverlap.NodeNames  = ['OCMS']
0073 # enable dump gdml file 
0074 process.g4SimHits.G4CheckOverlap.gdmlFlag   = 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 #