Use of parametrized formulae twice

From: Davide Cremonesi (davide@ifctr.mi.cnr.it)
Date: Tue Jan 11 2000 - 14:53:31 MET


Hello everybody.

I would like to define a set of parametrized formulae, e.g.

TFormula *f1 = new TFormula("f1","[0]*pow([1],[2])");
TFormula *f2 = new TFormula("f2","[0]*sin([1]/[2])");
etc...

and use them IN ANY ORDER in a TF1 object, for example:

TF1 *tf1 = new TF1("tf1", "f1 - [3]*f2", 0, 10);
tf1->SetParameters(1,2,3,4,5,6,7);

which does not work because the first three parameters are used also in
f2.
I cannot (I don't want to) know in advance the order of f1,f2 ... fN in
the expression
and therefore cannot write:
TFormula *f2 = new TFormula("f2","[4]*sin([5]/[6])");
which indeed works.

If I use for example gaus or expo I can specify expo(4) to start
numbering
its parameters from 4 on, but in this case using "f1 - [3]*f2(4)" does
not work.

Any suggestion on how to proceed?

Thanks in advance,
Davide Cremonesi



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