Hi I want to use m fitting parameter value from ascii file …how do i do it ?
TF1 func("func","*(1 - *x*x - *x*x*x", 1.0, 10.);
I want the parameter (, , ) to be read from an ascii file (test.dat) which has three number (one single line as below)
0.3 0.4 0.13
how to read and assign the parameter values of “func” from test.dat ?
TF1 func("func", "*(1. - *x*x - *x*x*x)", 1., 10.);
std::ifstream ifs("test.dat", std::ifstream::in);
ifs >> (func.GetParameters())
BTW. When you post “output” or “source code” here, do remember to enclose them into two lines which contain just three characters ``` (see how your post has been edited above).
Thanks, yes i can read it from ascii file but the parameters are not fixed to the values shown
in ascii file…because when i use “func” to fit a histogram, i see ,  and  are completely different than the values in ascii file. How can i fix those parameters to the values shown in ascii file…
For example i want  to be fixed to 0.3, and  to be fixed to 0.4, and  to be fixed to 0.13.
Fixed it…don’t worry. Thanks.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.