Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:15:06

0001 ###############################################################################
0002 # Way to use this:
0003 #   cmsRun g4OverlapCheck_cfg.py type=V17 tol=0.01
0004 #
0005 #   Options for type V16, V17, V17n, V17ng, V18, V18n, V18O, Wafer, WaferFR,
0006 #                    WaferPR
0007 #               tol 1.0, 0.1, 0.01, 0.0
0008 #
0009 ###############################################################################
0010 import FWCore.ParameterSet.Config as cms
0011 import os, sys, importlib, re
0012 import FWCore.ParameterSet.VarParsing as VarParsing
0013 
0014 ####################################################################
0015 ### SETUP OPTIONS
0016 options = VarParsing.VarParsing('standard')
0017 options.register('type',
0018                  "V17",
0019                   VarParsing.VarParsing.multiplicity.singleton,
0020                   VarParsing.VarParsing.varType.string,
0021                   "type of operations: V16, V17, V17n, V7ng, V18, V18n, V18O, Wafer, WaferFR, WaferPR")
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 from Configuration.Eras.Modifier_phase2_hgcalOnly_cff import phase2_hgcalOnly
0034 
0035 if (options.type == "V18O"):
0036     process = cms.Process("OverlapCheck",Phase2C17I13M9,phase2_hgcalOnly)
0037 else:
0038     process = cms.Process("OverlapCheck",Phase2C17I13M9)
0039 
0040 ####################################################################
0041 # Use the options
0042 geomFile = "Geometry.HGCalCommonData.testHGCal" + options.type + "XML_cfi"
0043 outFile = "hgcal" + options.type + str(options.tol)
0044 
0045 print("Geometry file: ", geomFile)
0046 print("Output file:   ", outFile)
0047 
0048 process.load('FWCore.MessageService.MessageLogger_cfi')
0049 process.load(geomFile)
0050 process.load('Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cff')
0051 process.load('SLHCUpgradeSimulations.Geometry.fakePhase2OuterTrackerConditions_cff')
0052 process.load('Geometry.EcalCommonData.ecalSimulationParameters_cff')
0053 process.load('Geometry.HcalCommonData.hcalDDDSimConstants_cff')
0054 process.load('Geometry.HGCalCommonData.hgcalParametersInitialization_cfi')
0055 process.load('Geometry.HGCalCommonData.hgcalNumberingInitialization_cfi')
0056 process.load('Geometry.MuonNumbering.muonGeometryConstants_cff')
0057 process.load('Geometry.MuonNumbering.muonOffsetESProducer_cff')
0058 process.load('Geometry.MTDNumberingBuilder.mtdNumberingGeometry_cff')
0059 
0060 if hasattr(process,'MessageLogger'):
0061 #    process.MessageLogger.SimG4CoreGeometry=dict()
0062     process.MessageLogger.HGCalGeom=dict()
0063 
0064 from SimG4Core.PrintGeomInfo.g4TestGeometry_cfi import *
0065 process = checkOverlap(process)
0066 
0067 # enable Geant4 overlap check 
0068 process.g4SimHits.CheckGeometry = True
0069 
0070 # Geant4 geometry check 
0071 process.g4SimHits.G4CheckOverlap.OutputBaseName = outFile
0072 process.g4SimHits.G4CheckOverlap.OverlapFlag = True
0073 process.g4SimHits.G4CheckOverlap.Tolerance  = options.tol
0074 process.g4SimHits.G4CheckOverlap.Resolution = 10000
0075 process.g4SimHits.G4CheckOverlap.Depth      = -1
0076 # tells if NodeName is G4Region or G4PhysicalVolume
0077 process.g4SimHits.G4CheckOverlap.RegionFlag = False
0078 # list of names
0079 process.g4SimHits.G4CheckOverlap.NodeNames  = ['OCMS']
0080 # enable dump gdml file 
0081 process.g4SimHits.G4CheckOverlap.gdmlFlag   = False
0082 # if defined a G4PhysicsVolume info is printed
0083 process.g4SimHits.G4CheckOverlap.PVname     = ''
0084 # if defined a list of daughter volumes is printed
0085 process.g4SimHits.G4CheckOverlap.LVname     = ''
0086 
0087 # extra output files, created if a name is not empty
0088 process.g4SimHits.FileNameField   = ''
0089 process.g4SimHits.FileNameGDML    = ''
0090 process.g4SimHits.FileNameRegions = ''
0091 #