Eventlist generation with gen info for HEFT#329
Draft
dprim7 wants to merge 5 commits intoLPC-HH:mainfrom
Draft
Conversation
- Added all_hist_samples: list[str] | None = None parameter
- Guards sig_key in events_dict before accessing events_dict[sig_key] (prevents KeyError when only
one sample is passed)
- When all_hist_samples is provided, uses it directly for the StrCategory axis instead of deriving
from events_dict.keys()
PostProcess.py:
- Added _compute_all_hist_samples() helper that pre-computes the full set of histogram sample
names (base samples + txbb shifts for signals + all weight shift variations)
- Changed the single-year events_combined assignment to a shallow copy (dict(...)) so del in the
template loop doesn't corrupt events_dict_postprocess
- Replaced the all-at-once template loop with a per-sample loop:
a. Pre-computes all_hist_samples for consistent StrCategory axes
b. For each sample, passes only that sample's dataframe to get_templates
c. Accumulates histograms via addition (templates[key] + h works because all histograms have
identical axes)
d. del events_combined[sample_key] frees that sample's dataframe after processing
Side effect: Per-region cutflow CSVs and plots are skipped during template generation
(template_dir="", plot_dir=""), since they'd contain partial data per-call. The preselection
cutflow CSVs (from cutflows[year]) are unaffected.
Extend postprocessing event-list trees for HH signal samples with MC-only metadata needed downstream, including xsec/lumi/gen weights, coupling values, ordered generator-level Higgs four-vector branches, and ggF/VBF category flags. Keep the existing per-year file structure unchanged and omit these extra branches from non-signal trees.
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.
No description provided.