diff --git a/Core/include/Acts/Fitter/KalmanFitter.hpp b/Core/include/Acts/Fitter/KalmanFitter.hpp index 6c89a0f59154e4cf57d81b55a36fae0d2809c597..8f8769971a6c5b10ac48837ac55beb7c230ad6cc 100644 --- a/Core/include/Acts/Fitter/KalmanFitter.hpp +++ b/Core/include/Acts/Fitter/KalmanFitter.hpp @@ -265,9 +265,9 @@ class KalmanFitter { // Finalization: // When all track states have been handled or the navigation is breaked - if ((result.processedStates == inputMeasurements.size() or - (state.navigation.navigationBreak and - result.processedStates > 0)) and + if ((result.measurementStates == inputMeasurements.size() or + (result.measurementStates > 0 and + state.navigation.navigationBreak)) and not result.smoothed) { // -> Sort the track states (as now the path length is set) // -> Call the smoothing @@ -405,6 +405,7 @@ class KalmanFitter { result.fittedStates.getTrackState(result.trackTip); // Fill the track state + trackStateProxy.setReferenceSurface(surface->getSharedPtr()); trackStateProxy.predicted() = boundParams.parameters(); trackStateProxy.predictedCovariance() = *boundParams.covariance(); trackStateProxy.jacobian() = jacobian; @@ -458,12 +459,14 @@ class KalmanFitter { /// @param state The mutable propagator state object /// @param stepper The stepper in use /// @param mStage The materal update stage + /// @param reinitialize The flag to steer whether the state should be + /// reinitialized at the new position /// /// @return The material interaction template <typename propagator_state_t, typename stepper_t> detail::PointwiseMaterialInteraction materialInteractor( const Surface* surface, propagator_state_t& state, stepper_t& stepper, - const MaterialUpdateStage& mStage) const { + const MaterialUpdateStage& mStage, bool reinitialize = false) const { // Prepare relevant input particle properties detail::PointwiseMaterialInteraction interaction(surface, state, stepper); @@ -476,7 +479,7 @@ class KalmanFitter { // Transport the covariance to the current position in space // the 'true' indicates re-initializaiton of the further transport if (interaction.performCovarianceTransport) { - stepper.covarianceTransport(state.stepping, true); + stepper.covarianceTransport(state.stepping, initialize); } // Update the state and stepper with material effects diff --git a/Core/include/Acts/Propagator/detail/PointwiseMaterialInteraction.hpp b/Core/include/Acts/Propagator/detail/PointwiseMaterialInteraction.hpp index c10cda3f37fdb6d9606588e6675995b4f7059eaf..40bb9c77b43c4c9242f36ba452eee3c269cece24 100644 --- a/Core/include/Acts/Propagator/detail/PointwiseMaterialInteraction.hpp +++ b/Core/include/Acts/Propagator/detail/PointwiseMaterialInteraction.hpp @@ -8,6 +8,7 @@ #pragma once +#include "Acts/Material/ISurfaceMaterial.hpp" #include "Acts/Material/MaterialProperties.hpp" #include "Acts/Surfaces/Surface.hpp" @@ -86,9 +87,9 @@ struct PointwiseMaterialInteraction { } // Retrieve the material properties - slab = - state.navigation.currentSurface->surfaceMaterial()->materialProperties( - pos, nav, updateStage); + const ISurfaceMaterial* sMaterial = + state.navigation.currentSurface->surfaceMaterial(); + slab = sMaterial->materialProperties(pos, nav, updateStage); // Correct the material properties for non-zero incidence pathCorrection = surface->pathCorrection(state.geoContext, pos, dir); @@ -148,4 +149,4 @@ struct PointwiseMaterialInteraction { double updateVariance(double variance, double change) const; }; } // namespace detail -} // end of namespace Acts \ No newline at end of file +} // end of namespace Acts