WIP: Add RecHit#5
Conversation
|
Warning Review limit reached
Next review available in: 40 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdds new reconstruction data structures, maps ACTS fit results into a track-fit record, extends ChangesReconstruction data and conversion
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
include/SHiP/RecHit.hpp (1)
10-10: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueDoc comment mismatch.
Comment says "Reconstructed particle" but this is
RecHit.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@include/SHiP/RecHit.hpp` at line 10, The doc comment on RecHit is incorrect and refers to a reconstructed particle instead of a rec hit. Update the comment in RecHit.hpp so it accurately describes the RecHit type, keeping the wording aligned with the RecHit declaration and related class naming.include/SHiP/TrackFitResult.hpp (1)
8-9: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRemove commented-out includes; fix doc comment.
Lines 8-9 are dead code (the same includes are added live in
Utilities.hpp). Line 13's comment "Reconstructed particle" is a copy-paste leftover — should describe a track-fit result.Proposed cleanup
- -//#include <Acts/EventData/VectorMultiTrajectory.hpp> -//#include <Acts/EventData/VectorTrackContainer.hpp> namespace SHiP { -/// Reconstructed particle +/// Reconstructed track fit result struct TrackFitResult {Also applies to: 13-13
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@include/SHiP/TrackFitResult.hpp` around lines 8 - 9, Remove the commented-out include lines from TrackFitResult.hpp since those headers are already brought in through Utilities.hpp, and update the doc comment on the TrackFitResult type/member so it describes a track-fit result rather than the copied “Reconstructed particle” text. Use the TrackFitResult declaration and its nearby comment as the anchor when cleaning up the header.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@include/SHiP/RecHit.hpp`:
- Around line 22-30: The fromSimHit helper currently omits SimHit::pathLength,
leaving RecHit::pathLength at its default value. Update the mapping in
fromSimHit in RecHit to copy sp.pathLength alongside the other fields so
reconstructed hits preserve the simulated path length.
In `@include/SHiP/Utilities.hpp`:
- Around line 32-36: The TrackFitResult::refLoc assignment in the utility
conversion is misleading because it stores Acts::eBoundLoc0/1 local surface
coordinates with a dummy zero z-value, which makes the field look like a global
position. Update the semantics in this conversion path by either
renaming/commenting the TrackFitResult::refLoc field to clearly indicate it is
local bound coordinates, or change the logic to transform the values into a true
global position before storing them. Use the existing parameter extraction in
the conversion helper to keep the chosen representation consistent throughout
the code.
---
Nitpick comments:
In `@include/SHiP/RecHit.hpp`:
- Line 10: The doc comment on RecHit is incorrect and refers to a reconstructed
particle instead of a rec hit. Update the comment in RecHit.hpp so it accurately
describes the RecHit type, keeping the wording aligned with the RecHit
declaration and related class naming.
In `@include/SHiP/TrackFitResult.hpp`:
- Around line 8-9: Remove the commented-out include lines from
TrackFitResult.hpp since those headers are already brought in through
Utilities.hpp, and update the doc comment on the TrackFitResult type/member so
it describes a track-fit result rather than the copied “Reconstructed particle”
text. Use the TrackFitResult declaration and its nearby comment as the anchor
when cleaning up the header.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 48333f5c-0a5b-4f51-923c-2e80bf069f69
📒 Files selected for processing (6)
CMakeLists.txtinclude/SHiP/LinkDef.hinclude/SHiP/RecHit.hppinclude/SHiP/RecParticle.hppinclude/SHiP/TrackFitResult.hppinclude/SHiP/Utilities.hpp
✅ Files skipped from review due to trivial changes (1)
- include/SHiP/LinkDef.h
🚧 Files skipped from review as they are similar to previous changes (1)
- include/SHiP/RecParticle.hpp
| inline RecHit fromSimHit(SimHit const& sp) { | ||
| return {.detectorId = sp.detectorId, | ||
| .trackId = sp.trackId, | ||
| .pdgCode = sp.pdgCode, | ||
| .position = sp.position, | ||
| .momentum = sp.momentum, | ||
| .energyDeposit = sp.energyDeposit, | ||
| .time = sp.time}; | ||
| } |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check whether SimHit has a pathLength-equivalent field
fd -a SimHit.hpp | xargs cat -nRepository: ShipSoft/data-model
Length of output: 886
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Inspect RecHit.hpp around the conversion and struct definition.
fd -a RecHit.hpp
printf '\n---\n'
cat -n include/SHiP/RecHit.hpp
printf '\n---\n'
# Check for any other conversions/usages that set RecHit::pathLength.
rg -n "pathLength" include src test . -g '!**/.git/**'Repository: ShipSoft/data-model
Length of output: 1788
Populate pathLength in fromSimHit include/SHiP/RecHit.hpp:22-30 drops SimHit::pathLength, so reconstructed hits always keep the default 0. Map sp.pathLength here.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@include/SHiP/RecHit.hpp` around lines 22 - 30, The fromSimHit helper
currently omits SimHit::pathLength, leaving RecHit::pathLength at its default
value. Update the mapping in fromSimHit in RecHit to copy sp.pathLength
alongside the other fields so reconstructed hits preserve the simulated path
length.
| result.qoverp = params[Acts::eBoundQOverP]; | ||
| result.phi = params[Acts::eBoundPhi]; | ||
| result.theta = params[Acts::eBoundTheta]; | ||
| result.time = params[Acts::eBoundTime]; | ||
| result.refLoc = {params[Acts::eBoundLoc0], params[Acts::eBoundLoc1], 0.0}; |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '\n## Utilities.hpp context\n'
sed -n '1,120p' include/SHiP/Utilities.hpp
printf '\n## refLoc usages/declarations\n'
rg -n --hidden --no-ignore-vcs '\brefLoc\b' include src . || true
printf '\n## nearby type definitions for the result struct/class\n'
rg -n --hidden --no-ignore-vcs 'struct|class.*refLoc|std::array<double, 3>|std::array<.*3>' include src || trueRepository: ShipSoft/data-model
Length of output: 4724
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '\n## TrackFitResult.hpp\n'
sed -n '1,120p' include/SHiP/TrackFitResult.hpp
printf '\n## TrackFitResult usages\n'
rg -n --hidden --no-ignore-vcs '\bTrackFitResult\b' include . || trueRepository: ShipSoft/data-model
Length of output: 1902
Clarify TrackFitResult::refLoc semantics Acts::eBoundLoc0/1 are local surface coordinates, so this field reads like a global point while storing local bound values plus a dummy z=0. Rename/comment it, or store a transformed global position instead.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@include/SHiP/Utilities.hpp` around lines 32 - 36, The TrackFitResult::refLoc
assignment in the utility conversion is misleading because it stores
Acts::eBoundLoc0/1 local surface coordinates with a dummy zero z-value, which
makes the field look like a global position. Update the semantics in this
conversion path by either renaming/commenting the TrackFitResult::refLoc field
to clearly indicate it is local bound coordinates, or change the logic to
transform the values into a true global position before storing them. Use the
existing parameter extraction in the conversion helper to keep the chosen
representation consistent throughout the code.
Summary by CodeRabbit
New Features
Refactor