Parameter issues with TF2 contains 2 same TF1

Dear Experts

I defined a TF2 function which contains TF1 two times:
**func2 = (“func2”,"log(1+[0]*func1 *3 *y)/([0] *func1 *3 *y)")
where the func1 = (“func1”, “[0]/sqrt(([1]/tan(x)),2)))+[2]”)

So in total there should be 4 parameters in 2D func2, but actually there are 7 parameters created since func1 are used double time. Is there a way to let TF2 only parameterize once when using the same function multiple times?

Please read tips for efficient and successful posting and posting code

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided

I think @moneta can help you.


It is nor clear to me what you are doing. The code is not readable. Can you please post the C++ code used for creating the TF1 and TF2 objects within the correct quotes (```) ?
See Posting code? Read this first!


  auto func1 = new TF1("func1", "[0]/pow(([1]/tan(x)),2)+[2]", 0., 1.);
  auto func2 = new TF2("func2", "log(1+[0]*func1(x,[1..3]) *3 *y)/([0] *func1(x,[1..3]) *3 *y)", 0., 1.);

This is what I meant, thank you very much! And sorry for the unclear code, I will put more readable code next time.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.