From ae02d4e1a812c5b622768d04dd610e6780e75d58 Mon Sep 17 00:00:00 2001 From: cohought Date: Fri, 2 Feb 2024 13:11:03 -0500 Subject: [PATCH 1/3] Implement quick fix for eta going out of scope --- .../L1TTrackMatch/plugins/L1TrackJetEmulatorProducer.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/L1Trigger/L1TTrackMatch/plugins/L1TrackJetEmulatorProducer.cc b/L1Trigger/L1TTrackMatch/plugins/L1TrackJetEmulatorProducer.cc index 02bd026bb97a0..3515cb5fd6a4f 100644 --- a/L1Trigger/L1TTrackMatch/plugins/L1TrackJetEmulatorProducer.cc +++ b/L1Trigger/L1TTrackMatch/plugins/L1TrackJetEmulatorProducer.cc @@ -297,6 +297,12 @@ void L1TrackJetEmulatorProducer::produce(Event &iEvent, const EventSetup &iSetup // Eta bin int j = eta_bin_firmwareStyle(L1TrkPtrs_[k]->getTanlWord()); //Function defined in L1TrackJetClustering.h + //This is a quick fix to eta going outside of scope - also including protection against phi going outside + //of scope as well. The eta index, j, cannot be less than zero or greater than 23 (the number of eta bins). + //The phi index, i, cannot be less than zero or greater than 26 (the number of phi bins). + if ((j < 0) || (j > 23) || (i < 0) || (i > 26)) + continue; + if (trkpt < pt_intern(trkPtMax_)) epbins[i][j].pTtot += trkpt; else From b87a14e4b0fabbb2ba3675607e9ca2770a0004a3 Mon Sep 17 00:00:00 2001 From: cohought Date: Sat, 3 Feb 2024 19:07:38 -0500 Subject: [PATCH 2/3] Use predefined eta and phi bin numbers in index protection for eta-phi array --- .../L1TTrackMatch/plugins/L1TrackJetEmulatorProducer.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/L1Trigger/L1TTrackMatch/plugins/L1TrackJetEmulatorProducer.cc b/L1Trigger/L1TTrackMatch/plugins/L1TrackJetEmulatorProducer.cc index 3515cb5fd6a4f..a281dd738b8b4 100644 --- a/L1Trigger/L1TTrackMatch/plugins/L1TrackJetEmulatorProducer.cc +++ b/L1Trigger/L1TTrackMatch/plugins/L1TrackJetEmulatorProducer.cc @@ -298,9 +298,10 @@ void L1TrackJetEmulatorProducer::produce(Event &iEvent, const EventSetup &iSetup int j = eta_bin_firmwareStyle(L1TrkPtrs_[k]->getTanlWord()); //Function defined in L1TrackJetClustering.h //This is a quick fix to eta going outside of scope - also including protection against phi going outside - //of scope as well. The eta index, j, cannot be less than zero or greater than 23 (the number of eta bins). - //The phi index, i, cannot be less than zero or greater than 26 (the number of phi bins). - if ((j < 0) || (j > 23) || (i < 0) || (i > 26)) + //of scope as well. The eta index, j, cannot be less than zero or greater than 23 (the number of eta bins + //minus one). The phi index, i, cannot be less than zero or greater than 26 (the number of phi bins + //minus one). + if ((j < 0) || (j > (etaBins_-1)) || (i < 0) || (i > (phiBins_-1))) continue; if (trkpt < pt_intern(trkPtMax_)) From 9620e9941d20b6e939b21e353d8554328ff66ee9 Mon Sep 17 00:00:00 2001 From: cohought Date: Mon, 5 Feb 2024 10:41:21 -0500 Subject: [PATCH 3/3] Formatting changes --- .../L1TTrackMatch/plugins/L1TrackJetEmulatorProducer.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/L1Trigger/L1TTrackMatch/plugins/L1TrackJetEmulatorProducer.cc b/L1Trigger/L1TTrackMatch/plugins/L1TrackJetEmulatorProducer.cc index a281dd738b8b4..4aed5b6091842 100644 --- a/L1Trigger/L1TTrackMatch/plugins/L1TrackJetEmulatorProducer.cc +++ b/L1Trigger/L1TTrackMatch/plugins/L1TrackJetEmulatorProducer.cc @@ -298,10 +298,10 @@ void L1TrackJetEmulatorProducer::produce(Event &iEvent, const EventSetup &iSetup int j = eta_bin_firmwareStyle(L1TrkPtrs_[k]->getTanlWord()); //Function defined in L1TrackJetClustering.h //This is a quick fix to eta going outside of scope - also including protection against phi going outside - //of scope as well. The eta index, j, cannot be less than zero or greater than 23 (the number of eta bins - //minus one). The phi index, i, cannot be less than zero or greater than 26 (the number of phi bins + //of scope as well. The eta index, j, cannot be less than zero or greater than 23 (the number of eta bins + //minus one). The phi index, i, cannot be less than zero or greater than 26 (the number of phi bins //minus one). - if ((j < 0) || (j > (etaBins_-1)) || (i < 0) || (i > (phiBins_-1))) + if ((j < 0) || (j > (etaBins_ - 1)) || (i < 0) || (i > (phiBins_ - 1))) continue; if (trkpt < pt_intern(trkPtMax_))