[WIP] Use existing code for arclengths
Created by: scarlehoff
This should be understood as a skeleton/interface which needs a bit of crowd-sourcing.
-
From the point of view of
n3fit
: I want to call a functioncompute_arc_length
that takes as argument a pdf object and returns an array of arc_lenghts. In this first commit that pdf object is just a function f(x_{xsize}) -> y_{xsize, 14}. -
From the point of view of vp: There is a function that takes a pdf object and returns an array of arc lenghts. The difference now is the
xplotting_grid
function which is expecting a proper LHAPDF pdf with all its replicas and Qs. Here it would be receiving the output of ann3fit
model, which means one single replica for one fixed Q.
There are several ways to go around this. My proposed solution, which I also commented a bit in #558 (closed) not sure whether it is the best solution because of the reasons given there.
Create a "N3PDF" class which tries to replicate the LHAPDF class. i.e., have things like a method load
(which would just return itself) or grid_values
. This has the advantage that we can start using many vp features right away without changing anything. Also, in reality most of vp would still be used with LHAPDF pdfs. The disadvantage is a bloated class that can introduce bugs by not doing what was expected from it.
Another possible solution is, branch each time we need to do lhapdf-specific stuff. Advantages and disadvantages afaict are the inverse of the previous approach.
Opinions welcome and needed. This PR is just for the arclengths but it will probably define the direction of future development.
Edit: current plan Create a N3PDF class inheriting from the PDF class. All functions from vp should be made to rely on that instead of on the LHAPDF class (most of them do anyway) so they should be changed as we go.
Closes #558 (closed).