Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor!: Remove alias IntersectionStatus::missed #3899

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Core/include/Acts/Propagator/MultiEigenStepperLoop.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ class MultiEigenStepperLoop : public EigenStepper<extension_t> {
void removeMissedComponents(State& state) const {
auto new_end = std::remove_if(
state.components.begin(), state.components.end(), [](const auto& cmp) {
return cmp.status == Intersection3D::Status::missed;
return cmp.status == Intersection3D::Status::unreachable;
});

state.components.erase(new_end, state.components.end());
Expand Down Expand Up @@ -584,7 +584,7 @@ class MultiEigenStepperLoop : public EigenStepper<extension_t> {
} else if (counts[static_cast<std::size_t>(Status::unreachable)] > 0) {
return Status::unreachable;
} else {
return Status::missed;
return Status::unreachable;
}
andiwand marked this conversation as resolved.
Show resolved Hide resolved
}

Expand Down
2 changes: 1 addition & 1 deletion Core/include/Acts/Propagator/MultiEigenStepperLoop.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Result<double> MultiEigenStepperLoop<E, R>::step(
m_stepLimitAfterFirstComponentOnSurface) {
for (auto& cmp : components) {
if (cmp.status != Status::onSurface) {
cmp.status = Status::missed;
cmp.status = Status::unreachable;
}
}

Expand Down
2 changes: 1 addition & 1 deletion Core/include/Acts/TrackFitting/detail/GsfActor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ struct GsfActor {
// we set ignored components to missed, so we can remove them after
// the loop
if (tmpStates.weights.at(idx) < m_cfg.weightCutoff) {
cmp.status() = Intersection3D::Status::missed;
cmp.status() = Intersection3D::Status::unreachable;
continue;
}

Expand Down
3 changes: 1 addition & 2 deletions Core/include/Acts/Utilities/Intersection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ namespace Acts {

/// Status enum
enum class IntersectionStatus : int {
missed = 0,
unreachable = 0,
reachable = 1,
onSurface = 2
Expand Down Expand Up @@ -60,7 +59,7 @@ class Intersection {
: m_position(position), m_pathLength(pathLength), m_status(status) {}

/// Returns whether the intersection was successful or not
constexpr bool isValid() const { return m_status != Status::missed; }
constexpr bool isValid() const { return m_status != Status::unreachable; }
andiwand marked this conversation as resolved.
Show resolved Hide resolved

/// Returns the position of the interseciton
constexpr const Position& position() const { return m_position; }
Expand Down
4 changes: 2 additions & 2 deletions Core/src/Surfaces/ConeSurface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ Acts::SurfaceMultiIntersection Acts::ConeSurface::intersect(

if (!boundaryTolerance.isInfinite() &&
!isOnSurface(gctx, solution1, direction, boundaryTolerance)) {
status1 = Intersection3D::Status::missed;
status1 = Intersection3D::Status::unreachable;
}

// Check the validity of the second solution
Expand All @@ -311,7 +311,7 @@ Acts::SurfaceMultiIntersection Acts::ConeSurface::intersect(
: Intersection3D::Status::reachable;
if (!boundaryTolerance.isInfinite() &&
!isOnSurface(gctx, solution2, direction, boundaryTolerance)) {
status2 = Intersection3D::Status::missed;
status2 = Intersection3D::Status::unreachable;
}

const auto& tf = transform(gctx);
Expand Down
4 changes: 2 additions & 2 deletions Core/src/Surfaces/CylinderSurface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,11 +267,11 @@ Acts::SurfaceMultiIntersection Acts::CylinderSurface::intersect(
double modifiedTolerance = tolerance + absoluteBound->tolerance1;
double hZ = cBounds.get(CylinderBounds::eHalfLengthZ) + modifiedTolerance;
return std::abs(cZ) < std::abs(hZ) ? status
: Intersection3D::Status::missed;
: Intersection3D::Status::unreachable;
}
return isOnSurface(gctx, solution, direction, boundaryTolerance)
? status
: Intersection3D::Status::missed;
: Intersection3D::Status::unreachable;
};
// Check first solution for boundary compatibility
status1 = boundaryCheck(solution1, status1);
Expand Down
4 changes: 2 additions & 2 deletions Core/src/Surfaces/DiscSurface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,11 +297,11 @@ Acts::SurfaceMultiIntersection Acts::DiscSurface::intersect(
double modifiedTolerance = tolerance + absoluteBound->tolerance0;
if (!m_bounds->insideRadialBounds(VectorHelpers::perp(lcartesian),
modifiedTolerance)) {
status = Intersection3D::Status::missed;
status = Intersection3D::Status::unreachable;
}
} else if (!insideBounds(localCartesianToPolar(lcartesian),
boundaryTolerance)) {
status = Intersection3D::Status::missed;
status = Intersection3D::Status::unreachable;
}
}
return {{Intersection3D(intersection.position(), intersection.pathLength(),
Expand Down
2 changes: 1 addition & 1 deletion Core/src/Surfaces/LineSurface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ Acts::SurfaceMultiIntersection Acts::LineSurface::intersect(
double cZ = vecLocal.dot(eb);
double cR = (vecLocal - cZ * eb).norm();
if (!m_bounds->inside({cR, cZ}, boundaryTolerance)) {
status = Intersection3D::Status::missed;
status = Intersection3D::Status::unreachable;
}
}

Expand Down
2 changes: 1 addition & 1 deletion Core/src/Surfaces/PlaneSurface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ Acts::SurfaceMultiIntersection Acts::PlaneSurface::intersect(
const Vector3 vecLocal(intersection.position() - tMatrix.block<3, 1>(0, 3));
if (!insideBounds(tMatrix.block<3, 2>(0, 0).transpose() * vecLocal,
boundaryTolerance)) {
status = Intersection3D::Status::missed;
status = Intersection3D::Status::unreachable;
}
}
return {{Intersection3D(intersection.position(), intersection.pathLength(),
Expand Down
6 changes: 3 additions & 3 deletions Tests/UnitTests/Core/Surfaces/SurfaceIntersectionTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ BOOST_AUTO_TEST_CASE(CylinderIntersectionTests) {
BOOST_CHECK(!eIntersection[1].isValid());
// The other intersection MUST NOT be reachable
BOOST_CHECK_EQUAL(eIntersection[1].status(),
Intersection3D::Status::missed);
Intersection3D::Status::unreachable);
// And be the positive one
BOOST_CHECK_GT(eIntersection[1].pathLength(), 0.);
};
Expand Down Expand Up @@ -295,7 +295,7 @@ BOOST_AUTO_TEST_CASE(PlanarIntersectionTest) {
BOOST_CHECK(!mIntersection[0].isValid());
// The intersection MUST be reachable
BOOST_CHECK_EQUAL(mIntersection[0].status(),
Intersection3D::Status::missed);
Intersection3D::Status::unreachable);
// The path length MUST be negative
BOOST_CHECK_GT(mIntersection[0].pathLength(), 0.);
// The intersection MUST be unique
Expand Down Expand Up @@ -407,7 +407,7 @@ BOOST_AUTO_TEST_CASE(LineIntersectionTest) {
BOOST_CHECK(!mIntersection[0].isValid());
// The intersection MUST be reachable
BOOST_CHECK_EQUAL(mIntersection[0].status(),
Intersection3D::Status::missed);
Intersection3D::Status::unreachable);
// The path length MUST be negative
BOOST_CHECK_LT(mIntersection[0].pathLength(), 0.);
// The intersection MUST be unique
Expand Down
2 changes: 1 addition & 1 deletion Tests/UnitTests/Core/Utilities/IntersectionTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ BOOST_AUTO_TEST_CASE(ObjectIntersectionTest) {

BOOST_AUTO_TEST_CASE(IntersectionStatusPrinting) {
std::array<IntersectionStatus, 4> status_values = {
{IntersectionStatus::missed, IntersectionStatus::unreachable,
{IntersectionStatus::unreachable, IntersectionStatus::unreachable,
IntersectionStatus::reachable, IntersectionStatus::onSurface}};
std::array<std::string, 4> expected_messages = {
{"missed/unreachable", "missed/unreachable", "reachable", "onSurface"}};
Expand Down
Loading