TF1 as a member

From: Wouter Hulsbergen (s37@nikhef.nl)
Date: Thu Mar 26 1998 - 11:44:05 MET


Dear Root,
I would like to create a member object TF1, in order to plot a member
functions, like in

class A
{
public:
  A() ;
  Double_t fSquare(Double_t*, Double_t*) ;
private
  Double_t a;
  TF1 gSquare ;
};
Double_t A::fSquare(Double_t* x, Double_t* par) { return a * *x * *x ; }
A::A() : gSquare("gSquare",fSquare) {} ;

However, I get the compiler error
Error 541: "nogeentest.C", line 12 # Nonstatic member function "double
    A::fSquare(double *,double *)" is used incorrectly (must be either
called
    or used to form a pointer to member).
    A::A() : gSquare("gSquare",fSquare) {} ;
                               ^^^^^^^      
I tried a lot of other things, but didn't find anything that works. Can
anybody tell me whether it is possible at all to create a TF1 from a
member function, and if, how, and if not, why ?

Regards,
Wouter



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:34:31 MET