-
Notifications
You must be signed in to change notification settings - Fork 36
feat: cloner algorithm and factory #2384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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 aroundCloner<T>. - Updates
src/global/beam/beam.ccto produceMCBeamElectronsClonedandMCBeamProtonsClonedcollections 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.
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>
|
No diffs. |
|
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. |
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
MCBeamElectronsandMCBeamProtonscollections (subset collections toMCParticles), so those can be stored in a digitization step in #2380 without storing all truth ofMCParticles.What kind of change does this PR introduce?
Please check if this PR fulfills the following:
Does this PR introduce breaking changes? What changes might users need to make to their code?
No.
Does this PR change default behavior?
No.