Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions roofit/hs3/src/JSONFactories_HistFactory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,10 @@ class HistFactoryImporter : public RooFit::JSONIO::Importer {

std::vector<double> errs(sumW.size());
for (size_t i = 0; i < sumW.size(); ++i) {
if (sumW[i] == 0.) {
errs[i] = 0.;
continue;
}
errs[i] = std::sqrt(sumW2[i]) / sumW[i];
// avoid negative sigma. This NP will be set constant anyway later
errs[i] = std::max(errs[i], 0.);
Expand Down
2 changes: 1 addition & 1 deletion roofit/hs3/src/JSONFactories_RooFitCore.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1256,7 +1256,7 @@ STATIC_EXECUTE([]() {
registerExporter<RooFFTConvPdfStreamer>(RooFFTConvPdf::Class(), false);
registerExporter<RooExtendPdfStreamer>(RooExtendPdf::Class(), false);
registerExporter<ParamHistFuncStreamer>(ParamHistFunc::Class(), false);
registerExporter<RooSplineStreamer>(RooSpline::Class(), false);
registerExporter<RooSplineStreamer>(RooSpline::Class(), false);
});

} // namespace
25 changes: 11 additions & 14 deletions roofit/hs3/src/RooJSONFactoryWSTool.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -986,6 +986,9 @@ void RooJSONFactoryWSTool::exportVariable(const RooAbsArg *v, JSONNode &node, bo
var["value"] << rrv->getVal();
if (rrv->isConstant() && storeConstant) {
var["const"] << rrv->isConstant();
} else {
var["min"] << rrv->getMin();
var["max"] << rrv->getMax();
}
if (rrv->getBins() != 100 && storeBins) {
var["nbins"] << rrv->getBins();
Expand Down Expand Up @@ -1507,10 +1510,6 @@ void RooJSONFactoryWSTool::exportData(RooAbsData const &data)
return;

JSONNode &output = appendNamedChild((*_rootnodeOutput)["data"], data.GetName());
/*std::ofstream file("/home/scello/Data/ZvvH126_5.txt", std::ios::app);
if (!file.is_open()) {
std::cerr << "Error: Could not open file for writing.\n";
}*/

// This works around a problem in RooStats/HistFactory that was only fixed
// in ROOT 6.30: until then, the weight variable of the observed dataset,
Expand Down Expand Up @@ -1947,18 +1946,16 @@ void RooJSONFactoryWSTool::exportAllObjects(JSONNode &n)
// the ones that the pdfs encoded implicitly (like in the case of
// HistFactory).
for (RooAbsArg *arg : *snsh) {
if (exportedObjectNames.find(arg->GetName()) != exportedObjectNames.end()) {
bool do_export = false;
for (const auto &pdf : allpdfs) {
if (pdf->dependsOn(*arg)) {
do_export = true;
}
}
if (do_export) {
RooJSONFactoryWSTool::testValidName(arg->GetName(), true);
snapshotSorted.add(*arg);
bool do_export = false;
for (const auto &pdf : allpdfs) {
if (pdf->dependsOn(*arg)) {
do_export = true;
}
}
if (do_export) {
RooJSONFactoryWSTool::testValidName(arg->GetName(), true);
snapshotSorted.add(*arg);
}
}
snapshotSorted.sort();
std::string name(snsh->GetName());
Expand Down
Loading