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!: Refactored SeedFinder to avoid the need to recreate it for every event #1693

Conversation

tboldagh
Copy link
Contributor

@tboldagh tboldagh commented Nov 24, 2022

This PR is a technical refactor of the SeedFinder so that it does not need to be reinstantiated in every event.
Instead it would be made only once, properly configured and then only its
createSeedsForGroup called for events.

BREAKING CHANGE
The arguments to SeedFinder constructor have changed and the arguments needed when calling it's main method.

On the way, the SeedFinderConfig object was slimmed from those quantities that can't be filled w/o knowledge about the event (i.e. B field). Python binding for those properties that are overwritten anayways: highland and maxScatteringAngle2, pTPerHelixRadius, minHelixDiameter2 and pT2perRadius are removed. @LuisFelipeCoelho - please check me on this.

Tested on standalone ODD full chain. It is marginally faster now.

The OrthogonalSeedFinder should be likely refactored in the same way? For later PR.
It addresses issue #1690 (not closing it)

@tboldagh tboldagh added this to the next milestone Nov 24, 2022
@tboldagh tboldagh added Improvement Changes to an existing feature Component - Core Affects the Core module labels Nov 24, 2022
@codecov
Copy link

codecov bot commented Nov 24, 2022

Codecov Report

Merging #1693 (b556a13) into main (7414845) will increase coverage by 0.09%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main    #1693      +/-   ##
==========================================
+ Coverage   49.19%   49.29%   +0.09%     
==========================================
  Files         398      395       -3     
  Lines       21852    21809      -43     
  Branches     9917     9925       +8     
==========================================
  Hits        10751    10751              
+ Misses       4222     4179      -43     
  Partials     6879     6879              
Impacted Files Coverage Δ
Core/include/Acts/Seeding/BinnedSPGroup.ipp 0.00% <0.00%> (ø)
Core/include/Acts/Seeding/SeedFilter.ipp 0.00% <0.00%> (ø)
Core/include/Acts/Seeding/SeedFinder.hpp 0.00% <0.00%> (ø)
Core/include/Acts/Seeding/SeedFinder.ipp 0.00% <0.00%> (ø)
Core/include/Acts/Seeding/SpacePointGrid.ipp 0.00% <0.00%> (ø)
Core/include/Acts/Seeding/SeedFilterConfig.hpp
Core/include/Acts/Seeding/SeedFinderConfig.hpp
Core/include/Acts/Seeding/SpacePointGrid.hpp

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

@github-actions
Copy link

github-actions bot commented Nov 24, 2022

📊 Physics performance monitoring for b556a13

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

Copy link
Member

@LuisFelipeCoelho LuisFelipeCoelho left a comment

Choose a reason for hiding this comment

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

Thank you for this PR!
From the monitoring plots it appears that it leads to a loss of efficiency. Probably a small error that we want to understand.

I agree that the OrthogonalSeedFinder should be refactored in the same way (in another PR if you prefer)

Core/include/Acts/Seeding/SeedFinder.ipp Outdated Show resolved Hide resolved
@LuisFelipeCoelho
Copy link
Member

LuisFelipeCoelho commented Nov 25, 2022

I also agree that we should remove from the python binding the parameters that are overwritten: highland and maxScatteringAngle2, pTPerHelixRadius, minHelixDiameter2 and pT2perRadius

Copy link
Member

@LuisFelipeCoelho LuisFelipeCoelho left a comment

Choose a reason for hiding this comment

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

Thank you for these really nice changes.
clang_tidy is complaining about something, but apart from that I think this can go in.

@tboldagh
Copy link
Contributor Author

tboldagh commented Dec 6, 2022

Thank you for these really nice changes.
clang_tidy is complaining about something, but apart from that I think this can go in.

Thanks. There is one thing I am unsure about. That is the protections agains units conversion are aimplemented following ACTS sprit. I.e. there are exceptions now, but in principle they can be avoided i.e. toInternalUnits could become no-op method if config is in internal units already.

@LuisFelipeCoelho
Copy link
Member

@tboldagh I am not sure why we have two different units. The units from the config are mostly the same as in Athena configuration, if we change it it could be a bit confusing, but I don't have a strong opinion about that. Maybe we could discuss that in the meeting

@tboldagh
Copy link
Contributor Author

Thank you for these really nice changes.
clang_tidy is complaining about something, but apart from that I think this can go in.

It seems that all stuff is sorted out. Can you approve this PR. I think this is needed to move forward.

@kodiakhq kodiakhq bot merged commit 0590e9d into acts-project:main Dec 14, 2022
@paulgessinger paulgessinger modified the milestones: next, v22.0.0 Dec 21, 2022
CarloVarni pushed a commit to CarloVarni/acts that referenced this pull request Dec 22, 2022
… every event (acts-project#1693)

This PR is a technical refactor of the SeedFinder so that it does not need to be reinstantiated in every event. 
Instead it would be made only once, properly configured and then only its 
`createSeedsForGroup` called for events. 

BREAKING CHANGE
The arguments to SeedFinder constructor have changed and the arguments needed when calling it's main method. 

On the way, the SeedFinderConfig object was slimmed from those quantities that can't be filled w/o knowledge about the event (i.e. B field). Python binding for those properties that are overwritten anayways: `highland` and `maxScatteringAngle2`, `pTPerHelixRadius`, `minHelixDiameter2` and  `pT2perRadius` are removed.  @LuisFelipeCoelho - please check me on this.

Tested on standalone ODD full chain. It is marginally faster now. 

The OrthogonalSeedFinder should be likely refactored in the same way? For later PR. 
It addresses issue acts-project#1690 (not closing it)
kodiakhq bot pushed a commit that referenced this pull request Jan 18, 2023
…ct (#1757)

This PR applies similar changes to these in #1693 . As a result the SeedFinderOrthogonal does not need to be recreated for every event. 

Closes #1690

BREAKING CHANGE 
Method to crate OthogonalSeedFinder and createSeeds are modified. The former does not take SeedOptions while the later does now.
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 Improvement Changes to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants