From 939380587b259f471b3eb9a061ddfc96b6caa990 Mon Sep 17 00:00:00 2001 From: Aaron Bundock Date: Thu, 3 Aug 2023 19:01:38 +0200 Subject: [PATCH 1/2] L1T: add puppi jet cut to zpt in L1ntuples --- .../plugins/L1JetRecoTreeProducer.cc | 28 +++++++++++++++---- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/L1Trigger/L1TNtuples/plugins/L1JetRecoTreeProducer.cc b/L1Trigger/L1TNtuples/plugins/L1JetRecoTreeProducer.cc index 1ea55a694e707..3e8deed9881b3 100644 --- a/L1Trigger/L1TNtuples/plugins/L1JetRecoTreeProducer.cc +++ b/L1Trigger/L1TNtuples/plugins/L1JetRecoTreeProducer.cc @@ -80,7 +80,7 @@ class L1JetRecoTreeProducer : public edm::one::EDAnalyzer pfMet, edm::Handle); void doPUPPIMetNoMu(edm::Handle puppiMet, edm::Handle); - void doZPt(edm::Handle); + void doZPt(edm::Handle muons, edm::Handle > corrPuppiJets); bool pfJetID(const reco::PFJet& jet); bool puppiJetID(const pat::Jet& jet); @@ -129,7 +129,6 @@ class L1JetRecoTreeProducer : public edm::one::EDAnalyzer cal met_data->caloSumEtBE = theMet.sumEt(); } -void L1JetRecoTreeProducer::doZPt(edm::Handle muons) { - if (muons->size() < 2) { +void L1JetRecoTreeProducer::doZPt(edm::Handle muons, + edm::Handle > corrPuppiJets) { + bool passPuppiJetPtCut = false; + + for (auto it = corrPuppiJets->begin(); it != corrPuppiJets->end(); ++it) { + if (!puppiJetID(*it)) + continue; + if (it->muonEnergyFraction() > 0.5 || it->chargedEmEnergyFraction() > 0.5) + continue; + if (it->pt() > 30) + passPuppiJetPtCut = true; + } + + if (!passPuppiJetPtCut) { met_data->zPt = -999; return; } From 8e217483c289a3879b858d77290dac2c1c08bfb6 Mon Sep 17 00:00:00 2001 From: Aaron Bundock Date: Thu, 3 Aug 2023 19:08:38 +0200 Subject: [PATCH 2/2] L1T: re-add muon cut --- L1Trigger/L1TNtuples/plugins/L1JetRecoTreeProducer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/L1Trigger/L1TNtuples/plugins/L1JetRecoTreeProducer.cc b/L1Trigger/L1TNtuples/plugins/L1JetRecoTreeProducer.cc index 3e8deed9881b3..55f9bcf6d58d2 100644 --- a/L1Trigger/L1TNtuples/plugins/L1JetRecoTreeProducer.cc +++ b/L1Trigger/L1TNtuples/plugins/L1JetRecoTreeProducer.cc @@ -682,7 +682,7 @@ void L1JetRecoTreeProducer::doZPt(edm::Handle muons, passPuppiJetPtCut = true; } - if (!passPuppiJetPtCut) { + if (!passPuppiJetPtCut || muons->size() < 2) { met_data->zPt = -999; return; }