fix: avoid copying map entries in digi cell_hit_map iteration#2428
Open
Copilot wants to merge 6 commits into
Open
fix: avoid copying map entries in digi cell_hit_map iteration#2428Copilot wants to merge 6 commits into
Copilot wants to merge 6 commits into
Conversation
Copilot
AI
changed the title
[WIP] Fix
digi: avoid copying map entries in cell_hit_map iteration
Feb 6, 2026
cell_hit_map iteration to use const references
This comment was marked as resolved.
This comment was marked as resolved.
wdconinc
approved these changes
Feb 6, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to improve performance by avoiding unnecessary copying of map entries during iteration in tracker digitization algorithms. The changes replace value-based iteration (auto item) with const reference iteration using structured bindings (const auto& [cell_id, raw_hit]) for the cell_hit_map loops.
Changes:
- Modified iteration pattern to use const references with structured bindings instead of copying map entries
- Updated variable references from
item.firstanditem.secondto clearercell_idandraw_hitnames
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/algorithms/digi/SiliconTrackerDigi.cc | Changed cell_hit_map iteration from copying to const reference with structured bindings |
| src/algorithms/digi/MPGDTrackerDigi.cc | Changed cell_hit_map iteration from copying to const reference with structured bindings |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
wdconinc
pushed a commit
that referenced
this pull request
Feb 6, 2026
…#2429) This PR applies the include-what-you-use fixes as suggested by https://github.com/eic/EICrecon/actions/runs/21739227632. Please merge this PR into the branch `copilot/fix-cell-hit-map-iteration` to resolve failures in PR #2428. Auto-generated by [create-pull-request][1] [1]: https://github.com/peter-evans/create-pull-request Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Contributor
wdconinc
pushed a commit
that referenced
this pull request
Feb 6, 2026
…#2429) This PR applies the include-what-you-use fixes as suggested by https://github.com/eic/EICrecon/actions/runs/21739227632. Please merge this PR into the branch `copilot/fix-cell-hit-map-iteration` to resolve failures in PR #2428. Auto-generated by [create-pull-request][1] [1]: https://github.com/peter-evans/create-pull-request Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
92e3413 to
edd630b
Compare
…ndings Co-authored-by: wdconinc <4656391+wdconinc@users.noreply.github.com>
Co-authored-by: wdconinc <4656391+wdconinc@users.noreply.github.com>
…#2429) This PR applies the include-what-you-use fixes as suggested by https://github.com/eic/EICrecon/actions/runs/21739227632. Please merge this PR into the branch `copilot/fix-cell-hit-map-iteration` to resolve failures in PR #2428. Auto-generated by [create-pull-request][1] [1]: https://github.com/peter-evans/create-pull-request Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
for more information, see https://pre-commit.ci
e08ba27 to
d8bb9c1
Compare
wdconinc
reviewed
Feb 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Iteration over
cell_hit_mapwas copying eachstd::pair<uint64_t, MutableRawTrackerHit>unnecessarily.Changes:
SiliconTrackerDigi.cc: iterate by const& with structured bindingsMPGDTrackerDigi.cc: iterate by const& with structured bindingsBefore:
After:
Original prompt
cell_hit_mapin MGPD and SiTracker digi loops with copy, not ref #2427✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.