forked from acts-project/acts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Guarantee angle periodicity after KF filtering and smoothing (ac…
…ts-project#3684) I noticed a few cases where the angles escape their valid range after a KF update / smoothing. We can avoid that by normalizing the angles back to their range after update. In principle other params like local position and momentum are also constrained and might need checking+fixing but for those I am not sure how to do it right now.
- Loading branch information
1 parent
a429247
commit 4d840ba
Showing
5 changed files
with
63 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// This file is part of the ACTS project. | ||
// | ||
// Copyright (C) 2016 CERN for the benefit of the ACTS project | ||
// | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this | ||
// file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
||
#pragma once | ||
|
||
#include "Acts/Definitions/Algebra.hpp" | ||
#include "Acts/Definitions/TrackParametrization.hpp" | ||
#include "Acts/Utilities/detail/periodic.hpp" | ||
|
||
namespace Acts { | ||
|
||
/// Normalize the bound parameter angles | ||
/// | ||
/// @param boundParams The bound parameters to normalize | ||
/// | ||
/// @return The normalized bound parameters | ||
inline BoundVector normalizeBoundParameters(const BoundVector& boundParams) { | ||
BoundVector result = boundParams; | ||
std::tie(result[eBoundPhi], result[eBoundTheta]) = | ||
detail::normalizePhiTheta(result[eBoundPhi], result[eBoundTheta]); | ||
return result; | ||
} | ||
|
||
/// Subtract bound parameters and take care of angle periodicity for phi and | ||
/// theta. | ||
/// | ||
/// @param lhs The left hand side bound parameters | ||
/// @param rhs The right hand side bound parameters | ||
/// | ||
/// @return The difference of the bound parameters | ||
inline BoundVector subtractBoundParameters(const BoundVector& lhs, | ||
const BoundVector& rhs) { | ||
BoundVector result = lhs - rhs; | ||
result[eBoundPhi] = | ||
detail::difference_periodic(lhs[eBoundPhi], rhs[eBoundPhi], 2 * M_PI); | ||
return result; | ||
} | ||
|
||
} // namespace Acts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters