Hello. Yes, I am on ROOT 5 – because our teacher demands the older version… So I can’t update.
I’m trying to calculate mean of X of a TF2D function. Let’s say for x and y both in [0, 1].
Error in <TFormula::Compile>: Empty String
Error in <TF2::TF2>: function: TF2_ExpValHelper/density_tf2*pow(x,1.000000)*pow(y,0.000000) has 0 parameters instead of 2
There is a limitation in the function computing the mean TF2::Mean2X. The function works only for formula (expression) based functions and not for compiled functions or functors are in your case.
I will open a JIRA issue for this to then able to fix it. The workaround, which I hope is not too much a limitation, is to define TF2 as following:
TF2* funcTF2 = new TF2("f", "TMath::Sin(x*y)", 0., 1., 0., 1.);