Skip to content

Commit

Permalink
delete loaded cleanPatJets after the temporary load if it was not aro…
Browse files Browse the repository at this point in the history
…und already
  • Loading branch information
slava77devel committed Mar 10, 2016
1 parent 5bc8f67 commit c0e5ee4
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down

0 comments on commit c0e5ee4

Please sign in to comment.