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: Deduplicate some code in SingleBoundTrackParameters #2104

Merged

Conversation

andiwand
Copy link
Contributor

@andiwand andiwand commented May 6, 2023

  • deduplicate some code
  • add local param accessor

@andiwand andiwand added the Component - Core Affects the Core module label May 6, 2023
@andiwand andiwand added this to the next milestone May 6, 2023
@codecov
Copy link

codecov bot commented May 6, 2023

Codecov Report

Merging #2104 (a76acd2) into main (9bafb2f) will increase coverage by 0.01%.
The diff coverage is 25.00%.

@@            Coverage Diff             @@
##             main    #2104      +/-   ##
==========================================
+ Coverage   49.41%   49.43%   +0.01%     
==========================================
  Files         434      434              
  Lines       24985    24981       -4     
  Branches    11522    11515       -7     
==========================================
+ Hits        12347    12350       +3     
  Misses       4486     4486              
+ Partials     8152     8145       -7     
Impacted Files Coverage Δ
...lude/Acts/EventData/SingleBoundTrackParameters.hpp 65.38% <25.00%> (+6.84%) ⬆️

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

@github-actions
Copy link

github-actions bot commented May 6, 2023

📊 Physics performance monitoring for a76acd2

Full report
Seeding: seeded, truth estimated, orthogonal
CKF: seeded, truth smeared, truth estimated, orthogonal
IVF: seeded, truth smeared, truth estimated, orthogonal
Ambiguity resolution: seeded, orthogonal
Truth tracking
Truth tracking (GSF)

Vertexing

Vertexing vs. mu
IVF seeded

IVF truth_smeared

IVF truth_estimated

IVF orthogonal

Seeding

Seeding seeded

Seeding truth_estimated

Seeding orthogonal

CKF

CKF seeded

CKF truth_smeared

CKF truth_estimated

CKF orthogonal

Ambiguity resolution

seeded

Truth tracking (Kalman Filter)

Truth tracking

Truth tracking (GSF)

Truth tracking

@@ -168,6 +168,8 @@ class SingleBoundTrackParameters {
return m_params[kIndex];
}

/// Local spatial position two-vector.
Vector2 localPosition() const { return m_params.head<2>(); }
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Vector2 localPosition() const { return m_params.head<2>(); }
Vector2 localPosition() const { return m_params.segment<2>(eBoundLoc0); }

for consistency maybe?

Copy link
Member

Choose a reason for hiding this comment

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

Isn't .head<2>() preferable because it knows the offset at compile time?

Copy link
Member

Choose a reason for hiding this comment

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

Hmm since eBoundLoc0 is a compile time constant, I would expect the compiler to be able to optimize this, but not sure of course.
However, isn't it kind of our style to use these enum-values? https://acts.readthedocs.io/en/latest/codeguide.html#a-indices-always-use-enum-values-to-access-vector-matrix-components

Copy link
Member

Choose a reason for hiding this comment

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

I guess so, but you're making the assumption that eLoc0 and eLoc1 are consecutive in any case.

Copy link
Member

Choose a reason for hiding this comment

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

Thats true, we could also enforce this in TrackParameterization.hpp similar to the free coordinates I think...

Co-authored-by: Benjamin Huth <37871400+benjaminhuth@users.noreply.github.com>
@andiwand andiwand changed the title refactor: deduplicate some code in SingleBoundTrackParameters refactor: Deduplicate some code in SingleBoundTrackParameters May 10, 2023
@kodiakhq kodiakhq bot merged commit 42058fd into acts-project:main May 10, 2023
@andiwand andiwand deleted the refactor-single-bound-track-param-dedup branch May 10, 2023 08:41
@paulgessinger paulgessinger modified the milestones: next, v26.0.0 May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component - Core Affects the Core module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants