Problem with strange result

Well, it’s your code, right? You can simply replace the function calls to their content applied to single values. For example, replace this call:

AGBn = AGBn + fRSF(tmp1,par)*pow(tmp1,3)*(1/fLD(Bn,&par[nb]));by:

AGBn += par[RSF->GetXaxis()->FindBin(tmp1)-1]*pow(tmp1,3)*(1/par[LD->GetXaxis()->FindBin(Bn)-1]);
And apply the same recipe for the other calls…

Cheers, Bertrand.