-
Notifications
You must be signed in to change notification settings - Fork 8
Removed anaCache step #96
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
Conversation
kandrosov
commented
Jan 29, 2026
- Denominator is now defined at AnaTupleMerge stage
- updated weights naming
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 pull request removes the anaCache step from the corrections workflow, moving the denominator definition to the AnaTupleMerge stage, and updates weight naming conventions to be more modular and consistent.
Changes:
- Refactored
getNormalisationCorrections()to decompose the monolithicweight_MC_Lumi_puinto separate components (weight_lumi,weight_xs,weight_gen,weight_pu_*) that are combined intoweight_base - Added stage-based conditional enabling of pileup corrections with new
enabledparameter inpuWeightProducer.getWeight() - Updated weight naming from
puWeight_*toweight_pu_*for consistency with other weight naming conventions
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| pu.py | Added enabled and return_list_of_branches parameters to support conditional branch definition and explicit branch tracking; renamed branches from puWeight_* to weight_pu_* |
| Corrections.py | Decomposed monolithic weight into modular components, added stage-based PU weight enabling, and renamed weights from weight_MC_Lumi_* to weight_base_* for clarity |
| key = (source, scale) | ||
| if shape_weights_dict: | ||
| if key not in shape_weights_dict: | ||
| shape_weights_dict[key] = [] | ||
| shape_weights_dict[key].append(branch_name) |
Copilot
AI
Jan 30, 2026
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.
When enabled=False, the branch is not defined (line 60-65) but it is still added to shape_weights_dict (line 68-71). This means shape_weights_dict will contain references to undefined branches, which will cause runtime errors when these branches are later accessed in the weight formula calculation in Corrections.py (line 464). Either the branch should always be added to shape_weights_dict regardless of the enabled flag, or the addition to shape_weights_dict should also be conditional on enabled=True.
| key = (source, scale) | |
| if shape_weights_dict: | |
| if key not in shape_weights_dict: | |
| shape_weights_dict[key] = [] | |
| shape_weights_dict[key].append(branch_name) | |
| if shape_weights_dict: | |
| key = (source, scale) | |
| if key not in shape_weights_dict: | |
| shape_weights_dict[key] = [] | |
| shape_weights_dict[key].append(branch_name) |
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.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
|
tested with cms-flaf/FLAF#215 |