Skip to content

Commit

Permalink
Merge pull request #32329 from lathomas/PUPPIV15_106X
Browse files Browse the repository at this point in the history
PUPPI v15 bug/crash fix for NANOAOD (106X backport)
  • Loading branch information
cmsbuild authored Dec 1, 2020
2 parents eadf88e + dd50beb commit 39c926a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion CommonTools/PileupAlgos/python/Puppi_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@
)

from Configuration.ProcessModifiers.run2_miniAOD_UL_cff import run2_miniAOD_UL
run2_miniAOD_UL.toModify(
from Configuration.Eras.Modifier_run2_nanoAOD_106Xv1_cff import run2_nanoAOD_106Xv1
(run2_miniAOD_UL|run2_nanoAOD_106Xv1).toModify(
puppi,
EtaMinUseDeltaZ = 2.4,
PtMaxCharged = 20.,
Expand Down
6 changes: 3 additions & 3 deletions PhysicsTools/NanoAOD/python/nano_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ def nanoAOD_recalibrateMETs(process,isData):
reclusterJets = cms.untracked.bool(False),
)
run2_nanoAOD_106Xv1.toModify(nanoAOD_PuppiV15_switch,recoMetFromPFCs=True,reclusterJets=True)
runMetCorAndUncFromMiniAOD(process,isData=isData,metType="Puppi",postfix="Puppi",jetFlavor="AK4PFPuppi", recoMetFromPFCs=bool(nanoAOD_PuppiV15_switch.recoMetFromPFCs), reclusterJets=bool(nanoAOD_PuppiV15_switch.reclusterJets))
if nanoAOD_PuppiV15_switch.reclusterJets:
from RecoJets.JetProducers.ak4PFJets_cfi import ak4PFJets
from PhysicsTools.PatAlgos.tools.helpers import getPatAlgosToolsTask, addToProcessAndTask
Expand All @@ -243,11 +242,12 @@ def nanoAOD_recalibrateMETs(process,isData):
muSource =cms.InputTag( 'slimmedMuons'),
elSource = cms.InputTag('slimmedElectrons'),
genParticles= cms.InputTag('prunedGenParticles'),
getJetMCFlavour=False
getJetMCFlavour= False
)

process.patJetsPuppi.addGenPartonMatch = cms.bool(False)
process.patJetsPuppi.addGenJetMatch = cms.bool(False)

runMetCorAndUncFromMiniAOD(process,isData=isData,metType="Puppi",postfix="Puppi",jetFlavor="AK4PFPuppi", recoMetFromPFCs=bool(nanoAOD_PuppiV15_switch.recoMetFromPFCs), reclusterJets=bool(nanoAOD_PuppiV15_switch.reclusterJets))
process.nanoSequenceCommon.insert(process.nanoSequenceCommon.index(process.jetSequence),cms.Sequence(process.puppiMETSequence+process.fullPatMetSequencePuppi))
return process

Expand Down

0 comments on commit 39c926a

Please sign in to comment.