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!: Particle hypothesis for track parameters #2181

Conversation

andiwand
Copy link
Contributor

@andiwand andiwand commented Jun 6, 2023

In this PR I make the particle hypothesis part of the track parameters. This allows us to consistently use the same hypothesis across various parts of our code. Before that the particle hypothesis was a bit scattered in the propagator and stepper.

  • TrackParameters gain ParticleHypothesis
  • ParticleHypothesis is a new class which holds a charge type, the mass and the absolute PDG value
    • This interface is consistently used to get the charge or momenta from qOverP or vice versa
  • Single*TrackParameters are renamed and typedefed in TrackParameters.hpp
    • The templated TrackParameters implementations are now called Generic*TrackParameters
  • I aligned absoluteMomentum, direction, momentum in the steppers, truth particles and track parameters

alternative to #2178

@andiwand
Copy link
Contributor Author

2023-06-18T10:53:09.4149100Z The following tests FAILED:
2023-06-18T10:53:09.4149417Z 	 27 - Charge (Failed)
2023-06-18T10:53:09.4149733Z 	 28 - CurvilinearTrackParameters (Failed)
2023-06-18T10:53:09.4150015Z 	 37 - Track (Failed)
2023-06-18T10:53:09.4150269Z 	 91 - Interactions (Failed)
2023-06-18T10:53:09.4150546Z 	122 - EingenStepper (Failed)
2023-06-18T10:53:09.4150853Z 	155 - CombinatorialKalmanFilter (Failed)
2023-06-18T10:53:09.4151196Z 	158 - KalmanFitter (Failed)
2023-06-18T10:53:09.4154127Z 	159 - Gsf (Failed)
2023-06-18T10:53:09.4154388Z 	162 - Chi2Fitter (Failed)
2023-06-18T10:53:09.4154675Z 	200 - ImpactPointEstimator (Failed)
2023-06-18T10:53:09.4158101Z Errors while running CTest
2023-06-18T10:53:09.4158605Z 	213 - EventDataView3D (Failed)
2023-06-18T10:53:09.4161257Z 	265 - ConvertTrackEDM4hep (Failed)
2023-06-18T10:53:09.4161737Z 	266 - Alignment (Failed)

@github-actions github-actions bot added Infrastructure Changes to build tools, continous integration, ... and removed Infrastructure Changes to build tools, continous integration, ... labels Jun 19, 2023
@codecov
Copy link

codecov bot commented Jun 19, 2023

Codecov Report

Merging #2181 (d42a8b5) into main (60bb598) will increase coverage by 0.25%.
The diff coverage is 63.65%.

❗ Current head d42a8b5 differs from pull request most recent head e7a7c2e. Consider uploading reports for the commit e7a7c2e to get more accurate results

@@            Coverage Diff             @@
##             main    #2181      +/-   ##
==========================================
+ Coverage   49.26%   49.52%   +0.25%     
==========================================
  Files         449      447       -2     
  Lines       25403    25293     -110     
  Branches    11723    11620     -103     
==========================================
+ Hits        12516    12527      +11     
+ Misses       4554     4513      -41     
+ Partials     8333     8253      -80     
Impacted Files Coverage Δ
Core/include/Acts/EventData/TrackContainer.hpp 89.04% <ø> (ø)
Core/include/Acts/EventData/TrackProxy.hpp 78.70% <ø> (ø)
...re/include/Acts/EventData/VectorTrackContainer.hpp 49.03% <0.00%> (-1.97%) ⬇️
Core/include/Acts/Navigation/NextNavigator.hpp 47.65% <0.00%> (ø)
...lude/Acts/Propagator/DenseEnvironmentExtension.hpp 100.00% <ø> (ø)
...ore/include/Acts/Propagator/MaterialInteractor.hpp 39.72% <0.00%> (ø)
.../include/Acts/Propagator/MultiEigenStepperLoop.ipp 40.62% <0.00%> (+1.56%) ⬆️
Core/include/Acts/Propagator/Propagator.hpp 92.68% <ø> (-0.66%) ⬇️
Core/include/Acts/Propagator/StandardAborters.hpp 71.73% <ø> (+3.11%) ⬆️
.../include/Acts/Propagator/detail/LoopProtection.hpp 42.10% <0.00%> (ø)
... and 47 more

... and 11 files with indirect coverage changes

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

@github-actions
Copy link

github-actions bot commented Jun 19, 2023

📊 Physics performance monitoring for e7a7c2e

Summary
Full report
Seeding: seeded, truth estimated, orthogonal
CKF: seeded, truth smeared, truth estimated, orthogonal
IVF: seeded, truth smeared, truth estimated, orthogonal
AMVF: 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

AMVF seeded

AMVF truth_smeared

AMVF truth_estimated

AMVF 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

Copy link
Member

@benjaminhuth benjaminhuth left a comment

Choose a reason for hiding this comment

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

I took a first round, didn't found anything critical, just a few comments! Great work!
I think I'll do a second round once the CI is green

Core/include/Acts/EventData/detail/Charge.hpp Outdated Show resolved Hide resolved
Core/include/Acts/EventData/detail/ParticleHypothesis.hpp Outdated Show resolved Hide resolved
Core/include/Acts/Utilities/detail/periodic.hpp Outdated Show resolved Hide resolved
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.

Ok, I looked through this until the point where GitHub stops auto-showing the diff anymore because too many files are touched.
I think in the future, it would be nice to separate the actual changes from the extra ones, so the PR stays reviewable.

return ParticleHypothesis<ChargeType>(pion().absPdg(), pion().mass(), absQ);
}

constexpr ParticleHypothesis(PdgParticle absPdg, float mass,
Copy link
Member

Choose a reason for hiding this comment

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

Should we make this private?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not sure - I feel like a user might want to add a particle we do not provide without writing their own particle hypothesis class and modified track parameters

Core/include/Acts/EventData/detail/ParticleHypothesis.hpp Outdated Show resolved Hide resolved
Core/include/Acts/EventData/detail/ParticleHypothesis.hpp Outdated Show resolved Hide resolved
/// Momentum accessor
///
/// @param state [in] The stepping state (thread-local cache)
Vector3 momentum(const State& state) const {
Copy link
Member

Choose a reason for hiding this comment

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

So momentum becomes absolute momentum and momentum is now the absolute momentum vector?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes I tried to align this with the methods we have in the track parameters

Core/include/Acts/EventData/detail/Charge.hpp Outdated Show resolved Hide resolved
Core/src/EventData/NeutralTrackParameters.cpp Outdated Show resolved Hide resolved
Examples/Io/EDM4hep/src/EDM4hepUtil.cpp Outdated Show resolved Hide resolved
@paulgessinger
Copy link
Member

I think before we can consider merging, we should discuss it in the meeting.

Also, I've been thinking about the downstream implications and support. Could we actually separate just the hypothesis changes from everything else?

I'm thinking that a lot of users will have a hard time adjusting to the particle hypothesis change, so if we cut a release right before merging we'd be able to backport changes for a while.

kodiakhq bot pushed a commit that referenced this pull request Jun 28, 2023
I would like to move `ParticleData` to `Core` so we have one central spot to get mass and charge for a PDG particle identifier.

This can the be utilized in #2181
kodiakhq bot pushed a commit that referenced this pull request Jun 30, 2023
…e interface (#2250)

Currently the `Surface` classes have `momentum` parameters which is misleading IMO as we do not care about the magnitude of that input. Here I try to improve things by renaming the occasions with `direction`.

I pulled these changes out of #2181.
kodiakhq bot pushed a commit that referenced this pull request Jun 30, 2023
With this PR I try to align the naming in the Stepper interface to `qOverP` and `absoluteMomentum` which is also my goal for the track parameters.

I pulled these changes out of #2181.
noemina pushed a commit to noemina/acts that referenced this pull request Jul 5, 2023
I would like to move `ParticleData` to `Core` so we have one central spot to get mass and charge for a PDG particle identifier.

This can the be utilized in acts-project#2181
@paulgessinger paulgessinger added the Breaking change This change breaks backwards compatibility label Jul 5, 2023
@paulgessinger paulgessinger modified the milestones: next, v28.0.0 Jul 5, 2023
@andiwand andiwand marked this pull request as draft July 6, 2023 12:08
kodiakhq bot pushed a commit that referenced this pull request Jul 8, 2023
I noticed that we are quite inconsistent with the use of `direction` and `unitDirection`. Personally I would opt for `direction` and have it as a unit vector implicitly.

Also, I changed `qop` to `qOverP` which I will also align for the Stepper and TrackParameter interfaces in follow-up PRs

I pulled these changes out of #2181.
@paulgessinger
Copy link
Member

We're ready to go for v28 now. Can you update the PR so we can merge it?

@andiwand
Copy link
Contributor Author

We're ready to go for v28 now. Can you update the PR so we can merge it?

I think this one is ready to be closed. I split it off into multiple PRs the ones we can merge next are

@andiwand andiwand closed this Jul 24, 2023
paulgessinger pushed a commit to paulgessinger/acts that referenced this pull request Jul 24, 2023
…s-project#2251)

I noticed that we are quite inconsistent with the use of `direction` and `unitDirection`. Personally I would opt for `direction` and have it as a unit vector implicitly.

Also, I changed `qop` to `qOverP` which I will also align for the Stepper and TrackParameter interfaces in follow-up PRs

I pulled these changes out of acts-project#2181.
kodiakhq bot pushed a commit that referenced this pull request Jul 27, 2023
…s` (#2269)

I am unhappy with the name `Single*TrackParameters` as it could refer to singly charged or single track. The track actually supports different kinds of charge hypothesis so I thought `Generic*TrackParameter` might fit better.

I also merged `NeutralTrackParameters` into `TrackParameters` and removed the external template instantiation as it could be a performance hit because it disables inlining.

Pulled these changes out of #2181
kodiakhq bot pushed a commit that referenced this pull request Jul 28, 2023
In this PR I introduce the concept of a particle hypothesis which will later be used by the track parameters.

I also refactored the Charge interface a bit. This is the foundation for upcoming refactor PRs for the particle hypothesis.

Pulled out from #2181.

Co-authored-by: Paul Gessinger <[email protected]>
@andiwand andiwand deleted the refactor-trackparam-particle-hypothesis branch September 18, 2023 16:17
kodiakhq bot pushed a commit that referenced this pull request Sep 18, 2023
In this PR I make the particle hypothesis part of the track parameters. This allows us to consistently use the same hypothesis across various parts of our code. Before that the particle hypothesis was a bit scattered in the propagator and stepper.

replaces #2181 after splitting it up

blocked by
- #2366
- #2396
- #2398
- #2397
AJPfleger pushed a commit to AJPfleger/acts that referenced this pull request Sep 29, 2023
In this PR I make the particle hypothesis part of the track parameters. This allows us to consistently use the same hypothesis across various parts of our code. Before that the particle hypothesis was a bit scattered in the propagator and stepper.

replaces acts-project#2181 after splitting it up

blocked by
- acts-project#2366
- acts-project#2396
- acts-project#2398
- acts-project#2397
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaking change This change breaks backwards compatibility Component - Core Affects the Core module Component - Examples Affects the Examples module Component - Fatras Affects the Fatras module Component - Plugins Affects one or more Plugins 🚧 WIP Work-in-progress Event Data Model Seeding SP formation Track Finding Track Fitting Vertexing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants