I am new to ROOT, but read the userguide. And still I have the following problem. I can;t get fit parameters shown in the fit. Page 72 of the userguide said I have to use gStyle->SetOptFit() for this, so i did. But still no parameters in the fit.
I use the following code where i read a file called data.root, define a 5 parameter function and set the parameters with a first guess.
[code]{
gStyle->SetOptFit(2);
TFile *f = new TFile(“data.root”);
TF1 *fit = new TF1(“fit”,"[0]exp(-x/[1])(1+[2]*cos([3]*x+[4]))",0,700e3);
When you are reading histograms from a root file and want to change those kind of option settings you need to call h->UseCurrentStyle(), i.e.[code]{
gStyle->SetOptFit(2);
TFile *f = new TFile(“data.root”);
TF1 *fit = new TF1(“fit”,"[0]exp(-x/[1])(1+[2]*cos([3]*x+[4]))",0,700e3);