Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-03-01 03:21:27

0001 ###############################################################################
0002 # Way to use this:
0003 #   cmsRun runPrintG4SolidsRun3_cfg.py dd4hep=False geometry=2021
0004 #
0005 #   Options for geometry 2021, 2023, 2024
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('dd4hep',
0016                  False,
0017                  VarParsing.VarParsing.multiplicity.singleton,
0018                  VarParsing.VarParsing.varType.bool,
0019                  "Geometry source DD4hep or DDD: False, True")
0020 options.register('geometry',
0021                  "2021",
0022                   VarParsing.VarParsing.multiplicity.singleton,
0023                   VarParsing.VarParsing.varType.string,
0024                   "geometry of operations: 2021, 2023, 2024")
0025 
0026 ### get and parse the command line arguments
0027 options.parseArguments()
0028 
0029 print(options)
0030 
0031 ####################################################################
0032 # Use the options
0033 if (options.dd4hep):
0034     from Configuration.Eras.Era_Run3_dd4hep_cff import Run3_dd4hep
0035     process = cms.Process('PrintG4Solids',Run3_dd4hep)
0036     geomFile = "Configuration.Geometry.GeometryDD4hepExtended" + options.geometry + "Reco_cff"
0037     process.load(geomFile)
0038 else:
0039     from Configuration.Eras.Era_Run3_DDD_cff import Run3_DDD
0040     process = cms.Process('PrintG4Solids',Run3_DDD)
0041     geomFile = "Configuration.Geometry.GeometryExtended" + options.geometry + "Reco_cff"
0042     process.load(geomFile)
0043 
0044 process.load('FWCore.MessageService.MessageLogger_cfi')
0045 print("Geometry file Name: ", geomFile)
0046 
0047 if hasattr(process,'MessageLogger'):
0048     process.MessageLogger.G4cerr=dict()
0049     process.MessageLogger.G4cout=dict()
0050 
0051 from SimG4Core.PrintGeomInfo.g4PrintG4Solids_cfi import *
0052 
0053 process = printGeomInfo(process)