\label{subsec:fast}

Given the highly CPU time--consuming nature of global PDF fits, the direct evaluation of
the lengthy (N)NLO hadronic cross sections during  the PDF fit is not feasible.
%
For this reason, until around 2008 PDF, fits included hadronic data using LO
hadronic cross-sections supplemented by bin--by--bin $K$-factors, defined
as
\be
K_{\rm NLO}^i\equiv\frac{\sigma_i^{\rm NLO}}{\sigma_i^{\rm LO}} \, ,
\ee
using the same PDF set in the numerator and in the denominator.
%
To ensure consistency of the procedure, these $K$ factors were computed iteratively
until convergence was achieved.
%
However, this approximation is known to have several deficiencies, the most
important one being the reduced sensitivity to those partonic initial states
that only enter the cross-section at NLO and beyond.

In order to improve over this  unsatisfactory situation, the method
of {\it fast interfaces} was proposed.
%
In these methods, the most CPU time consuming part of an (N)NLO calculation, namely the evaluation
of the partonic matrix elements by integrating over a very
large number of events, is precomputed {\it a priori} using
a complete interpolation basis for the input PDFs.
%
This way, the hadronic cross-sections can be reconstructed {\it a posteriori} by means
of a very efficient matrix multiplication of the PDFs evaluation in a grid of $(x,Q)$ points
and the precomputed partonic matrix elements at the same grid points.
%
These tools have become very popular within the community,
and are therefore used in the majority of
modern PDF fits.

Following a common approach, two main tools have been developed to tackle
this situation, {\tt APPLgrid}~\cite{Carli:2010rw} and {\tt FastNLO}~\cite{Wobisch:2011ij}.
%
The former is interfaced to the {\tt MCFM}~\cite{Boughezal:2016wmq}
and {\tt NLOjet++}~\cite{Nagy:2001fj} programs.
%
The latter is also interfaced to {\tt NLOjett++} as well as to
the NNLO $t\bar{t}$ calculation of Ref.~\cite{Czakon:2017dip}.
%
Therefore, using these tools, fast interfaces to the most commonly used
in PDF fits can be constructed.
%
More recently, the {\tt aMCfast} interface~\cite{amcfast} to
{\tt MadGraph5\_aMC@NLO}~\cite{Alwall:2014hca} has also been developed.
%
Given the automated character of this code, {\tt aMCfast} allows producing fast interpolation
of arbitrary NLO processes, defined by the user at run time.
%
It is also possible to produce fast grids for NLO calculations matched to parton shower
Monte Carlos, which opens the way to include in the PDF fit hadron-level cross-sections
such as $W$ boson in association with charmed mesons or forward $D$ meson production
at LHCb.

It is illustrative to describe here
the basic strategy of these fast interpolation methods.
%
We use the notation
of the {\tt APPLgrid} paper for concreteness, but the general method
is similar in the {\tt FastNLO} and {\tt aMCfast} cases.
%
All these methods
are based on representing the PDFs in $(x,Q^2)$ by means
of a suitable interpolation basis, computing a physical cross-section for a basis PDF set,
and then reconstructing the same observable {\it a posteriori} using
an arbitrary PDF set.
%
Therefore, to begin, with, one expands an arbitrary PDF $f(x,Q^2)$ in terms of a suitable
basis of interpolating polynomials as follows
\be
\label{eq:interpolatingpolynomials}
f(x,Q^2)=\sum_{i=0}^n\sum_{j=0}^{m}f_{k+i,\kappa+j}I_i^{(n)}\lp \frac{y(x)}{\delta y}-k\rp
I_j^{(m)}\lp \frac{\tau(Q^2)}{\delta \tau}-\kappa\rp \, ,
\ee
where $n$ and $m$ are the interpolation orders in $x$ and $Q^2$ respectively, 
$y(x)=\ln 1/x+a(1-x)$ and $\tau(Q^2)=\ln\left(\ln Q^2/\Lambda^2\right)$, and $I_i^{(n)},I_j^{(m)}$
are interpolating functions, for instance Lagrange interpolating polynomials,
though this expression holds generically for other choices.
%
In Eq.~(\ref{eq:interpolatingpolynomials}),
$k$ and $\kappa$ are the grid nodes associated with a given values
of $x$ and $Q^2$, and are defined as
\be
k(x)={\rm int}\left(\frac{y(x)}{\delta y}-\frac{n-1}{2}\right),\,\kappa(Q^2)=
{\rm int}\left(\frac{\tau(Q^2)}{\delta \tau}-\frac{m-1}{2}\right),
\ee
with ${\rm int}(u)$ being the largest integer that is smaller than $u$.

After the representation of the PDFs
Eq.~(\ref{eq:interpolatingpolynomials}) has been constructed, we need
to evaluate cross-sections using the same interpolation basis.
%
Let us consider here
for simplicity a hypothetical DIS structure function $F$ that receives contributions
from a single flavour.
%
Such NLO cross-section is usually computed by means of a Monte Carlo program that generates a large
number $N$ of events, each one with weight $\omega_m$ and with associated values
$x_m$ and $Q_m^2$.
%
If $p_m$ is the order of $\alpha_s$ for this specific event, the total cross-section
can be written as
\be
\label{eq:applgrid1}
F=\sum_{t=1}^N\omega_t \lp \frac{\alpha_s(Q^2_t)}{2\pi}\rp^{p_t} f(x_t,Q^2_t) \, .
\ee
The fast interpolation grid can then be constructed by, instead of computing $F$ as in
Eq.~(\ref{eq:applgrid1}), introducing a weight grid $W_{i_y,i_\tau}^{(p)}$, and for each event
only a fraction of the grid nodes is updated according to the expression
\be
W_{k+i,\kappa+j}^{(p_t)}\to W_{k+i,\kappa+j}^{(p_t)}+\omega_t
I_i^{(n)}\lp \frac{y(x_t)}{\delta y}-k\rp
I_j^{(m)}\lp \frac{\tau(Q^2_t)}{\delta \tau}-\kappa\rp \, .
\ee
Conceptually, the weight grid $W_{i_y,i_\tau}^{(p)}$ is the equivalent of computing
the structure function $F$ for a given combination of interpolating polynomials
rather than for the original parton distributions.

An important factor here is that the most CPU time intensive computation, namely the
calculation of the MC weights $\omega_m$, needs only to be done once to fill
the grid  $W_{i_y,i_\tau}^{(p)}$, and the PDF can be decided {\it a posteriori}
at virtually no extra computational cost.
%
Indeed, it can be shown that the structure function can be reconstructed
{\it a posteriori}
using the weight grid using the following expression:
\be
\label{eq:applgrid2}
F = \sum_p\sum_{i_y}\sum_{i_\tau}W_{i_y,i_\tau}^{(p)} \lp \frac{\alpha_s(Q^2_{i_\tau})}{2\pi}\rp^p
f(x_{i_y},Q^2_{i_\tau}) \, .
\ee
In other words, the only information which is needed is the value of the
PDFs and the strong coupling at the grid nodes $i_y,i_{\tau}$.
%
The method can be straightforwardly generalized to hadron-hadron collisions and to a generic composition
of the initial parton state, taking into account that now the formula includes two PDFs.
%
In proton-proton collisions, the analog of Eq.~(\ref{eq:applgrid2}) is given by
\be
\label{eq:applgrid3}
\sigma = \sum_p\sum_{l=0}^{n_{\rm sub}}\sum_{i_{y_1}}\sum_{i_{y_2}}\sum_{i_\tau}W_{i_{y_1},i_{y_2},i_\tau}^{(p)(l)} \lp \frac{\alpha_s(Q^2_{i_\tau})}{2\pi}\rp^p
\mathcal{L}^{(l)} \lp x_{1,i_{y_1}},x_{2,i_{y_2}}, Q^2_{i_\tau} \rp \, ,
\ee
where we have indicated that there are $n_l$ contributing partonic subprocesses,
each with the corresponding luminosity $\mathcal{L}^{(l)}$, which depend on the cross-section
upon consideration.
%
The more complex the process is, the larger the number of independent PDF luminosities
that will be relevant for the calculation.
%
Moreover, the  extension of Eq.~(\ref{eq:applgrid3}) to NNLO calculations
is conceptually simple, although challenging in practice since NNLO codes are rather
more complex than NLO ones.

In order to illustrate the high precision that these fast interfaces can achieve,
we show two representative examples in Fig.~\ref{fig:fastinterfaces}.
%
First of all, we show the ratio between the {\tt NLOjet++} calculation
   of inclusive jet production at NLO for 7 TeV in the rapidity interval
   $2 \le y \le 3$ and the corresponding {\it a posteriori} calculation
   based on {\tt APPLgrid}, for different values of the factorization
   and renormalization scales.
   %
   One sees that the differences between the original and the interpolated
   calculation are at the few permille level.
   %
   Then we show the transverse momentum distribution of photons in the $pp\to \gamma+{\rm jet}$
   process at 7 TeV, comparing the original {\tt MadGraph5\_aMC@NLO} calculation with the
   {\it a posteriori} result based on {\tt aMCfast} and {\tt APPLgrid}.
   %
   The lower insets show the ratio between the two calculations for different
   choices of $\mu_R$ and $\mu_F$.
   %
   Here, we also find excellent agreement between the original and interpolated
   calculations, now at the sub-permille level.
   %
   Note that in all these methods, the interpolation accuracy can be arbitrarily increased
   by using denser grids in $x$ and $Q^2$.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{figure}[t]
\begin{center}
  \includegraphics[scale=0.46]{3-datatheory/plots/fastinterfaces.pdf}
   \caption{\small Left: the ratio between the {\tt NLOjet++} calculation
   of inclusive jet production at NLO with $\sqrt{s}=7$ TeV in the rapidity interval
   $2 \le y \le 3$ and the corresponding {\it a posteriori} calculation
   based on {\tt APPLgrid}, for different values of the factorization
   and renormalization scales.
   %
   Right: the transverse momentum distribution of photons in the $pp\to \gamma+{\rm jet}$
   process at 7 TeV, comparing the original {\tt MadGraph5\_aMC@NLO} calculation with the
   {\it a posteriori} result based on {\tt aMCfast} and {\tt APPLgrid}.
   %
   The lower insets show the ratio between the two calculations for different
   choices of $\mu_R$ and $\mu_F$, highlighting the good agreement in all cases.
    \label{fig:fastinterfaces}
  }
\end{center}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

While the fast interfaces that we have just described
represent a very significant improvement in terms of CPU efficiency
as compared to the original (N)NLO calculations, one limitation of this approach
can be seen from the master formula for proton--proton collisions, Eq.~(\ref{eq:applgrid1}):
each time that the PDF set is varied, one needs to recompute again
its values in the $(x,Q^2)$ nodes.
%
In a PDF fit, this means that each time the input parametrization is modified during the
iterative minimization, the  DGLAP evolution equations need to be solved again, before
the PDFs can be convoluted with the interpolated coefficient functions to obtain
the hadronic cross-section.
%
Therefore, even {\tt FastNLO} or {\tt APPLgrid} tables might not be fast enough
in the case of PDF fits with extremely intensive minimization algorithms, such
as the NNPDF approach, which involves training a neural network
within a $\mathcal{O}\lp 300\rp$ parameter space.

To improve upon this shortcoming, recently the {\tt APFELgrid} tool has been
developed~\cite{Bertone:2016lga}.
%
The goal of {\tt APFELgrid} is to combine the interpolated partonic cross-sections
provided by {\tt APPLgrid} with the DGLAP evolution factors provided by {\tt APFEL}, in a way
that hadronic cross-sections can be reconstructed from a matrix multiplication requiring
only as input the values of the PDFs at the $x$ grid nodes at the input evolution scale $Q_0$.
%
This way, the need to solve the DGLAP PDF evolution
equations during the fit is bypassed.
%
The combination of these two ingredients
then leads to a very significant improvement in computation speed as compared to
 Eq.~(\ref{eq:applgrid1}) without any loss of numerical accuracy, and therefore allows
 much faster PDF fits.
 %
 Mathematically, the {\tt APFELgrid} method allows expressing an arbitrary hadronic cross-section
 as follows
 \be
 \label{eq:apfelgrid}
\sigma_{pp\to X}=\sum_{k,l}\sum_{\delta,\gamma}\widetilde{W}_{kl,\delta\gamma}f_k(x_\delta Q_0^2)f_l(x_\gamma,Q_0)\, ,
\ee
in terms of the PDFs at the parametrization scale $Q_0$, where $k,l$ run over all active parton flavours
and $\delta,\gamma$ run over the nodes of the $x$ interpolating grid.

To gauge the improvements in computational efficiency that can archived by this method,
in Fig.~\ref{fig:apfelgrid} we show a comparison of the timings per data point between the
   original {\tt APPLgrid} computation of hadronic cross-sections,
   Eq.~(\ref{eq:applgrid2}), with the same calculation
   based on the {\tt APFELgrid} combination, Eq.~(\ref{eq:apfelgrid}), for a variety of
   LHC datasets.
   %
   As we see from this figure, the improvement in computational speed is between a factor 100 and a factor 1000
   depending on the specific dataset.
   %
   This means that PDF fits based on {\tt APFELgrid} will be much faster, by up
   to two orders of magnitude, which is a very attractive property of this method.
   
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{figure}[t]
\begin{center}
  \includegraphics[scale=0.65]{3-datatheory/plots/apfelgrid.pdf}
   \caption{\small Comparison of the timings per data point between the
   original {\tt APPLgrid} computation of hadronic cross-sections,
   Eq.~(\ref{eq:applgrid2}), with the same calculation
   based on the {\tt APFELgrid} combination, Eq.~(\ref{eq:apfelgrid}), for a variety of
   LHC datasets~\cite{Bertone:2016lga}.
   %
   We find that the improvement in computational speed is between a factor $10^2$ and a factor
   $10^3$
   depending on the specific process.
    \label{fig:apfelgrid}
  }
\end{center}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
