double FitFunction(double *x, double *pars) { double result = 0; for(int L=0 ; L<= 2 ; L++) { result += pars[L]*ROOT::Math::legendre(2*L,cos(x[0]*TMath::Pi()/180)); } return result; }