Skip to content

fix data renaming for combination

Sebastien Rettie requested to merge srettie/quickstats:master-srettie into master

Should the data name not be read from the xml file also when combining? This MR should fix what I think is a bug. I ran into the issue when running this code with this XML config. The input workspaces can be found attached here.

HH4B_ggF_VBF_comb_161718_noBRAsimov.root k2V_parameterized_BDT_combined_k2V_parameterized_BDT_modelAsimov.root

The crash I get when running the code above without this fix is:

[INFO] Loaded extension module "RooTwoSidedCBShape"
[INFO] Loaded extension module "ResponseFunction"
[INFO] Checking XML input for the channel "channel_resolved".
[INFO] Successfully validated XML input for the channel "channel_resolved".
[INFO] Checking XML input for the channel "channel_boosted".
[INFO] Successfully validated XML input for the channel "channel_boosted".
[INFO] Checking input workspace for the channel "channel_resolved".
[INFO] Successfully validated input workspace for the channel "channel_resolved".
[INFO] Checking input workspace for the channel "channel_boosted".
[INFO] Successfully validated input workspace for the channel "channel_boosted".

 ------------------------------------------------
 ---------- Input summary (2 channels) ----------
 ------------------------------------------------

 +++++++++++++++++++++++++++++++++++++++++++++++
 ++++++++++ Channel: channel_resolved ++++++++++
 +++++++++++++++++++++++++++++++++++++++++++++++
     Input File Name: /Users/sebastienrettie/HH/nano_ntuples_JUN23_WS/resolved/HH4B_ggF_VBF_comb_161718_noBRAsimov.root
      Workspace Name: combined
    ModelConfig Name: ModelConfig
           Data Name: asimovData_1

 ++++++++++++++++++++++++++++++++++++++++++++++
 ++++++++++ Channel: channel_boosted ++++++++++
 ++++++++++++++++++++++++++++++++++++++++++++++
     Input File Name: /Users/sebastienrettie/HH/nano_ntuples_JUN23_WS/k2V_parameterized_BDT/RooStats/k2V_parameterized_BDT_combined_k2V_parameterized_BDT_modelAsimov.root
      Workspace Name: combined
    ModelConfig Name: ModelConfig
           Data Name: asimovData

 ------------------------------------------
 ----------       POI map        ----------
 ------------------------------------------
+------------+--------------------+-------------------+
| Combined   | channel_resolved   | channel_boosted   |
|------------+--------------------+-------------------|
| mu         | mu_HH              | mu                |
| mu_ggF     | mu_HH_ggF          | mu_ggF            |
| mu_VBF     | mu_HH_VBF          | mu_VBF            |
| kLambda    | klambda            | kLambda           |
| kt         | kt                 | kt                |
| k2V        | k2V                | k2V               |
| kV         | kV                 | kV                |
+------------+--------------------+-------------------+

 ----------------------------------------------------------
 ---------- Rename PDFs, functions and variables ----------
 ----------------------------------------------------------

[INFO] Renaming objects for the channel "channel_resolved"
[INFO] Renaming objects for the channel "channel_boosted"

 -----------------------------------------------------
 ---------- Create Combined Pdf and Dataset ----------
 -----------------------------------------------------


 ++++++++++++++++++++++++++++++++++++++++++++++
 ++++++++++ Channel channel_resolved ++++++++++
 ++++++++++++++++++++++++++++++++++++++++++++++

Traceback (most recent call last):
  File "CombineWithResolved.py", line 112, in <module>
    CreateCombinedWS(xmlconfig)
  File "CombineWithResolved.py", line 60, in CreateCombinedWS
    ws_combiner.create_combined_workspace()
  File "/Users/sebastienrettie/HH/limits/hh4b-boosted-vbf-limits/run_limits/conda/envs/run_limits/lib/python3.8/site-packages/quickstats/components/workspaces/xml_ws_combiner.py", line 904, in create_combined_workspace
    self.combine(load_rename_ws=save_rename_ws, save_combine_ws=save_combine_ws)
  File "/Users/sebastienrettie/HH/limits/hh4b-boosted-vbf-limits/run_limits/conda/envs/run_limits/lib/python3.8/site-packages/quickstats/components/workspaces/xml_ws_combiner.py", line 737, in combine
    self.combine_channel(channel)
  File "/Users/sebastienrettie/HH/limits/hh4b-boosted-vbf-limits/run_limits/conda/envs/run_limits/lib/python3.8/site-packages/quickstats/components/workspaces/xml_ws_combiner.py", line 702, in combine_channel
    raise RuntimeError(f'missing data "{channel_data_name}" in the channel "{channel}"')
RuntimeError: missing data "combData_channel_resolved" in the channel "channel_resolved"
Edited by Sebastien Rettie

Merge request reports