From e0ac188beb8a0026bbffad87d80059fee692d00c Mon Sep 17 00:00:00 2001 From: Jonas Rembser Date: Tue, 18 Nov 2025 12:56:04 +0100 Subject: [PATCH] [RF][HF] Don't rely on transient `globalObservables` set in combinations The `globalObservables` set is only a temporary set in the proto workspace to accumulate the global observables for the final model config of a channel. By using the global observables from the channel model configs, the `MakeCombinedModel` version that combines channel workspaces can also be run on persistent HistFactory output workspaces, and not only the proto workspaces creates during the parsing of the `Measurement` object. --- roofit/histfactory/src/HistoToWorkspaceFactoryFast.cxx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/roofit/histfactory/src/HistoToWorkspaceFactoryFast.cxx b/roofit/histfactory/src/HistoToWorkspaceFactoryFast.cxx index f5d9a473ffcf5..4f84339b57a00 100644 --- a/roofit/histfactory/src/HistoToWorkspaceFactoryFast.cxx +++ b/roofit/histfactory/src/HistoToWorkspaceFactoryFast.cxx @@ -34,13 +34,11 @@ #include #include #include -#include #include #include #include #include #include -#include #include #include #include @@ -56,8 +54,6 @@ #include "TH1.h" #include "TStopwatch.h" -#include "TVectorD.h" -#include "TMatrixDSym.h" // specific to this package #include @@ -1515,7 +1511,9 @@ RooArgList HistoToWorkspaceFactoryFast::createObservables(const TH1 *hist, RooWo if(!model) std::cout <<"failed to find model for channel"<< std::endl; // std::cout << "int = " << model->createIntegral(*obsN)->getVal() << std::endl; models.push_back(model); - globalObs.add(*ch->set("globalObservables"), /*silent=*/true); // silent because observables might exist in other channel. + auto &modelConfig = *static_cast(chs[i]->obj("ModelConfig")); + // silent because observables might exist in other channel: + globalObs.add(*modelConfig.GetGlobalObservables(), /*silent=*/true); // constrainedParams->add( * ch->set("constrainedParams") ); pdfMap[channel_name]=model;