Skip to content

MuonCalibMath - Use std::legendre function instead of custom made one.

Johannes Junggeburth requested to merge jojungge/athena:CalibMathLegendre into main

Remove custom made Legendre polynomials, given that there's a std::legendre equivalent. Plus the singelton pattern does not make sense. I've checked that the coefficients of the current implementation are matching what's in Wikipedia and also what's reported in the cpp standard.

c++

 switch(k) {
        case 0:
            return 1;
            break;
        case 1:
            return x;
            break;
        case 2:
            return 0.5*(3.0*x*x-1.0);
            break;
        case 3:
            return 0.5*(5.0*x*x*x-3.0*x);
            break;
        case 4:
            return (35.0*std::pow(x, 4)-30.0*x*x+3.0)/8.0;
            break;
Edited by Johannes Junggeburth

Merge request reports