Problem with Minuit. Don't recognize an array¿?

Hello again!

I don’t know exactly what’s the problem with Minuit because this code is tested separately of this class to work in this class.

I think that the problem is with the scope of array Intensidad.

Basically, the class reads the data from two files and store these data in a TObjArray of histograms. In calibradoxpos() method, I try to adjust the data of all of the histograms of the TObjArray of histograms with TMinuit.

Bye!
ref_antesraw.C (513 KB)
ref_antes.C (1.76 KB)
clase.C (6.19 KB)

Your code has far too many C++ basic errors. To see them, I suggest to do
root > .L clase.C+

Rene

Hello again!

I reviewed the source code with ACliC compiler as you suggested me and I removed some basic errors, but yet I’ve got three errors that I would like to tell you. The most important is that the line

min->SetFCN(clase::fcn);

is worng. AcliC says me that this function is unknown type. Only recognizes void* type. I’ve tried to make some casting but I’vent solved the problem. Also tell me something about TStrings in other lines but I think this is not important, and also, I think it’s boring that don’t accept me litterals as name.

Can you give me some clue to resolve this little problem?

I give you a copy of the program reviewed.

I’ve heard something about using wrappers to solve fcn problem but I don’t know very well what is a wrapper.
clase.C (5.96 KB)

min->SetFCN(clase::fcn); The parameter to SetFCN can NOT be a member function. It needs to be a free standing function:

void fcn_wrapper(Int_t &, Double_t *, Double_t &f, Double_t *, Int_t) { clase::fcn(....); }

Cheers,
Philippe

Has anyone tried this yet? If I try it does not work and I am rather sure I am doing something wrong.

I think it would be best if anyone could clarify what … in

{ clase::fcn(…); }

HAS TO include and if it is OK, to have there some additional parameters.

The wrapper will be call with the 5 usual parameters. You wrappers can take those and manipulate as necessary and pass only the needed arguments to your static function (and/or add additional arguments).

Cheers,
Philippe

The wrapper will be call with the 5 usual parameters. You wrappers can take those and manipulate as necessary and pass only the needed arguments to your static function (and/or add additional arguments).

Cheers,
Philippe

So with the code you previously send this would be

void fcn_wrapper(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag) { class::fcn(npar,gin,f,par,iflag); };but can of course be much most fancy :slight_smile: