diff --git a/L1Trigger/L1TNtuples/plugins/L1JetRecoTreeProducer.cc b/L1Trigger/L1TNtuples/plugins/L1JetRecoTreeProducer.cc index 1ea55a694e707..55f9bcf6d58d2 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 || muons->size() < 2) { met_data->zPt = -999; return; }