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

fix: Output correct track objects in GSF refitting #3999

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

Conversation

benjaminhuth
Copy link
Member

@benjaminhuth benjaminhuth commented Dec 19, 2024

Unfortunately, there where the KF tracks written to files so far.

--- END COMMIT MESSAGE ---

Any further description goes here, @-mentions are ok here!

  • Use a conventional commits prefix: quick summary
    • We mostly use feat, fix, refactor, docs, chore and build types.
  • A milestone will be assigned by one of the maintainers

Summary by CodeRabbit

  • New Features

    • Updated data sources for track writers in the GSF and Kalman refitting processes to enhance accuracy.
    • Introduced a new parameter for the GSF refitting function to improve configuration flexibility.
  • Bug Fixes

    • Corrected input parameters for track writers to ensure they reference the appropriate outputs from the refitting processes.
  • Tests

    • Updated hash values for various test files related to particle simulation and refitting processes to reflect recent changes.

Copy link

coderabbitai bot commented Dec 19, 2024

Walkthrough

Modifications to track refitting scripts in the Python examples have been made. Two files, truth_tracking_gsf_refitting.py and truth_tracking_kalman_refitting.py, were updated to adjust input and output track parameters. The changes primarily involve renaming track and matching input sources to reflect the refitting process, ensuring proper data flow for track summary and performance writers.

Changes

File Change Summary
Examples/Scripts/Python/.../truth_tracking_gsf_refitting.py Updated input/output track parameters for RootTrackSummaryWriter, TrackFitterPerformanceWriter, and RefittingAlgorithm
Examples/Scripts/Python/.../truth_tracking_kalman_refitting.py Modified inputTracks and inputTrackParticleMatching parameters for track writers
Examples/Python/tests/root_file_hashes.txt Updated hash values for test files related to GSF refitting

Possibly related PRs

Suggested labels

automerge, Track Fitting, Changes Performance

Suggested reviewers

  • andiwand
  • paulgessinger

Poem

Tracks refitted, data flows clear
Parameters dance, algorithms cheer
Python scripts, a Jedi's delight
Refactoring code with wisdom's might 🚀✨
Important changes, yes, they are!


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 3e34e7e and 26fbffa.

📒 Files selected for processing (1)
  • Examples/Python/tests/root_file_hashes.txt (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • Examples/Python/tests/root_file_hashes.txt

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 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 this to the next milestone Dec 19, 2024
@github-actions github-actions bot added the Component - Examples Affects the Examples module label Dec 19, 2024
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

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 32d4bc1 and 30d4564.

📒 Files selected for processing (1)
  • Examples/Scripts/Python/truth_tracking_gsf_refitting.py (2 hunks)
🔇 Additional comments (2)
Examples/Scripts/Python/truth_tracking_gsf_refitting.py (2)

79-82: Correct, this change is! Using GSF refit tracks instead of original tracks, we now are.

Wisdom in this modification I sense. Properly aligned with the GSF refitting output, the RootTrackSummaryWriter now is.


Line range hint 1-120: Verify the flow of tracks through the Force, we must.

Through the sequence of operations, track flow we must validate. From KF tracks to GSF refit tracks, the path leads.

✅ Verification successful

Verified, the flow of tracks is. Consistent, the Force remains.

Through the codebase, a clear path I see:

  • From "kf_tracks" to "gsf_refit_tracks" the transformation flows
  • Proper track-particle matching maintained through "refit_track_particle_matching"
  • Only in performance writer, "track_particle_matching" used as intended

Hmm, yes. In balance, the Force is. No disturbance in the tracking flow I sense.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the consistent usage of track references across the codebase

# Search for track reference patterns to ensure consistency
echo "=== Searching for track reference patterns ==="
rg -A 2 "inputTracks\s*=\s*['\"](?:kf_tracks|gsf_refit_tracks)['\"]"

# Search for track-particle matching patterns
echo "=== Searching for track-particle matching patterns ==="
rg -A 2 "TrackParticleMatching\s*=\s*['\"](?:track_particle_matching|refit_track_particle_matching)['\"]"

Length of output: 9852

Examples/Scripts/Python/truth_tracking_gsf_refitting.py Outdated Show resolved Hide resolved
andiwand
andiwand previously approved these changes Dec 19, 2024
Copy link
Contributor

@andiwand andiwand left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this!

This will most likely require a ref update

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)
Examples/Algorithms/TrackFitting/include/ActsExamples/TrackFitting/RefittingAlgorithm.hpp (1)

36-37: Approve this change, I do. Yet documentation, it needs.

Wise addition of initialVarInflation parameter, this is. But document its purpose and the meaning of each element in the array, we must.

Add documentation like this, you should:

    /// Inflate initial covariance.
+   /// @note Array elements correspond to [d0, z0, phi, theta, q/p, t] parameters
    std::array<double, 6> initialVarInflation = {1., 1., 1., 1., 1., 1.};
Examples/Python/src/TrackFitting.cpp (1)

43-45: Consider documentation updates, you should.

When Python bindings change, documentation in both realms - C++ and Python - update we must. For future Padawans, clear guidance provide.

Consider:

  • Adding Python docstring examples
  • Updating C++ documentation with parameter description
  • Including usage examples in README
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 52ed96f and abd3155.

📒 Files selected for processing (5)
  • Examples/Algorithms/TrackFitting/include/ActsExamples/TrackFitting/RefittingAlgorithm.hpp (1 hunks)
  • Examples/Algorithms/TrackFitting/src/RefittingAlgorithm.cpp (1 hunks)
  • Examples/Python/src/TrackFitting.cpp (1 hunks)
  • Examples/Scripts/Python/truth_tracking_gsf_refitting.py (3 hunks)
  • Examples/Scripts/Python/truth_tracking_kalman_refitting.py (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • Examples/Scripts/Python/truth_tracking_gsf_refitting.py
🔇 Additional comments (3)
Examples/Scripts/Python/truth_tracking_kalman_refitting.py (1)

44-44: Large inflation values, concerning they are. Verify their necessity, we must.

Setting all covariance inflation factors to 100.0, a significant impact on track fitting accuracy it may have. Consider different values for different parameters, you should.

Examples/Algorithms/TrackFitting/src/RefittingAlgorithm.cpp (1)

83-91: Placement of covariance inflation, correct it is.

Good structure maintained, error handling preserved. Approve this part of implementation, I do.

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

44-44: Approve this change, I do. Yet verify its impact, we must.

Hmmmm. Wise addition of initialVarInflation parameter, this is. With the PR's objective of fixing GSF refitting output, aligns well it does.

Run this verification script, we shall:

✅ Verification successful

Verified the change is, proper usage found it has.

Found evidence in the codebase, I have:

  • In truth_tracking_gsf_refitting.py and truth_tracking_kalman_refitting.py, properly used the parameter is, with value [100.0] * 6
  • In RefittingAlgorithm.hpp, default values defined correctly they are: {1., 1., 1., 1., 1., 1.}
  • In RefittingAlgorithm.cpp, implementation handles the parameter appropriately it does

Matches the PR's objective of fixing GSF refitting output, this change does. Working as intended, the parameter is.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Search for usage patterns of initialVarInflation in Python scripts
# and related configuration files

# Search for Python scripts using RefittingAlgorithm
echo "=== Python usage patterns ==="
rg -A 5 "RefittingAlgorithm.*initialVarInflation" --type py

# Search for any documentation or configuration mentioning this parameter
echo "=== Documentation and configuration ==="
rg "initialVarInflation" --type md --type txt

Length of output: 265


Script:

#!/bin/bash
# Search for RefittingAlgorithm usage patterns more broadly
echo "=== RefittingAlgorithm usage patterns ==="
rg -A 10 "RefittingAlgorithm" --type py

# Search for initialVarInflation in C++ files
echo "=== C++ implementation details ==="
rg -A 5 "initialVarInflation" --type cpp

# Look for the algorithm declaration pattern
echo "=== Algorithm declaration patterns ==="
ast-grep --pattern 'ACTS_PYTHON_DECLARE_ALGORITHM($$$)'

Length of output: 31849

Copy link

github-actions bot commented Dec 19, 2024

📊: Physics performance monitoring for b84b2cd

Full contents

physmon summary

@github-actions github-actions bot added Infrastructure Changes to build tools, continous integration, ... Changes Performance labels Dec 19, 2024
@paulgessinger
Copy link
Member

@andiwand @benjaminhuth the physmon failure is real, there's a new FPE in the KF refitting job:

 0# 0x00007F5235AF33A4 in /usr/lib/x86_64-linux-gnu/libm.so.6
 1# ActsExamples::RootTrackSummaryWriter::writeT(ActsExamples::AlgorithmContext const&, Acts::TrackContainer<Acts::ConstVectorTrackContainer, Acts::ConstVectorMultiTrajectory, std::shared_ptr> const&) at /builds/acts/ci-bridge/src/Examples/Io/Root/src/RootTrackSummaryWriter.cpp:412
 2# ActsExamples::Sequencer::run()::{lambda()#1}::operator()() const::{lambda(tbb::detail::d1::blocked_range<unsigned long> const&)#1}::operator()(tbb::detail::d1::blocked_range<unsigned long> const&) const at /builds/acts/ci-bridge/src/Examples/Framework/src/Framework/Sequencer.cpp:502
 3# tbb::detail::d1::start_for<tbb::detail::d1::blocked_range<unsigned long>, ActsExamples::Sequencer::run()::{lambda()#1}::operator()() const::{lambda(tbb::detail::d1::blocked_range<unsigned long> const&)#1}, tbb::detail::d1::auto_partitioner const>::execute(tbb::detail::d1::execution_data&) at /builds/acts/ci-bridge/dependencies/include/oneapi/tbb/parallel_for.h:170
 4# tbb::detail::r1::thread_dispatcher::process(rml::job&) at /home/runner/work/ci-dependencies/ci-dependencies/build/tbb/src/tbb/src/tbb/thread_dispatcher.cpp:183
 5# tbb::detail::r1::rml::private_worker::thread_routine(void*) at /home/runner/work/ci-dependencies/ci-dependencies/build/tbb/src/tbb/src/tbb/private_server.cpp:221
 6# 0x00007F5235968A94 in /usr/lib/x86_64-linux-gnu/libc.so.6
 7# __clone in /usr/lib/x86_64-linux-gnu/libc.so.6

08:04:30    ResPlotTool    WARNING   Fitted track parameter :phi has negative covariance = -1.0983e-08

Negatice covariance value?

@benjaminhuth
Copy link
Member Author

Puh... Seems to me like a 2025 problem :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changes Performance Component - Examples Affects the Examples module Infrastructure Changes to build tools, continous integration, ...
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants