Skip to content
Snippets Groups Projects

ACTS TF: compute shared hits (2nd attempt)

Merged Tim Adye requested to merge adye/athena:adye-ckf71 into main

Retry of !77366 (merged) (reverted by !77490 (merged) as discussed in ATLASRECTS-8161), continuing ATLIDTRKCP-633.

This MR adds shared hit flags to the TrackFindingAlg output tracks. This can be disabled by setting TrackFindingAlg flag, countSharedHits = False.

  • New class ActsTrk::detail::MeasurementIndex, separating out measurementContainerOffsets() code from ActsTrk::detail::TrackFindingMeasurements.
    • Provides new method MeasurementIndex::index(hit), which is a unique hit index that can be used to index into a std::vector, and can be printed by TrackStatePrinter.
    • This class needs the hits provided with its own addMeasurements() call (like TrackFindingMeasurements)
    • Caches last container pointer for faster lookup (new feature since !77366 (merged))
  • New class ActsTrk::detail::SharedHitCounter, providing a method computeSharedHits() to record shared hits in a newly created track.
    • Uses MeasurementIndex::index() internally. Internal object available for other uses (currently just TrackStatePrinter) by measurementIndexer() accessor.
    • This object is only created if needed (countSharedHits = true or TrackStatePrinter enabled).
    • !77366 (merged) crashed because we previously passed to computeSharedHits() the track proxy for the temporary container, so SharedHitFlag was set in the wrong place.
      • Fixed by passing the track proxy referring to the track in the output container.
      • Protect against crashing in that case by checking the track state indices are not out of range.
        • This protection has been tested with the !77366 (merged) code and identifies and skips some out-of-bounds accesses that were probably causing the crash.
        • I could not reproduce the !77366 (merged) CI crash, so could not fully confirm that this fixes it, but there seem to be no more CI crashes so it looks to be resolved.
  • Call TrackStatePrinter on the output track, after setting shared hits.
    • This changes the printed track state index numbers, which now refer to the output container.
    • This will show hits shared with previously-processed tracks (and their counts), but can't print out the updated hits and counts for tracks we have already printed.
  • Remove TrackExtensionAlg::collectMeasurements() and create TrackFindingMeasurements and (optionally, if TrackStatePrinter is enabled) MeasurementIndex inline.
    • This change was needed because TrackStatePrinter now requires MeasurementIndex and it's more complicated to return that from a separate method.
    • Note, that TrackExtensionAlg (and elsewhere) doesn't (yet) use SharedHitCounter, which is only used by TrackFindingAlg.
Edited by Tim Adye

Merge request reports

Pipeline #10225665 passed

Pipeline passed for 2ed51efc on adye:adye-ckf71

Merged by Tadej NovakTadej Novak 1 week ago (Feb 7, 2025 4:10pm UTC)

Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading