Skip to content

Commit

Permalink
more residual changes
Browse files Browse the repository at this point in the history
  • Loading branch information
andiwand committed Nov 23, 2024
1 parent 051da73 commit ee63416
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 38 deletions.
2 changes: 1 addition & 1 deletion Core/include/Acts/Navigation/NavigationStream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
#pragma once

#include "Acts/Definitions/Algebra.hpp"
#include "Acts/Definitions/Tolerance.hpp"
#include "Acts/Geometry/GeometryContext.hpp"
#include "Acts/Geometry/Portal.hpp"
#include "Acts/Surfaces/BoundaryTolerance.hpp"
#include "Acts/Utilities/Intersection.hpp"

#include <span>
#include <tuple>
#include <vector>

namespace Acts {
Expand Down
6 changes: 2 additions & 4 deletions Core/include/Acts/Propagator/DirectNavigator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,18 @@
#pragma once

#include "Acts/Definitions/Direction.hpp"
#include "Acts/Geometry/BoundarySurfaceT.hpp"
#include "Acts/Definitions/Units.hpp"
#include "Acts/Geometry/Layer.hpp"
#include "Acts/Geometry/TrackingGeometry.hpp"
#include "Acts/Geometry/TrackingVolume.hpp"
#include "Acts/Propagator/ConstrainedStep.hpp"
#include "Acts/Propagator/NavigatorOptions.hpp"
#include "Acts/Propagator/NavigatorStatistics.hpp"
#include "Acts/Propagator/Propagator.hpp"
#include "Acts/Surfaces/BoundaryTolerance.hpp"
#include "Acts/Surfaces/Surface.hpp"
#include "Acts/Utilities/Intersection.hpp"
#include "Acts/Utilities/Logger.hpp"

#include <algorithm>
#include <iterator>
#include <limits>
#include <memory>
#include <vector>
Expand Down
2 changes: 1 addition & 1 deletion Core/include/Acts/Propagator/EigenStepper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ class EigenStepper {
/// @param [in] boundaryTolerance The boundary check for this status update
/// @param [in] surfaceTolerance Surface tolerance used for intersection
/// @param [in] logger A @c Logger instance
Intersection3D::Status updateSurfaceStatus(
IntersectionStatus updateSurfaceStatus(
State& state, const Surface& surface, std::uint8_t index,
Direction navDir, const BoundaryTolerance& boundaryTolerance,
ActsScalar surfaceTolerance = s_onSurfaceTolerance,
Expand Down
8 changes: 4 additions & 4 deletions Core/include/Acts/Propagator/TryAllNavigator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ class TryAllNavigator : public TryAllNavigatorBase {
const auto& intersection = candidate.intersection;
const Surface& surface = *intersection.object();

Intersection3D::Status surfaceStatus = stepper.updateSurfaceStatus(
IntersectionStatus surfaceStatus = stepper.updateSurfaceStatus(
state.stepping, surface, intersection.index(),
state.options.direction, BoundaryTolerance::Infinite(),
state.options.surfaceTolerance, logger());
Expand Down Expand Up @@ -463,7 +463,7 @@ class TryAllNavigator : public TryAllNavigatorBase {
const auto& intersection = candidate.intersection;
const Surface& surface = *intersection.object();

Intersection3D::Status surfaceStatus = stepper.updateSurfaceStatus(
IntersectionStatus surfaceStatus = stepper.updateSurfaceStatus(
state.stepping, surface, intersection.index(),
state.options.direction, BoundaryTolerance::None(),
state.options.surfaceTolerance, logger());
Expand Down Expand Up @@ -788,7 +788,7 @@ class TryAllOverstepNavigator : public TryAllNavigatorBase {
const auto& intersection = candidate.intersection;
const Surface& surface = *intersection.object();

Intersection3D::Status surfaceStatus = stepper.updateSurfaceStatus(
IntersectionStatus surfaceStatus = stepper.updateSurfaceStatus(
state.stepping, surface, intersection.index(),
state.options.direction, BoundaryTolerance::Infinite(),
state.options.surfaceTolerance, logger());
Expand All @@ -815,7 +815,7 @@ class TryAllOverstepNavigator : public TryAllNavigatorBase {
const auto& intersection = candidate.intersection;
const Surface& surface = *intersection.object();

Intersection3D::Status surfaceStatus = stepper.updateSurfaceStatus(
IntersectionStatus surfaceStatus = stepper.updateSurfaceStatus(
state.stepping, surface, intersection.index(),
state.options.direction, BoundaryTolerance::None(),
state.options.surfaceTolerance, logger());
Expand Down
1 change: 1 addition & 0 deletions Core/include/Acts/TrackFitting/GaussianSumFitter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "Acts/Propagator/Navigator.hpp"
#include "Acts/Propagator/StandardAborters.hpp"
#include "Acts/Surfaces/BoundaryTolerance.hpp"
#include "Acts/TrackFitting/GsfError.hpp"
#include "Acts/TrackFitting/GsfOptions.hpp"
#include "Acts/TrackFitting/detail/GsfActor.hpp"
#include "Acts/Utilities/Helpers.hpp"
Expand Down
31 changes: 12 additions & 19 deletions Core/include/Acts/TrackFitting/detail/GsfActor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,9 @@
#include "Acts/EventData/MultiComponentTrackParameters.hpp"
#include "Acts/EventData/MultiTrajectory.hpp"
#include "Acts/EventData/MultiTrajectoryHelpers.hpp"
#include "Acts/MagneticField/MagneticFieldProvider.hpp"
#include "Acts/Material/ISurfaceMaterial.hpp"
#include "Acts/Surfaces/CylinderSurface.hpp"
#include "Acts/Propagator/detail/PointwiseMaterialInteraction.hpp"
#include "Acts/Surfaces/Surface.hpp"
#include "Acts/TrackFitting/BetheHeitlerApprox.hpp"
#include "Acts/TrackFitting/GsfError.hpp"
#include "Acts/TrackFitting/GsfOptions.hpp"
#include "Acts/TrackFitting/KalmanFitter.hpp"
#include "Acts/TrackFitting/detail/GsfComponentMerging.hpp"
#include "Acts/TrackFitting/detail/GsfUtils.hpp"
#include "Acts/TrackFitting/detail/KalmanUpdateHelpers.hpp"
Expand All @@ -28,7 +23,6 @@

#include <ios>
#include <map>
#include <numeric>

namespace Acts::detail {

Expand All @@ -53,8 +47,8 @@ struct GsfResult {
std::size_t measurementHoles = 0;
std::size_t processedStates = 0;

std::vector<const Acts::Surface*> visitedSurfaces;
std::vector<const Acts::Surface*> surfacesVisitedBwdAgain;
std::vector<const Surface*> visitedSurfaces;
std::vector<const Surface*> surfacesVisitedBwdAgain;

/// Statistics about material encounterings
Updatable<std::size_t> nInvalidBetheHeitler;
Expand All @@ -74,7 +68,7 @@ struct GsfActor {
/// Enforce default construction
GsfActor() = default;

using ComponentCache = Acts::GsfComponent;
using ComponentCache = GsfComponent;

/// Broadcast the result_type
using result_type = GsfResult<traj_t>;
Expand Down Expand Up @@ -189,7 +183,7 @@ struct GsfActor {
// All components must have status "on surface". It is however possible,
// that currentSurface is nullptr and all components are "on surface" (e.g.,
// for surfaces excluded from the navigation)
using Status [[maybe_unused]] = Acts::IntersectionStatus;
using Status [[maybe_unused]] = IntersectionStatus;
assert(std::all_of(
stepperComponents.begin(), stepperComponents.end(),
[](const auto& cmp) { return cmp.status() == Status::onSurface; }));
Expand Down Expand Up @@ -477,7 +471,7 @@ struct GsfActor {
/// Function that updates the stepper from the MultiTrajectory
template <typename propagator_state_t, typename stepper_t>
void updateStepper(propagator_state_t& state, const stepper_t& stepper,
coIntersectionStatusmpStates) const {
const TemporaryStates& tmpStates) const {
auto cmps = stepper.componentIterable(state.stepping);

for (auto [idx, cmp] : zip(tmpStates.tips, cmps)) {
Expand Down Expand Up @@ -534,9 +528,9 @@ struct GsfActor {
state.geoContext, freeParams.template segment<3>(eFreePos0),
freeParams.template segment<3>(eFreeDir0));
cmp.pathAccumulated() = state.stepping.pathAccumulated;
cmp.jacobian() = Acts::BoundMatrix::Identity();
cmp.derivative() = Acts::FreeVector::Zero();
cmp.jacTransport() = Acts::FreeMatrix::Identity();
cmp.jacobian() = BoundMatrix::Identity();
cmp.derivative() = FreeVector::Zero();
cmp.jacTransport() = FreeMatrix::Identity();
}
}

Expand Down Expand Up @@ -574,8 +568,7 @@ struct GsfActor {

// If at least one component is no outlier, we consider the whole thing
// as a measurementState
if (trackStateProxy.typeFlags().test(
Acts::TrackStateFlag::MeasurementFlag)) {
if (trackStateProxy.typeFlags().test(TrackStateFlag::MeasurementFlag)) {
is_valid_measurement = true;
}

Expand Down Expand Up @@ -621,7 +614,7 @@ struct GsfActor {
stepper.particleHypothesis(state.stepping));

// Return success
return Acts::Result<void>::success();
return Result<void>::success();
}

template <typename propagator_state_t, typename stepper_t,
Expand Down Expand Up @@ -790,7 +783,7 @@ struct GsfActor {

/// Set the relevant options that can be set from the Options struct all in
/// one place
void setOptions(const Acts::GsfOptions<traj_t>& options) {
void setOptions(const GsfOptions<traj_t>& options) {
m_cfg.maxComponents = options.maxComponents;
m_cfg.extensions = options.extensions;
m_cfg.abortOnError = options.abortOnError;
Expand Down
18 changes: 9 additions & 9 deletions Core/src/Surfaces/IntersectionHelper2D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ Acts::Intersection2D Acts::detail::IntersectionHelper2D::intersectSegment(
auto d = line.intersectionParameter(Plane::Through(s0, s1));

Vector2 intersection(origin + d * dir);
Intersection2D::Status status = Intersection2D::Status::reachable;
IntersectionStatus status = IntersectionStatus::reachable;
if (boundCheck) {
auto edgeToSol = intersection - s0;
if (edgeToSol.dot(edge) < 0. || edgeToSol.norm() > (edge).norm()) {
status = Intersection2D::Status::unreachable;
status = IntersectionStatus::unreachable;
}
}
return Intersection2D(intersection, d, status);
Expand All @@ -55,11 +55,11 @@ Acts::detail::IntersectionHelper2D::intersectEllipse(ActsScalar Rx,
ActsScalar altD = std::copysign(toAltD.norm(), toAltD.dot(dir));

if (std::abs(solD) < std::abs(altD)) {
return {Intersection2D(sol, solD, Intersection2D::Status::reachable),
Intersection2D(alt, altD, Intersection2D::Status::reachable)};
return {Intersection2D(sol, solD, IntersectionStatus::reachable),
Intersection2D(alt, altD, IntersectionStatus::reachable)};
}
return {Intersection2D(alt, altD, Intersection2D::Status::reachable),
Intersection2D(sol, solD, Intersection2D::Status::reachable)};
return {Intersection2D(alt, altD, IntersectionStatus::reachable),
Intersection2D(sol, solD, IntersectionStatus::reachable)};
};

// Special cases first
Expand All @@ -73,7 +73,7 @@ Acts::detail::IntersectionHelper2D::intersectEllipse(ActsScalar Rx,
return createSolution(sol, alt);
} else if (std::abs(D) < s_epsilon) {
return {Intersection2D(Vector2(solx, 0.), -origin.y(),
Intersection2D::Status::reachable),
IntersectionStatus::reachable),
Intersection2D::invalid()};
}
return {Intersection2D::invalid(), Intersection2D::invalid()};
Expand All @@ -87,7 +87,7 @@ Acts::detail::IntersectionHelper2D::intersectEllipse(ActsScalar Rx,
return createSolution(sol, alt);
} else if (std::abs(D) < s_epsilon) {
return {Intersection2D(Vector2(0., soly), -origin.x(),
Intersection2D::Status::reachable),
IntersectionStatus::reachable),
Intersection2D::invalid()};
}
return {Intersection2D::invalid(), Intersection2D::invalid()};
Expand All @@ -105,7 +105,7 @@ Acts::detail::IntersectionHelper2D::intersectEllipse(ActsScalar Rx,
Vector2 sol(x, k * x + d);
Vector2 toSolD(sol - origin);
ActsScalar solD = std::copysign(toSolD.norm(), toSolD.dot(dir));
return {Intersection2D(sol, solD, Intersection2D::Status::reachable),
return {Intersection2D(sol, solD, IntersectionStatus::reachable),
Intersection2D::invalid()};
} else if (solver.solutions > 1) {
ActsScalar x0 = solver.first;
Expand Down
2 changes: 2 additions & 0 deletions Core/src/Utilities/Intersection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

#include "Acts/Utilities/Intersection.hpp"

#include "Acts/Definitions/Tolerance.hpp"

namespace Acts {

bool detail::checkPathLength(double pathLength, double nearLimit,
Expand Down

0 comments on commit ee63416

Please sign in to comment.