Skip to content

Commit

Permalink
Merge branch 'main' into greedy-ambiguity-resolution-performance
Browse files Browse the repository at this point in the history
  • Loading branch information
SylvainJoube authored Feb 23, 2024
2 parents b3f8cf2 + 3d8daab commit ffa542e
Showing 1 changed file with 50 additions and 9 deletions.
59 changes: 50 additions & 9 deletions core/include/traccc/edm/track_state.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,26 @@ struct track_state {
"The measurement dimension should be 1 or 2");

matrix_type<D, 1> ret;
matrix_operator().element(ret, 0, 0) = m_measurement.local[0];
if constexpr (D == 2u) {
matrix_operator().element(ret, 1, 0) = m_measurement.local[1];
if (m_measurement.subs.get_indices()[0] == e_bound_loc0) {
matrix_operator().element(ret, 0, 0) = m_measurement.local[0];
if constexpr (D == 2u) {
matrix_operator().element(ret, 1, 0) = m_measurement.local[1];
}
} else if (m_measurement.subs.get_indices()[0] == e_bound_loc1) {
matrix_operator().element(ret, 0, 0) = m_measurement.local[1];
if constexpr (D == 2u) {
matrix_operator().element(ret, 1, 0) = m_measurement.local[0];
}
} else {
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 All @@ -91,11 +107,36 @@ struct track_state {
"The measurement dimension should be 1 or 2");

matrix_type<D, D> ret;
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];
if (m_measurement.subs.get_indices()[0] == e_bound_loc0) {

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];
}

} else if (m_measurement.subs.get_indices()[0] == e_bound_loc1) {

matrix_operator().element(ret, 0, 0) = m_measurement.variance[1];
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[0];
}
} else {
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 Expand Up @@ -176,4 +217,4 @@ using track_state_collection_types = collection_types<track_state<transform3>>;
using track_state_container_types =
container_types<fitting_result<transform3>, track_state<transform3>>;

} // namespace traccc
} // namespace traccc

0 comments on commit ffa542e

Please sign in to comment.