TFitResult has no attribute "Parameter"

Hi,
I’m trying to use the new (5.26) FitResult with:

result = hist.Fit("gaus", "SR+", "", *interval) mean = result.Parameter(1) error = result.ParError(1)

But I get the following error:

mean = result.Parameter(1) AttributeError: 'TFitResult' object has no attribute 'Parameter'

Is the python version still to be completed? result.Print() works just fine…

Hi,

do you have a runnable script to reproduce the error? AFAICS, it simply works.

Cheers,
Wim

This is not working on my ROOT 5.26/00

[code]#!/usr/bin/env python
#coding=utf-8

from future import division, print_function
from ROOT import TH1D, TCanvas

hist_name = "gaussian"
hist = TH1D(hist_name, hist_name, 300, -3, 3)
canvas = TCanvas(hist_name + “canvas”, hist_name)

hist.FillRandom(“gaus”, 10000)
hist.Draw()

result = hist.Fit(“gaus”, “S”)
raw_input()
result.Print()
mean = result.Parameter(1)
error = result.ParError(1)
print(mean)[/code]

Traceback (most recent call last): File "result_error.py", line 17, in <module> mean = result.Parameter(1) AttributeError: 'TFitResult' object has no attribute 'Parameter'

Hi,

thanks for the script. AFAICS in 5.26, the TFitResult class does not have a Parameter() member function (it does in trunk, which is what I initially had setup). Recommend to use Parameters()[1] instead as that is available in 5.26, see TFitResult.h in both cases.

Cheers,
Wim

Alright, I upgraded to 5.27/06 and now it works. Thanks!