Integral of a TSpline

Dear all,

what is the best way to integrate a TSpline? Should I construct a TF1 function calling TGraph::Eval and use TF1::Integral (seems inefficient since Eval throws away the spline after every evaluation), or is there a way to cast the TSpline into a TF1 to apply the Integral method? Or is there a direct way to integrate the TSpline itself?..

Thanks for any advice!

Thomas

Thomas,

Of course the best way would be to implement a TSpline::Integral along the lines of TF1::Integral. If you are courageous enough to make an implementation, let me know.
Otherwise you have to proceed with a more expensive interface via a TF1.

Rene

Hi Rene,

I see… To me a spline is essentially just a function defined in some particular way. Couldn’t the TSplines simply derive from TF1 and then get all the goodies like Integral from it? (Rather than trying to copy TF1::Integral over to TSpline.) Is there a deeper reason for not having this inheritance?

Thanks again,

Thomas