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.
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)
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).
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