Draft: Add higher dimensional pdfs
In this draft, I try to include higher-dimensional PDF's in LHAPDF. See detailed design decisions below.
Data Handling
Loading:
- added new key to
.info
files,GridDim: dim
indicates the dimensionality of the PDF grid - based on
GridDim
,GridPDF::_loadData
now decides whether to useGridPDF::_loadData2D
, orGridPDF::_loadDataND
. IfGridDim
is not set in.info
,GridPDF::_loadData2D
is used. - complete memory structure is reused from the 2D interpolations, with the exception of the knots. For 2D interpolations we had dedicated
std::vector
s for x,q2 knots, now reuse x-knots container for all knots - not support yet for discontinuities in the grids
Todos:
- add support for discontinuities in the grids
- add sanity checks while reading in the grids
- precompute log grids
Interpolations
General:
- this MR makes use of !25 (gathering all 1D interpolators in one header)
- add (purely virtual) new function for interpolators,
double _interpolateND(...)
. This might be the easiest method to ensure that no wrong interpolation is used by accident, since we have to implement the purely virtual functions anyways and we can throw an exception directly in the derived interpolators. - working tri-linear interpolator
Todos:
- automatically choose the interpolator with right dimensionality, depending on
GridDim
"Outside" API
- Added function
Interpolator::interpolateXQ2(int id, double x, double q2, double p2)
for 3D grids; (name is debatable)
Todos:
- what else do we need, 4D? ND? all pid-version(s)?