Skip to content

Commit

Permalink
remove inconsistencies for puppi in met tools
Browse files Browse the repository at this point in the history
  • Loading branch information
ahinzmann committed Feb 15, 2020
1 parent 7a02dd3 commit 9511a7f
Showing 1 changed file with 7 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down Expand Up @@ -1340,18 +1335,18 @@ 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,
enabled = cms.bool(smear),
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 *
Expand Down Expand Up @@ -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'],
Expand All @@ -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))
)

Expand Down

0 comments on commit 9511a7f

Please sign in to comment.