From 9511a7fad82731d1bd39a11aa353800913e444d7 Mon Sep 17 00:00:00 2001 From: Andreas Hinzmann Date: Sat, 15 Feb 2020 22:11:00 +0100 Subject: [PATCH] remove inconsistencies for puppi in met tools --- .../runMETCorrectionsAndUncertainties.py | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/PhysicsTools/PatUtils/python/tools/runMETCorrectionsAndUncertainties.py b/PhysicsTools/PatUtils/python/tools/runMETCorrectionsAndUncertainties.py index 818f6d78b8352..b8e12acdbd047 100644 --- a/PhysicsTools/PatUtils/python/tools/runMETCorrectionsAndUncertainties.py +++ b/PhysicsTools/PatUtils/python/tools/runMETCorrectionsAndUncertainties.py @@ -273,11 +273,6 @@ def __call__(self, process, if recoMetFromPFCs and reclusterJetsIsNone and not fixEE2017: self.setParameter('reclusterJets',True) - #ZD: puppi jet reclustering breaks the puppi jets - #overwriting of jet reclustering parameter for puppi - if self._parameters["Puppi"].value and not onMiniAOD: - self.setParameter('reclusterJets',False) - self.apply(process) @@ -1340,6 +1335,10 @@ def createSmearedJetModule(self, process, jetCollection, smear, varyByNsigmas, v if self._parameters["onMiniAOD"].value: genJetsCollection=cms.InputTag("slimmedGenJets") + if self._parameters["Puppi"].value: + getattr(process, "patSmearedJets"+postfix).algo = cms.string('AK4PFPuppi') + getattr(process, "patSmearedJets"+postfix).algopt = cms.string('AK4PFPuppi_pt') + if "PF" == self._parameters["metType"].value: smearedJetModule = getattr(process, "patSmearedJets"+postfix).clone( src = jetCollection, @@ -1347,11 +1346,7 @@ def createSmearedJetModule(self, process, jetCollection, smear, varyByNsigmas, v variation = cms.int32( int(varyByNsigmas) ), genJets = genJetsCollection, ) - - if self._parameters["Puppi"].value: - smearedJetModule.algo = cms.string('AK4PFPuppi') - smearedJetModule.algopt = cms.string('AK4PFPuppi_pt') - + #MM: FIXME MVA #if "MVA" == self._parameters["metType"].value: # from RecoMET.METProducers.METSigParams_cfi import * @@ -1464,7 +1459,7 @@ def updateJECs(self,process,jetCollection, patMetModuleSequence, postfix): from PhysicsTools.PatAlgos.producersLayer1.jetUpdater_cff import updatedPatJetCorrFactors patJetCorrFactorsReapplyJEC = updatedPatJetCorrFactors.clone( - src = jetCollection if not self._parameters["Puppi"].value else cms.InputTag("slimmedJetsPuppi"), + src = jetCollection, levels = ['L1FastJet', 'L2Relative', 'L3Absolute'], @@ -1475,7 +1470,7 @@ def updateJECs(self,process,jetCollection, patMetModuleSequence, postfix): from PhysicsTools.PatAlgos.producersLayer1.jetUpdater_cff import updatedPatJets patJetsReapplyJEC = updatedPatJets.clone( - jetSource = jetCollection if not self._parameters["Puppi"].value else cms.InputTag("slimmedJetsPuppi"), + jetSource = jetCollection, jetCorrFactorsSource = cms.VInputTag(cms.InputTag("patJetCorrFactorsReapplyJEC"+postfix)) )