Re: [ROOT] TF1 constructors/fitting user function.

From: Rutger van der Eijk (r36@nikhef.nl)
Date: Wed Jun 28 2000 - 10:54:51 MEST


Hi Marco,

> Actually, I have made a class which derived from TF1 and overloaded the
> Eval() and EvalPar() methods, in oredr to be able to use a fitfunction,
> which a programmed myself. This is especially convenient since this
> function needs input from a certain histogram, which serves as a range
of
> fixed parmeters. This seems to work fine, although, of course, if such a
> function is attached to a histogram after fitting, it doesn't work
> anymore, because it will be copied to a TF1... However, this possibility
> has never been suggested in earlier discussion about the use of user
> functions in a TF1 (notably also about using object member functions).
> Is anyone aware of any additional (or 'hidden')  problem to be expected
> with this implementation??

I also derived some specialised functions from TF1. The clear advantage
is that everything related to the function is grouped in one place (i.e.
no user function etc.. needed). I did not experience any problems. Of
course this use is not completely correct because your derived class "is"
not a TF1 (which is the case for a publicly derived class), i.e. it
should not have e.g. the behaviour of TFormula (defining forumla from a
string etc...). But as said, it seems to work.

Rutger



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:29 MET