Fitting a graph

Is it possible to automatically discard points in a fit depending on if they fulfills or not any condition? I would like not to take into account some points in my fit which are far away from the others, and they disturb MINUIT to give the correct answer.


see example in tutorial fitExclude.C


Hi Rene,
Thanks for your reply. I think that I am searching for something different. What I would like to do is to automaticaly discard some points in the fit which are far away from the others and only contributes to annoy the fitting procedure. This behaviour of anomalous points is random and I can not set a specific range like in the example you told me.
Here I attach an example of the fit I am triying to do. First point in data disturb the well behavior and convergence of the fit, leading to bad result. I would like to not take into account that point (which is the first only in this case).
BetheBlock.h (2.47 KB)
fitEx.c (2.38 KB)

In the tutorial fitExclude.C we show how to exclude a range, but
you can use it to exclude one or more points too.
Just call TF1::RejectPoint() for the points you want to exclude.