Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-07-08 01:46:14

0001 ###############################################################################
0002 # Way to use this:
0003 #   cmsRun grunPrintG4Solids_cfg.py geometry=D86 dd4hep=False
0004 #
0005 #   Options for geometry D77, D83, D88, D92, D93
0006 #
0007 ###############################################################################
0008 import FWCore.ParameterSet.Config as cms
0009 import os, sys, imp, re
0010 import FWCore.ParameterSet.VarParsing as VarParsing
0011 
0012 ####################################################################
0013 ### SETUP OPTIONS
0014 options = VarParsing.VarParsing('standard')
0015 options.register('geometry',
0016                  "D92",
0017                   VarParsing.VarParsing.multiplicity.singleton,
0018                   VarParsing.VarParsing.varType.string,
0019                   "geometry of operations: D77, D83, D88, D92, D93")
0020 options.register('dd4hep',
0021                  False,
0022                  VarParsing.VarParsing.multiplicity.singleton,
0023                  VarParsing.VarParsing.varType.bool,
0024                  "Geometry source DD4hep or DDD: False, True")
0025 
0026 ### get and parse the command line arguments
0027 options.parseArguments()
0028 
0029 print(options)
0030 
0031 ####################################################################
0032 # Use the options
0033 from Configuration.ProcessModifiers.dd4hep_cff import dd4hep
0034 if (options.geometry == "D83"):
0035     from Configuration.Eras.Era_Phase2C11M9_cff import Phase2C11M9
0036     if (options.dd4hep):
0037         process = cms.Process('PrintG4Solids',Phase2C11M9,dd4hep)
0038         process.load('Configuration.Geometry.GeometryDD4hepExtended2026D83Reco_cff')
0039     else:
0040         process = cms.Process('PrintG4Solids',Phase2C11M9)
0041         process.load('Configuration.Geometry.GeometryExtended2026D83Reco_cff')
0042 elif (options.geometry == "D77"):
0043     from Configuration.Eras.Era_Phase2C11_cff import Phase2C11
0044     if (options.dd4hep):
0045         process = cms.Process('PrintG4Solids',Phase2C11,dd4hep)
0046         process.load('Configuration.Geometry.GeometryDD4hepExtended2026D77Reco_cff')
0047     else:
0048         process = cms.Process('PrintG4Solids',Phase2C11)
0049         process.load('Configuration.Geometry.GeometryExtended2026D77Reco_cff')
0050 elif (options.geometry == "D92"):
0051     from Configuration.Eras.Era_Phase2C11M9_cff import Phase2C11M9
0052     if (options.dd4hep):
0053         process = cms.Process('PrintG4Solids',Phase2C11M9,dd4hep)
0054         process.load('Configuration.Geometry.GeometryDD4hepExtended2026D92Reco_cff')
0055     else:
0056         process = cms.Process('PrintG4Solids',Phase2C11M9)
0057         process.load('Configuration.Geometry.GeometryExtended2026D92Reco_cff')
0058 elif (options.geometry == "D93"):
0059     from Configuration.Eras.Era_Phase2C11M9_cff import Phase2C11M9
0060     if (options.dd4hep):
0061         process = cms.Process('PrintG4Solids',Phase2C11M9,dd4hep)
0062         process.load('Configuration.Geometry.GeometryDD4hepExtended2026D93Reco_cff')
0063     else:
0064         process = cms.Process('PrintG4Solids',Phase2C11M9)
0065         process.load('Configuration.Geometry.GeometryExtended2026D93Reco_cff')
0066 else:
0067     from Configuration.Eras.Era_Phase2C11M9_cff import Phase2C11M9
0068     if (options.dd4hep):
0069         process = cms.Process('PrintG4Solids',Phase2C11M9,dd4hep)
0070         process.load('Configuration.Geometry.GeometryDD4hepExtended2026D88Reco_cff')
0071     else:
0072         process = cms.Process('PrintG4Solids',Phase2C11M9)
0073         process.load('Configuration.Geometry.GeometryExtended2026D88Reco_cff')
0074 
0075 process.load('FWCore.MessageService.MessageLogger_cfi')
0076 
0077 if hasattr(process,'MessageLogger'):
0078     process.MessageLogger.G4cerr=dict()
0079     process.MessageLogger.G4cout=dict()
0080 
0081 from SimG4Core.PrintGeomInfo.g4PrintG4Solids_cfi import *
0082 
0083 process = printGeomInfo(process)