Skip to content

Commit

Permalink
fix read out of bounds in CLUE3D
Browse files Browse the repository at this point in the history
  • Loading branch information
felicepantaleo committed Jun 8, 2023
1 parent a8e815d commit 492128b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion RecoHGCal/TICL/plugins/PatternRecognitionbyCLUE3D.cc
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ void PatternRecognitionbyCLUE3D<TILES>::calculateDistanceToHigher(
int etaWindow = 1;
int phiWindow = 1;
int etaBinMin = std::max(tileOnLayer.etaBin(clustersOnLayer.eta[i]) - etaWindow, 0);
int etaBinMax = std::min(tileOnLayer.etaBin(clustersOnLayer.eta[i]) + etaWindow, nEtaBin);
int etaBinMax = std::min(tileOnLayer.etaBin(clustersOnLayer.eta[i]) + etaWindow, nEtaBin - 1);
int phiBinMin = tileOnLayer.phiBin(clustersOnLayer.phi[i]) - phiWindow;
int phiBinMax = tileOnLayer.phiBin(clustersOnLayer.phi[i]) + phiWindow;
for (int ieta = etaBinMin; ieta <= etaBinMax; ++ieta) {
Expand Down

0 comments on commit 492128b

Please sign in to comment.