From 4cf67cb4c0a251294c66a2786daccd7da0f56b54 Mon Sep 17 00:00:00 2001
From: xai <xiaocong.ai@cern.ch>
Date: Fri, 13 Dec 2019 10:24:19 +0800
Subject: [PATCH] Fix a bug when creating track state for non measurement

---
 Core/include/Acts/EventData/MultiTrajectory.hpp | 2 +-
 Core/include/Acts/Fitter/KalmanFitter.hpp       | 9 ++++++---
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/Core/include/Acts/EventData/MultiTrajectory.hpp b/Core/include/Acts/EventData/MultiTrajectory.hpp
index 27e4305bc..f290c1029 100644
--- a/Core/include/Acts/EventData/MultiTrajectory.hpp
+++ b/Core/include/Acts/EventData/MultiTrajectory.hpp
@@ -108,7 +108,7 @@ struct IndexData {
 
   double chi2;
   double pathLength;
-  std::bitset<TrackStateFlag::NumTrackStateFlags> typeFlags;
+  TrackStateType typeFlags;
 
   IndexType iuncalibrated = kInvalid;
   IndexType icalibrated = kInvalid;
diff --git a/Core/include/Acts/Fitter/KalmanFitter.hpp b/Core/include/Acts/Fitter/KalmanFitter.hpp
index d3e601c7f..42d477847 100644
--- a/Core/include/Acts/Fitter/KalmanFitter.hpp
+++ b/Core/include/Acts/Fitter/KalmanFitter.hpp
@@ -396,10 +396,13 @@ class KalmanFitter {
         // We count the processed state
         ++result.processedStates;
       } else {
-        // add a full TrackState entry multi trajectory
-        // (this allocates storage for all components, we will set them later)
+        // add a non-measurement TrackState entry multi trajectory
+        // (this allocates storage for components except measurements, we will
+        // set them later)
         result.trackTip = result.fittedStates.addTrackState(
-            TrackStatePropMask::All, result.trackTip);
+            ~(TrackStatePropMask::Uncalibrated |
+              TrackStatePropMask::Calibrated),
+            result.trackTip);
 
         // now get track state proxy back
         auto trackStateProxy =
-- 
GitLab