diff --git a/L1Trigger/L1TTrackMatch/plugins/L1TrackJetEmulatorProducer.cc b/L1Trigger/L1TTrackMatch/plugins/L1TrackJetEmulatorProducer.cc index 02bd026bb97a0..4aed5b6091842 100644 --- a/L1Trigger/L1TTrackMatch/plugins/L1TrackJetEmulatorProducer.cc +++ b/L1Trigger/L1TTrackMatch/plugins/L1TrackJetEmulatorProducer.cc @@ -297,6 +297,13 @@ 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 + //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_)) epbins[i][j].pTtot += trkpt; else