I would like to use a TGraph2D to smooth a curve f(a,b).
After filling the graph, TGraph2D->Interpolate(a,b)
returns 0 in many cases. This includes exact input points
and exact input points plus a small (+0.001) offset.
Draw does produce a reasonable smooth curve.
I tested this with several versions of 5.34 including 5.34/18 on lxplus.
To reproduce, please see attached file.
Double_t pt = 50 + 0.001;
Double_t eta = 1. + 0.01*i+ 0.001;
Double_t res = graph2d->Interpolate(pt,eta);
Double_t res2 = dt->ComputeZ(pt, eta);
Double_t res3 = dt->Interpolate(pt, eta);
std::cout << eta << " " << res << " " << res2 << " " << res3
I suspect what you observe is due to the fact that your points are distributed in a Grid and they are not random.
This is a known limitation of the current algorithm, and we hope to improve it in the future. However, if you have (x,y) points equally spaced, used the interpolations of the 2D Histogram (TH2)
Basically, I’m using Honda Neutrino Flux for INO site (with out mountain avg. azimuthal) and trying to produce a rough calculation of #muon event via CC, with DIS Fe56 scattering using its crossection.
for that I need interpolation on 2D Honda Flux(E,Zenith)
I am using root-v6-18-04@v6-18-04 version (the latest one).
Please suggest me what to do in this regard.