Skip to content

Commit

Permalink
restore OutOfBounds check. assert if neighbors array not fully filled.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Adye authored and Tim Adye committed Jun 14, 2023
1 parent e8ec0ca commit f596fd2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Core/include/Acts/MagneticField/InterpolatedBFieldMap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,17 @@ class InterpolatedBFieldMap : public InterpolatedMagneticField {
std::array<Vector3, nCorners> neighbors;
const auto& cornerIndices = m_cfg.grid.closestPointsIndices(gridPosition);

if (!isInsideLocal(gridPosition)) {
return MagneticFieldError::OutOfBounds;
}

size_t i = 0;
for (size_t index : cornerIndices) {
neighbors.at(i++) = m_cfg.transformBField(m_cfg.grid.at(index), position);
}

assert(i == nCorners);

return FieldCell(lowerLeft, upperRight, std::move(neighbors));
}

Expand Down

0 comments on commit f596fd2

Please sign in to comment.