17ws = ROOT.RooWorkspace(
"workspace")
20tool = ROOT.RooJSONFactoryWSTool(ws)
23tool.importJSON(ROOT.gROOT.GetTutorialDir().Data() +
"/roofit/rf515_hfJSON.json")
28model = ws[
"ModelConfig"]
31params = model.GetPdf().getParameters(ws[
"observed"])
32ROOT.SetOwnership(params,
True)
33params_initial = params.snapshot()
34ROOT.SetOwnership(params_initial,
True)
37result = model.fitTo(ws[
"observed"], ROOT.RooFit.Save(), ROOT.RooFit.PrintLevel(-1))
38ROOT.SetOwnership(result,
True)
42params.assign(params_initial)
46tool.exportJSON(
"myWorkspace.json")
49ws_2 = ROOT.RooWorkspace(
"workspace")
50tool_2 = ROOT.RooJSONFactoryWSTool(ws_2)
51tool_2.importJSON(
"myWorkspace.json")
53model_2 = ws_2[
"ModelConfig"]
54result = model_2.fitTo(ws_2[
"observed"], ROOT.RooFit.Save(), ROOT.RooFit.PrintLevel(-1))
55ROOT.SetOwnership(result,
True)