From c0e5ee446a05eb63bde88cdb0425d2fd7dc53bf5 Mon Sep 17 00:00:00 2001 From: Slava Krutelyov Date: Thu, 10 Mar 2016 19:48:34 +0100 Subject: [PATCH] delete loaded cleanPatJets after the temporary load if it was not around already --- .../python/tools/runMETCorrectionsAndUncertainties.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/PhysicsTools/PatUtils/python/tools/runMETCorrectionsAndUncertainties.py b/PhysicsTools/PatUtils/python/tools/runMETCorrectionsAndUncertainties.py index 235089982cda6..e064e71a30154 100644 --- a/PhysicsTools/PatUtils/python/tools/runMETCorrectionsAndUncertainties.py +++ b/PhysicsTools/PatUtils/python/tools/runMETCorrectionsAndUncertainties.py @@ -1409,10 +1409,14 @@ def jetCleaning(self, process, autoJetCleaning, postfix ): photonCollection = cms.InputTag("cleanedPatPhotons"+postfix) #jet cleaning + have_cleanPatJets = hasattr(process, "cleanPatJets") process.load("PhysicsTools.PatAlgos.cleaningLayer1.jetCleaner_cfi") cleanPatJetProducer = getattr(process, "cleanPatJets").clone( src = jetCollection ) + #do not leave it hanging + if not have_cleanPatJets: + del process.cleanPatJets cleanPatJetProducer.checkOverlaps.muons.src = muonCollection cleanPatJetProducer.checkOverlaps.electrons.src = electronCollection if isValidInputTag(photonCollection) and autoJetCleaning != "LepClean":