Skip to content

Instantly share code, notes, and snippets.

@artlbv
Last active June 13, 2023 10:14
Show Gist options
  • Save artlbv/21c09433234db1df5204d394174388f1 to your computer and use it in GitHub Desktop.
Save artlbv/21c09433234db1df5204d394174388f1 to your computer and use it in GitHub Desktop.
cmsRun config to run in 125x producing NANO output with the gmtTkMuon collection
import FWCore.ParameterSet.Config as cms
from Configuration.StandardSequences.Eras import eras
from PhysicsTools.NanoAOD.common_cff import Var, ExtVar, P3Vars
process = cms.Process("RESP", eras.Phase2C9)
process.load('Configuration.StandardSequences.Services_cff')
process.load("FWCore.MessageLogger.MessageLogger_cfi")
process.options = cms.untracked.PSet(
wantSummary = cms.untracked.bool(True),
allowUnscheduled = cms.untracked.bool(False)
)
process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1))
process.MessageLogger.cerr.FwkReport.reportEvery = 50
process.source = cms.Source("PoolSource",
fileNames = cms.untracked.vstring(
'/store/mc/Phase2Fall22DRMiniAOD/TT_TuneCP5_14TeV-powheg-pythia8/GEN-SIM-DIGI-RAW-MINIAOD/PU200_125X_mcRun4_realistic_v2_ext1-v1/30000/000c5e5f-78f7-44ee-95fe-7b2f2c2e2312.root'
),
)
process.extraPFStuff = cms.Task()
process.p = cms.Path()
process.p.associate(process.extraPFStuff)
process.outnano = cms.OutputModule("NanoAODOutputModule",
fileName = cms.untracked.string("perfNano_gmtTkMuOnly.root"),
SelectEvents = cms.untracked.PSet(SelectEvents = cms.vstring('p')),
outputCommands = cms.untracked.vstring("drop *", "keep nanoaodFlatTable_*Table_*_*"),
compressionLevel = cms.untracked.int32(4),
compressionAlgorithm = cms.untracked.string("ZLIB"),
)
process.end = cms.EndPath(process.outnano)
l1ObjVars = cms.PSet(
P3Vars,
hwPt = Var("hwPt()",int,doc="hardware pt"),
hwEta = Var("hwEta()",int,doc="hardware eta"),
hwPhi = Var("hwPhi()",int,doc="hardware phi"),
hwQual = Var("hwQual()",int,doc="hardware qual"),
hwIso = Var("hwIso()",int,doc="hardware iso")
)
def addGmtTkMu():
process.gmtTkMuTable = cms.EDProducer("SimpleCandidateFlatTableProducer",
src = cms.InputTag('l1tTkMuonsGmt',''),
cut = cms.string(""),
name = cms.string("gmtTkMuons"),
doc = cms.string("GMT Tk Muons"),
singleton = cms.bool(False), # the number of entries is variable
extension = cms.bool(False), # this is the main table
variables = cms.PSet(
l1ObjVars,
charge = Var("charge", int, doc="charge id"),
)
)
process.extraPFStuff.add(process.gmtTkMuTable)
addGmtTkMu()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment