Fitting problem

Hi!
I’d like to fit 3 parameter function to histogram containing my data, but ROOT seems not to cope with it.
I had “manually” find parameters for one of histograms and tried to set these as start values, but it didn’t help.
I had huge amount of data and I wish I could do all the fits with ROOT.
I’m attaching sample code with data.
If someone could tell me how make it works, I would be grateful.
nofit.c (1.25 KB)

Hi Adam,
simple move:float A[3]; A[0]=37.3512; A[1]=6.4672; A[2]=0.5656; func->SetParameters(A[0],A[1],A[2]);immediately after: TF1 *func = new TF1("func","[0]*x^[1]*exp(-x/[2])",0,42);
(and before fit: hist1->Fit(“func”,“W”, “CP”);

Jan