-
Notifications
You must be signed in to change notification settings - Fork 56
Track Fit/State SoA, main branch (2025.08.05.) #1112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
krasznaa
merged 11 commits into
acts-project:main
from
krasznaa:TrackStateSoA-main-20250730
Aug 18, 2025
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
14e8fab
Introduced an SoA EDM for the track fit in traccc::core.
krasznaa 9ca8243
Adapted traccc::device_common and traccc::cuda to the SoA track fit EDM.
krasznaa 4d01d5c
Adapted traccc::alpaka and traccc::sycl to the SoA track fit EDM.
krasznaa 4dbf225
Adapted the tests and benchmarks to the SoA track fit EDM.
krasznaa e35894e
Adapted the examples to the SoA track fit EDM.
krasznaa 5b6c301
Introduced track_candidates_container::device and track_fit_container…
krasznaa 70d1cb3
Moved "complex EDM operations" to helper functions.
krasznaa da0241c
Adjusted the host Kalman fit testing code a little.
krasznaa ac0386e
Reintroduce print_fitted_tracks_statistics(...).
krasznaa c20b01b
Small changes in the host fitting code.
krasznaa ca7c1a0
Made the plotting tool documentation more explicit.
krasznaa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,80 @@ | ||
| /** TRACCC library, part of the ACTS project (R&D line) | ||
| * | ||
| * (c) 2025 CERN for the benefit of the ACTS project | ||
| * | ||
| * Mozilla Public License Version 2.0 | ||
| */ | ||
|
|
||
| #pragma once | ||
|
|
||
| namespace traccc::edm { | ||
|
|
||
| template <detray::concepts::algebra algebra_t, std::integral size_t, size_t D> | ||
| TRACCC_HOST_DEVICE void get_measurement_local( | ||
| const measurement& meas, detray::dmatrix<algebra_t, D, 1>& pos) { | ||
|
|
||
| static_assert(((D == 1u) || (D == 2u)), | ||
| "The measurement dimension must be 1 or 2"); | ||
|
|
||
| assert((meas.subs.get_indices()[0] == e_bound_loc0) || | ||
| (meas.subs.get_indices()[0] == e_bound_loc1)); | ||
|
|
||
| const point2& local = meas.local; | ||
|
|
||
| switch (meas.subs.get_indices()[0]) { | ||
| case e_bound_loc0: | ||
| getter::element(pos, 0, 0) = local[0]; | ||
| if constexpr (D == 2u) { | ||
| getter::element(pos, 1, 0) = local[1]; | ||
| } | ||
| break; | ||
| case e_bound_loc1: | ||
| getter::element(pos, 0, 0) = local[1]; | ||
| if constexpr (D == 2u) { | ||
| getter::element(pos, 1, 0) = local[0]; | ||
| } | ||
| break; | ||
| default: | ||
| #if defined(__GNUC__) | ||
| __builtin_unreachable(); | ||
| #endif | ||
| } | ||
| } | ||
|
|
||
| template <detray::concepts::algebra algebra_t, std::integral size_t, size_t D> | ||
| TRACCC_HOST_DEVICE void get_measurement_covariance( | ||
| const measurement& meas, detray::dmatrix<algebra_t, D, D>& cov) { | ||
|
|
||
| static_assert(((D == 1u) || (D == 2u)), | ||
| "The measurement dimension must be 1 or 2"); | ||
|
|
||
| assert((meas.subs.get_indices()[0] == e_bound_loc0) || | ||
| (meas.subs.get_indices()[0] == e_bound_loc1)); | ||
|
|
||
| const variance2& variance = meas.variance; | ||
|
|
||
| switch (meas.subs.get_indices()[0]) { | ||
| case e_bound_loc0: | ||
| getter::element(cov, 0, 0) = variance[0]; | ||
| if constexpr (D == 2u) { | ||
| getter::element(cov, 0, 1) = 0.f; | ||
| getter::element(cov, 1, 0) = 0.f; | ||
| getter::element(cov, 1, 1) = variance[1]; | ||
| } | ||
| break; | ||
| case e_bound_loc1: | ||
| getter::element(cov, 0, 0) = variance[1]; | ||
| if constexpr (D == 2u) { | ||
| getter::element(cov, 0, 1) = 0.f; | ||
| getter::element(cov, 1, 0) = 0.f; | ||
| getter::element(cov, 1, 1) = variance[0]; | ||
| } | ||
| break; | ||
| default: | ||
| #if defined(__GNUC__) | ||
| __builtin_unreachable(); | ||
| #endif | ||
| } | ||
| } | ||
|
|
||
| } // namespace traccc::edm |
This file contains hidden or 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,21 @@ | ||
| /** TRACCC library, part of the ACTS project (R&D line) | ||
| * | ||
| * (c) 2022-2025 CERN for the benefit of the ACTS project | ||
| * | ||
| * Mozilla Public License Version 2.0 | ||
| */ | ||
|
|
||
| #pragma once | ||
|
|
||
| namespace traccc::edm { | ||
|
|
||
| template <typename BASE> | ||
| TRACCC_HOST_DEVICE void track_fit<BASE>::reset_quality() { | ||
|
|
||
| ndf() = {}; | ||
| chi2() = {}; | ||
| pval() = {}; | ||
| nholes() = {}; | ||
| } | ||
krasznaa marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| } // namespace traccc::edm | ||
This file contains hidden or 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 @@ | ||
| /** TRACCC library, part of the ACTS project (R&D line) | ||
| * | ||
| * (c) 2022-2025 CERN for the benefit of the ACTS project | ||
| * | ||
| * Mozilla Public License Version 2.0 | ||
| */ | ||
|
|
||
| #pragma once | ||
|
|
||
| namespace traccc::edm { | ||
|
|
||
| template <typename BASE> | ||
| TRACCC_HOST_DEVICE bool track_state<BASE>::is_hole() const { | ||
|
|
||
| return (state() & IS_HOLE_MASK); | ||
| } | ||
|
|
||
| template <typename BASE> | ||
| TRACCC_HOST_DEVICE void track_state<BASE>::set_hole(bool value) { | ||
|
|
||
| if (value) { | ||
| state() |= IS_HOLE_MASK; | ||
| } else { | ||
| state() &= ~IS_HOLE_MASK; | ||
| } | ||
| } | ||
|
|
||
| template <typename BASE> | ||
| TRACCC_HOST_DEVICE bool track_state<BASE>::is_smoothed() const { | ||
|
|
||
| return (state() & IS_SMOOTHED_MASK); | ||
| } | ||
|
|
||
| template <typename BASE> | ||
| TRACCC_HOST_DEVICE void track_state<BASE>::set_smoothed(bool value) { | ||
|
|
||
| if (value) { | ||
| state() |= IS_SMOOTHED_MASK; | ||
| } else { | ||
| state() &= ~IS_SMOOTHED_MASK; | ||
| } | ||
| } | ||
|
|
||
| } // namespace traccc::edm |
This file contains hidden or 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,39 @@ | ||
| /** TRACCC library, part of the ACTS project (R&D line) | ||
| * | ||
| * (c) 2025 CERN for the benefit of the ACTS project | ||
| * | ||
| * Mozilla Public License Version 2.0 | ||
| */ | ||
|
|
||
| #pragma once | ||
|
|
||
| namespace traccc::edm { | ||
|
|
||
| template <typename algebra_t> | ||
| TRACCC_HOST_DEVICE | ||
| typename track_state_collection<algebra_t>::device::object_type | ||
| make_track_state( | ||
| const measurement_collection_types::const_device& measurements, | ||
| unsigned int mindex) { | ||
|
|
||
| // Create the result object. | ||
| typename track_state_collection<algebra_t>::device::object_type state{ | ||
| track_state_collection<algebra_t>::device::object_type::IS_HOLE_MASK, | ||
| 0.f, | ||
| 0.f, | ||
| 0.f, | ||
| {}, | ||
| {}, | ||
| mindex}; | ||
|
|
||
| // Set the correct surface link for the track parameters. | ||
| state.filtered_params().set_surface_link( | ||
| measurements.at(mindex).surface_link); | ||
| state.smoothed_params().set_surface_link( | ||
| measurements.at(mindex).surface_link); | ||
|
|
||
| // Return the initialized state. | ||
| return state; | ||
| } | ||
|
|
||
| } // namespace traccc::edm |
This file contains hidden or 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,46 @@ | ||
| /** TRACCC library, part of the ACTS project (R&D line) | ||
| * | ||
| * (c) 2025 CERN for the benefit of the ACTS project | ||
| * | ||
| * Mozilla Public License Version 2.0 | ||
| */ | ||
|
|
||
| #pragma once | ||
|
|
||
| // Local include(s). | ||
| #include "traccc/definitions/primitives.hpp" | ||
| #include "traccc/definitions/qualifiers.hpp" | ||
| #include "traccc/edm/measurement.hpp" | ||
|
|
||
| namespace traccc::edm { | ||
|
|
||
| /// Get the local position of a measurement as a matrix | ||
| /// | ||
| /// @tparam algebra_t The algebra type used to describe the tracks | ||
| /// @tparam size_t The type of the matrix size variable | ||
| /// @tparam D The dimension of the matrix | ||
| /// | ||
| /// @param meas The measurement to extract the local position from | ||
| /// @param pos The matrix to fill with the local position of the measurement | ||
| /// | ||
| template <detray::concepts::algebra algebra_t, std::integral size_t, size_t D> | ||
| TRACCC_HOST_DEVICE void get_measurement_local( | ||
| const measurement& meas, detray::dmatrix<algebra_t, D, 1>& pos); | ||
|
|
||
| /// Get the covariance of a measurement as a matrix | ||
| /// | ||
| /// @tparam algebra_t The algebra type used to describe the tracks | ||
| /// @tparam size_t The type of the matrix size variable | ||
| /// @tparam D The dimension of the matrix | ||
| /// | ||
| /// @param meas The measurement to extract the covariance from | ||
| /// @param cov The matrix to fill with the covariance of the measurement | ||
| /// | ||
| template <detray::concepts::algebra algebra_t, std::integral size_t, size_t D> | ||
| TRACCC_HOST_DEVICE void get_measurement_covariance( | ||
| const measurement& meas, detray::dmatrix<algebra_t, D, D>& cov); | ||
|
|
||
| } // namespace traccc::edm | ||
|
|
||
| // Include the implementation. | ||
| #include "traccc/edm/impl/measurement_helpers.ipp" |
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.