Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 10:04:02

0001 ###############################################################################
0002 # Way to use this:
0003 #   cmsRun MinBias.py maxevt=1000
0004 #
0005 ###############################################################################
0006 import FWCore.ParameterSet.Config as cms
0007 import os, sys, imp, re, random
0008 import FWCore.ParameterSet.VarParsing as VarParsing
0009 
0010 ####################################################################
0011 ### SETUP OPTIONS
0012 options = VarParsing.VarParsing('standard')
0013 options.register('maxevt',
0014                  "1000",
0015                   VarParsing.VarParsing.multiplicity.singleton,
0016                   VarParsing.VarParsing.varType.string)
0017 
0018 ### get and parse the command line arguments
0019 options.parseArguments()
0020 
0021 maxevt = int(options.maxevt)
0022 print(options)
0023 print("maxevt: ", maxevt)
0024 
0025 from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9
0026 
0027 process = cms.Process('GEN',Phase2C17I13M9)
0028 
0029 # import of standard configurations
0030 process.load('Configuration.StandardSequences.Services_cff')
0031 process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
0032 process.load('FWCore.MessageService.MessageLogger_cfi')
0033 process.load('Configuration.EventContent.EventContent_cff')
0034 process.load('SimGeneral.MixingModule.mixNoPU_cfi')
0035 process.load('Configuration.Geometry.GeometryExtended2026D98Reco_cff')
0036 process.load('Configuration.StandardSequences.MagneticField_cff')
0037 process.load('Configuration.StandardSequences.Generator_cff')
0038 process.load('IOMC.EventVertexGenerators.VtxSmearedHLLHC_cfi')
0039 process.load('GeneratorInterface.Core.genFilterSummary_cff')
0040 process.load('Configuration.StandardSequences.EndOfProcess_cff')
0041 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0042 
0043 process.maxEvents = cms.untracked.PSet(
0044         input = cms.untracked.int32(maxevt),
0045     output = cms.optional.untracked.allowed(cms.int32,cms.PSet)
0046 )
0047 
0048 # Input source
0049 process.source = cms.Source("EmptySource")
0050 
0051 process.options = cms.untracked.PSet(
0052     IgnoreCompletely = cms.untracked.vstring(),
0053     Rethrow = cms.untracked.vstring(),
0054     TryToContinue = cms.untracked.vstring(),
0055     accelerators = cms.untracked.vstring('*'),
0056     allowUnscheduled = cms.obsolete.untracked.bool,
0057     canDeleteEarly = cms.untracked.vstring(),
0058     deleteNonConsumedUnscheduledModules = cms.untracked.bool(True),
0059     dumpOptions = cms.untracked.bool(False),
0060     emptyRunLumiMode = cms.obsolete.untracked.string,
0061     eventSetup = cms.untracked.PSet(
0062         forceNumberOfConcurrentIOVs = cms.untracked.PSet(
0063             allowAnyLabel_=cms.required.untracked.uint32
0064         ),
0065         numberOfConcurrentIOVs = cms.untracked.uint32(0)
0066     ),
0067     fileMode = cms.untracked.string('FULLMERGE'),
0068     forceEventSetupCacheClearOnNewRun = cms.untracked.bool(False),
0069     holdsReferencesToDeleteEarly = cms.untracked.VPSet(),
0070     makeTriggerResults = cms.obsolete.untracked.bool,
0071     modulesToIgnoreForDeleteEarly = cms.untracked.vstring(),
0072     numberOfConcurrentLuminosityBlocks = cms.untracked.uint32(0),
0073     numberOfConcurrentRuns = cms.untracked.uint32(1),
0074     numberOfStreams = cms.untracked.uint32(0),
0075     numberOfThreads = cms.untracked.uint32(1),
0076     printDependencies = cms.untracked.bool(False),
0077     sizeOfStackForThreadsInKB = cms.optional.untracked.uint32,
0078     throwIfIllegalParameter = cms.untracked.bool(True),
0079     wantSummary = cms.untracked.bool(False)
0080 )
0081 
0082 # Production Info
0083 process.configurationMetadata = cms.untracked.PSet(
0084     annotation = cms.untracked.string('MinBias_13TeV_pythia8_TuneCUETP8M1_cfi.py nevts:100'),
0085     name = cms.untracked.string('Applications'),
0086     version = cms.untracked.string('$Revision: 1.19 $')
0087 )
0088 
0089 # Output definition
0090 
0091 process.FEVTDEBUGoutput = cms.OutputModule("PoolOutputModule",
0092     SelectEvents = cms.untracked.PSet(
0093         SelectEvents = cms.vstring('generation_step')
0094     ),
0095     dataset = cms.untracked.PSet(
0096         dataTier = cms.untracked.string('GEN-SIM'),
0097         filterName = cms.untracked.string('')
0098     ),
0099     fileName = cms.untracked.string('file:step0MinBias.root'),
0100     outputCommands = process.FEVTDEBUGEventContent.outputCommands,
0101     splitLevel = cms.untracked.int32(0)
0102 )
0103 
0104 # Additional output definition
0105 
0106 # Other statements
0107 process.genstepfilter.triggerConditions=cms.vstring("generation_step")
0108 from Configuration.AlCa.GlobalTag import GlobalTag
0109 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic_T25', '')
0110 
0111 process.generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter",
0112     PythiaParameters = cms.PSet(
0113         parameterSets = cms.vstring(
0114             'pythia8CommonSettings',
0115             'pythia8CUEP8M1Settings',
0116             'processParameters'
0117         ),
0118         processParameters = cms.vstring(
0119             'SoftQCD:nonDiffractive = on',
0120             'SoftQCD:singleDiffractive = on',
0121             'SoftQCD:doubleDiffractive = on'
0122         ),
0123         pythia8CUEP8M1Settings = cms.vstring(
0124             'Tune:pp 14',
0125             'Tune:ee 7',
0126             'MultipartonInteractions:pT0Ref=2.4024',
0127             'MultipartonInteractions:ecmPow=0.25208',
0128             'MultipartonInteractions:expPow=1.6'
0129         ),
0130         pythia8CommonSettings = cms.vstring(
0131             'Tune:preferLHAPDF = 2',
0132             'Main:timesAllowErrors = 10000',
0133             'Check:epTolErr = 0.01',
0134             'Beams:setProductionScalesFromLHEF = off',
0135             'SLHA:minMassSM = 1000.',
0136             'ParticleDecays:limitTau0 = on',
0137             'ParticleDecays:tau0Max = 10',
0138             'ParticleDecays:allowPhotonRadiation = on'
0139         )
0140     ),
0141     comEnergy = cms.double(13000.0),
0142     crossSection = cms.untracked.double(71390000000.0),
0143     filterEfficiency = cms.untracked.double(1.0),
0144     maxEventsToPrint = cms.untracked.int32(0),
0145     pythiaHepMCVerbosity = cms.untracked.bool(False),
0146     pythiaPylistVerbosity = cms.untracked.int32(1)
0147 )
0148 
0149 
0150 process.ProductionFilterSequence = cms.Sequence(process.generator)
0151 
0152 # Path and EndPath definitions
0153 process.generation_step = cms.Path(process.pgen)
0154 process.genfiltersummary_step = cms.EndPath(process.genFilterSummary)
0155 process.endjob_step = cms.EndPath(process.endOfProcess)
0156 process.FEVTDEBUGoutput_step = cms.EndPath(process.FEVTDEBUGoutput)
0157 
0158 # Schedule definition
0159 process.schedule = cms.Schedule(process.generation_step,process.genfiltersummary_step,process.endjob_step,process.FEVTDEBUGoutput_step)
0160 from PhysicsTools.PatAlgos.tools.helpers import associatePatAlgosToolsTask
0161 associatePatAlgosToolsTask(process)
0162 
0163 #Setup FWK for multithreaded
0164 process.options.numberOfThreads = 8
0165 process.options.numberOfStreams = 0
0166 # filter all path with the production filter sequence
0167 for path in process.paths:
0168     getattr(process,path).insert(0, process.ProductionFilterSequence)
0169 
0170 
0171 
0172 # Customisation from command line
0173 
0174 # Add early deletion of temporary data products to reduce peak memory need
0175 from Configuration.StandardSequences.earlyDeleteSettings_cff import customiseEarlyDelete
0176 process = customiseEarlyDelete(process)
0177 # End adding early deletion