Hi Greg, You mention TMinuit and TVirtualFitter, but you do not indicate which one you are really using in your external loop and in your internal loop. The following should work: - you create your own instance of TMinuit *myminuit = new TMinuit(...); - you then use only the myminuit pointer (not gMinuit) - you let TH1::Fit calls TVirtualFitter Rene Brun On Mon, 3 Mar 2003, Greg Landsberg wrote: > Dear Rooters, > > I have faced the following problem when trying to use TMinuit or > TVirtualFitter class to do a complicated minimization. My minimization > function, fcn, which is passed to TMinuit/TVirtualFitter via the SetFCN > method fills a histogram that it further fits to a certain function via > standard TH1F Fit() method. The results of this 'internal' fit are used > in order to estimate the return value of fcn. > > However, as soon as the first instance of the TH1F Fit() is called, the > Minuit is switched to optimize the histogram, not the function fcn! This > is as if there were just a single copy of the TMinuit object that exists > in memory, and is superceded with whatever the latest initialization > setting that took place (i.e. via TH1F Fit). > > This sounds like a bug to me, rather than a designed behavior. I wonder > if anyone faced a similar problem and knows a workaround. > > Please, CC: your reply directly to me, as I don't always read the > roottalk. > > Many thanks, > > Greg Landsberg >
This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:09 MET