Skip to content

Instantly share code, notes, and snippets.

@artlbv
Created June 13, 2023 12:34
Show Gist options
  • Save artlbv/386d75b3f2a472b549534e6629ba6c3f to your computer and use it in GitHub Desktop.
Save artlbv/386d75b3f2a472b549534e6629ba6c3f to your computer and use it in GitHub Desktop.
cmsRun config for 125x to dump some PhL1 collection as in menu ntuple
import FWCore.ParameterSet.Config as cms
from Configuration.StandardSequences.Eras import eras
from PhysicsTools.NanoAOD.nano_eras_cff import *
from PhysicsTools.NanoAOD.common_cff import *
process = cms.Process("L1Ph2Nano", 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.outnano = cms.OutputModule("NanoAODOutputModule",
fileName = cms.untracked.string("L1Ph2menuNano.root"),
outputCommands = cms.untracked.vstring("drop *", "keep nanoaodFlatTable_*Table_*_*"),
compressionLevel = cms.untracked.int32(4),
compressionAlgorithm = cms.untracked.string("ZLIB"),
)
process.end = cms.EndPath(process.outnano)
#process.nanoTask = cms.Task()#p2L1TablesTask)
#process.nanoTask.add(p2L1TablesTask)
##################################################################
### This part can be taken from l1trig_cff starting from 13X
l1_float_precision_=12
l1PtVars = cms.PSet(
pt = Var("pt", float, precision=l1_float_precision_),
phi = Var("phi", float, precision=l1_float_precision_),
)
l1P3Vars = cms.PSet(
l1PtVars,
eta = Var("eta", float, precision=l1_float_precision_),
)
l1ObjVars = cms.PSet(
l1P3Vars,
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")
)
### This above part can be taken from l1trig_cff starting from 13X
##################################################################
### Tables definitions
### Muons
process.gmtTkMuTable = cms.EDProducer("SimpleCandidateFlatTableProducer",
src = cms.InputTag('l1tTkMuonsGmt',''),
cut = cms.string(""),
name = cms.string("gmtTkMuon"),
doc = cms.string("GMT Tk Muons"),
singleton = cms.bool(False), # the number of entries is variable
variables = cms.PSet(
l1ObjVars,
charge = Var("charge", int, doc="charge id"),
)
)
### Jets
process.scjetTable = cms.EDProducer("SimpleCandidateFlatTableProducer",
src = cms.InputTag('l1tSCPFL1PuppiCorrectedEmulator'),
cut = cms.string(""),
name = cms.string("seededConeJet"),
doc = cms.string("SeededCone 0.4 Puppi jet"),
singleton = cms.bool(False), # the number of entries is variable
variables = cms.PSet(
l1ObjVars,
)
)
#### FULL Table definition
p2L1TablesTask = cms.Task(
process.gmtTkMuTable,
process.scjetTable,
)
process.schedule = cms.Schedule(
process.end,
tasks = [p2L1TablesTask],
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment