Fix QCD Shape unc, calulated at hist merge step, not event wise Unc, so added data-driven flag so that it do not crash before hist-Merge#281
Open
Sayan-Dhani wants to merge 1 commit into
Conversation
…so added data-driven flag so that it do not crash before histMerge
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.
Title: Exclude data-driven shape uncertainties from per-event tree processing (fixes QCDScale crash)
Description:
Problem
QCDScale is a data-driven shape uncertainty for the HH→bbττ QCD ABCD estimate: its Up/Down templates are built after histogramming, from the OS_AntiIso/SS_Iso/SS_AntiIso sideband regions — there is no per-event weight variation and no corresponding Events__QCDScale__Up/Down tree in the anaTuple.
However, every stage that consumes
unc_cfg_dict["shape"]assumed the opposite: that each key in that section names a real tree-level systematic requiring anEvents__<unc>__<scale>tree. Adding QCDScale there (to give it a datacard nuisance name) made three independent stages try to load a tree that was never produced, crashing with:Fix
Introduce a
data_driven: trueflag on a shape entry (set in the main repo'sweights.yamlfor QCDScale) and skip flagged entries wherever a stage builds its list of per-event/tree-level uncertainties to process:Analysis/HistTupleProducer.py (createHistTuple):scale_uncertaintiesnow skipsdata_drivenentries.Analysis/AnalysisCacheProducer.py (createAnalysisCache): same skip (same bug pattern; would have crashed identically once this stage runs with unc variations enabled).Analysis/HistProducerFromNTuple.py:uncs_to_computenow skipsdata_drivenentries, so it neither looks up aEvents__QCDScale__*tree nor produces{var}_QCDScale_{scale}-named histograms.The
Analysis/HistMergerFromHists.py'sfill_hists, which needed the opposite treatment (see HH_bbtautau PR 74 ), andtasks.py'sHistMergerTask.uncNamesconstruction, which correctly still includesQCDScaleunfiltered — the merge stage is exactly where this data-driven uncertainty is supposed to be built and consumed.