The NNPDF stand-alone driver
C++ Makefile Fortran
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


NNPDF stand-alone drivers for C++ and Fortran77 which can be easily included in any program. The drivers use as input the official LHAPDF5 and LHAPDF6 (c++) grids at


Checkout the latest release at


cd nnpdfdriver/cpp or nnpdfdriver/fortran


# run example

Code example

 * NNPDF tutorial: Loading and using a NNPDF grid with the NNPDF Driver.
 * Compile with:
 * g++ -O3 -o prog
 * Author: The NNPDF Collaboration - 2014
#include "iostream"
#include "cmath"
#include "NNPDFDriver.h"
using namespace std;
int main()
  NNPDFDriver *nnpdf = new NNPDFDriver("NNPDF23_nlo_as_0119.LHgrid");
  nnpdf->initPDF(0); // initialize PDF member
  // or use the fast option: grid name + replica number
  // NNPDFDriver *nnpdf = new NNPDFDriver("NNPDF23_nlo_as_0119.LHgrid", 0);
  double x = 0.1, Q = sqrt(2);
  int f = 0;
  cout << nnpdf->xfx(x,Q,f) << endl; // prints the gluon x*PDF
  delete *nnpdf;                 
  return 0;

A minimilist fortran interface is provided

  void initnnset_(const char* setname); // set the PDF name
  void initpdf_(int *mem); // change member
  double nnxfx_(double *x, double *Q, int *id); // return x*PDF