Skip to content

Commit

Permalink
avoid error messages of uninitialized use of matrices
Browse files Browse the repository at this point in the history
  • Loading branch information
Shima Shimizu committed Feb 22, 2024
1 parent 9e11796 commit fec868d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions core/include/traccc/edm/track_state.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ struct track_state {
assert(
"The measurement index out of e_bound_loc0 and e_bound_loc1 "
"should not happen.");
matrix_operator().element(ret, 0, 0) = m_measurement.local[0];
if constexpr (D == 2u) {
matrix_operator().element(ret, 1, 0) = m_measurement.local[1];
}
}

return ret;
Expand Down Expand Up @@ -126,6 +130,13 @@ struct track_state {
assert(
"The measurement index out of e_bound_loc0 and e_bound_loc1 "
"should not happen.");
matrix_operator().element(ret, 0, 0) = m_measurement.variance[0];
if constexpr (D == 2u) {
matrix_operator().element(ret, 0, 1) = 0.f;
matrix_operator().element(ret, 1, 0) = 0.f;
matrix_operator().element(ret, 1, 1) =
m_measurement.variance[1];
}
}
return ret;
}
Expand Down

0 comments on commit fec868d

Please sign in to comment.