Tadeusz Pytlos wrote: > > Dear Rooters, > I've got a histo (hin) with small statistics. Before > fitting my own function (func) I'd like to smooth the > histo using pol9. So in fact I want to fit pol9 by > my own function. > What is the right way to do it? > I tried for example: > TF1 *hpol=new TF1("hpol","pol9(0)",0,m_max,npar); > hin->Fit("hpol","be"); > TF1 *fpol=gROOT->GetFunction("hpol"); > fpol->Fit("func","be"); > TF1 *fun=gROOT->GetFunction("func"); > > but I received > Function:hpol cannot be compiled > > *** Break *** segmentation violation > In your 3 statements above, when you fpol->Fit("func","be"), func is not defined at this point. In case of basic expressions such as polynomials, you do not need to create yourself a function. They are already known from Root. You can do directly: hin->Fit("pol9"); Please, next time, send a short working macro. > > Next question - Is the folding of histos implemented in ROOT? No Rene Brun
This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:34:38 MET