File indexing completed on 2023-08-06 22:43:37
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 import FWCore.ParameterSet.Config as cms
0011 import os, sys, imp, re
0012 import FWCore.ParameterSet.VarParsing as VarParsing
0013
0014
0015
0016 options = VarParsing.VarParsing('standard')
0017 options.register('geometry',
0018 "D92",
0019 VarParsing.VarParsing.multiplicity.singleton,
0020 VarParsing.VarParsing.varType.string,
0021 "geometry of operations: D86, D88, D91, D92, D93, D94, D95, D96, D98, D99, D100, D101")
0022 options.register('type',
0023 "DDD",
0024 VarParsing.VarParsing.multiplicity.singleton,
0025 VarParsing.VarParsing.varType.string,
0026 "type of operations: DDD, DD4hep")
0027
0028
0029 options.parseArguments()
0030
0031 print(options)
0032
0033
0034
0035 from Configuration.ProcessModifiers.dd4hep_cff import dd4hep
0036
0037 if (options.geometry == "D94"):
0038 from Configuration.Eras.Era_Phase2C20I13M9_cff import Phase2C20I13M9
0039 if (options.type == "DD4hep"):
0040 process = cms.Process('G4PrintGeometry',Phase2C20I13M9,dd4hep)
0041 else:
0042 process = cms.Process('G4PrintGeometry',Phase2C20I13M9)
0043 else:
0044 from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9
0045 if (options.type == "DD4hep"):
0046 process = cms.Process('G4PrintGeometry',Phase2C17I13M9,dd4hep)
0047 else:
0048 process = cms.Process('G4PrintGeometry',Phase2C17I13M9)
0049
0050 if (options.type == "DD4hep"):
0051 geomFile = "Configuration.Geometry.GeometryDD4hepExtended2026" + options.geometry + "Reco_cff"
0052 dd4hep = True
0053 else:
0054 geomFile = "Configuration.Geometry.GeometryExtended2026" + options.geometry + "Reco_cff"
0055 dd4hep = False
0056
0057 print("Geometry file Name: ", geomFile)
0058 print("dd4hep: ", dd4hep)
0059
0060 process.load(geomFile)
0061 process.load('FWCore.MessageService.MessageLogger_cfi')
0062
0063 process.MessageLogger.G4cout=dict()
0064
0065
0066 process.maxEvents = cms.untracked.PSet(
0067 input = cms.untracked.int32(1)
0068 )
0069
0070 process.load('SimGeneral.HepPDTESSource.pdt_cfi')
0071 process.load('IOMC.EventVertexGenerators.VtxSmearedFlat_cfi')
0072 process.load('GeneratorInterface.Core.generatorSmeared_cfi')
0073
0074 process.source = cms.Source("EmptySource")
0075
0076 process.generator = cms.EDProducer("FlatRandomPtGunProducer",
0077 PGunParameters = cms.PSet(
0078 PartID = cms.vint32(13),
0079 MinEta = cms.double(-2.5),
0080 MaxEta = cms.double(2.5),
0081 MinPhi = cms.double(-3.14159265359),
0082 MaxPhi = cms.double(3.14159265359),
0083 MinPt = cms.double(9.99),
0084 MaxPt = cms.double(10.01)
0085 ),
0086 AddAntiParticle = cms.bool(False),
0087 Verbosity = cms.untracked.int32(0),
0088 firstRun = cms.untracked.uint32(1)
0089 )
0090
0091 process.RandomNumberGeneratorService = cms.Service("RandomNumberGeneratorService",
0092 generator = cms.PSet(
0093 initialSeed = cms.untracked.uint32(123456789),
0094 engineName = cms.untracked.string('HepJamesRandom')
0095 ),
0096 VtxSmeared = cms.PSet(
0097 engineName = cms.untracked.string('HepJamesRandom'),
0098 initialSeed = cms.untracked.uint32(98765432)
0099 ),
0100 g4SimHits = cms.PSet(
0101 initialSeed = cms.untracked.uint32(11),
0102 engineName = cms.untracked.string('HepJamesRandom')
0103 )
0104 )
0105
0106 process.load('SimG4Core.Application.g4SimHits_cfi')
0107
0108 process.p1 = cms.Path(process.generator*process.VtxSmeared*process.generatorSmeared*process.g4SimHits)
0109
0110 process.g4SimHits.UseMagneticField = False
0111 process.g4SimHits.Physics.DefaultCutValue = 10.
0112 process.g4SimHits.Watchers = cms.VPSet(cms.PSet(
0113 Name = cms.string('*'),
0114 DD4hep = cms.bool(dd4hep),
0115 type = cms.string('PrintSensitive')
0116 ))