> double fun1(double *xVec, double *Param)
> {
> double x, fVal;
> x=xVec[0];
> fVal=Param[0]*x*x + Param[1]*x + Param[0];
> return fVal;
>}
>
>double fun2(double *xVec, double *Param)
>{
> double x, fVal;
> x=xVec[0];
> fVal=Param[0]*x*x + Param[1]*x + Param[0];
> return fVal;
>}
>
>TROOT root("TF1 test","TF1 test");
>
>void main()
>{
> double Params[3]={1.0, 1.0, 1.0};
>
> TF1 *f1 = new TF1("fun1", fun1, -10, 10, 3);
> f1->SetParameters(Params);
> TF1 *f2 = new TF1("fun2", fun2, -10, 10, 3);
> f2->SetParameters(Params);
> printf("\n f1(2)=%f", f1->Eval(2));
> printf("\n f2(2)=%f", f2->Eval(2));
>
> // the following statement produces an error "ERROR 4 : Empty String"
> TF1 *f3 = new TF1("fun3", "fun1 * fun2");
>}
This code generates the following output:
>
> f1(2)=7.000000
> f2(2)=7.000000
>*ERROR 4 :
> Empty String
So, there's a problem when defining f3. Any comments? Thanks.