From a8e815d72cb28db64e27f3faf040bb0b042a6410 Mon Sep 17 00:00:00 2001 From: Felice Pantaleo Date: Thu, 8 Jun 2023 16:09:29 +0200 Subject: [PATCH 1/2] fix read out of bounds in CLUE3D --- RecoHGCal/TICL/plugins/PatternRecognitionbyCLUE3D.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RecoHGCal/TICL/plugins/PatternRecognitionbyCLUE3D.cc b/RecoHGCal/TICL/plugins/PatternRecognitionbyCLUE3D.cc index 8470bbea04675..3ca89e82b9052 100644 --- a/RecoHGCal/TICL/plugins/PatternRecognitionbyCLUE3D.cc +++ b/RecoHGCal/TICL/plugins/PatternRecognitionbyCLUE3D.cc @@ -532,7 +532,7 @@ void PatternRecognitionbyCLUE3D::calculateLocalDensity( const int etaWindow = 2; const int phiWindow = 2; 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; if (PatternRecognitionAlgoBaseT::algo_verbosity_ > VerbosityLevel::Advanced) { From 492128bc1ceebd009ae1c1de9440b8a9cc7a6c63 Mon Sep 17 00:00:00 2001 From: Felice Pantaleo Date: Thu, 8 Jun 2023 16:20:06 +0200 Subject: [PATCH 2/2] fix read out of bounds in CLUE3D --- RecoHGCal/TICL/plugins/PatternRecognitionbyCLUE3D.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RecoHGCal/TICL/plugins/PatternRecognitionbyCLUE3D.cc b/RecoHGCal/TICL/plugins/PatternRecognitionbyCLUE3D.cc index 3ca89e82b9052..4af6e422698c9 100644 --- a/RecoHGCal/TICL/plugins/PatternRecognitionbyCLUE3D.cc +++ b/RecoHGCal/TICL/plugins/PatternRecognitionbyCLUE3D.cc @@ -686,7 +686,7 @@ void PatternRecognitionbyCLUE3D::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) {