Skip to content

Commit

Permalink
fix: Fix Kalman filter extrapolation after smoothing (#2470)
Browse files Browse the repository at this point in the history
KF and CKF are extrapolating from the last track state to the perigee. This can decrease the resolution drastically if that last state is a material state or hole (state without measurement).

Here I exclude these states and propagate from the last measurement to the perigee.

**old**
![old](https://github.com/acts-project/acts/assets/487211/3977b191-c2e2-4f74-a2f8-36b94cd11635)

**new**
![new](https://github.com/acts-project/acts/assets/487211/4f929459-a334-4e5c-8352-602deafe1290)
  • Loading branch information
andiwand authored Sep 23, 2023
1 parent 45e07d7 commit e34660a
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 8 deletions.
Binary file modified CI/physmon/reference/performance_amvf_truth_smeared_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_ivf_truth_smeared_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_truth_tracking.root
Binary file not shown.
Binary file modified CI/physmon/reference/tracksummary_ckf_orthogonal_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/tracksummary_ckf_seeded_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/tracksummary_ckf_truth_estimated_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/tracksummary_ckf_truth_smeared_hist.root
Binary file not shown.
7 changes: 5 additions & 2 deletions Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1150,8 +1150,11 @@ class CombinatorialKalmanFilter {
result.fittedStates->applyBackwards(lastMeasurementIndex, [&](auto st) {
bool isMeasurement =
st.typeFlags().test(TrackStateFlag::MeasurementFlag);
bool isMaterial = st.typeFlags().test(TrackStateFlag::MaterialFlag);
if (isMeasurement || isMaterial) {
bool isOutlier = st.typeFlags().test(TrackStateFlag::OutlierFlag);
// We are excluding non measurement states and outlier here. Those can
// decrease resolution because only the smoothing corrected the very
// first prediction as filtering is not possible.
if (isMeasurement && !isOutlier) {
firstStateIndex = st.index();
}
nStates++;
Expand Down
7 changes: 5 additions & 2 deletions Core/include/Acts/TrackFitting/KalmanFitter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -893,8 +893,11 @@ class KalmanFitter {
result.lastMeasurementIndex, [&](auto st) {
bool isMeasurement =
st.typeFlags().test(TrackStateFlag::MeasurementFlag);
bool isMaterial = st.typeFlags().test(TrackStateFlag::MaterialFlag);
if (isMeasurement || isMaterial) {
bool isOutlier = st.typeFlags().test(TrackStateFlag::OutlierFlag);
// We are excluding non measurement states and outlier here. Those
// can decrease resolution because only the smoothing corrected the
// very first prediction as filtering is not possible.
if (isMeasurement && !isOutlier) {
firstStateIndex = st.index();
}
nStates++;
Expand Down
8 changes: 4 additions & 4 deletions Examples/Python/tests/root_file_hashes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ test_itk_seeding__particles_initial.root: 88315e93ed4cb5d40a8721502048a9d1fc100e
test_propagation__propagation_steps.root: 174301b25784dbb881196b658f2d7f99c0a2ea688a0129e6110fc19aa5cf8e54
test_material_recording__geant4_material_tracks.root: e411152d370775463c22b19a351dfc7bfe40b51985e10a7c1a010aebde80715d
test_truth_tracking_kalman[generic-0.0]__trackstates_fitter.root: 0cdfeb13eaff45df38451820fcc15a7dfb40e55dab220e6e1d4d6f027ee8d4c8
test_truth_tracking_kalman[generic-0.0]__tracksummary_fitter.root: c893152e43fc76247d767292979a7acc61d693539620a7b6d3de5e9ce7945414
test_truth_tracking_kalman[generic-0.0]__tracksummary_fitter.root: 135ce6fbbe1789c56d42a834e148e6ce395c7425373989f8c03e6c32c989fe94
test_truth_tracking_kalman[generic-0.0]__performance_track_finder.root: ada9cda2ec3c648b144bdaa081d6eff923c80f3d484c4196006e847428cf67a8
test_truth_tracking_kalman[generic-1000.0]__trackstates_fitter.root: 5d54954ad21b8153b1788ccc296680a50969c761924f1c5db0600033d4577a3c
test_truth_tracking_kalman[generic-1000.0]__tracksummary_fitter.root: 3ecd6851e1633103b9ae20140aa8f6a5a27aecc777177cd83078ed292544d9ae
test_truth_tracking_kalman[generic-1000.0]__performance_track_finder.root: ada9cda2ec3c648b144bdaa081d6eff923c80f3d484c4196006e847428cf67a8
test_truth_tracking_kalman[odd-0.0]__trackstates_fitter.root: 7afa54c9f2c989e11236861b672e822f881443c5976dfcb65cebbab155280a83
test_truth_tracking_kalman[odd-0.0]__tracksummary_fitter.root: 08ed2bc87b5c8e6fa92104d4e1322f5c76755ada6a20899eed293dc5814b5c94
test_truth_tracking_kalman[odd-0.0]__tracksummary_fitter.root: 85cdf6aced8c7f7eb1c156d912f6be6a7ab1370b4c72955c0bd7b09095df9a60
test_truth_tracking_kalman[odd-0.0]__performance_track_finder.root: 39aec6316cceb90e314e16b02947faa691c18f57c3a851a25e547a8fc05a4593
test_truth_tracking_kalman[odd-1000.0]__trackstates_fitter.root: 04ec5361f32eae9151497c54d89c2a0b03a088050be7a37f521f65cd3abf85c8
test_truth_tracking_kalman[odd-1000.0]__tracksummary_fitter.root: 2a6de6dedd20acae66eef29649a0966f0b83ea00cee9475fbaaca696058b2525
Expand All @@ -56,15 +56,15 @@ test_ckf_tracks_example[generic-truth_estimated]__trackstates_ckf.root: 7dd654c2
test_ckf_tracks_example[generic-truth_estimated]__tracksummary_ckf.root: e9886b61af4934c1b2a825719ea69ec3b69b245927cb22d8cca5071612609fe5
test_ckf_tracks_example[generic-truth_estimated]__performance_seeding.root: 1facb05c066221f6361b61f015cdf0918e94d9f3fce2269ec7b6a4dffeb2bc7e
test_ckf_tracks_example[generic-truth_smeared]__trackstates_ckf.root: 0351e6e87bbda82c666e3580f8437fa9736f9d95ec4dd8658129bc73bb3fbf6c
test_ckf_tracks_example[generic-truth_smeared]__tracksummary_ckf.root: e72c400c9e7e9ca5f3612005254b6fa1cae070e86c533fc5487776e4120968a5
test_ckf_tracks_example[generic-truth_smeared]__tracksummary_ckf.root: 21eb776b8b6974543c0bfed6cdc18773a9f20629bed5d99154f2ded79a4297cd
test_ckf_tracks_example[odd-full_seeding]__trackstates_ckf.root: bf564fc788eed6e72791d4eac639bd439ba2e167554cee4edb6a6162cec22089
test_ckf_tracks_example[odd-full_seeding]__tracksummary_ckf.root: f107b73de07e5fb035c2a3e50b2d2928df77d7ce6579341bc5a227485972c878
test_ckf_tracks_example[odd-full_seeding]__performance_seeding_trees.root: 43c58577aafe07645e5660c4f43904efadf91d8cda45c5c04c248bbe0f59814f
test_ckf_tracks_example[odd-truth_estimated]__trackstates_ckf.root: 3defdfb49c4942e53e5cda8f2cd01475ce2bfe1b92b6745d83ea17d9c2ad535f
test_ckf_tracks_example[odd-truth_estimated]__tracksummary_ckf.root: b9a5e794e3d8c3c64426efb4abe2ce38e338de96f3de4f751b238b5ae1997189
test_ckf_tracks_example[odd-truth_estimated]__performance_seeding.root: 1a36b7017e59f1c08602ef3c2cb0483c51df248f112e3780c66594110719c575
test_ckf_tracks_example[odd-truth_smeared]__trackstates_ckf.root: d4b47a6c9621847be84a17a21fb929a050c49d0c7b3d944bf14fee365478609d
test_ckf_tracks_example[odd-truth_smeared]__tracksummary_ckf.root: 2c94035575fc222eff022368052b98c84d54f1b75e94681e794bd30282cc7146
test_ckf_tracks_example[odd-truth_smeared]__tracksummary_ckf.root: e01769e412c89fe73dac106465f2d6b13744da2d8e1b6d73edb8f91830024cd6
test_vertex_fitting_reading[Truth-False-100]__performance_vertexing.root: 76ef6084d758dfdfc0151ddec2170e12d73394424e3dac4ffe46f0f339ec8293
test_vertex_fitting_reading[Iterative-False-100]__performance_vertexing.root: 60372210c830a04f95ceb78c6c68a9b0de217746ff59e8e73053750c837b57eb
test_vertex_fitting_reading[Iterative-True-100]__performance_vertexing.root: e34f217d524a5051dbb04a811d3407df3ebe2cc4bb7f54f6bda0847dbd7b52c3
Expand Down

0 comments on commit e34660a

Please sign in to comment.