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

Draft: Start to migrate the R4-MS segment fit #4108

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

junggjo9
Copy link
Contributor

@junggjo9 junggjo9 commented Feb 24, 2025

PLEASE DESCRIBE YOUR CHANGES.
THIS MESSAGE ENDS UP AS THE COMMIT MESSAGE.
DO NOT USE @-MENTIONS HERE!

--- END COMMIT MESSAGE ---

@goblirsc , @dimitra97

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Introduced new measurement handling abstractions to support composite detectors and muon measurements.
    • Enhanced data operations with advanced sorting and refined attribute access (e.g., positions, sensor directions, timings).
    • Expanded output capabilities to capture more detailed measurement properties for improved data reporting.
    • Added new classes and structures for muon segment finding and seeding processes.
    • Implemented new algorithms for processing muon space points in tracking systems.
  • Bug Fixes

    • Resolved issues related to data handling and input configurations in the muon tracking algorithms.

Copy link

coderabbitai bot commented Feb 24, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

New headers and include directives, added they have been. In StationSpacePoint.hpp, a concept defined is; in MuonSpacePoint.hpp, a class for muon measurements now exists. Additional include directives enable access to the new muon space point definitions in existing modules, and a CSV structure for muon space point data is introduced. Changes, all related to muon measurement handling in composite detectors, they are.

Changes

File(s) Change Summary
Core/.../StationSpacePoint.hpp New header added, defining the StationSpacePoint concept.
Examples/Algorithms/.../MuonHoughSeeder.cpp
Examples/Framework/.../MuonSimHit.hpp
Added include directive for "ActsExamples/EventData/MuonSpacePoint.hpp".
Examples/Framework/.../MuonSpacePoint.hpp New header added, implementing the MuonSpacePoint class with methods for measurement properties.
Examples/Io/Csv/src/CsvOutputData.hpp New structure MuonSpacePointData added, holding muon measurement attributes.
Core/.../StrawChamberLineSeeder.hpp
Core/.../StrawChamberLineSeeder.ipp
New class StrawChamberLineSeeder added, with methods for seeding from uncalibrated hits.
Core/.../detail/SrawChamberLineSeederUtils.hpp New header created, intended for utility functions related to the seeding process.
Core/.../LineHelper.hpp New header added, providing functions for geometric computations involving lines and planes.
Examples/Algorithms/.../MuonSegmentFinder.hpp
Examples/Algorithms/.../MuonSegmentFinder.cpp
New header and source file added for the MuonSegmentFinder class, implementing a Hough transform seeding algorithm.
Examples/Algorithms/.../MuonHoughSeeder.hpp Modified to reflect changes in input/output data types and structures.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant Sorter as MeasurementSorter
    participant SSP as StationSpacePoint
    Client->>Sorter: Create sorter instance with muon point
    Sorter->>SSP: Call localPosition()
    Sorter->>SSP: Call sensorDirection()
    Sorter->>SSP: Call stripPlaneNormal()
    Sorter->>SSP: Call driftRadius()
    Sorter->>SSP: Call time()
    Client->>Sorter: Retrieve sorted measurements
Loading

Poem

In code’s vast galaxy, new stars shine bright,
A concept and sorter, guiding with light.
Muon points align in harmony true,
Headers and data, joined anew we do.
Hmmm, may the Force of clean code forever ignite!


🪧 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.
  • @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 Event Data Model Track Finding labels Feb 24, 2025
@github-actions github-actions bot added this to the next milestone Feb 24, 2025
@junggjo9 junggjo9 marked this pull request as draft February 24, 2025 21:33
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: 1

🧹 Nitpick comments (2)
Core/include/Acts/EventData/StationSpacePoint.hpp (1)

21-22: Complete the documentation, you must.

Incomplete, this documentation is. The sentence "To describe the" hangs without purpose, like a lightsaber without its crystal.

Examples/Io/Csv/src/CsvOutputData.hpp (1)

125-128: Redundant, these covariance entries are. Symmetric matrix properties, you must respect.

In a covariance matrix, covXY equals covYX it does. Unnecessary duplication of data, this creates.

Simplify the structure, you should:

   float covX{0.f};
   float covXY{0.f};
-  float covYX{0.f};
   float covY{0.f};

And update the DFE_NAMEDTUPLE macro accordingly:

   DFE_NAMEDTUPLE(MuonSpacePointData, sectorId, bucketId, 
                 localPositionX ,localPositionY ,localPositionZ,
                 locSensorDirX, locSensorDirY, locSensorDirZ, 
                 locPlaneNormX, locPlaneNormY, locPlaneNormZ, 
-                covX, covXY, covYX, covY, driftR,
+                covX, covXY, covY, driftR,
                 technology, gasGap, primaryCh, secondaryCh);
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between d15f9a3 and 56378e1.

📒 Files selected for processing (5)
  • Core/include/Acts/EventData/StationSpacePoint.hpp (1 hunks)
  • Examples/Algorithms/TrackFinding/src/MuonHoughSeeder.cpp (1 hunks)
  • Examples/Framework/include/ActsExamples/EventData/MuonSimHit.hpp (1 hunks)
  • Examples/Framework/include/ActsExamples/EventData/MuonSpacePoint.hpp (1 hunks)
  • Examples/Io/Csv/src/CsvOutputData.hpp (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • Examples/Framework/include/ActsExamples/EventData/MuonSimHit.hpp
  • Examples/Algorithms/TrackFinding/src/MuonHoughSeeder.cpp
⏰ Context from checks skipped due to timeout of 90000ms (21)
  • GitHub Check: CI Bridge / lcg_107: [alma9, clang19]
  • GitHub Check: CI Bridge / lcg_107: [alma9, gcc14]
  • GitHub Check: CI Bridge / lcg_107: [alma9, gcc13]
  • GitHub Check: CI Bridge / lcg_106a: [alma9, clang16]
  • GitHub Check: CI Bridge / lcg_106a: [alma9, gcc14]
  • GitHub Check: CI Bridge / lcg_105: [alma9, gcc13]
  • GitHub Check: CI Bridge / lcg_106a: [alma9, gcc13]
  • GitHub Check: CI Bridge / lcg_105: [alma9, clang16]
  • GitHub Check: CI Bridge / linux_ubuntu_2204_clang
  • GitHub Check: CI Bridge / linux_ubuntu_2204
  • GitHub Check: CI Bridge / build_linux_ubuntu
  • GitHub Check: CI Bridge / build_exatrkx_cpu
  • GitHub Check: CI Bridge / build_exatrkx
  • GitHub Check: CI Bridge / clang_tidy
  • GitHub Check: unused_files
  • GitHub Check: macos
  • GitHub Check: linux_ubuntu_extra (ubuntu2204, 20, clang++)
  • GitHub Check: missing_includes
  • GitHub Check: linux_ubuntu_extra (ubuntu2204, 20, g++)
  • GitHub Check: linux_ubuntu
  • GitHub Check: build_debug
🔇 Additional comments (3)
Core/include/Acts/EventData/StationSpacePoint.hpp (1)

23-37: Well-defined concept requirements, I sense.

Strong with the Force, this concept definition is. Clear requirements for space point measurements in composite detectors, it provides. Approve this implementation, I do.

Examples/Framework/include/ActsExamples/EventData/MuonSpacePoint.hpp (1)

32-36: Wise use of move semantics, I observe.

The Force flows strong through these setter methods. Move semantics, they use wisely. Memory efficiency, they bring.

Also applies to: 38-40, 42-44, 46-48

Examples/Io/Csv/src/CsvOutputData.hpp (1)

106-147: Well-structured data representation, this is.

Clear documentation and comprehensive fields for muon measurements, this structure provides. Strong foundation for CSV output handling, it creates.

Comment on lines 18 to 20
const Acts::Vector3& stripPlaneNormal() const {
return m_pos;
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

A disturbance in the Force, I sense. Wrong member variable returned, it is.

Return m_pos instead of m_norm, this function does. A critical error this is, young padawan.

Fix this, you must:

-                    return m_pos;
+                    return m_norm;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const Acts::Vector3& stripPlaneNormal() const {
return m_pos;
}
const Acts::Vector3& stripPlaneNormal() const {
return m_norm;
}

Copy link

github-actions bot commented Feb 24, 2025

📊: Physics performance monitoring for 9ed5ba9

Full contents

physmon summary

@junggjo9 junggjo9 force-pushed the CsvHough branch 2 times, most recently from 5316cea to 517d6e7 Compare February 26, 2025 13:17
@junggjo9 junggjo9 force-pushed the CsvHough branch 2 times, most recently from 39ab64f to 059b5e5 Compare March 8, 2025 10:02
@junggjo9
Copy link
Contributor Author

junggjo9 commented Mar 8, 2025

@coderabbitai review

Copy link

coderabbitai bot commented Mar 8, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link

coderabbitai bot commented Mar 8, 2025

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Get information about the PR
gh pr view 4108 --json files,additions,deletions,commits

# Get the diff for the files mentioned in the summary
git diff origin/main...HEAD -- Core/include/Acts/EventData/StationSpacePoint.hpp
git diff origin/main...HEAD -- Examples/Algorithms/TrackFinding/src/MuonHoughSeeder.cpp
git diff origin/main...HEAD -- Examples/Framework/include/ActsExamples/EventData/MuonSimHit.hpp 
git diff origin/main...HEAD -- Examples/Framework/include/ActsExamples/EventData/MuonSpacePoint.hpp
git diff origin/main...HEAD -- Examples/Io/Csv/src/CsvOutputData.hpp

Length of output: 5939


🏁 Script executed:

#!/bin/bash
# Get the list of files from the PR
gh pr view 4108 --json files

# Show the actual file contents for the key files
echo "=== StationSpacePoint.hpp ==="
cat Core/include/Acts/EventData/StationSpacePoint.hpp 2>/dev/null || echo "File not found"

echo -e "\n=== MuonHoughSeeder.cpp ==="
cat Examples/Algorithms/TrackFinding/src/MuonHoughSeeder.cpp 2>/dev/null || echo "File not found"

echo -e "\n=== MuonSpacePoint.hpp ==="
cat Examples/Framework/include/ActsExamples/EventData/MuonSpacePoint.hpp 2>/dev/null || echo "File not found"

echo -e "\n=== MuonSegmentFinder.hpp ==="
cat Examples/Algorithms/TrackFinding/include/ActsExamples/TrackFinding/MuonSegmentFinder.hpp 2>/dev/null || echo "File not found"

echo -e "\n=== StrawChamberLineSeeder.hpp ==="
cat Core/include/Acts/Seeding/StrawChamberLineSeeder.hpp 2>/dev/null || echo "File not found"

echo -e "\n=== LineHelper.hpp ==="
cat Core/include/Acts/Surfaces/detail/LineHelper.hpp 2>/dev/null || echo "File not found"

Length of output: 46508


@junggjo9 Review your PR I will, hmm? Impressed I am with your migration of the R4-MS segment fit! Study the changes in depth, I did.

Strong Points, Your Code Has

  • Well-structured abstraction layers: Using C++20 concepts for StationSpacePoint is elegant, yes! Define interface requirements clearly, you do.
  • Good migration path: Replacing DriftCircle with more versatile MuonSpacePoint while maintaining functionality, wise decision this is.
  • Proper use of modern C++: Move semantics and strong typing, employed well they are!
  • Clear mathematical implementation: In LineHelper, beautiful mathematical formulations for line intersections, I see!

Improvement Opportunities, There Are

  • In StationSpacePoint.hpp, typographical errors lurk: "primarly" should be "primarily", hmm?
  • In MuonSpacePoint, the stripPlaneNormal() method returns m_pos instead of m_norm - likely oversight this is!
  • Commented code in MuonHoughSeeder.cpp, remove you should for clarity, yes!
  • In StrawChamberLineSeeder.hpp, commented-out concept SpacePointCalibrator, either implement or remove you should.

Questions For You, I Have

  • Is MuonSpacePointSorter fully tested for different layer configurations?
  • Any performance considerations with the new architecture compared to previous implementation?

Good progress this PR shows. When ready to address these points, notify me you shall!

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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: 6

🧹 Nitpick comments (7)
Core/include/Acts/EventData/StationSpacePoint.hpp (3)

1-45: A strong concept definition for StationSpacePoint, this is.

A well-defined concept for station space points, you have created. Clear requirements for types implementing this concept, you have specified. The force of strong typing, I sense in this file.

Hmm, one small issue I observe. Incomplete concept definition at line 43-44, there is. A commented template declaration without implementation, remove or complete you should.

-    /** @brief Concept of a space point container */
-    // template 

15-15: Missing space after namespace name, I see.

Consistency in your code style, important it is. After namespace name, a space add you should.

-namespace Acts{
+namespace Acts {

23-41: Good use of concepts, but comment formatting improve you must.

The concept implementation itself, strong it is. But your comments, align with Doxygen style better they should. Double asterisks at the beginning of each line in multi-line comments, use you should.

Examples/Algorithms/TrackFinding/src/MuonSegmentFinder.cpp (1)

9-13: Excessive empty lines between namespace and class, unnecessary they are.

Too many empty lines, readability they do not improve. Remove some of them you should, hmm?

namespace ActsExamples{


-
-
    MuonSegmentFinder::MuonSegmentFinder(Config cfg, Acts::Logging::Level lvl)
Examples/Algorithms/TrackFinding/include/ActsExamples/TrackFinding/MuonSegmentFinder.hpp (1)

21-29: Consider initializing data handles or removing the commented code.
Hmmm, see I do that lines for reading data handles are commented out. If needed, use them you should, or remove them to keep the code clean and confusion away, yes. Clarity in code, the Force demands.

Core/include/Acts/Surfaces/detail/LineHelper.hpp (1)

36-46: Handle degenerate cases more explicitly, you could.
Parallel lines or near-parallel lines handle with caution, an extra threshold or fallback might be wise, yes. Return invalid intersection you do, but further logging or distinct results might help debugging. Guide others with the Force, you should.

Core/include/Acts/Seeding/StrawChamberLineSeeder.ipp (1)

98-120: Implement the seed-building logic fully, helpful it would be.
Currently returns std::nullopt, yes? Implementation incomplete. Extend you should, or confirm that stub it remains. Improve the path of the seeding, you will.

🧰 Tools
🪛 GitHub Actions: Builds

[error] 116-116: unused variable 'y0' [-Werror,-Wunused-variable]

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 56378e1 and 059b5e5.

📒 Files selected for processing (10)
  • Core/include/Acts/EventData/StationSpacePoint.hpp (1 hunks)
  • Core/include/Acts/Seeding/StrawChamberLineSeeder.hpp (1 hunks)
  • Core/include/Acts/Seeding/StrawChamberLineSeeder.ipp (1 hunks)
  • Core/include/Acts/Seeding/detail/SrawChamberLineSeederUtils.hpp (1 hunks)
  • Core/include/Acts/Surfaces/detail/LineHelper.hpp (1 hunks)
  • Examples/Algorithms/TrackFinding/CMakeLists.txt (1 hunks)
  • Examples/Algorithms/TrackFinding/include/ActsExamples/TrackFinding/MuonHoughSeeder.hpp (3 hunks)
  • Examples/Algorithms/TrackFinding/include/ActsExamples/TrackFinding/MuonSegmentFinder.hpp (1 hunks)
  • Examples/Algorithms/TrackFinding/src/MuonHoughSeeder.cpp (5 hunks)
  • Examples/Algorithms/TrackFinding/src/MuonSegmentFinder.cpp (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • Core/include/Acts/Seeding/detail/SrawChamberLineSeederUtils.hpp
🧰 Additional context used
🪛 GitHub Actions: Builds
Examples/Algorithms/TrackFinding/src/MuonSegmentFinder.cpp

[error] 29-29: unused parameter 'ctx' [-Werror,-Wunused-parameter]

Examples/Algorithms/TrackFinding/src/MuonHoughSeeder.cpp

[error] 57-57: unused variable 'gotSH' [-Werror,-Wunused-variable]

Core/include/Acts/Seeding/StrawChamberLineSeeder.ipp

[error] 116-116: unused variable 'y0' [-Werror,-Wunused-variable]


[error] 93-93: unused parameter 'ctx' [-Werror,-Wunused-parameter]

🪛 GitHub Actions: Docs
Core/include/Acts/Seeding/StrawChamberLineSeeder.hpp

[error] 155-155: Doxygen error: argument 'sign' of command @param is not found in the argument list of Acts::StrawChamberLineSeeder::buildSeed.


[error] 155-155: Doxygen error: The following parameters are not documented: 'ctx', 'signs'.

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: missing_includes
  • GitHub Check: build_debug
🔇 Additional comments (13)
Examples/Algorithms/TrackFinding/CMakeLists.txt (1)

12-12: Good, the addition of MuonSegmentFinder.cpp is, hmm.

New source file to the library, properly added it has been. Consistent with the path structure and naming conventions, it is.

Examples/Algorithms/TrackFinding/src/MuonSegmentFinder.cpp (1)

30-36: Empty hits vector used, no actual functionality implemented this has.

Creating a seeder with empty hits vector and default configuration, hmm? No actual work your function performs. Stub implementation this appears to be. Comment explaining future implementation, add you should.

Are you planning to implement the functionality later? Add a TODO comment if that is your intention, you should.

Examples/Algorithms/TrackFinding/include/ActsExamples/TrackFinding/MuonHoughSeeder.hpp (3)

16-17: Good, the inclusion of new headers for MuonSpacePoint and MuonHoughMaximum is.

Proper headers added you have. Migration from DriftCircle to MuonSpacePoint, begun it has. The path to enlightenment, this is.


52-54: Config structure updated properly, it has been.

Replace DriftCircles with SpacePoints in configuration, wise decision this is. Added output for HoughMax, good foresight you have shown.


76-77: Data handles updated to match new types, well done this is.

ReadDataHandle for MuonSpacePointCont and WriteDataHandle for MuonHoughMaxContainer, properly implemented they are. Consistent with config changes, this is.

Examples/Algorithms/TrackFinding/include/ActsExamples/TrackFinding/MuonSegmentFinder.hpp (1)

43-45: Ensure correct implementation of execute, initialize, and finalize.
Implemented the interface methods may be, hmm? But see no definitions here I do. Provide them externally you might. Confirm they exist, you must, so the Force remains balanced.

Core/include/Acts/Surfaces/detail/LineHelper.hpp (1)

67-69: Clarify the near-zero check for plane intersection.
Caught in an epsilon check, we are. Precisely define the threshold for when a line is parallel to the plane, you must. Decrease confusion in boundary conditions, it will.

Examples/Algorithms/TrackFinding/src/MuonHoughSeeder.cpp (6)

10-14: Good additions, these includes are.
Needed for muon seeding logic, I sense.


21-21: Matters not, these changes do.
Harmless new format and cutoff constant, they are.

Also applies to: 28-28


32-54: Constructor changes, no conflict I see.
Structure consistent, well formed it is.


58-137: Hough transform logic, implemented well it seems.
Further validation, you might do, but concerns immediate I do not sense.


255-256: Return success, coherent is.
Fine, these lines are.


259-273: Initialization and finalization, correct they appear.
Problems here, found none I have.

Comment on lines +29 to +37
ProcessCode MuonSegmentFinder::execute( const AlgorithmContext& ctx) const {

using StrawSeeder_t = Acts::StrawChamberLineSeeder<MuonSpacePoint, MuonSpacePointSorter>;
StrawSeeder_t::Config seedCfg{};
std::vector<const MuonSpacePoint*> hits{};

StrawSeeder_t seeder{hits, std::move(seedCfg), m_logger->clone()};
return ProcessCode::SUCCESS;
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Unused parameter 'ctx' exists. Fix this issue, you must.

Pipeline failure warns about unused parameter 'ctx'. Properly use the parameter or mark it as unused with (void)ctx; syntax you should. Empty implementation has not much purpose, hmm?

ProcessCode MuonSegmentFinder::execute( const AlgorithmContext& ctx) const {
+  // Suppress unused parameter warning
+  (void)ctx;
  
  using StrawSeeder_t = Acts::StrawChamberLineSeeder<MuonSpacePoint, MuonSpacePointSorter>;
  StrawSeeder_t::Config seedCfg{};
  std::vector<const MuonSpacePoint*> hits{};
  
  StrawSeeder_t seeder{hits, std::move(seedCfg), m_logger->clone()};
  return ProcessCode::SUCCESS;
}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
ProcessCode MuonSegmentFinder::execute( const AlgorithmContext& ctx) const {
using StrawSeeder_t = Acts::StrawChamberLineSeeder<MuonSpacePoint, MuonSpacePointSorter>;
StrawSeeder_t::Config seedCfg{};
std::vector<const MuonSpacePoint*> hits{};
StrawSeeder_t seeder{hits, std::move(seedCfg), m_logger->clone()};
return ProcessCode::SUCCESS;
}
ProcessCode MuonSegmentFinder::execute( const AlgorithmContext& ctx) const {
// Suppress unused parameter warning
(void)ctx;
using StrawSeeder_t = Acts::StrawChamberLineSeeder<MuonSpacePoint, MuonSpacePointSorter>;
StrawSeeder_t::Config seedCfg{};
std::vector<const MuonSpacePoint*> hits{};
StrawSeeder_t seeder{hits, std::move(seedCfg), m_logger->clone()};
return ProcessCode::SUCCESS;
}
🧰 Tools
🪛 GitHub Actions: Builds

[error] 29-29: unused parameter 'ctx' [-Werror,-Wunused-parameter]

Comment on lines +17 to +26
// if (m_cfg.inDriftCircles.empty()) {
// throw std::invalid_argument(
// "MuonSegmentFinder: Missing drift circle collection");
// }
// if (m_cfg.inSimHits.empty()) {
// throw std::invalid_argument("MuonSegmentFinder: Missing sim hit collection");
// }

// m_inputDriftCircles.initialize(m_cfg.inDriftCircles);
// m_inputSimHits.initialize(m_cfg.inSimHits);
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Commented code, remove or uncomment you should.

Dead code that is commented out, not good practice it is. Either remove these lines or implement proper error handling you must. Commented code, confusion it creates and maintenance it hampers.

-//   if (m_cfg.inDriftCircles.empty()) {
-//     throw std::invalid_argument(
-//         "MuonSegmentFinder: Missing drift circle collection");
-//   }
-//   if (m_cfg.inSimHits.empty()) {
-//     throw std::invalid_argument("MuonSegmentFinder: Missing sim hit collection");
-//   }
-
-//   m_inputDriftCircles.initialize(m_cfg.inDriftCircles);
-//   m_inputSimHits.initialize(m_cfg.inSimHits);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// if (m_cfg.inDriftCircles.empty()) {
// throw std::invalid_argument(
// "MuonSegmentFinder: Missing drift circle collection");
// }
// if (m_cfg.inSimHits.empty()) {
// throw std::invalid_argument("MuonSegmentFinder: Missing sim hit collection");
// }
// m_inputDriftCircles.initialize(m_cfg.inDriftCircles);
// m_inputSimHits.initialize(m_cfg.inSimHits);

double theta{thetaTubes - std::asin(std::clamp(R / distTubes, -1., 1.))};

Vector3 seedDir = makeDirectionFromPhiTheta(90.*UnitConstants::degree, theta);
double y0 = bottomPos.y() * seedDir.z() - bottomPos.z() * seedDir.y() + signBot * bottomHit->driftRadius();
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Remove or consume variable 'y0', you must.
Unused is the local variable, hmm. With purpose it must be, or banish it you shall to restore pipeline harmony.

-    double y0 = bottomPos.y() * seedDir.z() - bottomPos.z() * seedDir.y() + signBot * bottomHit->driftRadius();
+    // Removed or used if needed for further calculations
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
double y0 = bottomPos.y() * seedDir.z() - bottomPos.z() * seedDir.y() + signBot * bottomHit->driftRadius();
// Removed or used if needed for further calculations
🧰 Tools
🪛 GitHub Actions: Builds

[error] 116-116: unused variable 'y0' [-Werror,-Wunused-variable]


template <StationSpacePoint UncalibSp_t, StationSpacePointSorter<UncalibSp_t> Sorter_t>
std::optional<typename StrawChamberLineSeeder<UncalibSp_t, Sorter_t>::DriftCircleSeed>
StrawChamberLineSeeder<UncalibSp_t, Sorter_t>::buildSeed(const CalibrationContext& ctx,
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Remove or utilize parameter 'ctx' you must.
Unused the parameter is, causing pipeline fail, hmm. Either use it for calibration logic or remove it to quell compiler's wrath. Let no wasted parameter remain, yes.

-    std::optional<typename StrawChamberLineSeeder<UncalibSp_t, Sorter_t>::DriftCircleSeed>
-        buildSeed(const CalibrationContext& ctx,
+    std::optional<typename StrawChamberLineSeeder<UncalibSp_t, Sorter_t>::DriftCircleSeed>
+        buildSeed(/* const CalibrationContext& ctx, */ 
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
StrawChamberLineSeeder<UncalibSp_t, Sorter_t>::buildSeed(const CalibrationContext& ctx,
std::optional<typename StrawChamberLineSeeder<UncalibSp_t, Sorter_t>::DriftCircleSeed>
buildSeed(/* const CalibrationContext& ctx, */
🧰 Tools
🪛 GitHub Actions: Builds

[error] 93-93: unused parameter 'ctx' [-Werror,-Wunused-parameter]

Comment on lines +155 to +163
/** @brief Tries to build the seed from the two hits. Fails if the solution is invalid
* or if the seed has already been built before
* @param topHit: Hit candidate from the upper layer
* @param bottomHit: Hit candidate from the lower layer
* @param sign: Object encoding whether the tangent is left / right */
std::optional<DriftCircleSeed> buildSeed(const CalibrationContext& ctx,
const UncalibSp_t& topHit,
const UncalibSp_t& bottomHit,
const SignCombo_t& signs);
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix Doxygen doc, you must.
Mismatch between documented param name and actual argument, I see. Also missing docs for 'ctx' and 'signs', there are.

Proposed fix, apply you can:

- /**
-  *  @param topHit: Hit candidate from the upper layer
-  *  @param bottomHit: Hit candidate from the lower layer
-  *  @param sign: Object encoding whether the tangent is left / right
-  */
+ /**
+  * @brief Tries to build the seed from two hits. Fails if invalid solution this is, 
+  *        or if the seed already built, it has been.
+  * @param ctx        The calibration context, used for calibrations it is.
+  * @param topHit     Hit candidate from the upper layer, hmmm.
+  * @param bottomHit  Hit candidate from the lower layer, correct it is.
+  * @param signs      Whether tangents left/right they be, encoded here.
+  */
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/** @brief Tries to build the seed from the two hits. Fails if the solution is invalid
* or if the seed has already been built before
* @param topHit: Hit candidate from the upper layer
* @param bottomHit: Hit candidate from the lower layer
* @param sign: Object encoding whether the tangent is left / right */
std::optional<DriftCircleSeed> buildSeed(const CalibrationContext& ctx,
const UncalibSp_t& topHit,
const UncalibSp_t& bottomHit,
const SignCombo_t& signs);
/**
* @brief Tries to build the seed from two hits. Fails if invalid solution this is,
* or if the seed already built, it has been.
* @param ctx The calibration context, used for calibrations it is.
* @param topHit Hit candidate from the upper layer, hmmm.
* @param bottomHit Hit candidate from the lower layer, correct it is.
* @param signs Whether tangents left/right they be, encoded here.
*/
std::optional<DriftCircleSeed> buildSeed(const CalibrationContext& ctx,
const UncalibSp_t& topHit,
const UncalibSp_t& bottomHit,
const SignCombo_t& signs);
🧰 Tools
🪛 GitHub Actions: Docs

[error] 155-155: Doxygen error: argument 'sign' of command @param is not found in the argument list of Acts::StrawChamberLineSeeder::buildSeed.


[error] 155-155: Doxygen error: The following parameters are not documented: 'ctx', 'signs'.

const AlgorithmContext& ctx) const {
// read the hits and circles
auto gotSH = m_inputSimHits(ctx);
auto gotDC = m_inputDriftCircles(ctx);
const auto& gotSH = m_inputSimHits(ctx);
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Unused variable, remove it you must!
Build broken is, by 'gotSH' not used. Fix quickly, you should.

Apply thus:

-  const auto& gotSH = m_inputSimHits(ctx);

Or cast to void, if used in future:

// (void) gotSH; 
🧰 Tools
🪛 GitHub Actions: Builds

[error] 57-57: unused variable 'gotSH' [-Werror,-Wunused-variable]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant