import FWCore.ParameterSet.Config as cms externalLHEProducer = cms.EDProducer("ExternalLHEProducer", args = cms.vstring('/cvmfs/cms.cern.ch/phys_generator/gridpacks/2017/13TeV/madgraph/V5_2.7.3/tt0123j_1l_tbar_5f_ckm_LO_MLM/tt0123j_1l_tbar_5f_ckm_LO_MLM_slc7_amd64_gcc700_CMSSW_10_6_19_tarball.tar.xz'), nEvents = cms.untracked.uint32(5000), generateConcurrently = cms.untracked.bool(True), numberOfParameters = cms.uint32(1), outputFile = cms.string('cmsgrid_final.lhe'), scriptName = cms.FileInPath('GeneratorInterface/LHEInterface/data/run_generic_tarball_cvmfs.sh') ) # Link to datacards: # https://github.com/cms-sw/genproductions/tree/d16c3b4debe6ef6d3549d41ef9628e0b2bba89b5/bin/MadGraph5_aMCatNLO/cards/production/2017/13TeV/tt0123j_1l_tbar_5f_ckm_LO_MLM import FWCore.ParameterSet.Config as cms from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.MCTunes2017.PythiaCP5Settings_cfi import * from Configuration.Generator.PSweightsPythia.PythiaPSweightsSettings_cfi import * generator = cms.EDFilter("Pythia8ConcurrentHadronizerFilter", maxEventsToPrint = cms.untracked.int32(1), pythiaPylistVerbosity = cms.untracked.int32(1), filterEfficiency = cms.untracked.double(1.0), pythiaHepMCVerbosity = cms.untracked.bool(False), comEnergy = cms.double(13000.), PythiaParameters = cms.PSet( pythia8CommonSettingsBlock, pythia8CP5SettingsBlock, pythia8PSweightsSettingsBlock, JetMatchingParameters = cms.vstring( 'JetMatching:setMad = off', 'JetMatching:scheme = 1', 'JetMatching:merge = on', 'JetMatching:jetAlgorithm = 2', 'JetMatching:etaJetMax = 5.', 'JetMatching:coneRadius = 1.', 'JetMatching:slowJetPower = 1', 'JetMatching:qCut = 70.', #this is the actual merging scale 'JetMatching:nQmatch = 5', #4 corresponds to 4-flavour scheme (no matching of b-quarks), 5 for 5-flavour scheme 'JetMatching:nJetMax = 3', #number of partons in born matrix element for highest multiplicity 'JetMatching:doShowerKt = off', #off for MLM matching, turn on for shower-kT matching ), processParameters = cms.vstring( 'TimeShower:mMaxGamma = 1.0',#cutting off lepton-pair production ##in the electromagnetic shower to not overlap with ttZ/gamma* samples ), parameterSets = cms.vstring('pythia8CommonSettings', 'pythia8CP5Settings', 'pythia8PSweightsSettings', 'JetMatchingParameters','processParameters' ) ) ) # Filter setup # ------------------------ # https://github.com/cms-sw/cmssw/blob/CMSSW_8_0_X/PhysicsTools/HepMCCandAlgos/python/genParticles_cfi.py # Fixed according to https://hypernews.cern.ch/HyperNews/CMS/get/generators/3803/1/1.html tmpGenParticles = cms.EDProducer("GenParticleProducer", saveBarCodes = cms.untracked.bool(True), src = cms.InputTag("generator", "unsmeared"), abortOnUnknownPDGCode = cms.untracked.bool(False) ) # https://github.com/cms-sw/cmssw/blob/CMSSW_8_0_X/RecoJets/Configuration/python/GenJetParticles_cff.py # https://github.com/cms-sw/cmssw/blob/CMSSW_8_0_X/RecoMET/Configuration/python/GenMETParticles_cff.py tmpGenParticlesForJetsNoNu = cms.EDProducer("InputGenJetsParticleSelector", src = cms.InputTag("tmpGenParticles"), ignoreParticleIDs = cms.vuint32( 1000022, 1000012, 1000014, 1000016, 2000012, 2000014, 2000016, 1000039, 5100039, 4000012, 4000014, 4000016, 9900012, 9900014, 9900016, 39,12,14,16), partonicFinalState = cms.bool(False), excludeResonances = cms.bool(False), excludeFromResonancePids = cms.vuint32(12, 13, 14, 16), tausAsJets = cms.bool(False) ) tmpGenMetTrue = cms.EDProducer("GenMETProducer", src = cms.InputTag("tmpGenParticlesForJetsNoNu"), alias = cms.string('GenMETAllVisible'), onlyFiducialParticles = cms.bool(False), ## Use only fiducial GenParticles globalThreshold = cms.double(0.0), ## Global Threshold for input objects usePt = cms.bool(True), ## using Pt instead Et applyFiducialThresholdForFractions = cms.bool(False), ) genMETfilter1 = cms.EDFilter("CandViewSelector", src = cms.InputTag("tmpGenMetTrue"), cut = cms.string("pt > 150") ) genMETfilter2 = cms.EDFilter("CandViewCountFilter", src = cms.InputTag("genMETfilter1"), minNumber = cms.uint32(1), ) ProductionFilterSequence = cms.Sequence(generator* tmpGenParticles * tmpGenParticlesForJetsNoNu * tmpGenMetTrue * genMETfilter1 * genMETfilter2 )