From fc745bf68e645e8006bd5578581491dbf36493d1 Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Wed, 24 Aug 2022 16:45:01 +0200 Subject: [PATCH] dont produce duplicate outputs in HLTPFJetsMatchedToFilteredJetsProducer --- .../HLTPFJetsMatchedToFilteredJetsProducer.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/HLTrigger/JetMET/interface/HLTPFJetsMatchedToFilteredJetsProducer.h b/HLTrigger/JetMET/interface/HLTPFJetsMatchedToFilteredJetsProducer.h index 44150c1272167..47a09d1f7da43 100644 --- a/HLTrigger/JetMET/interface/HLTPFJetsMatchedToFilteredJetsProducer.h +++ b/HLTrigger/JetMET/interface/HLTPFJetsMatchedToFilteredJetsProducer.h @@ -47,7 +47,7 @@ HLTPFJetsMatchedToFilteredJetsProducer::HLTPFJetsMatchedToFi maxDeltaR2_(maxDeltaR_ * maxDeltaR_) { if (maxDeltaR_ <= 0.) { throw cms::Exception("HLTPFJetsMatchedToFilteredJetsProducerConfiguration") - << "invalid value for parameter \"DeltaR\" (must be > 0): " << maxDeltaR_; + << "invalid value for parameter \"maxDeltaR\" (must be > 0): " << maxDeltaR_; } produces(); @@ -58,7 +58,7 @@ void HLTPFJetsMatchedToFilteredJetsProducer::fillDescription edm::ConfigurationDescriptions& descriptions) { edm::ParameterSetDescription desc; desc.add("src", edm::InputTag("hltPFJets")); - desc.add("triggerJetsFilter", edm::InputTag("hltSingleJet240Regional")); + desc.add("triggerJetsFilter", edm::InputTag("hltCaloJetsFiltered")); desc.add("triggerJetsType", trigger::TriggerJet); desc.add("maxDeltaR", 0.5); descriptions.addWithDefaultLabel(desc); @@ -71,8 +71,7 @@ void HLTPFJetsMatchedToFilteredJetsProducer::produce(edm::St auto const& recoCands = iEvent.get(recoCandsToken_); std::vector triggerJetsRefVec; - auto const& triggerJets = iEvent.get(triggerJetsToken_); - triggerJets.getObjects(triggerJetsType_, triggerJetsRefVec); + iEvent.get(triggerJetsToken_).getObjects(triggerJetsType_, triggerJetsRefVec); math::XYZPoint const pvtxPoint(0., 0., 0.); reco::PFJet::Specific const pfJetSpec; @@ -80,10 +79,9 @@ void HLTPFJetsMatchedToFilteredJetsProducer::produce(edm::St auto outPFJets = std::make_unique(); outPFJets->reserve(recoCands.size()); - for (auto const& iJetRef : triggerJetsRefVec) { - for (auto const& jRecoCand : recoCands) { - auto const dR2 = reco::deltaR2(jRecoCand.p4(), iJetRef->p4()); - if (dR2 < maxDeltaR2_) { + for (auto const& jRecoCand : recoCands) { + for (auto const& iJetRef : triggerJetsRefVec) { + if (reco::deltaR2(jRecoCand.p4(), iJetRef->p4()) < maxDeltaR2_) { outPFJets->emplace_back(jRecoCand.p4(), pvtxPoint, pfJetSpec); break; }