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!: Remove now-obsolete property skipZMiddleBinSearch #2835

Merged
merged 31 commits into from
Jan 15, 2024

Conversation

CarloVarni
Copy link
Collaborator

@CarloVarni CarloVarni commented Dec 15, 2023

This needs #2718 to be in.

As quoted there: The grid iterator will be able to iterate on whatever sequence of bins you like.

In other words... for a usual seed finding process we have:

zBinsCustomLooping = [1, 2, 3, 4, 11, 10, 9, 8, 6, 5, 7]
but for fast tracking you can simply provide a shorter vector. For instance:

zBinsCustomLooping = [11, 10, 9, 8, 6, 5, 7]
much simpler imho.

@CarloVarni CarloVarni added the 🛑 blocked This item is blocked by another item label Dec 15, 2023
@CarloVarni CarloVarni added this to the next milestone Dec 15, 2023
@github-actions github-actions bot added the Component - Core Affects the Core module label Dec 15, 2023
@paulgessinger
Copy link
Member

Is this ready to review @CarloVarni?

@CarloVarni CarloVarni marked this pull request as ready for review December 17, 2023 09:00
@CarloVarni CarloVarni removed the 🛑 blocked This item is blocked by another item label Dec 17, 2023
@acts-project-service
Copy link
Collaborator

acts-project-service commented Dec 17, 2023

✅ Athena integration test results [242e3b3]

✅ All tests successful

status job report
🟢 run_unit_tests
🟢 run_ci_tests: ../athena/AtlasTest/CITest/test/ActsBenchmarkWithSpot.sh 8 100
🟢 run_ci_tests: ../athena/AtlasTest/CITest/test/ActsWorkflow.sh
🟢 run_ci_tests: ../athena/AtlasTest/CITest/test/ActsValidateAmbiguityResolution.sh
🟢 run_ci_tests: ../athena/AtlasTest/CITest/test/ActsValidateResolvedTracks.sh
🟢 run_ci_tests: ../athena/AtlasTest/CITest/test/ActsValidateTracks.sh
🟢 run_ci_tests: ../athena/AtlasTest/CITest/test/ActsValidateActsCoreSpacePoints.sh
🟢 run_ci_tests: ../athena/AtlasTest/CITest/test/ActsValidateActsSpacePoints.sh
🟢 run_ci_tests: ../athena/AtlasTest/CITest/test/ActsValidateSeeds.sh
🟢 run_ci_tests: ../athena/AtlasTest/CITest/test/ActsValidateOrthogonalSeeds.sh
🟢 run_ci_tests: ../athena/AtlasTest/CITest/test/ActsValidateClusters.sh
🟢 run_ci_tests: ../athena/AtlasTest/CITest/test/ActsPersistifyEDM.sh
🟢 run_ci_tests: ../athena/AtlasTest/CITest/test/ActsGSFRefitting.sh
🟢 run_ci_tests: ../athena/AtlasTest/CITest/test/ActsKfRefitting.sh
🟢 run_ci_tests: python3 ../athena/Tracking/Acts/ActsGeometry/test/ActsExtrapolationAlgTest.py
🟢 run_ci_tests: python3 ../athena/Tracking/Acts/ActsGeometry/test/ActsITkTest.py
🟢 run_workflow_tests_run4_mc
🟢 run_workflow_tests_run2_mc
🟢 run_workflow_tests_run2_data
🟢 run_workflow_tests_run3_mc
🟢 run_workflow_tests_run3_data
🟢 run_art_test: test_data18_13TeV_1000evt
🟢 run_art_test: test_ttbarPU40_reco

@CarloVarni
Copy link
Collaborator Author

forgot to ping you @paulgessinger . This is ready for review

@CarloVarni
Copy link
Collaborator Author

FYI this PR is marked as a breaking PR since it removes a configuration property from the seeding. However, Athena is not complaining since this configuration property is only used for Fast tracking, and we do not have yet an Athena-ACTS configuration for that.

@kodiakhq kodiakhq bot merged commit 242e3b3 into acts-project:main Jan 15, 2024
51 checks passed
@CarloVarni CarloVarni deleted the removeSkipProperty branch January 15, 2024 09:43
@acts-project-service acts-project-service added the Fails Athena tests This PR causes a failure in the Athena tests label Jan 15, 2024
kodiakhq bot pushed a commit that referenced this pull request Jan 16, 2024
This will complete the adaptation of the grid to an N-dimentional case. The user is now able to iterate on any axis as they like without the need to rotate their geometry. 

Next step is to see how the seed finding routine can be adapted to be more general

This PR is also a bug-fix since in the past we had:
```cpp
template <typename external_spacepoint_t>
boost::container::small_vector<std::size_t, 9>
Acts::BinFinder<external_spacepoint_t>::findBins(
    std::size_t phiBin, std::size_t zBin,
    const Acts::SpacePointGrid<external_spacepoint_t>* binnedSP) const {
  // if zBinNeighbors is not defined, get the indices using
  // neighborHoodIndices
  if (m_zBinNeighbors->empty()) {
    return binnedSP->neighborHoodIndices({phiBin, zBin}).collect();
  }
  // if the zBinNeighbors is defined, get the indices from there
  std::array<std::pair<int, int>, 2> sizePerAxis;
  sizePerAxis.at(0) = std::make_pair(-m_numPhiNeighbors, m_numPhiNeighbors);
  sizePerAxis.at(1) = (*m_zBinNeighbors)[zBin - 1];
  return binnedSP->neighborHoodIndices({phiBin, zBin}, sizePerAxis).collect();
}
```

In the case `m_zBinNeighbors` is empty, the code is instructed to search neighbours in the range `{-1, 1}` FOR EVERY AXIS (this is what `binnedSP->neighborHoodIndices({phiBin, zBin}).collect();` does), thus overwriting the value set by the user for `m_numPhiNeighbors`. 

Now, the axes are treated independently

This requires: #2835
kodiakhq bot pushed a commit that referenced this pull request Jan 18, 2024
A general class for defining a `BinnedGroup`. This class stores a `grid` (owns it), two `GridBinFinders` and a navigation pattern, optionally defined by the user. The PR also defines its iterator.

This will replace the current `BinnedSPGroup` implementation, which is very specific.

Also, creating and filling a grid cannot be generalized imho: variable definitions, selection cuts, number of axes and their ordering. As such, the creation and the filling of the grid are now handled externally, and not inside the `BinnedGroup` class, and it's the user's duty to make sure the filling happens.

In my mind, all of this should be handled by the user for any custom way of doing it. One thing we can provide (as we currently do but I'm afraid is more a "nice consequence" then a "design") some pre-defined grids for specific geometries. 
For instance we can define a `CylindricalSpacePointGrid<external_spacepoint_t>` (as well as `CylindricalBinnedGroup<external_spacepoint_t>`) or a `TelescopeSpacePointGrid<external_spacepoint_t>` (and its `TelescopeBinnedGroup<external_spacepoint_t>`). 

These last points are not covered here, will be addressed in another PR once this one is in. My idea is to define these "specialization" as simple `typedef`s of the above generic classes, as well as defining functions for their creation and filling. This can be located inside  a new `Acts/Seeding/detail` folder, so we can add as many specializations as possible.

Requires:
- #2838
- #2835
- #2839 (maybe optional?)
kodiakhq bot pushed a commit that referenced this pull request Jan 19, 2024
Follow up from #2854 

In this PR I am defining a grid geometry for a cylindrical experiment with (phi, z) bins. This is done in a specific file that is included in the GridSpacePoint file. Other specializations can then be easily added in the same fashion (e.g. a pre-defined grid for telescope geometry).

Requires: 
- #2838
- #2854
- #2835
@paulgessinger paulgessinger removed the Fails Athena tests This PR causes a failure in the Athena tests label Jan 23, 2024
LaraCalic pushed a commit to LaraCalic/acts that referenced this pull request Feb 10, 2024
…project#2835)

This needs acts-project#2718 to be in.

As quoted there: The grid iterator will be able to iterate on whatever sequence of bins you like.

In other words... for a usual seed finding process we have:

`zBinsCustomLooping = [1, 2, 3, 4, 11, 10, 9, 8, 6, 5, 7]`
but for fast tracking you can simply provide a shorter vector. For instance:

`zBinsCustomLooping = [11, 10, 9, 8, 6, 5, 7]`
much simpler imho.
LaraCalic pushed a commit to LaraCalic/acts that referenced this pull request Feb 10, 2024
This will complete the adaptation of the grid to an N-dimentional case. The user is now able to iterate on any axis as they like without the need to rotate their geometry. 

Next step is to see how the seed finding routine can be adapted to be more general

This PR is also a bug-fix since in the past we had:
```cpp
template <typename external_spacepoint_t>
boost::container::small_vector<std::size_t, 9>
Acts::BinFinder<external_spacepoint_t>::findBins(
    std::size_t phiBin, std::size_t zBin,
    const Acts::SpacePointGrid<external_spacepoint_t>* binnedSP) const {
  // if zBinNeighbors is not defined, get the indices using
  // neighborHoodIndices
  if (m_zBinNeighbors->empty()) {
    return binnedSP->neighborHoodIndices({phiBin, zBin}).collect();
  }
  // if the zBinNeighbors is defined, get the indices from there
  std::array<std::pair<int, int>, 2> sizePerAxis;
  sizePerAxis.at(0) = std::make_pair(-m_numPhiNeighbors, m_numPhiNeighbors);
  sizePerAxis.at(1) = (*m_zBinNeighbors)[zBin - 1];
  return binnedSP->neighborHoodIndices({phiBin, zBin}, sizePerAxis).collect();
}
```

In the case `m_zBinNeighbors` is empty, the code is instructed to search neighbours in the range `{-1, 1}` FOR EVERY AXIS (this is what `binnedSP->neighborHoodIndices({phiBin, zBin}).collect();` does), thus overwriting the value set by the user for `m_numPhiNeighbors`. 

Now, the axes are treated independently

This requires: acts-project#2835
LaraCalic pushed a commit to LaraCalic/acts that referenced this pull request Feb 10, 2024
A general class for defining a `BinnedGroup`. This class stores a `grid` (owns it), two `GridBinFinders` and a navigation pattern, optionally defined by the user. The PR also defines its iterator.

This will replace the current `BinnedSPGroup` implementation, which is very specific.

Also, creating and filling a grid cannot be generalized imho: variable definitions, selection cuts, number of axes and their ordering. As such, the creation and the filling of the grid are now handled externally, and not inside the `BinnedGroup` class, and it's the user's duty to make sure the filling happens.

In my mind, all of this should be handled by the user for any custom way of doing it. One thing we can provide (as we currently do but I'm afraid is more a "nice consequence" then a "design") some pre-defined grids for specific geometries. 
For instance we can define a `CylindricalSpacePointGrid<external_spacepoint_t>` (as well as `CylindricalBinnedGroup<external_spacepoint_t>`) or a `TelescopeSpacePointGrid<external_spacepoint_t>` (and its `TelescopeBinnedGroup<external_spacepoint_t>`). 

These last points are not covered here, will be addressed in another PR once this one is in. My idea is to define these "specialization" as simple `typedef`s of the above generic classes, as well as defining functions for their creation and filling. This can be located inside  a new `Acts/Seeding/detail` folder, so we can add as many specializations as possible.

Requires:
- acts-project#2838
- acts-project#2835
- acts-project#2839 (maybe optional?)
LaraCalic pushed a commit to LaraCalic/acts that referenced this pull request Feb 10, 2024
…#2858)

Follow up from acts-project#2854 

In this PR I am defining a grid geometry for a cylindrical experiment with (phi, z) bins. This is done in a specific file that is included in the GridSpacePoint file. Other specializations can then be easily added in the same fashion (e.g. a pre-defined grid for telescope geometry).

Requires: 
- acts-project#2838
- acts-project#2854
- acts-project#2835
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 Component - Examples Affects the Examples module Seeding
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants