From d6fbedf6d9cebc3085d05911a2ab203678ffd15d Mon Sep 17 00:00:00 2001
From: xai <xiaocong.ai@cern.ch>
Date: Wed, 12 Feb 2020 01:12:22 -0800
Subject: [PATCH] rebase

---
 Core/include/Acts/Fitter/KalmanFitter.hpp         |  4 ++--
 Tests/UnitTests/Core/Fitter/KalmanFitterTests.cpp | 12 ++++++------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/Core/include/Acts/Fitter/KalmanFitter.hpp b/Core/include/Acts/Fitter/KalmanFitter.hpp
index ec3a9cebd..dfc7535da 100644
--- a/Core/include/Acts/Fitter/KalmanFitter.hpp
+++ b/Core/include/Acts/Fitter/KalmanFitter.hpp
@@ -534,6 +534,8 @@ class KalmanFitter {
             // which is a bit awkward.
             stepper.update(state.stepping, trackStateProxy.filteredParameters(
                                                state.options.geoContext));
+            // We count the state with measurement
+            ++result.measurementStates;
           } else {
             ACTS_VERBOSE(
                 "Filtering step successful. But measurement is deterimined to "
@@ -545,8 +547,6 @@ class KalmanFitter {
           // Update state and stepper with post material effects
           materialInteractor(surface, state, stepper, postUpdate);
         }
-        // We count the state with measurement
-        ++result.measurementStates;
         // We count the processed state
         ++result.processedStates;
       } else {
diff --git a/Tests/UnitTests/Core/Fitter/KalmanFitterTests.cpp b/Tests/UnitTests/Core/Fitter/KalmanFitterTests.cpp
index 7572f5566..b11d6d9f8 100644
--- a/Tests/UnitTests/Core/Fitter/KalmanFitterTests.cpp
+++ b/Tests/UnitTests/Core/Fitter/KalmanFitterTests.cpp
@@ -6,8 +6,8 @@
 // License, v. 2.0. If a copy of the MPL was not distributed with this
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-#include <boost/test/unit_test.hpp>
 #include <boost/math/distributions/chi_squared.hpp>
+#include <boost/test/unit_test.hpp>
 
 #include <algorithm>
 #include <cmath>
@@ -439,7 +439,7 @@ BOOST_AUTO_TEST_CASE(kalman_fitter_zero_field) {
   BOOST_CHECK(!Acts::Test::checkCloseRel(fittedParameters.parameters(),
                                          fittedWithHoleParameters.parameters(),
                                          1e-6));
-  
+
   // Run KF fit in backward filtering mode
   kfOptions.backwardFiltering = true;
   // Fit the track
@@ -451,8 +451,8 @@ BOOST_AUTO_TEST_CASE(kalman_fitter_zero_field) {
   BOOST_CHECK(not fittedWithBwdFiltering.smoothed);
 
   // Count the number of 'smoothed' states
-  auto& trackTip = fittedWithBwdFiltering.trackTip;
-  auto& mj = fittedWithBwdFiltering.fittedStates;
+  auto trackTip = fittedWithBwdFiltering.trackTip;
+  auto mj = fittedWithBwdFiltering.fittedStates;
   size_t nSmoothed = 0;
   mj.visitBackwards(trackTip, [&](const auto& state) {
     if (state.hasSmoothed())
@@ -476,8 +476,8 @@ BOOST_AUTO_TEST_CASE(kalman_fitter_zero_field) {
   auto& fittedWithOneOutlier = *fitRes;
 
   // Count the number of outliers
-  auto& trackTip = fittedWithOneOutlier.trackTip;
-  auto& mj = fittedWithOneOutlier.fittedStates;
+  trackTip = fittedWithOneOutlier.trackTip;
+  mj = fittedWithOneOutlier.fittedStates;
   size_t nOutliers = 0;
   mj.visitBackwards(trackTip, [&](const auto& state) {
     auto typeFlags = state.typeFlags();
-- 
GitLab