Skip to content

Commit e0ac188

Browse files
committed
[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.
1 parent 9966609 commit e0ac188

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

roofit/histfactory/src/HistoToWorkspaceFactoryFast.cxx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,11 @@
3434
#include <RooGlobalFunc.h>
3535
#include <RooHelpers.h>
3636
#include <RooHistFunc.h>
37-
#include <RooMultiVarGaussian.h>
3837
#include <RooNumIntConfig.h>
3938
#include <RooPoisson.h>
4039
#include <RooPolyVar.h>
4140
#include <RooProdPdf.h>
4241
#include <RooProduct.h>
43-
#include <RooProfileLL.h>
4442
#include <RooRandom.h>
4543
#include <RooRealSumPdf.h>
4644
#include <RooRealVar.h>
@@ -56,8 +54,6 @@
5654

5755
#include "TH1.h"
5856
#include "TStopwatch.h"
59-
#include "TVectorD.h"
60-
#include "TMatrixDSym.h"
6157

6258
// specific to this package
6359
#include <RooStats/HistFactory/Detail/HistFactoryImpl.h>
@@ -1515,7 +1511,9 @@ RooArgList HistoToWorkspaceFactoryFast::createObservables(const TH1 *hist, RooWo
15151511
if(!model) std::cout <<"failed to find model for channel"<< std::endl;
15161512
// std::cout << "int = " << model->createIntegral(*obsN)->getVal() << std::endl;
15171513
models.push_back(model);
1518-
globalObs.add(*ch->set("globalObservables"), /*silent=*/true); // silent because observables might exist in other channel.
1514+
auto &modelConfig = *static_cast<ModelConfig *>(chs[i]->obj("ModelConfig"));
1515+
// silent because observables might exist in other channel:
1516+
globalObs.add(*modelConfig.GetGlobalObservables(), /*silent=*/true);
15191517

15201518
// constrainedParams->add( * ch->set("constrainedParams") );
15211519
pdfMap[channel_name]=model;

0 commit comments

Comments
 (0)