Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

delete loaded cleanPatJets after the temporary load if it was not around already #13681

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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