Table of Contents
LHAPDF is a general purpose C++ interpolator, used for evaluating PDFs from discretised data files. Previous versions of LHAPDF were written in Fortran 77/90 and are documented at http://lhapdf.hepforge.org/lhapdf5/.
LHAPDF6 vastly reduces the memory overhead of the Fortran LHAPDF (from gigabytes to megabytes!), entirely removes restrictions on numbers of concurrent PDFs, allows access to single PDF members without needing to load whole sets, and separates a new standardised PDF data format from the code library so that new PDF sets may be created and released easier and faster. The C++ LHAPDF6 also permits arbitrary parton contents via the standard PDG ID code scheme, is computationally more efficient (particularly if only one or two flavours are required at each phase space point, as in PDF reweighting), and uses a flexible metadata system which fixes many fundamental metadata and concurrency bugs in LHAPDF5.
Compatibility routines are provided as standard for existing C++ and Fortran codes using the LHAPDF5 and PDFLIB legacy interfaces, so you can keep using your existing codes. But the new interface is much more powerful and pleasant to work with, so we think you'll want to switch once you've used it!
LHAPDF6 is documented in more detail in http://arxiv.org/abs/1412.7420
The source files can be downloaded from https://www.hepforge.org/downloads/lhapdf
Full installation and troubleshooting details are given at Installation instructions .
In the move to LHAPDF6 we have migrated the most recent PDF set families of each major PDF fitting group from LHAPDF5 to the new unified LHAPDF6 format. With a few exceptions for particularly significant older PDF sets, this means an effective age cutoff of ~2005 on the migrated sets.
If you need older sets you are encouraged to convert the LHAPDF5 version to LHAPDF6's data format: see the Instructions for building and running migration scripts/programs page for details of this procedure. We do not provide support for LHAPDF5, and a very strong case will be needed for further "official" set migrations beyond the many already available in LHAPDF6.
The following link takes you to the PDF sets which are currently available and officially supported:
The PDF set data files can be downloaded from https://www.hepforge.org/archive/lhapdf/pdfsets/6.1/ and the latest versions are installed (as tarballs and expanded into directories) on CERN AFS at
We also provide a script called
If you want to add new PDF sets to the standard collection, please contact the LHAPDF authors at firstname.lastname@example.org@email@example.com@firstname.lastname@example.org@email@example.com. You are expected to create and validate these PDF data files yourself, and to fix and update them in the case of user-reported bugs in the public files. We will allocate appropriate PDF ID codes, which will need to be added to your new sets'
As for previous versions, LHAPDF6 is a programmatic library. It can be accessed via user code written in C++, and to a more limited extent from Python and Fortran programs.
PDF sets (each of which is stored in a unique filesystem directory) should usually be installed in the
Here are some reference documents on the library design and the system of PDF/set/config metadata flags:
Many code usage examples are collected here:
Using LHAPDF through Python just requires that the LHAPDF library and module be installed, then you can use it: there are no compilation or linking complexities. For C++ and Fortran, however, you need to compile your code against LHAPDF, which introduces some extra technical hurdles.
Building your own program that uses LHAPDF6 is aided by the
g++ mycode.cc -o myexe `lhapdf-config --cflags --ldflags`
If you are compiling a Fortran program against LHAPDF, the header files are not relevant, but the library details are. You will also need to explicitly link against the C++ standard library, which is done implicitly by C++ compilers:
gfortran mycode.f90 -o myexe `lhapdf-config --ldflags` -lstdc++
Finally, note that LHAPDF is primarily available as a "dynamic" shared library, i.e. a
If your code compiled fine, but you get errors about "missing symbol" when you try to run your program, you probably need to add the LHAPDF lib directory path to your
A typical LHAPDF6 PDF set with error members is between 20 and 100 MB in size. If you only intend to use a subset of these (e.g. in MC production where you will only use the central member), you can simply remove the unneeded
For special applications where PDF initialization speed or disk space are very critical, you may wish to use zipped PDF data files. Since the data files are plain text, they compress well, by a factor of 4 or so, but for most applications this is largely irrelevant since you will usually not need to install more than about 100 MB of data files to use the main modern PDF sets, and set initialisation time is less than one second... and that happens only once per run.
Actually reading zipped data files would make LHAPDF's code and (more importantly) build process much more awkward, so we haven't done that. However, if you really need to squeeze the maximum out of limited space and time then there is a trick you can play – at least on Linux systems – using
In this case, we can override the
This is rather a hack and may not work on Macs... but it can be useful in special circumstances. Please let us know your experiences if you use it!
Testing, advice, etc.:
Luigi del Debbio
Please make sure to cite the following paper if you use LHAPDF6:
"LHAPDF6: parton density access in the LHC precision era"
Eur.Phys.J. C75 (2015) 3, 132
An earlier write-up of progress on LHAPDF6 appeared in the Les Houches workshop proceedings:
"New access to PDF data via LHAPDF6", by A. Buckley
in "Les Houches 2013: Physics at TeV Colliders: Standard Model Working Group Report"
If you need assistance with LHAPDF, please contact the authors at firstname.lastname@example.org@email@example.com@firstname.lastname@example.org@email@example.com . Please also send feature suggestions to this address: please don't contact individual developers if you can avoid it. We also accept compliments ;-)
You are very strongly advised to make sure that you are running the latest version of the LHAPDF library, since issues are often fixed in later releases. Please supply some information about which version you are using, what type of system and compiler you are using, a copy of the LHAPDF config.log file, a reasonably full copy of the errors you are getting, and the output of downloading and running this script: https://users.hepforge.org/~buckley/sysdebug.sh .
Please do not send us screenshots of your terminal! To capture the output of a command, use a shell redirection like this:
Lastly, please try to read the configure/compiler/runtime error message: once decoded it may tell you something simple e.g. you have not got the required compiler, you are compiling against a 32 bit library on a 64 bit system, or you have not installed a PDF data file. If you can't parse the error messages then try Googling for generic-looking bits of the message before asking for direct assistance: there are often good explanations and solutions online.
To check out LHAPDF6 from Mercurial, use this command for read-only:
See the following pages:
Generated on Mon May 14 2018 16:39:41 for LHAPDF by 1.8.13