Skip to content

Commit ebfd56d

Browse files
noferinisawenzel
authored andcommitted
add protection in TOF geo
1 parent 0b719d9 commit ebfd56d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Detectors/TOF/base/src/Geo.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -755,12 +755,12 @@ Int_t Geo::fromPlateToStrip(Float_t* pos, Int_t iplate, Int_t isector)
755755
int firstStripToCheck = stripFound;
756756
int lastStripToCheck = stripFound;
757757
if (stripFound != 0) {
758-
while (std::abs(pos[2] + getGeoDistances(isector, iplate, firstStripToCheck - 1)) < 10) {
758+
while (firstStripToCheck != 0 && std::abs(pos[2] + getGeoDistances(isector, iplate, firstStripToCheck - 1)) < 10) {
759759
--firstStripToCheck;
760760
}
761761
}
762762
if (stripFound != nstrips - 1) {
763-
while (std::abs(pos[2] + getGeoDistances(isector, iplate, lastStripToCheck + 1)) < 10) {
763+
while (lastStripToCheck != nstrips - 1 && std::abs(pos[2] + getGeoDistances(isector, iplate, lastStripToCheck + 1)) < 10) {
764764
++lastStripToCheck;
765765
}
766766
}

0 commit comments

Comments
 (0)