diff --git a/PhysicsTools/NanoAOD/python/nanogen_cff.py b/PhysicsTools/NanoAOD/python/nanogen_cff.py index 9c7addd1b2cf3..1ebf92a00d7f0 100644 --- a/PhysicsTools/NanoAOD/python/nanogen_cff.py +++ b/PhysicsTools/NanoAOD/python/nanogen_cff.py @@ -58,6 +58,7 @@ def nanoGenCommonCustomize(process): setGenPtPrecision(process, CandVars.pt.precision) setGenEtaPrecision(process, CandVars.eta.precision) setGenPhiPrecision(process, CandVars.phi.precision) + setGenMassPrecision(process, CandVars.mass.precision) def customizeNanoGENFromMini(process): process.nanogenSequence.insert(0, process.genParticles2HepMCHiggsVtx) @@ -123,15 +124,18 @@ def pruneGenParticlesMini(process): "Use a different customization.") from PhysicsTools.PatAlgos.slimming.prunedGenParticles_cfi import prunedGenParticles process.prunedGenParticles = prunedGenParticles.clone() + process.prunedGenParticles.src = cms.InputTag("genParticles") process.genParticleTable.src = "prunedGenParticles" process.patJetPartons.particles = "prunedGenParticles" process.nanogenSequence.insert(0, process.prunedGenParticles) return process def setGenFullPrecision(process): - setGenPtPrecision(process, 23) - setGenEtaPrecision(process, 23) - setGenPhiPrecision(process, 23) + process = setGenPtPrecision(process, 23) + process = setGenEtaPrecision(process, 23) + process = setGenPhiPrecision(process, 23) + process = setGenMassPrecision(process, 23) + return process def setGenPtPrecision(process, precision): process.genParticleTable.variables.pt.precision = precision @@ -150,6 +154,11 @@ def setGenPhiPrecision(process, precision): process.metMCTable.variables.phi.precision = precision return process +def setGenMassPrecision(process, precision): + process.genParticleTable.variables.mass.precision = precision + process.genJetTable.variables.mass.precision = precision + return process + def setLHEFullPrecision(process): process.lheInfoTable.precision = 23 return process