feat: type the GENIE and particle-gun boundaries#73
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughThe PR replaces raw generator configuration scalars with SHiP unit quantities across particle gun, fixed-target, Pythia8, GENIE, and benchmark paths. Shared Pythia helpers perform explicit unit conversions, and required SHiP unit libraries are added to plugin and benchmark linkage. ChangesUnit-aware event generation
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
2952d72 to
e9ec269
Compare
482d5c8 to
319561a
Compare
319561a to
f0ec9d8
Compare
e9ec269 to
52e61e0
Compare
Pythia8's native units (GeV, mm, mm/c production time) become explicit: beam energies are ship::Energy, lifetime thresholds and tProd are mm/c quantities, and the mm/c -> ns conversion derives from the exact SI definition of c instead of a hand-typed 299.792458. Fixed-target and Pythia8 source configuration is read via get_quantity, so each parameter's unit is defined in exactly one place. The only numeric change is the tProd conversion (division by 299.792458 becomes multiplication by the c-derived factor): at most 1 ulp on ~20% of values. Validation histograms of a 200-event pythia8_only run are bitwise identical to an origin/main build.
GENIE's SI vertex (m, s) converts to the canonical mm/ns through quantities instead of hand-typed 1e3/1e9 factors (exact powers of ten, value-identical). Particle-gun configuration is read via get_quantity (momenta in GeV/c, angle in rad, vertex in mm); sampling stays on raw numbers at the RNG call so the Philox stream is bit-identical. Validation: determinism check passes; a 100-event gun_only run is bitwise identical to an origin/main build (order-independent event comparison; the parallel writer emits events in arbitrary order).
52e61e0 to
cba7262
Compare
f0ec9d8 to
9218e28
Compare
Physics Metrics Comparison1 configuration(s) have differences
Configurations with Differences
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
Stacked on #72. GENIE SI→canonical conversions become derived quantities (exact powers of ten); gun config is typed via get_quantity with the Philox stream untouched. 100-event gun_only output bitwise identical to origin/main.
Summary by CodeRabbit