Add multidimentional sWeights from X2VV project#30
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds multidimensional sWeights functionality to HighEnergyTools.jl, enabling statistical background subtraction for complex multi-component analyses like the X2VV ccbar->phi phi decay study. The implementation follows the Pivk & Le Diberder method for generalized sWeights calculation.
Key changes:
- Added
sWeights_general()for arbitrary component sWeights calculation with pre-computed shape values - Added
sWeights_multidimensional()wrapper for multi-dimensional data using shape functions - Added
check_sweights_closure()utility for validating closure property
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/sweights.jl | Core implementation of generalized sWeights algorithms and utility functions |
| src/HighEnergyTools.jl | Exported new public API functions |
| test/test-sweights.jl | Comprehensive test suite for new functionality including edge cases |
| examples/phi_phi_2d_sweights_example.jl | Complete demonstration script for 2D phi-phi analysis |
| 2D_sWeights_README.md | Documentation and usage examples for the new functionality |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| Generate synthetic 2D phi-phi data for demonstration | ||
| """ | ||
| function generate_synthetic_phi_phi_data(n_events::Int=1000) | ||
| Random.seed!(42) # For reproducibility |
There was a problem hiding this comment.
Similar to the test file, the Random.seed! call should be at the module level or function entry point for better control over reproducibility throughout the entire example.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #30 +/- ##
==========================================
+ Coverage 68.64% 74.58% +5.94%
==========================================
Files 8 8
Lines 236 303 +67
==========================================
+ Hits 162 226 +64
- Misses 74 77 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
The Linter error comes from README that reference which is broken. |
|
ping @IlyaSegal for completing. |
I have added 2D sWeights calculation that I used in ccbar->phiphi analysis.
Plus some tests, example and documentation.