Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:30:51

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 import random
0004 import math
0005 
0006 from Configuration.StandardSequences.Eras import eras
0007 process = cms.Process('SIM',eras.Run3)
0008 
0009 # import of standard configurations
0010 process.load('Configuration.StandardSequences.Services_cff')
0011 process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
0012 process.load('FWCore.MessageService.MessageLogger_cfi')
0013 process.load('Configuration.EventContent.EventContent_cff')
0014 process.load('Configuration.StandardSequences.MagneticField_cff')
0015 process.load('Configuration.StandardSequences.Generator_cff')
0016 process.load('IOMC.EventVertexGenerators.VtxSmearedHLLHC14TeV_cfi')
0017 process.load('GeneratorInterface.Core.genFilterSummary_cff')
0018 process.load('Configuration.StandardSequences.SimIdeal_cff')
0019 process.load('Configuration.StandardSequences.EndOfProcess_cff')
0020 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0021 process.load('Configuration.StandardSequences.GeometrySimDB_cff')
0022 
0023 process.RandomNumberGeneratorService.generator.initialSeed = cms.untracked.uint32(random.randint(0,900000000))
0024 
0025 process.load('SimG4Core.Application.g4SimHits_cfi')
0026 process.g4SimHits.LHCTransport = cms.bool(True)
0027 
0028 nEvent_ = 1000
0029 process.maxEvents = cms.untracked.PSet(
0030         input = cms.untracked.int32(nEvent_)
0031         )
0032 
0033 process.source = cms.Source("EmptySource")
0034 from Configuration.AlCa.GlobalTag import GlobalTag
0035 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2022_realistic', '')
0036 #process.GlobalTag = GlobalTag(process.GlobalTag, '113X_mcRun3_2021_realistic_Candidate_2021_04_06_19_59_53', '')
0037 # generator
0038 """
0039 process.GlobalTag.toGet = cms.VPSet(
0040                  cms.PSet(
0041                      record = cms.string('LHCInfoRcd'),
0042                      tag = cms.string("LHCInfo_2021_mc_v1")
0043                  ),
0044                  cms.PSet(
0045                      record = cms.string('CTPPSOpticsRcd'),
0046                      tag = cms.string("PPSOpticalFunctions_2021_mc_v1")
0047                  )
0048      )
0049 """
0050 
0051 phi_min = -math.pi
0052 phi_max = math.pi
0053 t_min   = 0.
0054 t_max   = 2.
0055 xi_min  = 0.02
0056 xi_max  = 0.20
0057 ecms = 14000. # ATTENTION: if using HECTOR propagator, currently the energy is hardcoded as 6500 but the optics file is prepared for 7 TeV
0058 
0059 process.generator = cms.EDProducer("RandomtXiGunProducer",
0060         PGunParameters = cms.PSet(
0061             PartID = cms.vint32(2212),
0062             MinPhi = cms.double(phi_min),
0063             MaxPhi = cms.double(phi_max),
0064             ECMS   = cms.double(ecms),
0065             Mint   = cms.double(t_min),
0066             Maxt   = cms.double(t_max),
0067             MinXi  = cms.double(xi_min),
0068             MaxXi  = cms.double(xi_max)
0069             ),
0070         Verbosity = cms.untracked.int32(0),
0071         psethack = cms.string('single protons'),
0072         FireBackward = cms.bool(True),
0073         FireForward  = cms.bool(True),
0074         firstRun = cms.untracked.uint32(1),
0075         )
0076 
0077 process.ProductionFilterSequence = cms.Sequence(process.generator)
0078 
0079 ############
0080 process.o1 = cms.OutputModule("PoolOutputModule",
0081         outputCommands = cms.untracked.vstring('keep *'),
0082         fileName = cms.untracked.string('step1_SIM2021.root')
0083         )
0084 
0085 process.generation_step = cms.Path(process.pgen)
0086 process.simulation_step = cms.Path(process.psim)
0087 
0088 
0089 process.genfiltersummary_step = cms.EndPath(process.genFilterSummary)
0090 process.outpath = cms.EndPath(process.o1)
0091 process.schedule = cms.Schedule(process.generation_step,process.genfiltersummary_step,process.simulation_step,process.outpath)
0092 
0093 # filter all path with the production filter sequence
0094 for path in process.paths:
0095     getattr(process,path)._seq = process.ProductionFilterSequence * getattr(process,path)._seq