Hi there,
As a non-expert ROOT user, I am trying to use one of the existing examples to minimize a function (a chi-square function, to be precise).
I took one of the examples called NumericalMinimization which shows the usage with all the possible minimizers with the Rosenbrock function (a 2D -function). I thought i was easy to modify this macro to use any function I want, but it turned out not to be so.
My problem is that I need the function to minimize to be a kind of complicated chi-square function which depends on some other parameters.
double chi2(const double *xx, double *exp1, double *error, double *the1, double *NCb, int r1,double **ntuple, int ns, double dmn31, double sn2th, double integ)
Then, when using either
or
I thought I should pass all the parameters in chi2(), but an error message is displayed:
Error: Function chi2(obs,err,t1,NC_background,N_BINS,ntuple,NUM_SAMPLES,dmn31,sn2th,int_minos_no_osc) is not defined in current scope chi2Minim_22Jun11.C:275:
*** Interpreter error recovered ***
or
Error: Can't call Functor::Functor(&chi2,N_params,obs,err,t1,NC_background,N_BINS,ntuple,NUM_SAMPLES,dmn31,sn2th,int_minos_no_osc) in current scope chi2Minim_22Jun11.C:274:
Possible candidates are...
Error: class,struct,union or type Functor not defined chi2Minim_22Jun11.C:274:
*** Interpreter error recovered ***
respectively.
So the point is, how do I pass the necessary parameters to the function I want to minimize (it has N_params = 3 parameters to be “fitted”)?
Thanks in advance.
Best,
Mario AAO.