PyROOT: RooAbsArg not casted into RooRealVar

Dear expert,

the following piece of code does not work:

#glm.coefficients() returns a RooArgList object
meas = glm.coefficients().at(i).getVal()

output:
AttributeError: ‘RooAbsArg’ object has no attribute ‘getVal’

In a C/C++ script, this would be fixed by a cast like (RooRealVar*)

What about PyROOT?

Thanks,
Vincenzo

Hi Vincenzo,

I cannot reproduce your issue (ROOT 6.10/04):

>>> import ROOT
>>>x = ROOT.RooRealVar("x","x",10,0,10)
[...]
>>> l = ROOT.RooArgList(x)
>>> l.at(0)
<ROOT.RooRealVar object ("x") at 0x7fbd8c61df70>
>>> l.at(0).getVal()
10.0

Cheers,
D

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.