Quadratic interpolation

Dear all,

I need to perform an linear interpolation over a 4 dimensions map.
My map is basically a 3D space (x,y,z) joined to an energy dimension ==> f(x,y,z,E)=value

I have discrete points on that map and I would like to interpolate it to have a value for all the coordinates.

Well for now I have just read my text file containing that map :

  TTree *MyTree = new TTree("MyTree", "MyTree");
  MyTree->ReadFile("all.txt", "X/I:E/I:alpha/D");

Would you happen by any chance to know whether such an function already exist in ROOT ?
I saw that the TH2F contain a method interpolation but my 4 dimensions datas won’t fit in a TH2F.
Now I found that link on GitHub with examples using #include “Math/Interpolator.h” but it is applied to 2 dimensions interpolation.

Thank you. P.

Hello @PPierre,

I am inviting @moneta to this topic as the relevant expert in this area. Unfortunately, I think he is off for a couple of days, so it might take a while to reply.



If you want to do linear interpolation of your data (3d data + regressor value), you can use a 3d histogram (e…g. TH3D). There is an Interpolate function, see :

The requirement is that you have a 3d data grid.


1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.