Skip to content

Commit 7716e0a

Browse files
authored
Fix ixMax assignment to use NumVoxels-1
1 parent 2bd1d68 commit 7716e0a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Detectors/Base/src/MatLayerCylSet.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ GPUd() bool MatLayerCylSet::getLayersRange(const Ray& ray, short& lmin, short& l
602602
// The two lookups are independent so overlapping the pair is worth the clumsier shape.
603603
const bool useMax = rmax2 < getRMax2();
604604
const bool useMin = rmin2 >= getRMin2();
605-
const int ixMax = useMax ? voxelIndex(rmax2) : 0;
605+
const int ixMax = useMax ? voxelIndex(rmax2) : [NumVoxels-1];
606606
const int ixMin = useMin ? voxelIndex(rmin2) : 0;
607607
const uint16_t eMax = mLayerVoxelLU[ixMax];
608608
const uint16_t eMin = mLayerVoxelLU[ixMin];

0 commit comments

Comments
 (0)