Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:13:16

0001 #!/usr/bin/env cmsRun
0002 import FWCore.ParameterSet.Config as cms
0003 
0004 # The values in the r.h.s are supposed to be changed in an automatic
0005 # way, e.g. sed 's/MATCHING/True/'
0006 AlpgenCard = "FILENAME"
0007 AlpgenApplyMatching = MATCHING
0008 AlpgenExclusive = EXCLUSIVE
0009 AlpgenEtMin = ETMIN
0010 AlpgenDrMin = DRMIN
0011 
0012 process = cms.Process("GEN")
0013 
0014 process.source = cms.Source("AlpgenSource",
0015         fileNames = cms.untracked.vstring('file:'+AlpgenCard) 
0016 )
0017 
0018 process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(100))
0019 
0020 process.load("Configuration.StandardSequences.Services_cff")
0021 
0022 # Setup RandomNumberGeneratorService so it provides
0023 # random numbers to the Alpgen Producer.
0024 process.RandomNumberGeneratorService.generator = cms.PSet(
0025         initialSeed = cms.untracked.uint32(123456789),
0026         engineName = cms.untracked.string('HepJamesRandom')
0027 )
0028 
0029 # The Alpgen Producer.
0030 # Change the jet matching parameters as you see fit.
0031 process.load("GeneratorInterface.AlpgenInterface.generator_cfi")
0032 process.generator.maxEventsToPrint = 0
0033 process.generator.jetMatching.applyMatching = AlpgenApplyMatching
0034 process.generator.jetMatching.exclusive = AlpgenExclusive
0035 process.generator.jetMatching.etMin = AlpgenEtMin
0036 process.generator.jetMatching.drMin = AlpgenDrMin
0037 
0038 process.p0 = cms.Path(process.generator)
0039 
0040 # Alternatively, you may also want to use these,
0041 # if you want a more complete generation.
0042 
0043 #process.load("Configuration.StandardSequences.Generator_cff")
0044 #process.load("Configuration.StandardSequences.VtxSmearedGauss_cff")
0045 
0046 #process.VtxSmeared.src = 'generator'
0047 #process.genParticles.src = 'VtxSmeared'
0048 #process.genParticleCandidates.src = 'VtxSmeared'
0049 
0050 # Needed for the SIM step.
0051 #process.g4SimHits.Generator.HepMCProductLabel = 'VtxSmeared'
0052 #process.mergedtruth.HepMCDataLabels.append('VtxSmeared')
0053 
0054 # Comment the path above if you want to use this one.
0055 #process.p0 = cms.Path(process.generator * process.pgen)
0056 
0057 process.load("Configuration.EventContent.EventContent_cff")
0058 
0059 process.GEN = cms.OutputModule("PoolOutputModule",
0060     process.FEVTSIMEventContent,
0061     dataset = cms.untracked.PSet(dataTier = cms.untracked.string('GEN')),
0062     SelectEvents = cms.untracked.PSet(SelectEvents = cms.vstring('p0')),
0063     fileName = cms.untracked.string(AlpgenCard+'.root')
0064 )
0065 process.GEN.outputCommands.append("keep *_generator_*_*")
0066 
0067 process.outpath = cms.EndPath(process.GEN)