[ROOT] Questions on TMinuit::SetFCN

From: Yiqun Wang (yqwang@rcf.rhic.bnl.gov)
Date: Thu Aug 28 2003 - 18:13:50 MEST


Hi, ROOTers:

I have a question on using TMinuit. I read the tutorial "Ifit.C", but it
did not answer my question. I am using ROOT 3.10.00 self-compiled on
Mandrake 9.1.

In "Ifit.C", the data points "Float_t z[5],x[5],y[5],errorz[5];" are
global variables. This is understandable, since "void fcn(Int_t &npar,
Double_t *gin, Double_t &f, Double_t *par, Int_t iflag)" has not idea what
data points to use beforehand. However, this is ugly, not particularly
safe.

Now suppose I want to make a custom fitter for my own class. Data points
will come from the members of the class (actually I will reload the data
members every event, use the fitter, and write fit result to a tree). Can
I call "TMinuit::SetFCN(...)" on a memeber function "void fcn(Int_t &npar,
Double_t *gin, Double_t &f, Double_t *par, Int_t iflag)" (so it knows the
member data, without the need to make the data global)? Is this possible?
Or there is a better solution?

Thanks in advance!

Yiqun Wang



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:15 MET