TFormula

From: zaldy <zaldy_at_neutrino.kek.jp>
Date: Tue, 25 Oct 2005 10:59:05 +0900 (JST)

Dear Rooter,

I wanted to insert a numerical constant inside the TFormula class. If I change the value of the numerical constant I keep on changing the code to update the numerical value.

How can we insert a numerical constant in TFormula?

For example:

   TFormula * form1 = TFormula("form1","10*sin(x)");

Sometimes I want to change the constant 10 to 15 or other values so I have to update the code again.

How do we make it like this:

   TFormula * form1 = TFormula("form1","FuncConst()*sin(x)");

where FuncConst() is defined (Double_t FuncConst() ) elsewhere.



I see one hint in the use of the TMath functions, for example:    

    TFormula * form1 = TFormula("form1","TMath::C()*sin(x)");

Can inheriting from TMath class be possible for this case?

Thanks.

-- 
Zaldy A. Nawang
Received on Tue Oct 25 2005 - 04:00:46 MEST

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:13 MET