Hi rooters,
I added in my gui a TFitEditor panel, in this way the user can have a sort of interactive fitter.
I embedded the fitpanel in my gui in the following way
vFrameTab3_2b->SetEditable(kTRUE);
new TFitEditor(NULL,NULL);
vFrameTab3_2b->SetEditable(kFALSE);
where vFrameTab3_2b is a TGCompositeFrame.
But when I run the code everything I have the following error
Error in <TList::AddLast>: argument is a null pointer
Concerning the error, I am not an expert but may it be related to the fact that I launch my TFitEditor with neither an object to fit nor a function to perform such fit.
Moreover, I have no idea how to retrieve informations after the fit has been performed: since I did not build the TFitEditor, I have no Fit-button to connect to some method.
Well, I’m not the author of the editor, but I think you’re using it the wrong way. It should be connected to a TCanvas in order to automatically get connected to its histogram…
Well, I’m not the author of the editor, but I think you’re using it the wrong way. It should be connected to a TCanvas in order to automatically get connected to its histogram…
Maybe I did not explained myself correctly…
I can connect the TFitEditor to the object I want to fit by clicking on it.
The one thing I am interested in and which I cannot get (up to now) is retrieving the fitted information such as the fitted function.
I tried to use the TFItEditor::GetListOfFittedFunctions()->Print() but such command is called when I launch my gui and because of no fit has been performed yet no function is listed.
What I would like to do is to connect the Fit-button to a function so that I can call these methods after the fit has been performed.
that command gives the list of the predefined functions of ROOT.
Anyway, it could be useful in the future for me but right now I am looking for something that allow me to know whether the fit has been performed or not.
More precisely, I would like to produce a residual graph, but only after the fit has been executed.
Actually I have access to the graph that has been fitted.
I wanted to plot the residual graph only when it makes sense, i.e. when the fit has been performed.
Do you have any suggestion?
From the TGraph you can get the fitted function using TGraph::GetFunction(name) or TGraph::GetListOfFunctions() if you don’t know the name.
The function contains information about the fit, such as the chi2-square. If it is not zero, a fit has been performed.
Although you cannot really know if the fit was successful. The return status from the fitter is saved only in the FitResult class.
Thanks a lot: it worked perfectly!
Concerning the TFitEditor I have another problem: is it possible to change the dimensions of the TFitEditor embedded into my frame in my gui?