For many years, the H1 and ZEUS collaborations performed QCD
 analyses of their structure function data, first separately
and then together based on the H1+ZEUS combined datasets.
%
The backbone of these analysis was the neutral- and charged-current inclusive structure
function measurements, in some cases supplemented by the charm production
structure functions and DIS jet cross-sections.
%
The main results from these studies were the HERAPDF family of PDF fits, which include
HERAPDF1.0~\cite{Aaron:2009aa}, based on the Run II data, and
HERAPDF2.0~\cite{Abramowicz:2015mha}, based on the final combination
of inclusive measurements from Runs I+II.
%
In Fig.~\ref{fig:xfitter} we show the results of the HERAPDF1.0 analysis for the
$u_V$, $d_V$ and $S$ quarks and the gluon.
%
In the HERAPDF methodology, the total PDF uncertainty is divided into three types
of errors: experimental uncertainties, propagated from the statistical
and systematic uncertainties in the fitted data, model uncertainties, for instance
due to $\alpha_s$ and $Q_0$ variations, and parametrization uncertainties, reflecting
the spread from different comparable choices of input functional form for the PDFs.

The expertise developed by  these QCD analyses
of HERA structure function data lead to the development and release of
{\tt HERAfitter}~\cite{Alekhin:2014irh}, a publicly available open--source PDF fitting toolbox.
%
This was developed as an extension of the H1 and ZEUS internal PDF fitting
codes, that were extensively tested and applied in various QCD analyses
of HERA inclusive and charm data, including the HERAPDF sets.
%
Despite its name, {\tt HERAfitter}  was not restricted
to the analysis of HERA data, and could also be used for the PDF interpretation
of measurements from fixed-target DIS and proton-proton collisions.
%
The flexibility of this open--source software tool also allows QCD
analyses beyond unpolarized fixed-order PDF fits to be performed, such as fits of transverse-momentum
dependent (TMD) parton distributions and fragmentation functions.
%
Recently, {\tt HERAfitter} was renamed {\tt xFitter}, to emphasize that this code is a general fitting toolbox,
not  necessarily related to or involving the analysis of HERA inclusive structure function data.

The {\tt xFitter} framework includes modules that allow for various theoretical and
methodological options, and is capable of fitting to a large number of data sets from
HERA, Tevatron and LHC.
%
For example, polarized and unpolarized PDF evolution can be performed
using either {\tt APFEL} or {\tt QCDNUM}, and a number of fixed and variable
flavor number schemes are implemented, such as the FFN scheme from {\tt OpenQCDrad}
and the S-ACOT, TR and FONLL general-mass schemes.
%
In addition to PDF fitting, a large number of their functionalities are available,
such as the approximate inclusion of new datasets in existing PDF sets
by means of either Bayesian reweighting and Hessian profiling (see Sect.~\ref{sec:fitmeth.approx}),
and a wide variety
of PDF plotting options.

In Fig.~\ref{fig:xfitter} we show a schematic representation of the 
{\tt xFitter} code structure.
%
The first part is the initialization, where the fit settings are specified
in the steering file.
%
This involves a number of choices, in particular selecting the fitted data sets
and the theory and methodology settings such as the specific PDF parametrisation
or the scheme for heavy quark structure functions.
%
Then the PDF fit is performed, where the fit parameters are determined
by means of {\tt MINUIT}-based minimization including the propagation
of experimental results.
%
The final result is the {\tt LHAPDF6} grid file, together with various
PDF and data/theory comparison plots.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{figure}[t]
\begin{center}
  \includegraphics[scale=0.50]{5-pdfgroups/plots/xfitter.pdf}
   \caption{\small Left plot: the HERAPDF1.0 determination of parton distributions,
   based on the analysis of the combined HERA structure functions from
   Run I.
   %
   Right plot: schematic representation of the {\tt xFitter} code structure, see text
   for more details.
    \label{fig:xfitter}
  }
\end{center}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

The {\tt HERAfitter/xFitter} framework has been used in many ATLAS and CMS
PDF interpretation studies, discussed in Sects.~\ref{sec:pdfgroups.ATLAS}
and~\ref{sec:pdfgroups.CMS} respectively.
%
In addition, the {\tt HERAfitter/xFitter} developer's team has released a number
of dedicated PDF studies, including:
\begin{itemize}
\item A QCD analysis of the legacy $W$ and $Z$ boson production measurements at the
Tevatron~\cite{Camarda:2015zba}, based on the precise $W$ asymmetries in the electron
and muon channels by the D0 collaboration, together with the HERA structure function data.
%
This analysis demonstrated that these measurements, which are now included in most global
PDF fits, provide useful information on quark flavour separation at medium and
large-$x$.

\item A determination of the running charm quark mass $m_c(m_c)$
from HERA structure function data within the framework of the FONLL
general-mass variable-flavour number scheme~\cite{Bertone:2016ywq}.
%
This study demonstrated that the best-fit value of $m_c(m_c)$
was consistent when using FONLL as compared to a fit performed in the fixed-flavor
number scheme, as  expected from general theoretical considerations. This value was also consistent with previous determinations of the running mass from HERA data
and with the global PDG average.

\item A determination of the photon PDF $x\gamma(x,Q^2)$~\cite{Giuli:2017oii} from the
measurement of Drell-Yan high mass cross-sections at 8 TeV from
the ATLAS collaboration.
%
This was the first analysis where LHC data was included in a QED fit of the photon
PDF directly, rather than using reweighting methods, by means of an extension
of the {\tt aMCfast} interface to  account for the photon-initiated contributions
in {\tt MadGraph5\_aMC@NLO}.
%
The results of this analysis showed that the high-mass DY data indeed allowed important
constrains on the photon PDF at intermediate $x$, although the resulting
PDF uncertainties are
not competitive with those from the more recent determinations of $\gamma(x,Q^2)$,
discussed in Sect.~\ref{sec:QED.photon}.

\end{itemize}

Additional work based on {\tt xFitter} include studies of PDFs
with correlated uncertainties between different
perturbative orders~\cite{Belov:2014xwo},
non-DGLAP evolution equations~\cite{Hautmann:2017xtx},
a study of the impact of the heavy quark matching scales in PDF
fits~\cite{Bertone:2017ehk},
and
the determination of transverse-momentum
dependent PDFs~\cite{Angeles-Martinez:2015sea}, 
%
In Fig.~\ref{fig:xfitter2} we show two representative PDF-related analyses
   performed by the {\tt xFitter} Developer's Team.
   %
   First, we show the impact on the $d_V$ PDF of the Tevatron $W$ and $Z$ data when
   added to an HERA-only
   fit, comparing the impact of the lepton-level measurements with that of the boson-level
   measurements, from the {\tt xFitter} analysis of Ref.~\cite{Camarda:2015zba}.
  %
  We also show the $\chi^2$ profile of a {\tt xFitter} fit based on the inclusive
   HERA and charm data, as a function of the running mass $m_c(m_c)$ from
   Ref.~\cite{Bertone:2016ywq}.
   %
   In this analysis charm structure functions were computed with {\tt APFEL}
   in the FONLL-C general mass scheme.
   %
   As discussed above, this analysis finds a value of the running charm
   mass $m_c(m_c)=1.335\pm 0.043$, which is consistent with the PDG average
   as well as with previous determinations based on HERA data, such
   as those in~\cite{Alekhin:2012vu,Gao:2013wwa,Alekhin:2017kpj}.
   
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{figure}[t]
\begin{center}
  \includegraphics[scale=0.85]{5-pdfgroups/plots/xfitter2.pdf}
   \caption{\small Two representative analyses of PDF-related studies
   performed by the {\tt xFitter} Developer's Team.
   Left plot: the impact on $d_V$ of the Tevatron $W$ and $Z$ data on a HERA-only
   fit, comparing the impact of the lepton-level measurements with that of the boson-level
   measurements, from Ref.~\cite{Camarda:2015zba}.
   %
   Right plot: the $\chi^2$ profile of a fit based on the inclusive
   HERA and charm data, as a function of the running mass $m_c(m_c)$ from
   Ref.~\cite{Bertone:2016ywq}.
   %
   In this analysis, the charm structure functions were computed with {\tt APFEL}
   in the FONLL-C general mass scheme.
    \label{fig:xfitter2}
  }
\end{center}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Concerning future developments, the {\tt xFitter} code is now being rewritten
from Fortran to C++, to ensure modularity and to facilitate its maintenance and
the addition of novel theoretical ingredients.
%
Several new external codes and additional features are being implemented, such
as the possibility of new parametrization options like Chebyshev polynomials,
the fast convolution option for hadronic cross-sections as realized
in {\tt APFELgrid}~\cite{Bertone:2016lga}, more flexible PDF parametrizations
including the charm and the photon PDF, and improvements in the QED evolution
interface.


