Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-05-15 04:21:44

0001 ###############################################################################
0002 # Way to use this:
0003 #   cmsRun g4OverlapCheckLayer_cfg.py type=EEV17 tol=0.01
0004 #
0005 #   Options for type EEV16, EEV17, HEsilV16, HEsilV17, HEmixV16, HEmixV17,
0006 #                    PassiveV18, PassiveV19
0007 #               tol 1.0, 0.1, 0.01, 0.0
0008 #
0009 ###############################################################################
0010 import FWCore.ParameterSet.Config as cms
0011 import os, sys, imp, re
0012 import FWCore.ParameterSet.VarParsing as VarParsing
0013 
0014 ####################################################################
0015 ### SETUP OPTIONS
0016 options = VarParsing.VarParsing('standard')
0017 options.register('type',
0018                  "EEV17",
0019                   VarParsing.VarParsing.multiplicity.singleton,
0020                   VarParsing.VarParsing.varType.string,
0021                   "type of operations: EEV16, EEV17, HEsilV16, HEsilV17, HEmixV16, HEmixV17, PassiveV18, PassiveV19")
0022 options.register('tol',
0023                  0.01,
0024                  VarParsing.VarParsing.multiplicity.singleton,
0025                  VarParsing.VarParsing.varType.float,
0026                  "Tolerance for checking overlaps: 0.0, 0.01, 0.1, 1.0")
0027 
0028 ### get and parse the command line arguments
0029 options.parseArguments()
0030 print(options)
0031 
0032 from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9
0033 
0034 process = cms.Process("OverlapCheckLayer",Phase2C17I13M9)
0035 
0036 ####################################################################
0037 # Use the options
0038 geomFile = "Geometry.HGCalCommonData.testHGCal" + options.type + "XML_cfi"
0039 outFile = "hgcal" + options.type + 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 
0047 if hasattr(process,'MessageLogger'):
0048     process.MessageLogger.HGCalGeom=dict()
0049 
0050 from SimG4Core.PrintGeomInfo.g4TestGeometry_cfi import *
0051 process = checkOverlap(process)
0052 
0053 # enable Geant4 overlap check 
0054 process.g4SimHits.CheckGeometry = True
0055 process.g4SimHits.OnlySDs = ['DreamSensitiveDetector']
0056 
0057 # Geant4 geometry check 
0058 process.g4SimHits.G4CheckOverlap.OutputBaseName = outFile
0059 process.g4SimHits.G4CheckOverlap.OverlapFlag = True
0060 process.g4SimHits.G4CheckOverlap.Tolerance  = options.tol
0061 process.g4SimHits.G4CheckOverlap.Resolution = 10000
0062 process.g4SimHits.G4CheckOverlap.Depth      = -1
0063 # tells if NodeName is G4Region or G4PhysicalVolume
0064 process.g4SimHits.G4CheckOverlap.RegionFlag = False
0065 # list of names
0066 process.g4SimHits.G4CheckOverlap.NodeNames  = ['OCMS']
0067 # enable dump gdml file 
0068 process.g4SimHits.G4CheckOverlap.gdmlFlag   = False
0069 # if defined a G4PhysicsVolume info is printed
0070 process.g4SimHits.G4CheckOverlap.PVname     = ''
0071 # if defined a list of daughter volumes is printed
0072 process.g4SimHits.G4CheckOverlap.LVname     = ''
0073 
0074 # extra output files, created if a name is not empty
0075 process.g4SimHits.FileNameField   = ''
0076 process.g4SimHits.FileNameGDML    = ''
0077 process.g4SimHits.FileNameRegions = ''
0078 #