TF2 2D array

Hello Rooters,
I tried to add TF2 2D array as follows.(First I tried TF2 1D array, it was working fine)
Once I introduced following lines to the code.root quit unexpectedly.

TF2 * fLikeli[nQ2][nxB];
    for (int jQ2Bin=0; jQ2Bin<nQ2; jQ2Bin++) {
        for (int ixBin=0; ixBin<nxB; ixBin++) {
            sprintf(fName,"fLikeli_Q2_%02d_xB_%02d",jQ2Bin, ixBin);
            fLikeli[jQ2Bin][ixBin]= new TF2(fName,Likelihood,0.0,1.0,0.0,10.0,4);
            fLikeli[jQ2Bin][ixBin]->SetParameters(-0.5,2.0,2.0,1.0);
        }
    }


Attached my code here.Could you help me to figure this out?

Thanks
Dil
Logli_search.cpp (4.6 KB)

xBQ2binning.root (1.9 MB)

Hi

You have an error in your code. The line 87 should be:

double LogLi[nQ2][nxB], NBin[nQ2][nxB];

Lorenzo

Thank you,@moneta