gauss2d_fit_bb is a C function defined as Double_t gauss2d_fit_bb(Double_t *x, Double_t *par).
I have also tried TF2 *fit = new TF2(“fit”, gauss2d_fit_bb, 1330, 1400, 1330, 1400, 11, 2); where I assume that ndim is the number of dimensions, but I get the same error: no matching constructor for initialization of ‘TF2’
It seems to be correct from the documentation and it also ran fine previously. Is there a mistake I am making here?
I am running ROOT 6.04/02 and the error I get is
input_line_44:2:7: error: no matching constructor for initialization of ‘TF2’
(new TF2((“fit”, gauss2d_fit_bb, 1330, 1400, 1330, 1400, 11)))
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I am using just one set of parentheses, but in the error, there seems to be extra ones appended. Here is the exact line copied and pasted from my code.
I tried a copy and paste to a new file and used a second browser and I get the same error. I also checked in a hex editor to see if there were any invisible characters and I didn’t find any. My code is below.
the issue is that ROOT6 does not interpret the macros line by line as CINT did for ROOT5.
As a result, the variable name you use in the constructor is not available to the interpreter.
There are many solutions which would allow you to solve this issue, also with minimal reformulations of your macro. For example:
o Load the macro with the function before running the macro, e.g. invoking ROOT like this