Hello,
I am running into a problem when I try using TF1 and call another method. My code is as follows:
TF1 *f2 = new TF1( “f2”, “PionCTH([0], x)”, -1, 1);
f2->SetParameters( 0, ke);
and I have PionCTH defined as its own method:
Double_t PionCTH(Double_t a, Double_t b)
{
return(a*b); //the simplest formula to help with the debugging process
}
My file is an executable (.cxx file) and when I compile it, everything works fine. But, as soon as I try to run it, I get the following errors:
Error in TFormula::Compile: Bad numerical expression : PionCTH([0],x)"
Error in TF1::TF1: function: f2/PionCTH( [0], x) has 0 parameters instead of 1
I am using the following version of Root:
-
*
-
W E L C O M E to R O O T *
-
*
- Version 5.14/00e 29 March 2007 *
-
*
- You are welcome to visit our Web site *
-
[root.cern.ch](http://root.cern.ch) *
-
*
FreeType Engine v2.1.9 used to render TrueType fonts.
Compiled on 24 May 2007 for linux with thread support.
CINT/ROOT C/C++ Interpreter version 5.16.16, November 24, 2006
Hopefully someone knows of what I’m doing wrong, or what I need to fix to get this working.
Thanks in Advance,
Alex L