Dear experts,
I noticed that the Legendre polynomials are used by INCL, ABLA and HP models, and each one uses a different implementation [1-3]. In addition, there is a wrapper of GSL [4] in CLHEP [5].
Since these Legendre polynomials are used at every step to calculate angular distributions, they are likely very hot and maybe the particular implementation of these functions in hadronic processes are not fully optimal. Would it be worth to refactor the calls to these functions, so hadronic models use the CLHEP implementation instead?
Thank you for your time.
Best,
Alvaro
[1] geant4/source/processes/hadronic/util/include/G4LegendrePolynomial.hh at e58e650b32b961c8093f3dd6a2c3bc917b2552be · Geant4/geant4 · GitHub
[2] geant4/source/processes/hadronic/models/abla/include/G4Abla.hh at e58e650b32b961c8093f3dd6a2c3bc917b2552be · Geant4/geant4 · GitHub
[3] geant4/source/processes/hadronic/models/coherent_elastic/src/G4NuclNuclDiffuseElastic.cc at e58e650b32b961c8093f3dd6a2c3bc917b2552be · Geant4/geant4 · GitHub
[4] Special Functions — GSL 2.8 documentation
[5] legendre · Search · GitLab