Skip to content

Conversation

@wdconinc
Copy link
Contributor

@wdconinc wdconinc commented Jan 31, 2026

Briefly, what does this PR introduce?

Needs:

In a few places, due to historical limitations of podio collections, we were still using iterator-based loops with tests and early break to do things that are more nicely done with find_if nowadays. This PR introduces the find_if based approach in a few cases, and removes a comment block complaints about all that used to not work...

What kind of change does this PR introduce?

  • Bug fix (issue: tech debt)
  • New feature (issue #__)
  • Documentation update
  • Other: __

Please check if this PR fulfills the following:

  • Tests for the changes have been added
  • Documentation has been added / updated
  • Changes have been communicated to collaborators

Does this PR introduce breaking changes? What changes might users need to make to their code?

No.

Does this PR change default behavior?

No.

Copilot AI review requested due to automatic review settings January 31, 2026 21:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors a few remaining “iterator loop + break” patterns into std::find_if-based lookups now that podio collections support this more cleanly, and removes outdated commented examples.

Changes:

  • Replace manual association-search loops with std::find_if in scattered-electron association logic.
  • Update beam-particle selection helpers in Beam.h to use std::find_if.
  • Remove a large block of obsolete commented-out iteration examples.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
src/algorithms/reco/ScatteredElectronsTruth.cc Uses std::find_if to locate the truth↔reco association instead of a manual loop.
src/algorithms/reco/InclusiveKinematicsElectron.cc Removes outdated commented code demonstrating older iteration patterns.
src/algorithms/reco/HadronicFinalState.cc Uses std::find_if for truth↔reco association lookup instead of a manual loop.
src/algorithms/reco/Beam.h Refactors “find first with PDG/status” helpers to std::find_if and adds <algorithm>.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings January 31, 2026 21:29

This comment was marked as resolved.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings January 31, 2026 21:32

This comment was marked as resolved.

@wdconinc wdconinc marked this pull request as draft January 31, 2026 21:45
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.

1 participant