Skip to content
Snippets Groups Projects
Commit 8e3e1565 authored by Xiaocong Ai's avatar Xiaocong Ai
Browse files

Add a new type of KalmanFitterError: no states created at all

parent 3b7b5216
No related branches found
No related tags found
1 merge request!706Kf with nested material interaction
...@@ -653,6 +653,12 @@ class KalmanFitter { ...@@ -653,6 +653,12 @@ class KalmanFitter {
/// Get the result of the fit /// Get the result of the fit
auto kalmanResult = propRes.template get<KalmanResult>(); auto kalmanResult = propRes.template get<KalmanResult>();
/// It could happen that the fit ends in zero processed states.
/// The result gets meaningless so such case is regarded as fit failure.
if (kalmanResult.result.ok() and not kalmanResult.processedStates) {
kalmanResult.result = Result<void>(KalmanFitterError::PropagationInVain);
}
if (!kalmanResult.result.ok()) { if (!kalmanResult.result.ok()) {
return kalmanResult.result.error(); return kalmanResult.result.error();
} }
...@@ -736,6 +742,12 @@ class KalmanFitter { ...@@ -736,6 +742,12 @@ class KalmanFitter {
/// Get the result of the fit /// Get the result of the fit
auto kalmanResult = propRes.template get<KalmanResult>(); auto kalmanResult = propRes.template get<KalmanResult>();
/// It could happen that the fit ends in zero processed states.
/// The result gets meaningless so such case is regarded as fit failure.
if (kalmanResult.result.ok() and not kalmanResult.processedStates) {
kalmanResult.result = Result<void>(KalmanFitterError::PropagationInVain);
}
if (!kalmanResult.result.ok()) { if (!kalmanResult.result.ok()) {
return kalmanResult.result.error(); return kalmanResult.result.error();
} }
......
...@@ -17,7 +17,8 @@ namespace Acts { ...@@ -17,7 +17,8 @@ namespace Acts {
enum class KalmanFitterError { enum class KalmanFitterError {
UpdateFailed = 1, UpdateFailed = 1,
SmoothFailed = 2, SmoothFailed = 2,
OutputConversionFailed = 3 OutputConversionFailed = 3,
PropagationInVain = 4
}; };
namespace detail { namespace detail {
...@@ -35,6 +36,8 @@ class KalmanFitterErrorCategory : public std::error_category { ...@@ -35,6 +36,8 @@ class KalmanFitterErrorCategory : public std::error_category {
return "Kalman smooth failed"; return "Kalman smooth failed";
case KalmanFitterError::OutputConversionFailed: case KalmanFitterError::OutputConversionFailed:
return "Kalman output conversion failed"; return "Kalman output conversion failed";
case KalmanFitterError::PropagationInVain:
return "No detector observed during the propagation";
default: default:
return "unknown"; return "unknown";
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment