-
Notifications
You must be signed in to change notification settings - Fork 173
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
base: main
Are you sure you want to change the base?
feat!: Updates to GBTS for Athena Implementation #3882
Conversation
WalkthroughSignificant modifications made, yes. The Changes
Possibly related PRs
Suggested labels
Suggested reviewers
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Quality Gate passedIssues Measures |
There was a problem hiding this 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 ofisPixel
, 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 SLExamples/Algorithms/TrackFinding/src/GbtsSeedingAlgorithm.cpp (1)
223-230
: SimplifyisPixel
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 SLCore/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:
- Parameter naming inconsistency:
- ConnectorInputFileStr = str(ConnectorInputConfigFile) + connector_input_file_str = str(connector_input_config_file)
- Documentation for new parameter
m_useClusterWidth
missing it is.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 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
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
GbtsSP
struct with new parameters for improved spatial information.SeedFinderGbts
andGbtsTrackingFilter
classes.Bug Fixes
Gbts_id
assignment in geometry mapping.Documentation
Chores