File indexing completed on 2024-04-30 04:10:44
0001
0002
0003
0004
0005
0006
0007
0008
0009 import FWCore.ParameterSet.Config as cms
0010 import os, sys, importlib, re
0011 import FWCore.ParameterSet.VarParsing as VarParsing
0012
0013
0014
0015 options = VarParsing.VarParsing('standard')
0016 options.register('geometry',
0017 "2024",
0018 VarParsing.VarParsing.multiplicity.singleton,
0019 VarParsing.VarParsing.varType.string,
0020 "geometry of operations: 2021, 2023, 2024")
0021 options.register('type',
0022 "DDD",
0023 VarParsing.VarParsing.multiplicity.singleton,
0024 VarParsing.VarParsing.varType.string,
0025 "type of operations: DDD, DD4hep")
0026
0027
0028 options.parseArguments()
0029
0030 print(options)
0031
0032
0033
0034
0035 if (options.type == "DDD"):
0036 from Configuration.Eras.Era_Run3_DDD_cff import Run3_DDD
0037 process = cms.Process('G4PrintGeometry',Run3_DDD)
0038 geomFile = "Configuration.Geometry.GeometryExtended" + options.geometry + "Reco_cff"
0039 else:
0040 from Configuration.Eras.Era_Run3_dd4hep_cff import Run3_dd4hep
0041 process = cms.Process('G4PrintGeometry',Run3_dd4hep)
0042 geomFile = "Configuration.Geometry.GeometryDD4hepExtended" + options.geometry + "Reco_cff"
0043
0044 print("Geometry file: ", geomFile)
0045
0046 process.load('SimGeneral.HepPDTESSource.pdt_cfi')
0047 process.load(geomFile)
0048
0049 process.load('IOMC.RandomEngine.IOMC_cff')
0050 process.load('IOMC.EventVertexGenerators.VtxSmearedFlat_cfi')
0051 process.load('GeneratorInterface.Core.generatorSmeared_cfi')
0052 process.load('FWCore.MessageService.MessageLogger_cfi')
0053 process.load('SimG4Core.Application.g4SimHits_cfi')
0054 process.load('SimG4Core.PrintGeomInfo.printGeomSolids_cff')
0055
0056 if hasattr(process,'MessageLogger'):
0057 process.MessageLogger.G4cout=dict()
0058 process.MessageLogger.G4cerr=dict()
0059 process.MessageLogger.PrintGeom=dict()
0060
0061 process.source = cms.Source("EmptySource")
0062
0063 process.generator = cms.EDProducer("FlatRandomEGunProducer",
0064 PGunParameters = cms.PSet(
0065 PartID = cms.vint32(14),
0066 MinEta = cms.double(-3.5),
0067 MaxEta = cms.double(3.5),
0068 MinPhi = cms.double(-3.14159265359),
0069 MaxPhi = cms.double(3.14159265359),
0070 MinE = cms.double(9.99),
0071 MaxE = cms.double(10.01)
0072 ),
0073 AddAntiParticle = cms.bool(False),
0074 Verbosity = cms.untracked.int32(0),
0075 firstRun = cms.untracked.uint32(1)
0076 )
0077
0078 process.maxEvents = cms.untracked.PSet(
0079 input = cms.untracked.int32(1)
0080 )
0081
0082 process.g4SimHits.UseMagneticField = False
0083 process.g4SimHits.Physics.type = 'SimG4Core/Physics/DummyPhysics'
0084 process.g4SimHits.Physics.DummyEMPhysics = True
0085 process.g4SimHits.Physics.DefaultCutValue = 10.
0086 process.g4SimHits.LHCTransport = False
0087
0088 process.p1 = cms.Path(process.generator*process.VtxSmeared*process.generatorSmeared*process.g4SimHits*process.printGeomSolids)