hep
hep copied to clipboard
rootio: add read support for RooWorkspace
this would be interesting for Recast. wouldn't it, @lukasheinrich ?
yes, if we could read workspaces and run fits, that would be quite helpful. To give you a feel, this is a not-so-minimal example of running it via PyROOT
https://gist.github.com/lukasheinrich/4afa0159fd3f3f51620b12e66abbdf08
but even something simpler that is more like the below would be a great start
f = ROOT.TFile.Open('file.root')
workspace = f.Get('myworkspace')
result = workspace.pdf('pdfname').fitTo(workspace.data('dataname'),
ROOT.RooFit.Extended(True),
ROOT.RooFit.Save(True),
ROOT.RooFit.Minimizer("Minuit","Migrad"),
ROOT.RooFit.Offset(True)
)