Hi Kalen, What you do should work. Could you send me a copy of your function? When writing a TF1 referencing an interpreted or compiled function, the function is tabulated at fNpx values in such a way that you can always draw the function in the reading program even if the code of the function is not available. In your case, it looks like the function is being evaluated with a division by 0. Rene Brun On Wed, 21 May 2003, Kalen Martens wrote: > Hi again, > > Is it possible to save a function (a TF1 object, for example) to a .root > file? I am having difficulties when I try: > > root [14] TFile f("DeltaNLR_functions.root","recreate"); > > root [15] TF1 *qq_mh100 = new TF1("qq_mh100", DeltaNLR_qq_1D_mh100, 350., > 1200., 0); > > ...define more functions... > > root [26] qq_mh100 -> Write(); > Error: operator '/' divided by zero FILE:/tmp/sxAeOo_cint LINE:17 > *** Interpreter error recovered *** > > It looks like the function is being evaluated. The Draw() method works > just fine and without any errors, but the Write() is doing something > strange. > > Thanks, > > -Kalen > > ----------------------------------------------------------------- > - Kalen Martens Ph:(416)-978-6632 - > - Dept. of Physics - > - University of Toronto, Toronto, Canada - > ----------------------------------------------------------------- >
This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:11 MET