I have a distribution in data between x-values of -1 and 1 that should follow a sum of Legendre polynomials, and I want to extract the fraction of order 0, order 1 etc, up to some fixed order, e.g. order 4.
For this, I tried to fit a RooGenericPdf since the RooLegendre class is not implemented as Pdf, however, this does not converge at all. I tried to fit the data with a RooChebychev, and this works perfectly fine. I could now calculate the coefficients of the Legendre Polynomials from these Chebychev coefficients, but it feels like there must be a better way to do this.
Do you have any suggestions?
Thanks a lot in advance!