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

Migrate module configurations in {JetMETCorrections,PhysicsTools} to use automatically generated cfi default/reference configurations #33307

Merged
merged 2 commits into from
Apr 12, 2021
Merged
Show file tree
Hide file tree
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
7 changes: 4 additions & 3 deletions JetMETCorrections/Type1MET/python/cleanJetFromEEnoise_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@
)
)

pfcandidateForUnclusteredUnc = cms.EDProducer("CandPtrProjector",
src = cms.InputTag("packedPFCandidates"),
veto = cms.InputTag("pfcandidateClustered"),
import CommonTools.CandAlgos.candPtrProjector_cfi as _mod
pfcandidateForUnclusteredUnc = _mod.candPtrProjector.clone(
src = "packedPFCandidates",
veto = "pfcandidateClustered",
)


Expand Down
13 changes: 5 additions & 8 deletions PhysicsTools/PatAlgos/python/patMuonMerger_cfi.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import FWCore.ParameterSet.Config as cms

mergedMuons = cms.EDProducer("PATMuonMerger",
muons = cms.InputTag("slimmedMuons"),
pfCandidates=cms.InputTag("packedPFCandidates"),
otherTracks = cms.InputTag("lostTracks"),
muonCut = cms.string("pt>15 && abs(eta)<2.4"),
pfCandidatesCut = cms.string("pt>15 && abs(eta)<2.4"),
lostTrackCut = cms.string("pt>15 && abs(eta)<2.4")
import PhysicsTools.PatAlgos.mergedMuonsNoCuts_cfi as _mod
mergedMuons = _mod.mergedMuonsNoCuts.clone(
muonCut = "pt>15 && abs(eta)<2.4",
pfCandidatesCut = "pt>15 && abs(eta)<2.4",
lostTrackCut = "pt>15 && abs(eta)<2.4"
)
10 changes: 6 additions & 4 deletions PhysicsTools/PatUtils/python/tools/muonRecoMitigation.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,13 @@ def muonRecoMitigation(process,

# now cleaning ================================
cleanedPFCandCollection=cleanCollName+postfix

if runOnMiniAOD:
cleanedPFCandProducer = cms.EDProducer("CandPtrProjector",
src = cms.InputTag(pfCandCollection),
veto = cms.InputTag(badMuonCollection)
)
import CommonTools.CandAlgos.candPtrProjector_cfi as _mod
cleanedPFCandProducer = _mod.candPtrProjector.clone(
src = pfCandCollection,
veto = badMuonCollection
)
else:
cleanedPFCandProducer = cms.EDProducer("PFCandPtrProjector",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not able to find a PFCandPtrProjector plugin anywhere in CMSSW, not even in 9_1_X (which is the release where this config was introduced with #18165)

@mmarionncern and @zdemirag: do you remember where that plugin was defined?

By the way, isn't this config already obsolete (and candidate for possible deletion)? corMETFromMuonAndEG is only called by PhysicsTools/PatAlgos/python/slimming/extraSlimmedMETs_MuEGFixMoriond2017.py, which according to the name is quite likely not needed any more. (Moreover, muCorrection=False in there , and therefore this muonRecoMitigation wasn't actually ever accessed even from there...)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kirschen @lathomas @ahinzmann (as mmarionncern original developer left the field)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps it's a more general XPOG question (as it was initially introduced via XPOG): do we still need to support the muon reco duplicate mitigation?
If not, it could be dropped.

src = cms.InputTag(pfCandCollection),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import PhysicsTools.PatAlgos.tools.helpers as configtools
from PhysicsTools.PatAlgos.tools.helpers import getPatAlgosToolsTask, addToProcessAndTask
from PhysicsTools.PatAlgos.tools.jetTools import switchJetCollection
import CommonTools.CandAlgos.candPtrProjector_cfi as _mod


def isValidInputTag(input):
Expand Down Expand Up @@ -833,43 +834,43 @@ def getMETUncertainties(self, process, metType, metModName, electronCollection,
if not hasattr(process, "pfCandsForUnclusteredUnc"+postfix):

#Jet projection ==
pfCandsNoJets = cms.EDProducer("CandPtrProjector",
pfCandsNoJets = _mod.candPtrProjector.clone(
src = pfCandCollection,
veto = copy.copy(jetCollection),
veto = jetCollection,
)
addToProcessAndTask("pfCandsNoJets"+postfix, pfCandsNoJets, process, task)
metUncSequence += getattr(process, "pfCandsNoJets"+postfix)

#electron projection ==
pfCandsNoJetsNoEle = cms.EDProducer("CandPtrProjector",
src = cms.InputTag("pfCandsNoJets"+postfix),
veto = copy.copy(electronCollection),
pfCandsNoJetsNoEle = _mod.candPtrProjector.clone(
src = "pfCandsNoJets"+postfix,
veto = electronCollection,
)
if not self.getvalue("onMiniAOD"):
pfCandsNoJetsNoEle.veto = "pfeGammaToCandidate:electrons"
addToProcessAndTask("pfCandsNoJetsNoEle"+postfix, pfCandsNoJetsNoEle, process, task)
metUncSequence += getattr(process, "pfCandsNoJetsNoEle"+postfix)

#muon projection ==
pfCandsNoJetsNoEleNoMu = cms.EDProducer("CandPtrProjector",
src = cms.InputTag("pfCandsNoJetsNoEle"+postfix),
veto = copy.copy(muonCollection),
pfCandsNoJetsNoEleNoMu = _mod.candPtrProjector.clone(
src = "pfCandsNoJetsNoEle"+postfix,
veto = muonCollection,
)
addToProcessAndTask("pfCandsNoJetsNoEleNoMu"+postfix, pfCandsNoJetsNoEleNoMu, process, task)
metUncSequence += getattr(process, "pfCandsNoJetsNoEleNoMu"+postfix)

#tau projection ==
pfCandsNoJetsNoEleNoMuNoTau = cms.EDProducer("CandPtrProjector",
src = cms.InputTag("pfCandsNoJetsNoEleNoMu"+postfix),
veto = copy.copy(tauCollection),
pfCandsNoJetsNoEleNoMuNoTau = _mod.candPtrProjector.clone(
src = "pfCandsNoJetsNoEleNoMu"+postfix,
veto = tauCollection,
)
addToProcessAndTask("pfCandsNoJetsNoEleNoMuNoTau"+postfix, pfCandsNoJetsNoEleNoMuNoTau, process, task)
metUncSequence += getattr(process, "pfCandsNoJetsNoEleNoMuNoTau"+postfix)

#photon projection ==
pfCandsForUnclusteredUnc = cms.EDProducer("CandPtrProjector",
src = cms.InputTag("pfCandsNoJetsNoEleNoMuNoTau"+postfix),
veto = copy.copy(photonCollection),
pfCandsForUnclusteredUnc = _mod.candPtrProjector.clone(
src = "pfCandsNoJetsNoEleNoMuNoTau"+postfix,
veto = photonCollection,
)
if not self.getvalue("onMiniAOD"):
pfCandsForUnclusteredUnc.veto = "pfeGammaToCandidate:photons"
Expand Down Expand Up @@ -1350,9 +1351,9 @@ def getUnclusteredVariationsForMVAMET(self, process, var, val, metUncSequence,
pfCandCollection = self._parameters["pfCandCollection"].value

#top projection on jets
pfCandsNotInJets = cms.EDProducer("CandPtrProjector",
pfCandsNotInJets = _mod.candPtrProjector.clone(
src = pfCandCollection,
veto = cms.InputTag("ak4PFJets")
veto = "ak4PFJets"
)
setattr(process, "pfCandsNotInJetsUnclusteredEn"+var+postfix, pfCandsNotInJets)
metUncSequence += getattr(process,"pfCandsNotInJetsUnclusteredEn"+var+postfix)
Expand Down Expand Up @@ -1922,9 +1923,9 @@ def runFixEE2017(self,process,params,jets,cands,goodcolls,patMetModuleSequence,p
)
addToProcessAndTask("pfcandidateClustered"+postfix, pfcandidateClustered, process, task)
patMetModuleSequence += getattr(process,"pfcandidateClustered"+postfix)
pfcandidateForUnclusteredUnc = cms.EDProducer("CandPtrProjector",
pfcandidateForUnclusteredUnc = _mod.candPtrProjector.clone(
src = cands,
veto = cms.InputTag("pfcandidateClustered"+postfix),
veto = "pfcandidateClustered"+postfix,
)
addToProcessAndTask("pfcandidateForUnclusteredUnc"+postfix, pfcandidateForUnclusteredUnc, process, task)
patMetModuleSequence += getattr(process,"pfcandidateForUnclusteredUnc"+postfix)
Expand All @@ -1947,9 +1948,9 @@ def runFixEE2017(self,process,params,jets,cands,goodcolls,patMetModuleSequence,p
)
addToProcessAndTask("superbad"+postfix, superbad, process, task)
patMetModuleSequence += getattr(process,"superbad"+postfix)
pfCandidatesGoodEE2017 = cms.EDProducer("CandPtrProjector",
pfCandidatesGoodEE2017 = _mod.candPtrProjector.clone(
src = cands,
veto = cms.InputTag("superbad"+postfix),
veto = "superbad"+postfix,
)
addToProcessAndTask("pfCandidatesGoodEE2017"+postfix, pfCandidatesGoodEE2017, process, task)
patMetModuleSequence += getattr(process,"pfCandidatesGoodEE2017"+postfix)
Expand Down