Hi Hermine, I have no problems in doing: root > .L tryFit.C root > TF1 *fFit = new TF1("fFit", fFitLandGaus, 0, 20,4); I can call your InitFunctions without problems. However, I cannot execute FitLandGaus because you forgot to send the LGconvl function and the Gaus function. For an example of fitting with multiple functions, see $ROOTSYS/tutorials/FittingDemo.C Rene Brun On Mon, 17 Jun 2002, Hermine Woehri wrote: > Hello, > > I want to use a function from a user defined library, which I load > whenever I start a root session (this function is a convolution of a > Landau with a Gauss). > > When I draw this function or add a print-out statement if this function is > known, there is no problem: I indeed see the function drawn on a canvas. > However, when I try to define a new function > using this predefined function, > TF1 *fFit = new TF1("fFit", "fFitLandGaus", 0, 20,4); > or > TF1 *fFit = new TF1("fFit", fFitLandGaus, 0, 20,4); > > I get the following error message: > > Function:fFit cannot be compiled > > I have attached a few lines of code, where you can follow up the steps, > that I want to do. > > The final command that I want to use is: > > TF1 *fFit = new TF1("fFit", "fFit+f1", 0, 20,7); > > I saw that it is possible to "add" two predefined function on the webpage > for the TF1 - class (http://root.cern.ch/root/html302/TF1.html) > > > Example: > { > TF1 *fcos = new TF1 ("fcos", "[0]*cos(x)", 0., 10.); > fcos->SetParNames( "cos"); > fcos->SetParameter( 0, 1.1); > > TF1 *fsin = new TF1 ("fsin", "[0]*sin(x)", 0., 10.); > fsin->SetParNames( "sin"); > fsin->SetParameter( 0, 2.1); > > TF1 *fsincos = new TF1 ("fsc", "fcos+fsin"); > } > > > I hope it is a trivial problem to solve, > > Thank you, > > Hermine Woehri > > > > +------------------------------------------------------+ > |Hermine Katharina Woehri hermine.woehri@cern.ch | > +------------------------------------------------------| > |EP Division office: +41 22 767 9408| > |CERN mobile: +41 79 201 0715| > |CH-1211 Geneve 23 fax: +41 22 767 9780| > |Switzerland private: +33 450 42 4415| > +------------------------------------------------------+ >
This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:57 MET