Skip to content

SSDReco/TrackReco: fix X1 cluster check, const-ref digit list, range-for copies - #306

Draft
gavinsdavies wants to merge 1 commit into
mainfrom
feature/gsdavies/ssdreco-trackreco-fixes
Draft

SSDReco/TrackReco: fix X1 cluster check, const-ref digit list, range-for copies#306
gavinsdavies wants to merge 1 commit into
mainfrom
feature/gsdavies/ssdreco-trackreco-fixes

Conversation

@gavinsdavies

Copy link
Copy Markdown
Contributor

Part of #303.

Fixes

  • SSDReco/experimental/SSDRecUpstreamTgtAutre.cxx: the "at least one cluster in each of the 2×2 views" requirement checked mySSDClsPtrsY1 twice and mySSDClsPtrsX1 never (copy-paste). Now checks X0, Y0, X1, Y1 as the comment intends. (Empty X1 previously fell through to produce zero candidates downstream, so physics output should be unchanged; the intended early return is restored.)
  • SSDReco/MakeSSDClusters_module.cc: FormClusters took its art::PtrVector<SSDRawDigit> by value, called per sensor per event. The body is read-only with respect to the digit list (sorting happens in the caller beforehand) — now passed by const reference.
  • TrackReco/MakeTrackSegments_module.cc: three range-for loops copied non-trivial objects (SpacePoint, TrackSegment, map pairs) per iteration — now const auto&. Three similar-looking loops were deliberately not converted because their bodies mutate the loop copy (i.region = kRegionN before push_back).

Verification

Behavior-preserving by construction. No local build environment and no repo CI — a collaborator build before undrafting would be appreciated.

🤖 Assisted by Claude Code (claude-fable-5)

…-for copies

- SSDRecUpstreamTgtAutre.cxx: third guard was mySSDClsPtrsY1 (copy-paste
  bug); corrected to mySSDClsPtrsX1 so all four views X0/Y0/X1/Y1 are
  actually checked before attempting the upstream-target track fit.
- MakeSSDClusters_module.cc: FormClusters takes sensDigits by value,
  causing a full PtrVector copy on every sensor per event; function body
  is read-only on the container, so change signature to const reference
  in both declaration and definition.
- MakeTrackSegments_module.cc: three range-for loops over rb::SpacePoint,
  rb::TrackSegment, and std::pair<...> containers copied non-trivial
  objects unnecessarily; changed to const auto&.  Three tstmp1/2/3 loops
  that mutate the loop variable (i.region = ...) are left unchanged.
@FNALbuild

Copy link
Copy Markdown
Collaborator

✔️ CI build for EMPHATIC Succeeded on slf7 for maxopt -- details available through the CI dashboard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants