# Full Width at Half Maximum

Hello， I would like to know if there is a way to compute the Full Width at Half Maximum for a Irregular curve with only one peak? Thank you！

Hi,
the curve are you talking about, is a graph or a proper function?

Cheers,
Stefano

Hi，
the curve is a function which is used to fit a histogram .
If you can, I want to know the difference between the two——a graph and a proper function.
Thank you very much!

Ok, if is a function is simpler, because there are a lot of method to use.

The idea here is find the maximum, then search for the two point with a half maximum.

``````//In this way you find the maximum
double max = f->GetMaximum();
double x_maximum = f->GetMaximumX();

//let's search for the point of half maximum,
//one will be on the left and the other one on the right
//so the reason for the two call, using he lower and upper bound
//of the x range for the fuction.

double fwhm_left = f->GetX(max/2,x_lower_range, x_maximum);
double fwhm_right = f->GetX(max/2, x_maximum, upper_range_x);

cout<<"FWHM = " << fwhm_right - fwhm_left<<endl;

``````

The method I used are quite self-explantory, but below there is the link to the root page
TF1::GetMaximum()
TF1::GetMaximumX();
TF1::GetX()

The TGraph is only a 2D collection of point.

on the other hand the TF1, is most of the time defined analytically and you can have parameters to change, and for each x you have only one y, and you have a lot of calculus method to find the different property.

Hope is enough.

S

It is enough .Thank you again!