Skip to content

Eventlist generation with gen info for HEFT#329

Draft
dprim7 wants to merge 5 commits intoLPC-HH:mainfrom
dprim7:ev-list-gen-info
Draft

Eventlist generation with gen info for HEFT#329
dprim7 wants to merge 5 commits intoLPC-HH:mainfrom
dprim7:ev-list-gen-info

Conversation

@dprim7
Copy link
Copy Markdown
Collaborator

@dprim7 dprim7 commented Mar 21, 2026

No description provided.

dprim7 and others added 5 commits March 17, 2026 14:58
  - 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant