File indexing completed on 2024-04-06 12:30:02
0001
0002
0003
0004
0005
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
0014 options = VarParsing.VarParsing('standard')
0015 options.register('type',
0016 "Standard",
0017 VarParsing.VarParsing.multiplicity.singleton,
0018 VarParsing.VarParsing.varType.string,
0019 "type of operations: Standard, Forward, Legacy")
0020
0021
0022 options.parseArguments()
0023 print(options)
0024
0025 from Configuration.Eras.Era_Run3_DDD_cff import Run3_DDD
0026
0027 process = cms.Process("ZDCRun3",Run3_DDD)
0028
0029 if (options.type == "Forward"):
0030 geomFile = "Geometry.ForwardCommonData.GeometryExtended2021Reco_cff"
0031 else:
0032 geomFile = "Configuration.Geometry.GeometryExtended2021Reco_cff"
0033 outFile = "zdc" + options.type + ".root"
0034 globalTag = "auto:phase1_2022_realistic"
0035
0036 print("Geometry file: ", geomFile)
0037 print("Global Tag: ", globalTag)
0038 print("Output file: ", outFile)
0039
0040 process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi")
0041 process.load('FWCore.MessageService.MessageLogger_cfi')
0042 process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi")
0043 process.load(geomFile)
0044 process.load("Configuration.StandardSequences.MagneticField_cff")
0045 process.load("Configuration.EventContent.EventContent_cff")
0046 process.load('Configuration.StandardSequences.Generator_cff')
0047 process.load('Configuration.StandardSequences.SimIdeal_cff')
0048
0049 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0050 from Configuration.AlCa.GlobalTag import GlobalTag
0051 process.GlobalTag = GlobalTag(process.GlobalTag, globalTag, '')
0052
0053 if 'MessageLogger' in process.__dict__:
0054 process.MessageLogger.ForwardSim=dict()
0055 process.MessageLogger.ZdcSD=dict()
0056
0057 process.source = cms.Source("EmptySource",
0058 firstRun = cms.untracked.uint32(1),
0059 firstEvent = cms.untracked.uint32(1)
0060 )
0061
0062 process.generator = cms.EDProducer("FlatRandomEGunProducer",
0063 PGunParameters = cms.PSet(
0064 PartID = cms.vint32(2112),
0065 MinEta = cms.double(8.20),
0066 MaxEta = cms.double(9.40),
0067 MinPhi = cms.double(-3.1415926),
0068 MaxPhi = cms.double(3.1415926),
0069 MinE = cms.double(5000.00),
0070 MaxE = cms.double(10000.00)
0071 ),
0072 Verbosity = cms.untracked.int32(0),
0073 AddAntiParticle = cms.bool(True)
0074 )
0075
0076 process.maxEvents = cms.untracked.PSet(
0077 input = cms.untracked.int32(100)
0078 )
0079
0080 process.Timing = cms.Service("Timing")
0081
0082 process.SimpleMemoryCheck = cms.Service("SimpleMemoryCheck",
0083 oncePerEventMode = cms.untracked.bool(True),
0084 showMallocInfo = cms.untracked.bool(True),
0085 dump = cms.untracked.bool(True),
0086 ignoreTotal = cms.untracked.int32(1)
0087 )
0088
0089 process.load("IOMC.RandomEngine.IOMC_cff")
0090 process.RandomNumberGeneratorService.generator.initialSeed = 456789
0091 process.RandomNumberGeneratorService.g4SimHits.initialSeed = 9876
0092 process.RandomNumberGeneratorService.VtxSmeared.initialSeed = 123456789
0093 process.rndmStore = cms.EDProducer("RandomEngineStateProducer")
0094
0095
0096 process.output = cms.OutputModule("PoolOutputModule",
0097 process.FEVTSIMEventContent,
0098 fileName = cms.untracked.string(outFile)
0099 )
0100
0101 process.generation_step = cms.Path(process.pgen)
0102 process.simulation_step = cms.Path(process.psim)
0103 process.out_step = cms.EndPath(process.output)
0104
0105 process.g4SimHits.Generator.MinEtaCut = -10.0
0106 process.g4SimHits.Generator.MaxEtaCut = 10.0
0107 process.g4SimHits.Generator.ApplyEtaCuts = False
0108 process.g4SimHits.LHCTransport = False
0109 process.g4SimHits.Physics.type = 'SimG4Core/Physics/FTFP_BERT_EMM'
0110 process.g4SimHits.EventVerbose = 2
0111 process.g4SimHits.SteppingVerbosity = 2
0112 process.g4SimHits.StepVerboseThreshold= 0.1
0113 process.g4SimHits.VerboseEvents = [1,2,3,4,5]
0114 process.g4SimHits.VertexNumber = []
0115 process.g4SimHits.VerboseTracks =[]
0116
0117
0118
0119 process.schedule = cms.Schedule(process.generation_step,
0120 process.simulation_step,
0121 process.out_step
0122 )
0123
0124
0125 for path in process.paths:
0126 getattr(process,path)._seq = process.generator * getattr(process,path)._seq
0127