Problems with finding minimum values

I’m not very experienced with Root analysis.
After studying laser diffraction from a slit I represent the pattern obtained with the TGraph. Is there a way to find all the local minima of the experimental points?


We don’t have in ROOT a specific algorithm for this. What we have is a function , TF1::GetMinimumX(min,max) to find the minimum of a function in the range [min,max].
From a TGraph you can create a TF1 early using a lambda function:

TF1 * f = new TF1("f",[&](double*x, double *p){ return graph->Eval(x[0]); }, xmin, xmax, 0); 

An alternative/complementary possibility is to use the TSpectrum class and its function to search for peaks.
You can use the peak positions as range for looking for the minima.


1 Like

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