-
Notifications
You must be signed in to change notification settings - Fork 181
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: Use RootTracksummaryWriter without truth information #3886
feat: Use RootTracksummaryWriter without truth information #3886
Conversation
WalkthroughChanges made to the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Config
participant RootTrackSummaryWriter
participant InputCollections
participant OutputFiles
User->>Config: Create configuration
User->>RootTrackSummaryWriter: Initialize with config
RootTrackSummaryWriter->>InputCollections: Check for input particles
alt Input particles available
RootTrackSummaryWriter->>InputCollections: Process input particles
else No input particles
RootTrackSummaryWriter->>InputCollections: Use emptyParticles
end
RootTrackSummaryWriter->>OutputFiles: Write output files
OutputFiles-->>User: Return generated files
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 (
|
Overall I wonder if it might be easier to just have empty truth information in case these entries in the whiteboard are not present. I think not having any truth should act similarly to not matching to truth? I would also like to avoid special casing in all directions so we can make data workflows work as this seems really not the goal of our design. |
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.
Looks good thank you! 🚀
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: 1
🧹 Outside diff range and nitpick comments (3)
Examples/Python/tests/test_writer.py (3)
206-220
: Strengthen the test assertions, we must!Missing assertions for the first phase of testing, I observe. Verify the successful execution of truth tracking, we should.
Add assertions to verify the truth tracking execution:
s=s, ) + assert "tracks" in s.store # Verify tracks were created + assert "measurement_particles_map" in s.store # Verify truth mapping exists
222-230
: Clear configuration, but magic string lurks in shadows!Good configuration of writer without truth information, but hardcoded collection name "tracks" I see.
Consider defining collection name as constant:
+ TRACKS_COLLECTION = "tracks" s.addWriter( conf_const( RootTrackSummaryWriter, level=acts.logging.INFO, - inputTracks="tracks", + inputTracks=TRACKS_COLLECTION, filePath=str(tmp_path / "track_summary_kf_no_truth.root"), ) )
200-235
: Test cleanup, missing it is!Resources properly released, they must be. Cleanup after test execution, we should add.
Add cleanup using pytest fixture:
@pytest.fixture(autouse=True) def cleanup(tmp_path): yield # Clean up root files after test for file in tmp_path.glob("*.root"): file.unlink()
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (3)
Examples/Io/Root/include/ActsExamples/Io/Root/RootTrackSummaryWriter.hpp
(1 hunks)Examples/Io/Root/src/RootTrackSummaryWriter.cpp
(3 hunks)Examples/Python/tests/test_writer.py
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- Examples/Io/Root/include/ActsExamples/Io/Root/RootTrackSummaryWriter.hpp
🔇 Additional comments (4)
Examples/Python/tests/test_writer.py (2)
200-201
: Appropriate test marker and function signature, hmm, yes!
Well-placed, the @pytest.mark.root
decorator is. Clear and descriptive, the test function name becomes.
202-204
: Proper test setup, I sense!
Wisely chosen, the test components are:
- Generic detector for simplicity
- Constant magnetic field for predictability
- Sequential processing for deterministic results
Examples/Io/Root/src/RootTrackSummaryWriter.cpp (2)
63-65
: Improved initialization, you have.
Replacing explicit checks with maybeInitialize
, flexibility it brings.
218-227
: Handle missing truth information, you do.
By using empty collections when uninitialized, robustness you ensure.
|
Since some people start to do tests within the examples framework with real data, we should extend our algorithms/writers to not require these information. This PR does the relevant changes for the
RootTracksummaryWriter
.--- END COMMIT MESSAGE ---
Any further description goes here, @-mentions are ok here!
feat
,fix
,refactor
,docs
,chore
andbuild
types.Summary by CodeRabbit
New Features
RootTrackSummaryWriter
, allowing the program to operate without mandatory input collections.Bug Fixes
Tests
RootTrackSummaryWriter
and integrated it into existing testing frameworks for comprehensive coverage.