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

refactor: comment and unify the creation and filling of trackStateProxy (KF) #2499

Merged
merged 13 commits into from
Oct 25, 2023

Conversation

AJPfleger
Copy link
Contributor

@AJPfleger AJPfleger commented Oct 2, 2023

Makes the generation and filling of the trackStateProxy, look the same at all places, where it occurs. I tried to make it more readable by updating the comments and adding more scopes for temporary variables that are used for the filling.

This should make it more easy to understand what's going on for the next user, because now it is clearer that we are:

  1. generating a trackstate
  2. fetching values from the propagation
  3. filling them in
  4. adding flags

@github-actions github-actions bot added Component - Core Affects the Core module Track Fitting labels Oct 2, 2023
@codecov
Copy link

codecov bot commented Oct 2, 2023

Codecov Report

Merging #2499 (f6085fe) into main (b4be75f) will increase coverage by 0.00%.
The diff coverage is 20.63%.

@@           Coverage Diff           @@
##             main    #2499   +/-   ##
=======================================
  Coverage   49.60%   49.60%           
=======================================
  Files         471      471           
  Lines       26687    26695    +8     
  Branches    12280    12284    +4     
=======================================
+ Hits        13238    13242    +4     
  Misses       4747     4747           
- Partials     8702     8706    +4     
Files Coverage Δ
Core/include/Acts/EventData/TrackStatePropMask.hpp 100.00% <ø> (ø)
Core/include/Acts/TrackFitting/KalmanFitter.hpp 42.47% <25.00%> (+0.08%) ⬆️
...e/Acts/TrackFitting/detail/KalmanUpdateHelpers.hpp 20.96% <19.14%> (+2.00%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@paulgessinger paulgessinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To me this seems like it makes it less readable and harder to follow, also because you lose the comments in between.

But ok if you feel like this is unneeded repetition we can factorize it.

@AJPfleger AJPfleger changed the title refactor: unify trackStateProxy for Kalman [WIP] refactor: unify trackStateProxy for Kalman Oct 5, 2023
@AJPfleger AJPfleger changed the title [WIP] refactor: unify trackStateProxy for Kalman refactor: generalise and unify creation of trackStateProxy (KF, GX2F) Oct 5, 2023
@paulgessinger paulgessinger added this to the next milestone Oct 9, 2023
Copy link
Member

@paulgessinger paulgessinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still not convinced this is an improvement. I think we're trading 10 possibly duplicated lines for a function with a very complex signature that does complex logic just to factorize.

Core/include/Acts/TrackFitting/detail/FitterHelpers.hpp Outdated Show resolved Hide resolved
Core/include/Acts/TrackFitting/detail/FitterHelpers.hpp Outdated Show resolved Hide resolved
Copy link
Contributor

@andiwand andiwand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to me this looks a bit like an over generalization. at least with the current code I do not see a big improvement. do you see this making a difference in the GX2F impl or an application on the GSF?

Core/include/Acts/TrackFitting/detail/FitterHelpers.hpp Outdated Show resolved Hide resolved
@AJPfleger AJPfleger changed the title refactor: generalise and unify creation of trackStateProxy (KF, GX2F) [WIP] refactor: generalise and unify creation of trackStateProxy (KF, GX2F) Oct 11, 2023
@AJPfleger AJPfleger changed the title [WIP] refactor: generalise and unify creation of trackStateProxy (KF, GX2F) refactor: comment and unify the creation and filling of trackStateProxy (KF) Oct 11, 2023
@AJPfleger
Copy link
Contributor Author

I see that an extra function might be overshooting the purpose.
I still would like to adapt the order line order, since I got always confused when getting to those sections, just to find out, that they are doing the same thing.

Could you have a look again? @paulgessinger @andiwand

@AJPfleger
Copy link
Contributor Author

AJPfleger commented Oct 11, 2023

We always check for the covariance before setting it. Is there in all 3 cases a chance, that it is missing?

At least from the unitTests I understood, that it is not necessary to check.

if (boundParams.covariance().has_value()) {
  trackStateProxy.predictedCovariance() =
      std::move(*boundParams.covariance());
}

@kodiakhq kodiakhq bot merged commit e0d26d8 into acts-project:main Oct 25, 2023
@paulgessinger paulgessinger modified the milestones: next, v30.3.0 Oct 25, 2023
@acts-project-service acts-project-service added the Fails Athena tests This PR causes a failure in the Athena tests label Oct 25, 2023
@paulgessinger paulgessinger removed the Fails Athena tests This PR causes a failure in the Athena tests label Oct 29, 2023
@AJPfleger AJPfleger deleted the kalman-refactor branch November 9, 2023 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants