Skip to content

Commit

Permalink
add protection in TOF geo
Browse files Browse the repository at this point in the history
  • Loading branch information
noferini committed Apr 15, 2024
1 parent f7351c9 commit 836a5cf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Detectors/TOF/base/src/Geo.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -755,12 +755,12 @@ Int_t Geo::fromPlateToStrip(Float_t* pos, Int_t iplate, Int_t isector)
int firstStripToCheck = stripFound;
int lastStripToCheck = stripFound;
if (stripFound != 0) {
while (std::abs(pos[2] + getGeoDistances(isector, iplate, firstStripToCheck - 1)) < 10) {
while (firstStripToCheck != 0 && std::abs(pos[2] + getGeoDistances(isector, iplate, firstStripToCheck - 1)) < 10) {
--firstStripToCheck;
}
}
if (stripFound != nstrips - 1) {
while (std::abs(pos[2] + getGeoDistances(isector, iplate, lastStripToCheck + 1)) < 10) {
while (lastStripToCheck != nstrips - 1 && std::abs(pos[2] + getGeoDistances(isector, iplate, lastStripToCheck + 1)) < 10) {
++lastStripToCheck;
}
}
Expand Down

0 comments on commit 836a5cf

Please sign in to comment.