feat(data-model): add EventHeader for per-event weight and provenance#17
Open
matclim wants to merge 1 commit into
Open
feat(data-model): add EventHeader for per-event weight and provenance#17matclim wants to merge 1 commit into
matclim wants to merge 1 commit into
Conversation
Add SHiP::EventHeader, a per-event metadata record carrying an event weight and the id of the originating event. The weight (default 1.0) supports weighted generation such as forced or oversampled muon DIS, where each replica of a source muon is written as its own event and down-weighted accordingly. parentEventId (default -1) records which source event a replica came from — event-level provenance, distinct from MCParticle::motherId, which links particles within an event. The struct is a single per-event record like SimResult, so it is registered in the ROOT dictionary without a std::vector counterpart, and added to both the installed header set and the dictionary inputs. RNTuple and TTree round-trip tests cover it, and the TTree dictionary-presence check now includes SHiP::EventHeader. Purely additive: existing classes and files are unchanged, so old files simply lack the new field.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughAdds ChangesEventHeader integration
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant Test as Round-trip tests
participant Utils as test::makeEventHeader
participant Writer as TTree/RNTuple writer
participant Storage as ROOT storage
participant Reader as TTree/RNTuple reader
participant Compare as test::equal
Test->>Utils: Create deterministic EventHeader
Utils-->>Writer: Provide eventHeader values
Writer->>Storage: Write eventHeader
Storage-->>Reader: Read eventHeader
Reader->>Compare: Compare with expected EventHeader
Compare-->>Test: Return round-trip result
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Add SHiP::EventHeader, a per-event metadata record carrying an event weight and the id of the originating event.
The weight (default 1.0) supports weighted generation such as forced or oversampled muon DIS, where each replica of a source muon is written as its own event and down-weighted accordingly. parentEventId (default -1) records which source event a replica came from — event-level provenance, distinct from MCParticle::motherId, which links particles within an event.
The struct is a single per-event record like SimResult, so it is registered in the ROOT dictionary without a std::vector counterpart, and added to both the installed header set and the dictionary inputs. RNTuple and TTree round-trip tests cover it, and the TTree dictionary-presence check now includes SHiP::EventHeader. Purely additive: existing classes and files are unchanged, so old files simply lack the new field.
Summary by CodeRabbit
New Features
SHiP::EventHeaderfor storing event weight and parent-event provenance metadata.Tests