From 4fa3e9584b7031190ddf92c02eab1c6705b8f814 Mon Sep 17 00:00:00 2001 From: menglu21 <1501110102@pku.edu.cn> Date: Wed, 12 Apr 2023 15:17:40 +0200 Subject: [PATCH 1/2] renew matched lepton ids for every jet --- PhysicsTools/NanoAOD/plugins/LeptonInJetProducer.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PhysicsTools/NanoAOD/plugins/LeptonInJetProducer.cc b/PhysicsTools/NanoAOD/plugins/LeptonInJetProducer.cc index 8cf4a31033932..80c75caac194a 100644 --- a/PhysicsTools/NanoAOD/plugins/LeptonInJetProducer.cc +++ b/PhysicsTools/NanoAOD/plugins/LeptonInJetProducer.cc @@ -91,6 +91,8 @@ void LeptonInJetProducer::produce(edm::StreamID streamID, edm::Event &iEvent, fastjet::PseudoJet p(d->px(), d->py(), d->pz(), d->energy()); lClusterParticles.emplace_back(p); } + ele_pfmatch_index = -1; + mu_pfmatch_index = -1; // match to leading and closest electron or muon double dRmin(0.8), dRele(999), dRmu(999), dRtmp(999); From 2d0392475f7443aa2e48385c7208f239e0301037 Mon Sep 17 00:00:00 2001 From: menglu21 <1501110102@pku.edu.cn> Date: Wed, 12 Apr 2023 17:16:23 +0200 Subject: [PATCH 2/2] update definition place --- PhysicsTools/NanoAOD/plugins/LeptonInJetProducer.cc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/PhysicsTools/NanoAOD/plugins/LeptonInJetProducer.cc b/PhysicsTools/NanoAOD/plugins/LeptonInJetProducer.cc index 80c75caac194a..58ed0516ede5f 100644 --- a/PhysicsTools/NanoAOD/plugins/LeptonInJetProducer.cc +++ b/PhysicsTools/NanoAOD/plugins/LeptonInJetProducer.cc @@ -76,9 +76,6 @@ void LeptonInJetProducer::produce(edm::StreamID streamID, edm::Event &iEvent, std::vector vmuIdx3SJ; std::vector veleIdx3SJ; - int ele_pfmatch_index = -1; - int mu_pfmatch_index = -1; - // Find leptons in jets for (unsigned int ij = 0; ij < nJet; ij++) { const pat::Jet &itJet = (*srcJet)[ij]; @@ -91,8 +88,8 @@ void LeptonInJetProducer::produce(edm::StreamID streamID, edm::Event &iEvent, fastjet::PseudoJet p(d->px(), d->py(), d->pz(), d->energy()); lClusterParticles.emplace_back(p); } - ele_pfmatch_index = -1; - mu_pfmatch_index = -1; + int ele_pfmatch_index = -1; + int mu_pfmatch_index = -1; // match to leading and closest electron or muon double dRmin(0.8), dRele(999), dRmu(999), dRtmp(999);