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

feat!: Updates to GBTS for Athena Implementation #3882

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

Rosie-Hasan
Copy link
Contributor

@Rosie-Hasan Rosie-Hasan commented Nov 20, 2024

Changes to GBTS seeding in Core and Examples needed to implement in Athena and make it work with any space point type.

--- END COMMIT MESSAGE ---
I have changed the space point class so I believe it will be breaking to Athena infrastructure (draft merge request of patch in canary)
And added infrastructure to use cluster width information, but this is disabled in the examples case
Also removed some unneeded parameters

Summary by CodeRabbit

Release Notes

  • New Features

    • Enhanced GbtsSP struct with new parameters for improved spatial information.
    • Streamlined access to space point properties in the SeedFinderGbts and GbtsTrackingFilter classes.
    • Added multiple new configuration classes for seed finding algorithms.
  • Bug Fixes

    • Corrected handling of Gbts_id assignment in geometry mapping.
  • Documentation

    • Updated parameter names for consistency across functions and classes.
  • Chores

    • Removed unnecessary dependencies and parameters to simplify configuration interfaces.

Copy link

coderabbitai bot commented Nov 20, 2024

Walkthrough

Significant modifications made, yes. The GbtsSP struct updated, new parameters added to its constructor, hmmm. Member variables enhanced, calculations refined. The addSpacePoint method now uses actual cluster width, yes. Changes in GbtsTrackingFilter, access patterns simplified, clearer code, it is. Seed finding configurations streamlined, unnecessary parameters removed, yes. Overall, a refinement of existing structures and functionalities, this is.

Changes

File Path Change Summary
Core/include/Acts/Seeding/GbtsDataStorage.hpp Updated GbtsSP constructor to include bool isPixel and float ClusterWidth. Added member variables m_phi, m_r, and m_ClusterWidth. Modified addSpacePoint method to use actual cluster width.
Core/include/Acts/Seeding/GbtsTrackingFilter.hpp Simplified access to r() method in GbtsEdgeState. Updated update method to reflect new access patterns.
Core/include/Acts/Seeding/SeedFinderGbts.ipp Simplified access to r and phi in runGbts_TrackFinder and createSeeds methods. Removed SeedFilter.hpp include.
Core/include/Acts/Seeding/SeedFinderGbtsConfig.hpp Removed seedFilter and maxSeedsPerSpM members. Renamed connector_input_file to ConnectorInputFile.
Examples/Algorithms/TrackFinding/include/ActsExamples/TrackFinding/GbtsSeedingAlgorithm.hpp Removed Acts::SeedFilterConfig seedFilterConfig from Config struct.
Examples/Algorithms/TrackFinding/src/GbtsSeedingAlgorithm.cpp Removed SeedFilter.hpp include. Updated constructor and logging in execute method. Modified MakeGbtsSpacePoints method to include new parameters.
Examples/Python/python/acts/examples/reconstruction.py Renamed connector_inputConfigFile to ConnectorInputConfigFile. Removed seedFilterConfigArg from addGbtsSeeding.
Examples/Python/src/TrackFinding.cpp Renamed connector_input_file to ConnectorInputFile in SeedFinderGbtsConfig. Removed maxSeedsPerSpM. Added multiple configuration classes.
Examples/Scripts/Python/full_chain_itk_Gbts.py Renamed connector_inputConfigFile in addSeeding function call to ConnectorInputConfigFile.

Possibly related PRs

Suggested labels

automerge

Suggested reviewers

  • AJPfleger
  • paulgessinger

In the code, changes abound,
New parameters, clarity found.
With Yoda's wisdom, we refine,
Structures and functions, all align.
A journey of growth, we embrace,
In the galaxy of code, we find our place! 🌌✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Experiment)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added Component - Core Affects the Core module Component - Examples Affects the Examples module Seeding Track Finding labels Nov 20, 2024
Copy link

github-actions bot commented Nov 20, 2024

📊: Physics performance monitoring for 8347b8a

Full contents

physmon summary

@paulgessinger paulgessinger changed the title feat: Updates to GBTS for Athena Implementation (Breaking Change) feat!: Updates to GBTS for Athena Implementation Nov 21, 2024
@AJPfleger AJPfleger added this to the v39.0.0 milestone Nov 30, 2024
@Rosie-Hasan Rosie-Hasan marked this pull request as ready for review December 12, 2024 10:21
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (7)
Core/include/Acts/Seeding/GbtsDataStorage.hpp (1)

Line range hint 223-230: Simplify determination of isPixel, you can.

Consider streamlining the assignment of isPixel.

Refactored code:

-          bool isPixel = false;
-          if (sourceLink.size() == 1) {  // pixels have 1 SL
-            isPixel = true;
-          } else {
-            isPixel = false;
-          }
+          bool isPixel = (sourceLink.size() == 1);  // pixels have 1 SL
Examples/Algorithms/TrackFinding/src/GbtsSeedingAlgorithm.cpp (1)

223-230: Simplify isPixel determination, you should.

Streamlining the code improves readability.

Simplify as follows:

-          bool isPixel = false;
-          if (sourceLink.size() == 1) {  // pixels have 1 SL
-            isPixel = true;
-          } else {
-            isPixel = false;
-          }
+          bool isPixel = (sourceLink.size() == 1);  // pixels have 1 SL
Core/include/Acts/Seeding/SeedFinderGbtsConfig.hpp (1)

46-46: Hmmmm, good the naming change is. Documentation, we must add.

The renaming to PascalCase convention, consistent with other changes in the codebase it is. Yet, a comment explaining the purpose of this configuration file, helpful it would be.

Add a documentation comment like this:

+  // Path to the connector configuration file that defines the layer connections
   std::string ConnectorInputFile;  // input file for connector object
Core/include/Acts/Seeding/SeedFinderGbts.ipp (1)

168-172: Hmmmm, simplified access patterns, good they are. Yet optimize further, we can.

The direct access to space point properties through m_spGbts, cleaner code it creates. However, for performance in critical calculations, consider caching frequently accessed values:

-              float r1 = n1->m_spGbts.r();
-              float x1 = n1->m_spGbts.SP->x();
-              float y1 = n1->m_spGbts.SP->y();
-              float z1 = n1->m_spGbts.SP->z();
-              float phi1 = n1->m_spGbts.phi();
+              const auto& sp = n1->m_spGbts;
+              const float r1 = sp.r();
+              const float x1 = sp.SP->x();
+              const float y1 = sp.SP->y();
+              const float z1 = sp.SP->z();
+              const float phi1 = sp.phi();

Also applies to: 201-201, 547-547

Examples/Python/python/acts/examples/reconstruction.py (3)

281-281: Parameter naming convention updated, yes.

Renamed parameter follows Python naming conventions better it does not. PascalCase for parameters unusual in Python it is. Consider snake_case instead.

-    ConnectorInputConfigFile: Optional[Union[Path, str]] = None,
+    connector_input_config_file: Optional[Union[Path, str]] = None,

437-437: Consistent parameter renaming applied, but naming convention concerns persist.

Changed for consistency with parameter definition it was, but same naming convention issue exists.

-                ConnectorInputConfigFile,
+                connector_input_config_file,

1094-1107: Cluster width feature disabled by default, hmm.

New infrastructure for cluster width added it was, but disabled by default it remains. Matches PR objectives this does, which mention feature is currently disabled in examples.

Two observations I have:

  1. Parameter naming inconsistency:
-    ConnectorInputFileStr = str(ConnectorInputConfigFile)
+    connector_input_file_str = str(connector_input_config_file)
  1. Documentation for new parameter m_useClusterWidth missing it is.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 595f2e6 and 8347b8a.

📒 Files selected for processing (9)
  • Core/include/Acts/Seeding/GbtsDataStorage.hpp (4 hunks)
  • Core/include/Acts/Seeding/GbtsTrackingFilter.hpp (3 hunks)
  • Core/include/Acts/Seeding/SeedFinderGbts.ipp (3 hunks)
  • Core/include/Acts/Seeding/SeedFinderGbtsConfig.hpp (1 hunks)
  • Examples/Algorithms/TrackFinding/include/ActsExamples/TrackFinding/GbtsSeedingAlgorithm.hpp (0 hunks)
  • Examples/Algorithms/TrackFinding/src/GbtsSeedingAlgorithm.cpp (3 hunks)
  • Examples/Python/python/acts/examples/reconstruction.py (3 hunks)
  • Examples/Python/src/TrackFinding.cpp (2 hunks)
  • Examples/Scripts/Python/full_chain_itk_Gbts.py (1 hunks)
💤 Files with no reviewable changes (1)
  • Examples/Algorithms/TrackFinding/include/ActsExamples/TrackFinding/GbtsSeedingAlgorithm.hpp
🔇 Additional comments (16)
Core/include/Acts/Seeding/GbtsDataStorage.hpp (8)

32-35: New member variables added, helpful they are.

Adding m_isPixel, m_phi, m_r, and m_ClusterWidth enhances data encapsulation within GbtsSP.


36-44: Constructor updated appropriately, it is.

The constructor initializes new members and computes m_phi and m_r correctly.


49-50: Getter methods provided, good practice this is.

Implementing accessors for r() and ClusterWidth() ensures proper data encapsulation.


160-160: Ensure consistency of sp.r(), you must.

Verify that sp.r() aligns with m_r, to maintain data consistency.


173-173: Cluster width retrieval, appropriate it is.

Using sp.ClusterWidth() to obtain the cluster width is correct.


184-184: Cluster width check, necessary it is.

Validating cluster_width > 0.2 maintains data integrity.


Line range hint 232-233: Placeholder for ClusterWidth, mindful you must be.

Setting ClusterWidth to zero may impact calculations. Update when actual values available, you should.


Line range hint 235-236: Constructor call updated correctly, it is.

Including new parameters in gbtsSpacePoints.emplace_back properly done.

Examples/Algorithms/TrackFinding/src/GbtsSeedingAlgorithm.cpp (4)

70-70: Input file stream initialized, acceptable it is.

input_ifstream correctly opens ConnectorInputFile from configuration.


89-97: Debug logging enhanced, clarity improved.

Logging of Gbts space points provides valuable information for debugging.


232-233: ClusterWidth set to zero, verify implications you must.

Ensure that a zero ClusterWidth does not adversely affect computations.


235-236: Constructor call updated, parameters included properly.

gbtsSpacePoints.emplace_back now correctly includes isPixel and ClusterWidth.

Examples/Python/src/TrackFinding.cpp (1)

206-206: Parameter name updated, consistency maintained.

Renaming connector_input_file to ConnectorInputFile aligns with naming conventions.

Examples/Scripts/Python/full_chain_itk_Gbts.py (1)

98-98: Parameter name updated, consistency improved it is.

Changed connector_inputConfigFile to ConnectorInputConfigFile, reflecting updates in configuration naming.

Core/include/Acts/Seeding/GbtsTrackingFilter.hpp (1)

55-56: Simplified access to space point properties, I sense. Wise decision, this is.

Direct access to r() through m_spGbts instead of m_spGbts.SP, cleaner and more maintainable the code becomes. Consistent with changes throughout the codebase, this pattern is.

Verify the consistency of this pattern, we must:

Also applies to: 70-70, 279-279

✅ Verification successful

Let me search for these patterns in different ways to verify the consistency, hmm. The Force will guide us to the truth about these access patterns, it will.


Consistent the changes are, throughout the codebase they flow

Through the Force, seen I have that both patterns coexist:

  • Direct access through m_spGbts.r() for radius
  • Legacy access through m_spGbts.SP->x(), m_spGbts.SP->y(), m_spGbts.SP->z()

A transition in progress this appears to be, where radius access simplified is, while other properties through SP pointer still flow. Natural this evolution is, as step by step the code transforms.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining old-style access patterns
rg -A 2 'm_spGbts\.SP->[r|phi]\(\)'

Length of output: 37


Script:

#!/bin/bash
# Search for any occurrences of m_spGbts to understand the access pattern
rg -A 2 'm_spGbts'

# Also search for specific radius access patterns
rg -A 2 '->r\(\)'

# And search for phi access patterns
rg -A 2 '->phi\(\)'

Length of output: 6863

Examples/Python/python/acts/examples/reconstruction.py (1)

1094-1107: Verify the impact of disabled cluster width feature.

Understand the effects of disabled cluster width feature we must.

✅ Verification successful

Safe to disable cluster width feature, it is

Investigated the Force surrounding cluster width, I have. Clear evidence found in the codebase:

  • Optional feature it is, defaulting to false in SeedFinderGbtsConfig.hpp
  • Used only in space point addition, impact minimal it has
  • No critical dependencies or tests broken by disabling, found there were not

Proceed with m_useClusterWidth=False, you may. No disturbance in the Force, this change will cause.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for cluster width usage in the codebase
echo "Searching for cluster width usage..."
rg -l "useClusterWidth|m_useClusterWidth"

# Search for related configuration settings
echo "Searching for related configuration..."
rg "cluster.*width.*config" -A 3

Length of output: 482


Script:

#!/bin/bash
# Search for the implementation details of cluster width usage
echo "Searching in SeedFinderGbts.ipp..."
rg -A 10 "m_useClusterWidth" "Core/include/Acts/Seeding/SeedFinderGbts.ipp"

echo "Searching in SeedFinderGbtsConfig.hpp..."
rg -A 5 "m_useClusterWidth" "Core/include/Acts/Seeding/SeedFinderGbtsConfig.hpp"

# Check if there are any tests related to cluster width
echo "Searching for tests..."
rg -A 5 "useClusterWidth.*test" 

# Check Python bindings for cluster width
echo "Checking Python bindings..."
rg -A 5 "useClusterWidth" "Examples/Python/src/TrackFinding.cpp"

Length of output: 1233

@AJPfleger AJPfleger requested a review from noemina December 17, 2024 16:13
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 Track Finding
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants