Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:14:38

0001 ###############################################################################
0002 # Way to use this:
0003 #   cmsRun g4OverlapCheckDDD_cfg.py geometry=2021 tol=0.01
0004 #
0005 #   Options for geometry 2021, 2023
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                  "2023",
0017                   VarParsing.VarParsing.multiplicity.singleton,
0018                   VarParsing.VarParsing.varType.string,
0019                   "geometry of operations: 2021, 2023")
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 
0027 ### get and parse the command line arguments
0028 options.parseArguments()
0029 
0030 print(options)
0031 
0032 ####################################################################
0033 # Use the options
0034 
0035 baseName = "cmsDDD" + options.geometry
0036 geomName = "Geometry.ForwardCommonData.cmsExtendedGeometry" + options.geometry + "XML_cfi"
0037 
0038 from Configuration.Eras.Era_Run3_DDD_cff import Run3_DDD
0039 process = cms.Process("G4PrintGeometry",Run3_DDD)
0040 
0041 print("Base file Name: ", baseName)
0042 print("Geom file Name: ", geomName)
0043 
0044 process.load("Geometry.ForwardCommonData.testForwardXML_cfi")
0045 process.load('FWCore.MessageService.MessageLogger_cfi')
0046 process.load(geomName)
0047 process.load('Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cff')
0048 process.load('Geometry.EcalCommonData.ecalSimulationParameters_cff')
0049 process.load('Geometry.HcalCommonData.hcalDDDSimConstants_cff')
0050 process.load('Geometry.MuonNumbering.muonGeometryConstants_cff')
0051 process.load('Geometry.MuonNumbering.muonOffsetESProducer_cff')
0052 
0053 if 'MessageLogger' in process.__dict__:
0054     process.MessageLogger.G4cout=dict()
0055 #   process.MessageLogger.ForwardGeom=dict()
0056 
0057 from SimG4Core.PrintGeomInfo.g4TestGeometry_cfi import *
0058 process = checkOverlap(process)
0059 
0060 # enable Geant4 overlap check 
0061 process.g4SimHits.CheckGeometry = True
0062 
0063 # Geant4 geometry check 
0064 process.g4SimHits.G4CheckOverlap.OutputBaseName = cms.string(baseName)
0065 process.g4SimHits.G4CheckOverlap.OverlapFlag = cms.bool(True)
0066 process.g4SimHits.G4CheckOverlap.Tolerance  = cms.double(options.tol)
0067 process.g4SimHits.G4CheckOverlap.Resolution = cms.int32(10000)
0068 process.g4SimHits.G4CheckOverlap.Depth      = cms.int32(-1)
0069 # tells if NodeName is G4Region or G4PhysicalVolume
0070 process.g4SimHits.G4CheckOverlap.RegionFlag = cms.bool(False)
0071 # list of names
0072 process.g4SimHits.G4CheckOverlap.NodeNames  = cms.vstring('OCMS')
0073 # enable dump gdml file 
0074 process.g4SimHits.G4CheckOverlap.gdmlFlag   = cms.bool(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 #
0085 process.g4SimHits.OnlySDs = cms.vstring('ZdcSensitiveDetector', 'TotemT2ScintSensitiveDetector', 'TotemSensitiveDetector', 'RomanPotSensitiveDetector', 'PLTSensitiveDetector', 'MuonSensitiveDetector', 'MtdSensitiveDetector', 'BCM1FSensitiveDetector', 'EcalSensitiveDetector', 'CTPPSSensitiveDetector', 'BSCSensitiveDetector', 'CTPPSDiamondSensitiveDetector', 'FP420SensitiveDetector', 'BHMSensitiveDetector', 'CastorSensitiveDetector', 'CaloTrkProcessing', 'HcalSensitiveDetector', 'TkAccumulatingSensitiveDetector')