Re: [ROOT] Add Function to fFunctions in TH1

From: Rene Brun (Rene.Brun@cern.ch)
Date: Tue May 20 2003 - 19:45:18 MEST


Hi,

If you use TH1::Fit you can use the "+" option to add the newly fitted 
function to the histogram list of functions. (see doc of TH1::Fit)

If you do not use TH1::Fit, do:
  h->GetListOfFunctions()->Add(func);

I do not see anything ugly with this solution. Adding a new member 
function to TF1 is certainly possible, but I would be very reluctant
to add yet one more function to an already large interface.

Rene Brun


On 20 May 2003, Dan Krop wrote:

> Hi,
> 	I am doing a simultaneous fit to many histograms using TMinuit.  I
> would like to add the functions that I obtain from this fit to their
> corresponding histograms.  I do not see any accessors to the member
> variable *fFunctions in TH1, such as AddFunction or SetFunction, other
> than GetListOfFunctions.  Is the only way to add a function the ugly way
> of "histo.fFunctions->Add(func)"?
> 
> Dan
> 



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:11 MET