Dear Experts,
I am trying to persist a workspace. Reading it gives an error
File "read.py", line 17, in <module>
x = w["x"]
TypeError: 'RooWorkspace' object is not subscriptable
This happens directly executing the tutorials wspacewrite and wspaceread with version 6.22/08 (pyRoot)
EDIT
I managed to make it work using
x = w.var("x")
model = w.pdf("model")
data = w.data("modelData")
instead of
x = w["x"]
model = w["model"]
data = w["modelData"]
I also had to use RooArgList
explicitly, e.g. replacing
bkg = ROOT.RooChebychev(“bkg”, “Background”, x, [a0, a1])
by
bkg = ROOT.RooChebychev(“bkg”, “Background”, x, ROOT.RooArgList(a0,a1))
and changing the keywords sintax e.g. replacing
model.plotOn(xframe, Components=“bkg”, LineStyle=“–”)
by
model.plotOn(xframe, ROOT.RooFit.Components(“bkg”), ROOT.RooFit.LineStyle(10))
Is this a version problem? or maybe the tutorials are outdated?
Joan