Reading fit parameters

I have a plot that I am fitting a Gaussian to, I would like to read the fit parameters of that process so I can check if any bin is overly filled (hot channels). When I try and do this I get a seg fault from root and get told

My code looks like this:


fit_hist = self.dig_cont[tra][sta][pla].Fit(“gaus”)
const = fit_hist.Parameter(1)[/code]

where dig_cont has been filled previously.

From output it looks like the fit is working properly, I get the parameters output to the screen. I just need to work with them in code.

As an aside. Is there a built-in way to compare bin contents with a fit, or another function? My thought on the subject was to take the parameters, find the value at x = bin and then do a GetBinContents(bin) and compare the results.

If it helps I’ve linked to an image of what the data output looks like when I’m not asking for parameters:

[code]fit_hist = self.dig_cont[tra][sta][pla]


const = fit_hist.GetFunction(“gaus”).GetParameter(0)[/code] … or … [code]fit_hist = self.dig_cont[tra][sta][pla]
fit_res = fit_hist.Fit(“gaus”, “S”)


const = fit_res.Parameter(0)[/code] … and then … hdiff = fit_hist.Clone("hdiff") hdiff.Add(fit_hist.GetFunction("gaus"), -1) hdiff.GetListOfFunctions().Clear() hdiff.Draw()

Thank you. Worked like a charm.