Skip to content
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

Check if all tracks are successfully fitted in the tests #889

Merged
merged 1 commit into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/common/tests/kalman_fitting_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ void KalmanFittingTests::ndf_tests(

for (const auto& state : track_states_per_track) {

if (!state.is_hole) {
if (!state.is_hole && state.is_smoothed) {

dim_sum += static_cast<scalar>(state.get_measurement().meas_dim);
n_effective_states++;
Expand Down
2 changes: 2 additions & 0 deletions tests/cpu/test_ckf_sparse_tracks_telescope.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,10 @@ TEST_P(CkfSparseTrackTelescopeTests, Run) {
// Run fitting
auto track_states =
host_fitting(host_det, field, traccc::get_data(track_candidates));
const std::size_t n_fitted_tracks = count_fitted_tracks(track_states);

ASSERT_EQ(track_states.size(), n_truth_tracks);
ASSERT_EQ(track_states.size(), n_fitted_tracks);

for (unsigned int i_trk = 0; i_trk < n_truth_tracks; i_trk++) {

Expand Down
2 changes: 2 additions & 0 deletions tests/cpu/test_kalman_fitter_momentum_resolution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,11 @@ TEST_P(KalmanFittingMomentumResolutionTests, Run) {

// Iterator over tracks
const std::size_t n_tracks = track_states.size();
const std::size_t n_fitted_tracks = count_fitted_tracks(track_states);

// n_trakcs = 100
ASSERT_EQ(n_tracks, n_truth_tracks);
ASSERT_EQ(n_tracks, n_fitted_tracks);

for (std::size_t i_trk = 0; i_trk < n_tracks; i_trk++) {

Expand Down
2 changes: 2 additions & 0 deletions tests/cpu/test_kalman_fitter_telescope.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,11 @@ TEST_P(KalmanFittingTelescopeTests, Run) {

// Iterator over tracks
const std::size_t n_tracks = track_states.size();
const std::size_t n_fitted_tracks = count_fitted_tracks(track_states);

// n_trakcs = 100
ASSERT_EQ(n_tracks, n_truth_tracks);
ASSERT_EQ(n_tracks, n_fitted_tracks);

for (std::size_t i_trk = 0; i_trk < n_tracks; i_trk++) {

Expand Down
2 changes: 2 additions & 0 deletions tests/cpu/test_kalman_fitter_wire_chamber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ TEST_P(KalmanFittingWireChamberTests, Run) {
const std::size_t n_tracks = track_states.size();
ASSERT_GE(static_cast<float>(n_tracks),
static_cast<float>(n_truth_tracks) * 0.95);
const std::size_t n_fitted_tracks = count_fitted_tracks(track_states);
ASSERT_EQ(n_tracks, n_fitted_tracks);

for (std::size_t i_trk = 0; i_trk < n_tracks; i_trk++) {

Expand Down
3 changes: 3 additions & 0 deletions tests/cuda/test_kalman_fitter_telescope.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,11 @@ TEST_P(KalmanFittingTelescopeTests, Run) {

traccc::track_state_container_types::host track_states_cuda =
track_state_d2h(track_states_cuda_buffer);
const std::size_t n_fitted_tracks =
count_fitted_tracks(track_states_cuda);

ASSERT_EQ(track_states_cuda.size(), n_truth_tracks);
ASSERT_EQ(track_states_cuda.size(), n_fitted_tracks);

for (std::size_t i_trk = 0; i_trk < n_truth_tracks; i_trk++) {

Expand Down
3 changes: 3 additions & 0 deletions tests/sycl/test_kalman_fitter_telescope.sycl
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,11 @@ TEST_P(KalmanFittingTelescopeTests, Run) {

traccc::track_state_container_types::host track_states_sycl =
track_state_d2h(track_states_sycl_buffer);
const std::size_t n_fitted_tracks =
count_fitted_tracks(track_states_sycl);

ASSERT_EQ(track_states_sycl.size(), n_truth_tracks);
ASSERT_EQ(track_states_sycl.size(), n_fitted_tracks);

for (std::size_t i_trk = 0; i_trk < n_truth_tracks; i_trk++) {

Expand Down
Loading