4 Dec 2006 13:59
Re: [ROOT] TMinuit function arguments
Rene Brun <Rene.Brun <at> cern.ch>
2006-12-04 12:59:39 GMT
2006-12-04 12:59:39 GMT
Hi Till, Instead of making the arrays t and sigma global, define only one global pointer to an object that includes these 2 arrays. We are currently considering extensions to the fitter where a pointer to an object could be specified instead of the FCN. Rene Brun Till Sawala wrote: > Hi Rooters, > > I would like to minimze a likelyhood-function of 1 parameter with Tminuit. At the moment, I use the following pair of functions (adapted from http://root.cern.ch/root/html/examples/Ifit.C.html): > > void NLL(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag) > { > Double_t LL = 0.0; > const Int_t nbins = 100000; > > for (int i=1; i<nbins; i++) > { > LL += TMath::Log(Prob(t[i], sigma[i],par)); > } > > f = -1. * LL; > } >(Continue reading)
RSS Feed