Skip to content

Conversation

@wdconinc
Copy link
Contributor

Briefly, what does this PR introduce?

This PR introduces a cloning meta algorithm and factory to turn subset collections into collections of objects. This is used here, in particular, to create a clone of the MCBeamElectrons and MCBeamProtons collections (subset collections to MCParticles), so those can be stored in a digitization step in #2380 without storing all truth of MCParticles.

What kind of change does this PR introduce?

  • Bug fix (issue #__)
  • New feature (issue: cloner meta algorithm)
  • 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 22:26
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

This PR adds a small “cloner” meta-algorithm and factory, and wires it into the beam plugin to materialize standalone copies of selected MC beam subset collections, enabling two-stage digitization workflows that don’t keep the full MCParticles truth.

Changes:

  • Introduces Cloner<T> meta algorithm to duplicate elements from an input collection into a new output collection.
  • Adds Cloner_factory<T> JANA omni-factory wrapper around Cloner<T>.
  • Updates src/global/beam/beam.cc to produce MCBeamElectronsCloned and MCBeamProtonsCloned collections from the existing beam subset collections.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/global/beam/beam.cc Registers two Cloner_factory<edm4hep::MCParticle> instances to clone MCBeamElectrons and MCBeamProtons into standalone collections for two-stage workflows.
src/factories/meta/Cloner_factory.h Defines a generic JOmni-based factory that wires a single input PODIO collection into the Cloner<T> algorithm and exposes a single cloned output collection.
src/algorithms/meta/Cloner.h Implements the generic Cloner<T> algorithm that iterates an input collection and pushes obj.clone() into the output collection to break subset dependencies.

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

Copilot AI review requested due to automatic review settings January 31, 2026 23:02

This comment was marked as resolved.

This PR applies the include-what-you-use fixes as suggested by
https://github.com/eic/EICrecon/actions/runs/21552375295.
Please merge this PR into the branch `cloner`
to resolve failures in PR #2384.

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>
@wdconinc wdconinc enabled auto-merge February 1, 2026 03:59
Copilot AI review requested due to automatic review settings February 1, 2026 04:02

This comment was marked as resolved.

@wdconinc
Copy link
Contributor Author

wdconinc commented Feb 1, 2026

No diffs.

@wdconinc wdconinc requested review from a team and rahmans1 and removed request for a team February 1, 2026 16:58
@simonge
Copy link
Contributor

simonge commented Feb 1, 2026

Commenting a bit of a longer conceptual view, rather than directly this purge of MC information (Thinking about #2385 and #2384). Should we be looking at storing the beam particles as Reconstructed Particles? Even after the metadata is available.

An algorithm would then take the vertex collection and the metadata on the beam settings to reconstruct a particle with an accurate covariance matrix. Which would be essential for the qError suggestion in eic/EDM4eic#93

@wdconinc
Copy link
Contributor Author

wdconinc commented Feb 1, 2026

Commenting a bit of a longer conceptual view, rather than directly this purge of MC information (Thinking about #2385 and #2384). Should we be looking at storing the beam particles as Reconstructed Particles? Even after the metadata is available.

An algorithm would then take the vertex collection and the metadata on the beam settings to reconstruct a particle with an accurate covariance matrix. Which would be essential for the qError suggestion in eic/EDM4eic#93

I think ultimately there will need to be some way of combining the metadata with primary vertex to get t0 and such, so that seems like a reasonable way forward. But I don't know how close we are to even starting that.

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.

3 participants