Sigma condition fit

Dear experts,
I have a dataset which follows a normal distribution and I have to fit it with a gaussian function within +/- 1 sigma. How can I achieve this?

What I tried is:
func = new TF1(“func”, “gaus”);
func->SetParameter(1, hist->GetMean());
func->FixParameter(2, 1);
hist->Fit(“func”, “B”);
But it does not work as expected. Any suggestions?

Thank you in advance!

hist->Fit("gaus", "", "", hist->GetMean() - hist->GetRMS(), hist->GetMean() + hist->GetRMS());


Thanks a lot!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.