Skip to content

Commit

Permalink
Fix NanoGen mass precision and pruning
Browse files Browse the repository at this point in the history
  • Loading branch information
mseidel42 committed May 12, 2021
1 parent 380ea03 commit d9ed083
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions PhysicsTools/NanoAOD/python/nanogen_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit d9ed083

Please sign in to comment.