From 7b76967837b31ca47125e35a2f785a99db473f01 Mon Sep 17 00:00:00 2001 From: Artur Lobanov Date: Mon, 5 Feb 2024 10:09:24 +0100 Subject: [PATCH] Make prunedGenParts use the displacement vars too --- python/l1tPh2Nano_cff.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/python/l1tPh2Nano_cff.py b/python/l1tPh2Nano_cff.py index 2d16281..9637167 100644 --- a/python/l1tPh2Nano_cff.py +++ b/python/l1tPh2Nano_cff.py @@ -25,6 +25,13 @@ def addPh2L1Objects(process): from PhysicsTools.NanoAOD.taus_cff import * ## for Gen taus def addGenObjects(process): + ## add more GenVariables + # from L1Ntuple Gen: https://github.com/artlbv/cmssw/blob/94a5ec13b8ce76afb8ea4f157bb92fb547fadee2/L1Trigger/L1TNtuples/plugins/L1GenTreeProducer.cc#L203 + genParticleTable.variables.vertX = Var("vertex.x", float, "vertex X") + genParticleTable.variables.vertY = Var("vertex.y", float, "vertex Y") + genParticleTable.variables.lXY = Var("sqrt(vertex().x() * vertex().x() + vertex().y() * vertex().y())", float, "lXY") + genParticleTable.variables.dXY = Var("-vertex().x() * sin(phi()) + vertex().y() * cos(phi())", float, "dXY") + ## add pruned gen particles a la Mini if True: ## Gen all @@ -39,14 +46,6 @@ def addGenObjects(process): process.prunedGenParticleTable.name = "prunedGenPart" process.l1tPh2NanoTask.add(process.prunedGenParticleTable) - - ## add more GenVariables - # from L1Ntuple Gen: https://github.com/artlbv/cmssw/blob/94a5ec13b8ce76afb8ea4f157bb92fb547fadee2/L1Trigger/L1TNtuples/plugins/L1GenTreeProducer.cc#L203 - genParticleTable.variables.vertX = Var("vertex.x", float, "vertex X") - genParticleTable.variables.vertY = Var("vertex.y", float, "vertex Y") - genParticleTable.variables.lXY = Var("sqrt(vertex().x() * vertex().x() + vertex().y() * vertex().y())", float, "lXY") - genParticleTable.variables.dXY = Var("-vertex().x() * sin(phi()) + vertex().y() * cos(phi())", float, "dXY") - process.l1tPh2NanoTask.add( puTable, metMCTable, genParticleTask, genParticleTablesTask,