hosted by CEDAR HepForge

LHAPDF the Les Houches Accord PDF Interface


LHAPDF manual

LHAPDF version 5 User Guide 1

Contents

1  Introduction
2  Installing LHAPDF
    2.1  Version 4.1 onwards
    2.2  Version 4.0 and earlier
3  Interfacing LHAPDF with a Code
    3.1  Using the LHAPDF routines directly
    3.2  Using the LHAGLUE inteface
    3.3  Whether to use .LHpdf or .LHgrid files?
    3.4  Nuclear PDFs
4  Multiset Initialization with Version 5
    4.1  How many sets can be initialised
    4.2  Using multiset initialization with LHAglue
    4.3  Using multiset initialization with native LHAPDF routines
5  C++ wrapper
    5.1  Documentation for new version 5.4 onwards
    5.2  Description (old version 5.3)

Appendices

A  PDF set numbers and names
B  Examples
    B.1  Example 1: A PDF table
    B.2  Example 2: Calculating Uncertainties for Monte Carlo PDF sets
    B.3  Example 3: A Convenient Wrap
    B.4  Example 4: Using LHAGLUE to do Example 1
    B.4  Example 5: Using Multiset Initalisation

Abstract

The Les Houches Accord PDF (LHAPDF) interface package is designed to work with PDF sets. A PDF set can consist of many individual member PDFs. While the interpretation of the member PDFs depends on the particular set, the LHAPDF interface is specifically designed to accommodate PDFs with uncertainties. For PDFs with uncertainties the PDF set represents one ``fit'' to the data. The individual member of a PDF set are needed to calculate the PDF uncertainty of the observable.

All PDF sets are defined through external files. This means that in many cases a new set can be added by simply downloading its file while the LHAPDF interface code does not change. The user has, since LHAPDF version 2, the option of using parameter files (.LHpdf) and doing the evolution "on the fly" or of using the interpolation grid files (.LHgrid) as supplied by the PDF set authors. The evolution code is not part of LHAPDF. Currently, QCDNUM [1] is the default evolution code fully interfaced with LHAPDF. Other evolution codes can easily be interfaced with the LHAPDF.

Since version 3 the LHAGLUE package 2 has been included as an alternative, and PDFLIB-like, inteface to the LHAPDF code.

The major changes in version 4 are the additional of the photon and pion PDF sets and the access to the QCD parameters Lamdba4/5 quoted by the authors of the PDF sets as applicable to that set.

Version 4.1 introduces a more standard "configure; make; makeinstall" installation procedure using gnu autoconf tools with and has some small changes for compatibility with f90/95 compilers.

Version 5 introduces multiset initialisation whereby several PDFs can be initialised a the beginning and then used interchangeably without incurring the cpu penalty of re-initialization.

1  Introduction

The Les Houches Accord Parton Density Function interface originated at the Les Houches 2001 workshop [2] in the PDF working group to enable the usage of Parton Density Functions with uncertainties in a uniform manner. When PDFs with uncertainties are considered, a ``fit'' to the data no longer is described by a single PDF. Instead in its most flexible implementation, a fit is represented by a PDF set consisting of many individual members. Calculating the observable for all the PDF members enables one to reconstruct the uncertainty on the observable. The LHAPDF interface was made with this in mind and manipulates PDF sets.

The LHAPDF interface can be viewed as a successor to PDFLIB [3]. Many improvements were added, to list some of the features:

  • The handling of PDF sets to enable PDF fits that include uncertainties.
  • All PDF sets are defined through external files in either parameterized or grid form. The parameterized files are compact compared to the grid files, but the latter allow faster usage when multiple PDF sets are called frequently and also allow older PDF sets to be made available in LHAPDF. New PDF sets can be defined by constructing the PDF defining parameter or grid files. The actual LHAPDF code does not have to be changed unless, in the grid file case, the authors of the PDFs use new interpolation methods.
  • The LHAPDF code is modular and default choices can be easily altered.

Note that the current ``best fit'' PDFs can be viewed as sets with one member PDF and can be easily defined through the PDF set external file definition. Alternatively one can group these ``fits'' is single sets (e.g. MRST98 set) as they often represent best fits given different model assumptions and as such reflect theoretical modeling uncertainties.

As mentioned above, using LHAPDF to determine the PDF uncertainty on an observable will involve evaluating N different PDFs in a single set. How to use the N predictions of the observable depends on the method used in the PDF set for propagation of errors. During the fitting of the PDFs many approximations can be made. An overview is given in the 2001 Les Houches proceedings [2].

2  Installing LHAPDF

The method of installing changed between versions 4.0 and 4.1. These are desribed below:

2.1   LHAPDF Installation (4.1 onwards)

First download the required gzipped tar file (eg lhapdf-v.r.tar.gz) from the downloads section (either with or without the PDFsets as required). Then do the following:-

tar -xvzf lhapdf-v.r.tar.gz to unpack this into the directory lhapdf-v.r.

cd lhapdf-v.r to change directory (v.r = version.revision, eg 4.1).

If you have root priviledge and want the installed files to go by default into /usr/local then do:

./configure

If you do not have root priviledge and/or want the files installed into a different directory then do:

./configure --prefix=/path/to/directory

note: this should be a different directory to the 'lhapdf-v.r.p' directory, otherwise the install step will not work.

If you want to install a memory light version to work with mainly single pdfs then use:

./configure --prefix=/path/to/directory --enable-low-memory

If you want to install with a maximum number of sets different from the default of 3 then use:

./configure --prefix=/path/to/directory --with-max-num-pdfsets=N

From version 5.8.0 onwards there is the additional configuration option to limit the virtual memory footprint of LHAPDF by building with only the code for selected PDFs as follows: ./configure --prefix=/path/to/directory -enable-pdfsets=LIST where LIST is a comma separated list chosen from:
mrst mrst06 mrst98 mrstqed cteq grv nnpdf gjr h1 zeus h1 hera alekhin botje fermi hkn pions photons

Note that -ve values in the list take precedence and exclude the selected PDF set.

Any of the above configuration options can of course be combined to tailor the build to your requirements.

Then do:

./make

./make install

The following directories/files should now have been installed in your selected installation directory.

lib/libLHAPDF.a
The library of LHAPDF (and LHAGLUE) routines to link against your program.
share/lhapdf/PDFsets/ (5.7.0 and earlier only)
The directory containing all the PDF parameter/grid data sets. Note that all the available sets are downloaded in the full tar file, or they can be selected individually after installation. In the latter case they should be put into this directory.
From 5.7.1 onwards the grid files are not included in the distribution and can be downloaded using the '/bin/lhapdf-getdata' script. The default expected location is share/lhapdf/PDFsets but they can be locate anywhere using the 'LHAPATH' environmental variable.
bin/lhapdf-config
A script (which must be in the users execution path) used by the LHAPDF routine "InitPDFsetByName" to determine the correct path to the PDF data sets.
bin/lhapdf-getdata (from 5.7.1 onwards)
A script to download the PDF grid files as required.

From version 5.2.3 onwards additionally the following files are installed:

lib/libLHAPDF.so
The dynamic LHAPDF library

From version 5.3.0 onwards additionally the following files are installed:

lib/libLHAPDFWrap.a.
The static C++ wrapper library
lib/libLHAPDFWrap.so
The dynamic C++ wrapper library
share/lhapdf/PDFsets.index
A text file detailing the LHaglue PDF numbers and, where applicable, the old PDFLIB equivalent numbers as well as the max and min ranges of X and Q**2.

If you wish to install the various components into different directories than above, the following options to ./configure (as well as --prefix=) can be used:

--bindir=DIR --datadir=DIR --libdir=DIR

More details are given in the INSTALL file in the downloaded package.

2.2   LHAPDF Installation (up to version 4.0)

Installing LHAPDF is simple and can be accomplished in two ways:

    1. Download all the LHAPDF files (including LHAGLUE) in one go from the download page on the web site. Un-tarring this file will create a directory LHAPDFv3 with all the files and makefiles in a subdirectory structure beneath this. There is a Makefile in this directory which will create (with the 'make' or 'make all' command) a library 'libLHAPDF.a', in this same directory, which can then be linked to external programmes.

    2. Alternatively the programme code and input parameter/grid files can be downloaded separately.

The Makefile has other options for compiling only the code relevant to the EVLCTEQ (make evlcteq) evolution code programmes. This is included mainly for compatibility with LHAPDF version 1 and in general it is better to compile the complete code as this will allow different PDF sets from the different authors and also the different type of input files (parameter or grid) to be used seamlessly without recompiling any code.

The 'make clean' command will remove the .o files from the directories once the installation has been successfully accompished.

Thus in its simplest form

download the file 'LHAfullv4.0'
tar -xvf LHAfullv4.0.tar
cd LHAPDFv4
make
make clean
should suffice to install LHAPDF version 4.

3  Interfacing LHAPDF with a Code

Since version 3 there are two ways of interfacing the LHAPDF code into a user program.

1) Using the LHAPDF routines directly.
2) Using the LHAGLUE interface.

3.1  Using the LHAPDF routines directly

The interface of LHAPDF with an external code is easy. We will describe the basic steps sufficient for most applications. In this section we describe single set intitalization. In a following section we describe how to use multiset initialization introduced in version 5. The function calls described here will not be altered in any way in future versions. Including the LHAPDF code into a program involves three steps:

  1. First one has to setup the LHAPDF interface code:

    call InitPDFset(name)

      It is called only once at the beginning of the code. The string variable name is the fully qualified file name of the external PDF file (i.e. including specific directory path) that defines the PDF set. For the default evolution code QCDNUM it will either calculate or read from file the LO/NLO splitting function weights. The calculation of the weights might take some time depending on the chosen grid size. However, after the first run a grid file is created. Subsequent runs will use this file to read in the weights so that the lengthy calculation of these weights is avoided. The file depends on the grid parameters and flavor thresholds. This means different PDF sets can have different grid files. The name of the grid file is specified in the PDF setup file. Appendix B gives a table showing the names of all the available files.

    As emphasised above, when using call InitPDFset the parameter name is the full path qualified name of the set. From version 4.1 onwards and additional routine:

    call InitPDFsetByName(name)

    has been added which uses the "lhapdf-config" script generated during the LHAPDF installation to determine and use the correct path so that in this case name is only the specific PDFset name itself (eg MRST2001nlo.LHpdf).

  • To use a individual PDF member it has to be initialized:

    call InitPDF(mem)

      The integer mem specifies the member PDF number. This routine only needs to be called when changing to a new PDF member. The time needed to setup depends on the evolution code used. For QCDNUM the grid size is the determining factor. Note that mem=0 selects the ``best fit'' PDF.

  • Once the PDF member is initialized one can call the evolution codes which will use the selected member.

    The subroutine call

    call evolvePDF(x,Q,f)

    returns the PDF momentum densities f (i.e. x × PDF number density) at double precision momentum fraction x and double precision scale Q. The double precision array f(-6:6) will contain the momentum PDFs using the labeling convention of table 1.

  •                

    -6
    -5
    -4
    -3
    -2
    -1
     0
    1
    2
    3
    4
    5
    6
    Parton
    tbar
    bbar
    cbar
    sbar
    ubar
    dbar
    g
    d
    u
    s
    c
    b
    t

    Table 1: The flavor enumeration convention used in the LHAPDF interface.

    As long as the member PDF is not changed (by the call InitPDF of step 2) the evolution calls will always use the same PDF member.

    A different subroutine call

    call evolvePDFp(x,Q,P2,IP2,f)

    is available for the photon PDFs where Q is the QCD scale in GeV, P2 is the vitruality of the photon in GeV2, which should by 0 for an on-shell photon, and IP2 is the parameter to evaluate the off-shell anomalous component. x and f are as above. Note that all inputs and outputs are defined in DOUBLE PRECISION

    A few additional calls listed below can be useful:

    function alphasPDF(Q) This double precision function call returns the values of aS(Q) at double precision scale Q. Note that its value can change between different PDF members.
    call GetLam4(mem,qcdl4)
    call GetLam5(mem,qlam5)
    return the values of qcdl4 and qcdl5 for the member number mem of the current set.. Note that the values should be used with care due to the differing defintions of lambda.
    call GetXmin(mem,xmin)
    call GetXmin(mem,xmin)
    call GetQ2max(mem,q2max)
    call GetQ2min(mem,q2min)
    return the minimum and maximum values of x and Q**2 as defined by the PDF authors for the member number mem of the current set (version 5.3.0 onwards) ..
    call numberPDF(Nmem) Returns as Nmem the number of PDF members in the set:(excluding the special ``best fit'' member, i.e. the member numbers run from 0 to Nmem)
    call GetOrderPDF(order) To get the evolution order of the PDFs. The integer variable order is 0 for Leading Order, 1 for Next-to-Leading Order, etc.
    call GetOrderAs(order) To get the evolution order of aS. The integer variable order is 0 for Leading Order, 1 for Next-to-Leading Order, etc.
    call GetRenFac(muf) Gives the ratio of the renormalization scale over the factorization scale used in the ``fit''. The double precision variable muf contains the ratio. Usually muf is equal to unity.
    call GetDesc() This call will print the PDF description to the default output stream.
    call GetQmass(nf,mass) The mass mass is returned for quark flavor nf. The quark masses are used in the aS evolution.
    call GetThreshold(nf,Q) The flavor threshold Q is returned for flavor nf. If Q=-1d0 the flavor is not in the evolution (e.g. the top quark is usually not included in the evolution). If Q=0d0 the flavor is parametrized at the parametrization scale. For positive non-zero values of Q the value is set to the flavor threshold at which the PDF starts to evolve.
    call GetNf(nfmax) For the PDF sets of the .LHpdf type, returns the number of flavor thresholds in the PDF evolution. Usually the returned value for nfmax is equal to five as the top quark is usually not considered in the PDFs. For the PDF sets of the .LHgrid type -1 is returned.

    3.2  Using the LHAGLUE interface

    The LHAGLUE interface 2 has been designed as a PDFLIB look alike interface to LHAPDF.

    The interface contains four subroutines (similar to PDFLIB) and can be used seamlessly by Monte Carlo generators interfaced to PDFLIB or in stand-alone mode.

    • For initialization (called once):

      call PDFSET(parm,value)

    • For the proton and pion structure functions:

      call STRUCTM(X,Q,UPV,DNV,USEA,DSEA,STR,CHM,BOT,TOP,GLU)

    • For the photon structure function:

      call STRUCTP(X,Q2,P2,IP2,UPV,DNV,USEA,DSEA,STR,CHM,BOT,TOP,GLU)

    • For statistics on PDF under/overflows:

      call PDFSTA

    Of course any of the LHAPDF routines, except the initialization routines InitPDFset and InitPDF, described in the previous subsection can also be used, for example to return the value of alphas (alphasPDF(Q)) or print the file description (GetDesc()).

    The interface can be invoked 3 ways depending on the value of parm(1) provided by the user when calling PDFSET(parm,value)

    • for PYTHIA: PARM(1).EQ.'NPTYPE'
      (this is set automatically by PYTHIA)
    • for HERWIG: PARM(1).EQ.'HWLHAPDF'
      (set by the user)
      e.g. in the main program like this:
      AUTPDF(1) = 'HWLHAPDF'
      AUTPDF(2) = 'HWLHAPDF'
    • for Stand-alone: PARM(1).EQ.'DEFAULT'
      (can be used for PDF studies or interfacing with a new generator.)

    The LHAPDF set/number is selected depending on the value of:

    • PYTHIA: ABS(MSTP(51)) - proton
    • PYTHIA: ABS(MSTP(53)) - pion
    • PYTHIA: ABS(MSTP(55)) - photon

    • HERWIG: ABS(INT(value(1))

    • Stand-alone: ABS(INT(value(1))

    There are other CONTROL switches which determine how the interface operates. The location of the LHAPDF library has to be specified as described below, the rest are optional.If the user does nothing, sensible defaults are active. To change the behaviour the corresponding values of parm() should be set to the values given below.

    1) Location of the LHAPDF library of PDFs (pathname):

    From version LHAPDF v4.1 onwards, and the LHAglue routines distributed with it, the location of the PDFsets data files is set automatically using the "lhapdf-config" script, provided that the precribed installation instructions have been used.

    Alternatively from version 5.0 onwards the PDFsets path can also be specified

    (a) with the call

    • CALL SetPDFPath('/path/to/PDFsets')

    (b) with the environmental variable

    • $LHAPATH
    The order of precedence is (a), (b) then, lhapdf-config

    The maximum length of the path is set to 232. Should this need to be increased then it can be changed in the include file "src/pathsetup.inc", followed by a complete recompilation.

    For previous version (4.0 and earlier) the following describes the situation:

    • uses common block COMMON/LHAPDFC/LHAPATH
      • If the user does nothing => default path is subdir 'PDFsets' of the current directory (can be a real subdir OR a soft link to the real location)
      • The user sets LHAPATH in COMMON/LHAPDFC/LHAPDFC - before calling PDFSET

    The following use the common block

    CHARACTER*20 LHAPARM(20)
    REAL*8 LHAVALUE(20)

    COMMON/LHACONTROL/LHAPARM,LHAVALUE

    which can be used directly in the user's program.

    Alternatively the various flags can be set and reset using the CALL SetLHAPARM(string) function call, thus removing the need to include the common block in the user's program.

    2) Collect statistics on under/over-low requests for PDFs outside their validity ranges in X and Q**2.

    • LHAPARM(16).EQ.'NOSTAT' ==> No statistics (faster)
    • LHAPARM(16).NE.'NOSTAT' ==> Default: collect statistics
    or
    • call SetLHAPARM('NOSTAT') ==> No statistics (faster)
    • call SetLHAPARM('16') ==> Default: collect statistics
    then
    • call PDFSTA at end to print out statistics

    3) Option to use the values for the strong coupling alpha_s as computed in LHAPDF

    • LHAPARM(17).EQ.'LHAPDF' ==> Use alpha_s from LHAPDF
    • LHAPARM(17).NE.'LHAPDF' ==> Default (same as LHAPDF v1/v3)
    or
    • call SetLHAPARM('LHAPDF') ==> Use alpha_s from LHAPDF
    • call SetLHAPARM('17') ==> Default (same as LHAPDF v1/v3)

    4) Extrapolation of PDFs outside the LHAPDF validity range given by [Xmin,Xmax] and [Q2min,Q2max]:

    • Default ==> PDFs "frozen" at the boundaries.
    • LHAPARM(18).EQ.'EXTRAPOLATE' ==> Extrapolate PDFs at own risk
      (Warning - crazy values can be returned!)
    or
    • call SetLHAPARM('EXTRAPOLATE') ==> Extrapolate PDFs at own risk
    • call SetLHAPARM('18') ==> Default: PDFs "frozen" at the boundaries.
       The values [Xmin,Xmax] and [Q2min,Q2max] are available in the common block
       COMMON/W50513/XMIN,XMAX,Q2MIN,Q2MAX as in PDFLIB

    5) Printout of initialization information in PDFSET (by default):

    • LHAPARM(19).EQ.'SILENT' ==> No printout (silent mode).
    • LHAPARM(19).EQ.'LOWKEY' ==> Print 5 times (almost silent).
    or
    • call SetLHAPARM('SILENT') ==> No printout (silent mode).
    • call SetLHAPARM('LOWKEY') ==> Print 5 times (almost silent).
    • call SetLHAPARM('19') ==> Default: Print everything

    6) Double Precision values of qcdl4 and qcdl5 relevant to the selected PDF are available in the COMMON block

    • COMMON/W50512/QCDL4,QCDL5 ==> as in PDFLIB.
       Note that these are read-only and changing these values in this common block has no effect in the program.

    3.3  Whether to use the ".LHpdf" or ".LHgrid" files ?

    The way in which the PDFs are calculated depends on whether the user selects ".LHpdf" or ".LHgrid" files (either by name or LHAGLUE number).
    • .LHpdf files - the PDFs are generated "on-the-fly" using an evolution package (eg QCDNUM or EVLCTEQ) from a parameterisation in X at an initial Q0 value. The form of the parameterisation is given by the PDF authors.
    • .LHgrid files - the PDFs are generated by interpolation inside the pre-calculated tables produced the PDF authors and with the same interpolation codes used by the authors. This is closer to the methods used in PDFLIB.
    In some cases only one type exists, but in others the user has a choice of either. Generally once the initialisation is done the LHgrid files are faster. This is particularly true when using QCDNUM (for example with the MRST sets) especially if the user makes repeated initialisations of different members of the same set using for example PDFSET(mem). This could be the case in using the PDF error sets.

    The advantage of the .LHpdf files is that they are much smaller than the equivalent .LHgrid files.

    Whichever the user chooses the method of using the LHAPDF and LHAGLUE routines is exactly the same.

    3.4  Using Nuclear PDFs

    LHAPDF provides the ability to add nuclear corrections to PDFs in the same way as in PDFLIB
    By default the native LHAPDF routines

    • call evolvePDFa(x,Q,a,f)
    • call evolvePDFaM(nset,x,Q,a,f)
    togther with the lhaglue routine
    • call STRUCTA(x,a,.....)
    add the nuclear corrections using the ESK98 formula as in PDFLIB.

    From version 5.4 onwards the latest EPS08 corrections can be used instead by preceding the call with

    • call setlhaparm('EPS08')

    4  Multiset initialization with Version 5

    Version 5 introduces the concept holding more than one PDF set initialized in memory at the same time. This is implemented to speed up the running of programmes where it is necessary to switch frequently between PDF sets, for example to use nucleon,photon and possibly pion PDF sets together. Speed has been shown to be a particular issue when using the .LHpdf sets.

    4.1  How many sets can be initialised? This is determined by the parameter nmxset in the file src/parmsetup.inc. It is set as a default to 3 but can be set to whatever the user wishes. Obviously the larger it is the larger will be the size of the executable programme. When changing this parameter it is necessary to recompile all the routines since the file is included in most of them. To do this do make clean followed by make then make install

    4.2  Using multiset initialization with LHAglue The LHAglue in version 5 program will do multiset initialization automatically with no changes to the users routines. Of course the parameter nmxset in the file src/parmsetup.inc described in the previous subsection the has to be large enough for the maximum number of sets.

    4.3  Using multiset initialization with the native LHAPDF routines Version 5 contains a set of subroutines which perform the same functions as those described in section 3.1 (using LHADF routines dirtectly) but with the additional parameter nset. This allows specific PDF sets/members to be assigned to nset and used interchangeably once they have been intialized. The table below lists those routines and their use.

    call InitPDFsetM(nset,name)
    or
    call InitPDFsetByNameM(nset,name)
    Called once per PDF set to allocate nset to a specific set
    call InitPDFM(nset,mem) Called once per PDF set/member to allocate the member number (mem) to nset.
    The above two calls are each made only ONCE per run no matter how many times a PDF set is used thereafter
    call evolvePDFM(nset,x,Q,f) Returns the PDF momentum density (f ) for the nucleon or pion PDF set initialised as nset for the given x and Q.
    call evolvePDFpM(nset,x,Q,P2,IP2,f) Returns the PDF momentum density (f ) for the photon PDF set initialised as nset for the given x,Q,P2and IP2.
    call GetLam4M(nset,mem,qcdl4)
    call GetLam5M(nset,mem,qcdl5)
    Return the values of qcdl4 and qcdl5 for the member number mem of the set nset. Note that the values should be used with care due to the differing defintions of lambda.
    call GetXminM(nset,mem,xmin)
    call GetXmaxM(nset,mem,xmax)
    call GetQ2minM(nset,mem,q2min)
    call GetQ2maxM(nset,mem,q2max)
    Return the minimum and maximum values of x and Q**2 for the member number mem of the set nset (version 5.3.0 onwards)
    call numberPDFM(nset,Nmem) Returns as Nmem the number of PDF members in the set nset:(excluding the special ``best fit'' member, i.e. the member numbers run from 0 to Nmem)
    call GetOrderPDFM(nset,order) To get the evolution order of the PDFs in set nset. The integer variable order is 0 for Leading Order, 1 for Next-to-Leading Order, etc.
    call GetOrderAsM(nset,order) To get the evolution order of aS in set nset. The integer variable order is 0 for Leading Order, 1 for Next-to-Leading Order, etc.
    call GetRenFacM(nset,muf) Gives the ratio of the renormalization scale over the factorization scale used in the ``fit'' for set nset. The double precision variable muf contains the ratio. Usually muf is equal to unity.
    call GetDescM(nset) This call will print the PDF description of set nset to the default output stream.
    call GetQmassM(nset,nf,mass) The mass mass is returned for quark flavor nf for set nset. The quark masses are used in the aS evolution.
    call GetThresholdM(nset,nf,Q) The flavor threshold Q is returned for flavor nf for set nset. If Q=-1d0 the flavor is not in the evolution (e.g. the top quark is usually not included in the evolution). If Q=0d0 the flavor is parametrized at the parametrization scale. For positive non-zero values of Q the value is set to the flavor threshold at which the PDF starts to evolve.
    call GetNfM(nset,nfmax) For the PDF sets of type .LHpdf returns the number of flavor thresholds in the PDF evolution for set nset. Usually the returned value for nfmax is equal to five as the top quark is usually not considered in the PDFs For the PDF sets of the .LHgrid type it returns -1.

    5  The C++ wrapper class LHAPDFWrap

    A C++ class (LHAPDFwrap) and methods are provided to allow interfacing with a users C++ code. Since version 5.3.0 this code is now bundled into the tarball and the libraries LHAPDFWrap.a and LHAPDFWrap.so are built and installed, along with the fortran libraries, during the "make"/"make install" procedures. The methods follow broadly the same functionality as the fortran subroutines.

    5.1  Description

    class LHAPDFWrap

    // constructors LHAPDFWrap();
      // std c'tor d'tor
    LHAPDFWrap(char *name); // (uses initPDFSetByName)
      // typical constructor with pdfset 'name', where 'name' is the name
      // of the data file of the desired set.
    LHAPDFWrap(char *name, int memset); // (uses initPDFSetByName)
      // typical constructor with pdfset 'name' and subset 'memset'
      // 'name' is the name of the pdf set and 'memset' the subset member number.
    // intialisers void initPDFSet(char *name);
      // initialises the pdfset by full name (including the path directory)
    void initPDFSetByName(char *name);
      // initialises the pdfset by name only
    void initPDF(int memset);
      // selects the pdf subset out of the initialised pdf distribution
    // methods for nucleon pdfs std::vector< double > xfx(const double &x;, const double &Q;);
      // returns a vector xf(x, Q) with index 0 < i < 12.
      // 0..5 = tbar, ..., ubar, dbar;
      // 6 = g;
      // 7..12 = d, u, ..., t
    double xfx(const double &x;, const double &Q;, int fl);
      // returns xf(x, Q) for flavour fl - this time the flavour encoding
      // is as in the LHAPDF manual...
      // -6..-1 = tbar,...,ubar, dbar
      // 1..6 = duscbt
      // 0 = g
    // methods for pion pdfs ($P2 and ip are ) std::vector< double > xfxp(const double &x;, const double &Q;, const double &P2;, int ip);
      // returns a vector xf(x, Q) with index 0 < i < 12.
      // 0..5 = tbar, ..., ubar, dbar;
      // 6 = g;
      // 7..12 = d, u, ..., t
    double xfxp(const double &x;, const double &Q;, const double &P2;, int ip, int fl);
      // returns xf(x, Q) for flavour fl - this time the flavour encoding
      // is as in the LHAPDF manual...
      // -6..-1 = tbar,...,ubar, dbar
      // 1..6 = duscbt
      // 0 = g
    // methods for nuclear pdfs (&a; is the atomic number) std::vector< double > xfxa(const double &x;, const double &Q;, const double &a;);
      // returns a vector xf(x, Q) with index 0 < i < 12.
      // 0..5 = tbar, ..., ubar, dbar;
      // 6 = g;
      // 7..12 = d, u, ..., t
    double xfxa(const double &x;, const double &Q;, const double &a;, int fl);
      // returns xf(x, Q) for flavour fl - this time the flavour encoding
      // -6..-1 = tbar,...,ubar, dbar
      // is as in the LHAPDF manual...
      // -6..-1 = tbar,...,ubar, dbar
      // 1..6 = duscbt
      // 0 = g
    // methods for photon pdfs (MRST2004qed.LHgrid) std::vector< double > xfxphoton(const double &x;, const double &Q;);
      // returns a vector xf(x, Q) with index 0 < i < 14.
      // 0..5 = tbar, ..., ubar, dbar;
      // 6 = g;
      // 7..12 = d, u, ..., t
      // 13 = photon
    double xfxphoton(const double &x;, const double &Q;, int fl);
      // returns xf(x, Q) for flavour fl - this time the flavour encoding
      // is as in the LHAPDF manual...
      // -6..-1 = tbar,...,ubar, dbar
      // 1..6 = duscbt
      // 0 = g
      // 7 = photon
    // other methods void getDescription();
      // prints a brief description of the current pdf set to stdout
    int numberPDF();
      // return the number of subsets available in the current distribution.
    double alphasPDF(double Q);
      // return the alphas used by the current pdf.
    int getOrderPDF();
      // returns the order (LO, NLO, NNLO) of the current pdf
    int getOrderAlphaS();
      // return is order (LO, NLO, NNLO) of alpha_S.
    double getQMass(int f);
      // returns quark mass used for flavour f.
    double getThreshold(int f);
      // returns the threshold for flavour f.
    int getNf();
      // returns the number of flavours used in the current pdf set.
    double getLam4(int m);
      // returns the value of qcd lambda4 for member m
    double getLam5(int m);
      // returns the value of qcd lambda5 for member m
    double getXmin(int m);
      // returns the value of Xmin for member m
    double getXmax(int m);
      // returns the value of Xmax for member m
    double getQ2min(int m);
      // returns the value of Q2min for member m
    double getQ2max(int m);
      // returns the value of Q2max for member m
    void extrapolate();
      // sets the flag to extrapolate beyond the x and Q2 limits of the pdf set.
    // Equivalent methods for multiset pdf use LHAPDFWrap(int nset, char *name);
    LHAPDFWrap(int nset, char *name, int memset);

    void initPDFSetM(int nset, char *name);
    void initPDFSetByNameM(int nset, char *name);
    void initPDFM(int nset, int memset);

    std::vector< double > xfxM(int nset, const double &x;, const double &Q;);
    double xfxM(int nset, const double &x;, const double &Q;, int fl);

    std::vector< double > xfxpM(int nset, const double &x;, const double &Q;, const double &P2;, int ip);
    double xfxpM(int nset, const double &x;, const double &Q;, const double &P2;, int ip, int fl);

    std::vector< double > xfxaM(int nset, const double &x;, const double &Q;, const double &a;);
    double xfxaM(int nset, const double &x;, const double &Q;, const double &a;, int fl);

    std::vector< double > xfxphotonM(int nset, const double &x;, const double &Q;);
    double xfxphotonM(int nset, const double &x;, const double &Q;, int fl);

    void getDescriptionM(int nset);
    int numberPDFM(int nset);
    double alphasPDFM(int nset, double Q);
    int getOrderPDFM(int nset);
    int getOrderAlphaSM(int nset);
    double getQMassM(int nset, int f);
    double getThresholdM(int nset, int f);
    int getNfM(int nset);
    double getLam4M(int nset, int m);
    double getLam5M(int nset, int m);
    double getXminM(int nset, int m);
    double getXmaxM(int nset, int m);
    double getQ2minM(int nset, int m);
    double getQ2maxM(int nset, int m);

    Appendices

    A  PDF set numbers and names

    Notes:

    • When using the LHAGLUE initialization method:
      • The columns headed .LHpdf and .LHgrid give the set numbers to use with LHAGLUE
    • When Using the direct LHAPDF initialization routines:
      • The .LHpdf and .LHgrid columns show the availablity of the respective files
      • The File Name and Member columns give the names to use in the direct LHAPDF initialization routines.
      • .LHpdf or .LHgrid has to be appended to the File Name depending the availability of that file (as indicated in the table) and wishes of the user.

    Proton PDFs
    r>
    PDF set .LHpdf .LHgrid File Name Member Xmin Xmax Q2min GeV2 Q2max GeV2
    CTEQ6m (central value) 10000 10050 cteq6m 0 10-6 1 1.69 108
    CTEQ6 (40 error sets) 10001-10040 10051-10090 cteq6 | cteq6mE 1-40 10-6 1 1.69 108
    CTEQ6l (LO fit/NLO alphas) 10041 - cteq6l 0/1 10-6 1 1.69 108
    CTEQ6ll (LO fit/LO alphas) 10042 - cteq6ll 0/1 10-6 1 1.69 108
    CTEQ61 (central value) 10100 10150 cteq61 0 10-6 1 1.69 108
    CTEQ61 (40 error sets) 10101-10140 10151-10190 cteq61 1-40 10-6 1 1.69 108
    CTEQ6AB (20 sets, variable alphas) - 10250-10269 cteq6AB 0-19 10-6 1 1.69 108
    CTEQ65 (40 sets) - 10350-10390 cteq65 0-40 10-7 1 1.69 1010
    CTEQ65c (6 sets) - 10450-10456 cteq65c 0-6 10-7 1 1.69 1010
    CTEQ65s (8 sets) - 10460-10467 cteq65s 0-7 10-7 1 1.69 1010
    CTEQ66 (44 sets) - 10550-10594 cteq66 0-44 10-8 1 1.69 1010
    CTEQ66alphas (5 sets) - 10595-10599 cteq66alphas 0-4 10-8 1 1.69 1010
    CTEQ66c (4 sets) - 10650-10653 cteq66c 0-3 10-8 1 1.69 1010
    CTEQ66a (4 sets) - 10660-10663 cteq66a0 to a3 0-3 10-8 1 1.69 1010
    CTEQ66lg (light-gluino 8 sets) - 10670-10677 cteq66lg 0-7 10-5 1 1.69 106
    CT09MCS (LO evnt gen) - 10770 CT09MCS 0 10-5 1 1.69 106
    CT09MC1 (LO evnt gen) - 10771 CT09MC1 0 10-5 1 1.69 106
    CT09MC2 (LO evnt gen) - 10772 CT09MC1 0 10-5 1 1.69 106
    CT10 (central value) - 10800 CT10 0 10-5 1 1.69 106
    CT10 (52 error sets) - 10801 CT10 1-52 10-5 1 1.69 106
    CT10as (11 alphas variations) - 10860-10870 CT10as 0-10 10-5 1 1.69 106
    CT10w (central value) - 10900 CT10w 0 10-5 1 1.69 106
    CT10w (52 error sets) - 10901 CT10w 1-52 10-5 1 1.69 106
    CT10was (11 alphas variations) - 10960-10970 CT10was 0-10 10-5 1 1.69 106
    CT10f3 (fixed flavour) - 10980 CT10f3 0 10-5 1 1.69 106
    CT10f4 (fixed flavour) - 10981 CT10f4 0 10-5 1 1.69 106
    CT10wf3 (fixed flavour) - 10982 CT10wf3 0 10-5 1 1.69 106
    CT10wf4 (fixed flavour) - 10983 CT10wf4 0 10-5 1 1.69 106
    CTEQ5m (Standard MSbar) - 19050 cteq5m 0/1 10-5 1 1.00 108
    CTEQ5m1 (updated CTEQ5m) - 19051 cteq5m1 0/1 10-5 1 1.00 108
    CTEQ5f3 (3-flav-DIS) - 19053 cteq5f3 0/1 10-5 1 1.00 108
    CTEQ5f4 (4-flav-DIS) - 19054 cteq5f4 0/1 10-5 1 1.00 108
    CTEQ5d (Standard DIS) - 19060 cteq5d 0/1 10-5 1 1.00 108
    CTEQ5l (LO fit) - 19070 cteq5l 0/1 10-5 1 1.00 108
    CTEQ4m (Standard MSbar) - 19150 cteq4m 0/1 10-5 1 2.56 108
    CTEQ4d (Standard DIS) - 19160 cteq4d 0/1 10-5 1 2.56 108
    CTEQ4l (LO fit) - 19170 cteq4l 0/1 10-5 1 2.56 108
    MRST2001nlo (Standard MSbar) 20000 20050 MRST2001nlo 0/1 10-5 1 1.25 107
    MRST2001nlo (lower $\alpha_S$) 20002 20052 MRST2001nlo 2 10-5 1 1.25 107
    MRST2001nlo (higher $\alpha_S$) 20003 20053 MRST2001nlo 3 10-5 1 1.25 107
    MRST2001nlo (Jet Fit) 20004 20054 MRST2001nlo 4 10-5 1 1.25 107
    MRST2001lo (LO fit) - 20060 MRST2001lo 0/1 10-5 1 1.25 107
    MRST2001nnlo (NNLO fit) - 20070 MRST2001nnlo 0/1 10-5 1 1.25 107
    MRST2001E (central value) 20100 20150 MRST2001E 0 10-5 1 1.25 107
    MRST2001E (30 error sets) 20101-20130 20151-20180 MRST2001E 1-30 10-5 1 1.25 107
    MRST2002nlo (Standard MSbar) 20200 20250 MRST2002nlo 0/1 10-5 1 1.25 107
    MRST2002nnlo (NNLO fit) - 20270 MRST2002nnlo 0/1 10-5 1 1.25 107
    MRST2003cnlo (NLO - restricted ) 20300 20350 MRST2003cnlo 0/1 10-3 1 10.0 107
    MRST2003cnnlo (NNLO - restricted) - 20370 MRST2003cnnlo 0/1 10-3 1 7.0 107
    MRST2004nlo (Standard MSbar) 20400 20450 MRST2004nlo 0/1 10-5 1 1.25 107
    MRST2004FF3lo (fixed flavour) - 20452 MRST2004FF3lo 0/1 10-5 1 1.25 107
    MRST2004FF4lo (fixed flavour) - 20454 MRST2004FF4lo 0/1 10-5 1 1.25 107
    MRST2004FF3nlo (fixed flavour) - 20456 MRST2004FF3nlo 0/1 10-5 1 1.25 107
    MRST2004FF4nlo (fixed flavour) - 20458 MRST2004FF4nlo 0/1 10-5 1 1.25 107
    MRST2004qed (photon) - 20460 MRST2004qed 0/1 10-5 1 1.25 107
    MRST2004nnlo (NNLO fit) - 20470 MRST2004nnlo 0/1 10-5 1 1.25 107
    MRST2006nnlo (NNLO fit) - 20550-20580 MRST2006nnlo 0-30 10-6 1 1.0 109
    MRST2007lomod (LO* for MC) - 20650 MRST2007lomod 0 10-5 1 1.25 107
    MRSTMCal (for MC) - 20651 MRSTMCal 0 10-5 1 1.25 107
    MSTW2008 (LO central) - 21000 MSTW2008lo68cl 0 10-6 1 1.0 109
    MSTW2008lo68cl - 21001-21040 MSTW2008lo68cl 1-40 10-6 1 1.0 109
    MSTW2008lo90cl - 21041-21080 MSTW2008lo90cl 1-40 10-6 1 1.0 109
    MSTW2008 (NLO central) - 21100 MSTW2008nlo68cl 0 10-6 1 1.0 109
    MSTW2008nlo68cl - 21101-21140 MSTW2008nlo68cl 1-40 10-6 1 1.0 109
    MSTW2008nlo90cl - 21141-21180 MSTW2008nlo90cl 1-40 10-6 1 1.0 109
    MSTW2008 (NNLO central) - 21200 MSTW2008nnlo68cl 0 10-6 1 1.0 109
    MSTW2008nnlo68cl - 21201-21240 MSTW2008nnlo68cl 1-40 10-6 1 1.0 109
    MSTW2008nnlo90cl - 21241-21280 MSTW2008nnlo90cl 1-40 10-6 1 1.0 109
    MSTW2008nlo_asmzrange - 22000-22021 MSTW2008nlo_asmzrange 0-21 10-6 1 1.0 109
    MSTW2008nnlo_asmzrange - 22500-22521 MSTW2008nlo_asmzrange 0-21 10-6 1 1.0 109
    MRST98 (central gluon/alphas) 29000 - MRST98 0/2 10-5 1 1.25 107
    MRST98 (lower gluon) 29001 - MRST98 1 10-5 1 1.25 107
    MRST98lo (LO) - 29041-29045 MRST98lo 1-5 10-5 1 1.25 107
    MRST98nlo (NLO) - 29051-29055 MRST98nlo 1-5 10-5 1 1.25 107
    MRST98dis (DIS) - 29061-29065 MRST98dis 1-5 10-5 1 1.25 107
    MRST98ht (HT) - 29071 MRST98dis 1 10-5 1 1.25 107
    Fermi2002_100 (101 sets) 30100-30200 - Fermi2002_100 0-100 10-6 1 1.00 1010
    Fermi2002_1000 (1001 sets) 31000-32000 - Fermi2002_1000 0-1000 10-6 1 1.00 1010
    Alekhin_100 (101 sets) 40100-40200 - Alekhin_100 0-100 10-6 1 1.00 1010
    Alekhin_1000 (1000 sets) 41000-41999 - Alekhin_1000 0-999 10-6 1 1.00 1010
    Alekhin2002 (LO - cent val) - 40350 a02m_lo 0 10-7 1 0.8 2 x 108
    Alekhin2002 (NLO - cent val) - 40450 a02m_nlo 0 10-7 1 0.8 2 x 108
    Alekhin2002 (NNLO - cent val) - 40550 a02m_nnlo 0 10-7 1 0.8 2 x 108
    Alekhin2002 (LO VFN 17 sets) - 40351-40367 a02m_lo 1-15 10-7 1 0.8 2 x 108
    Alekhin2002 (NLO VFN 17 sets) - 40451-40467 a02m_nlo 1-15 10-7 1 0.8 2 x 108
    Alekhin2002 (NNLO VFN 17 sets) - 40551-40567 a02m_nnlo 1-15 10-7 1 0.8 2 x 108
    ABKM09 (NLO 3FLV central) - 40650 abkm09_3_nlo 0 10-7 1 0.8 2 x 108
    ABKM09 (NNLO 3FLV central) - 40750 abkm09_3_nnlo 0 10-7 1 0.8 2 x 108
    ABKM09 (NLO 5FLV central) - 40850 abkm09_5_nlo 0 10-7 1 0.8 2 x 108
    ABKM09 (NNLO 5FLV central) - 40950 abkm09_5_nnlo 0 10-7 1 0.8 2 x 108
    ABKM09 (NLO 3FLV 25 sets) - 40651-40675 abkm09_3_nlo 1-25 10-7 1 0.8 2 x 108
    ABKM09 (NNLO 3FLV 25 sets) - 40751-40775 abkm09_3_nnlo 1-25 10-7 1 0.8 2 x 108
    ABKM09 (NLO 5FLV 25 sets) - 40851-40875 abkm09_5_nlo 1-25 10-7 1 0.8 2 x 108
    ABKM09 (NNLO 5FLV 25 sets) - 40951-40975 abkm09_5_nnlo 1-25 10-7 1 0.8 2 x 108
    Botje_100 (101 sets) 50100-50200 - Botje_100 0-100 10-6 1 1.00 1010
    Botje_1000 (1000 sets) 51000-51999 - Botje_1000 0-999 10-6 1 1.00 1010
    ZEUS2002 (VFN/TR cent value) 60000 - ZEUS2002_TR 0 10-6 1 0.3 2 x 105
    ZEUS2002 (ZM cent value) 60100 - ZEUS2002_ZM 0 10-6 1 0.3 2 x 105
    ZEUS2002 (FF cent value) 60200 - ZEUS2002_FF 0 10-6 1 0.3 2 x 105
    ZEUS2005 (ZJ cent value) 60300 - ZEUS2005_ZJ 0 10-6 1 0.3 2 x 105
    ZEUS2002 (VFN/TR 22 sets) 60001-60022 - ZEUS2002_TR 1-22 10-6 1 0.3 2 x 105
    ZEUS2002 (ZM 22 sets) 60101-60122 - ZEUS2002_ZM 1-22 10-6 1 0.3 2 x 105
    ZEUS2002 (FF 22 sets) 60201-60222 - ZEUS2002_FF 1-22 10-6 1 0.3 2 x 105
    ZEUS2005 (ZJ 22 sets) 60301-60322 - ZEUS2005_ZJ 1-22 10-6 1 0.3 2 x 105
    HERAPDF01 (Combined ZEUS+H1 central value) 60400 - HERAPDF01 0 10-6 1 1.0 2 x 108
    HERAPDF01 (Combined ZEUS+H1 22 sets) 60401-60422 - HERAPDF01 1-22 10-6 1 1.0 2 x 108
    HERAPDF01 (Combined ZEUS+H1 central value) - 60430 HERAPDF01 0 10-6 1 1.0 2 x 108
    HERAPDF01 (Combined ZEUS+H1 14 variation sets) - 60431-60444 HERAPDF01 1-14 10-6 1 1.0 2 x 108
    HERAPDF10 (Combined ZEUS+H1 central value) - 60500 HERAPDF10_EIG 0 10-6 1 1.0 2 x 108
    HERAPDF10 (Combined ZEUS+H1 20 sets) - 60501-60520 HERAPDF10_EIG 1-20 10-6 1 1.0 2 x 108
    HERAPDF10 (Combined ZEUS+H1 central value) - 60530 HERAPDF10_VAR 0 10-6 1 1.0 2 x 108
    HERAPDF10 (Combined ZEUS+H1 13 variation sets) - 60531-60543 HERAPDF10_VAR 1-13 10-6 1 1.0 2 x 108
    HERAPDF10 (Combined ZEUS+H1 12 alphas sets) - 60550-60561 HERAPDF10_ALPHAS 0-11 10-6 1 1.0 2 x 108
    H12000 (nlo msbar cent value) - 70050 H12000ms 0 5.7 x 10-5 1 1.5 106
    H12000E (nlo msbar 20 sets) - 70051-70070 H12000msE 1-20 5.7 x 10-5 1 1.5 106
    H12000 (nlo dis cent value) - 70150 H12000dis 0 5.7 x 10-5 1 1.5 106
    H12000E (nlo dis 20 sets) - 70151-70170 H12000disE 1-20 5.7 x 10-5 1 1.5 106
    H12000 (lo cent value) - 70250 H12000lo 0 5.7 x 10-5 1 1.5 106
    H12000E (lo 20 sets) - 70251-70270 H12000loE 1-20 5.7 x 10-5 1 1.5 106
    GRV98 (nlo msbar) - 80050 GRV98nlo 0 10-9 1 0.8 2 x 106
    GRV98 (nlo dis) - 80051 GRV98nlo 1 10-9 1 0.8 2 x 106
    GRV98 (lo) - 80060 GRV98lo 0 10-9 1 0.8 2 x 106
    GJR08 (FF lo) - 80150 GJR08lo 0 10-9 1.0 0.3 1 x 108
    GJR08 (VF lo) - 80151 GJR08lo 1 10-9 1.0 0.3 1 x 108
    GJR08 (FF nlo/DIS) - 80152 GJR08FFdis 1 10-9 1.0 0.5 1 x 108
    GJR08 (FF nlo/MSbar central value) - 80160 GJR08FFnloE 0 10-9 1.0 0.5 1 x 108
    GJR08 (FF nlo/MSbar 26 sets) - 80161-80186 GJR08FFnloE 1-26 10-9 1.0 0.5 1 x 108
    GJR08 (VF nlo/MSbar central value) - 80260 GJR08VFnloE 0 10-9 1.0 0.5 1 x 108
    GJR08 (VF nlo/MSbar 26 sets) - 80261-80286 GJR08VFnloE 1-26 10-9 1.0 0.5 1 x 108
    JR09 (FF nnlo central value) - 80360 JR09FFnnloE 0 10-9 1.0 0.55 1 x 108
    JR09 (FF nnlo 26 sets) - 80361-80386 JR09FFnnloE 1-26 10-9 1.0 0.55 1 x 108
    JR09 (VF nnlo central value) - 80460 JR09VFnnloE 0 10-9 1.0 0.55 1 x 108
    JR09 (VF nnlo 26 sets) - 80461-80486 JR09FFnnloE 1-26 10-9 1.0 0.55 1 x 108
    NNPDF10 (Neutral Network 100 sets) 90000-90100 90200-90300 NNPDF10_100 0-100 10-9 1.0 2.0 1 x 108
    NNPDF11 (Neutral Network 100 sets) - 90400-90500 NNPDF11_100 0-100 10-9 1.0 2.0 1 x 108
    NNPDF12 (Neutral Network 100 sets) - 90600-90700 NNPDF12_100 0-100 10-9 1.0 2.0 1 x 108
    NNPDF20 (Neutral Network 100 sets) - 90800-90900 NNPDF20_100 0-100 10-9 1.0 2.0 1 x 108
    NNPDF10 (Neutral Network 1000 sets) 91000-92000 93000-94000 NNPDF10_1000 0-1000 10-9 1.0 2.0 1 x 108
    NNPDF12 (Neutral Network 1000 sets) - 95000-96000 NNPDF12_1000 0-1000 10-9 1.0 2.0 1 x 108
    NNPDF20 (Neutral Network 1000 sets) - 97000-98000 NNPDF20_1000 0-1000 10-9 1.0 2.0 1 x 108
    NNPDF20 (Neutral Network alphas sets) - 190000-191900 NNPDF20_as_0114 to 0.124 (omitting 0119) 0-9 10-9 1.0 2.0 1 x 108
    NNPDF20 (Neutral Network separate ZEUS/H1 fit) - 192000-192100 NNPDF20_heraold 0-9 10-9 1.0 2.0 1 x 108
    NNPDF20 (Neutral Network DIS data fit) - 192200-192300 NNPDF20_dis 0-9 10-9 1.0 2.0 1 x 108
    NNPDF20 (Neutral Network DIS+DY data fit) - 192400-192500 NNPDF20_dis+dy 0-9 10-9 1.0 2.0 1 x 108
    NNPDF20 (Neutral Network DIS+JET data fit) - 192600-192700 NNPDF20_dis+jet 0-9 10-9 1.0 2.0 1 x 108

    Nuclear PDFs
    PDF set .LHpdf .LHgrid File Name Member Xmin Xmax Q2min GeV2 Q2max GeV2
    HKN - LO - 100051-100070 HKNlo 1-19 10-9 1.0 1.0 1 x 108
    HKN - NLO - 100151-100170 HKNnlo 1-19 10-9 1.0 1.0 1 x 108

    Pion PDFs
    PDF set .LHpdf .LHgrid File Name Member Xmin Xmax Q2min GeV2 Q2max GeV2
    OW-P Set 1 LO - 211 OWPI 0/1 5 x 10-3 0.9998 4.0 2 x 103
    OW-P Set 2 LO - 212 OWPI 2 5 x 10-3 0.9998 4.0 2 x 103
    SMRS-P 1 NLO - 231 SMRSPI 1 10-5 0.9998 5.0 1.31 x 106
    SMRS-P 2 NLO - 232 SMRSPI 0/2 10-5 0.9998 5.0 1.31 x 106
    SMRS-P 2 NLO - 233 SMRSPI 3 10-5 0.9998 5.0 1.31 x 106
    GRV-P HO NLO - 251 GRVPI1 0/1 10-5 0.9998 0.3 106
    GRV-P HO LO - 252 GRVPI0 0/1 10-5 0.9998 0.25 106
    ABFKW-P Set 1 NLO - 261 ABFKWPI 0/1 10-3 0.9998 2.0 108
    ABFKW-P Set 2 NLO - 262 ABFKWPI 2 10-3 0.9998 2.0 108
    ABFKW-P Set 3 NLO - 263 ABFKWPI 3 10-3 0.9998 2.0 108

    Photon PDFs
    PDF set .LHpdf .LHgrid File Name Member Xmin Xmax Q2min GeV2 Q2max GeV2
    DO-G Set 1 LO - 311 DOG0 0/1 10-5 0.9 10.0 104
    DO-G Set 2 NLO - 312 DOG1 0/1 10-5 0.9 10.0 104
    DG-G Set 1 LO - 321 DGG 0/1 10-5 0.9998 1.0 104
    DG-G Set 2 LO - 322 DGG 2 10-5 0.9998 1.0 50.0
    DG-G Set 3 LO - 323 DGG 3 10-5 0.9998 20.0 500.0
    DG-G Set 4 LO - 324 DGG 4 10-5 0.9998 200.0 104
    LAC-G Set 1 LO - 331 LACG 0/1 10-4 0.9998 4.0 105
    LAC-G Set 2 LO - 332 LACG 2 10-4 0.9998 4.0 105
    LAC-G Set 3 LO - 333 LACG 3 10-4 0.9998 1.0 105
    GAL-G LO - 334 LACG 4 10-4 0.9998 4.0 105
    GS-G NLO - 341 GSG1 0/1 5 x 10-4 0.9998 5.3 108
    GS-G LO Set 1 - 342 GSG0 0/1 5 x 10-4 0.9998 5.3 108
    GS-G LO Set 2 - 343 GSG0 2 5 x 10-4 0.9998 5.3 108
    GS-G-96 NLO - 344 GSG961 0/1 5 x 10-4 0.9998 5.3 108
    GS-G-96 LO - 345 GSG960 0/1 5 x 10-4 0.9998 5.3 108
    GRV-G 1HO DIS NLO - 351 GRVG1 1 10-5 0.9998 0.3 106
    GRV-G HO DIS NLO - 352 GRVG1 0/2 10-5 0.9998 0.3 106
    GRV-G LO - 353 GRVG0 1 10-5 0.9998 0.25 106
    GRS-G LO - 354 GRVG0 0/2 10-5 0.9998 0.6 5 x 104
    ACFGP-G HO NLO - 361 ACFGPG 1 1.37 x 10-3 0.9986 2.0 5.5 x 105
    ACFGP-G HO-mc NLO - 362 ACFGPG 2 1.37 x 10-3 0.9986 2.0 5.5 x 105
    ACFGP-G HO NLO - 363 ACFGPG 0/3 1.37 x 10-3 0.9986 2.0 5.5 x 105
    WHIT-G 1 LO - 381 WHITG 0/1 10-3 0.9998 4.0 2.5 x 103
    WHIT-G 2 LO - 382 WHITG 2 10-3 0.9998 4.0 2.5 x 103
    WHIT-G 3 LO - 383 WHITG 3 10-3 0.9998 4.0 2.5 x 103
    WHIT-G 4 LO - 384 WHITG 4 10-3 0.9998 4.0 2.5 x 103
    WHIT-G 5 LO - 385 WHITG 5 10-3 0.9998 4.0 2.5 x 103
    WHIT-G 6 LO - 386 WHITG 6 10-3 0.9998 4.0 2.5 x 103
    SaS-G 1D (ver.1) LO - 391 SASG 1 10-5 0.9998 0.36 5 x 104
    SaS-G 1M (ver.1) LO - 392 SASG 2 10-5 0.9998 0.36 5 x 104
    SaS-G 2D (ver.1) LO - 393 SASG 3 10-5 0.9998 4.0 5 x 104
    SaS-G 2M (ver.1) LO - 394 SASG 4 10-5 0.9998 4.0 5 x 104
    SaS-G 1D (ver.2) LO - 395 SASG 5 10-5 0.9998 0.36 5 x 104
    SaS-G 1M (ver.2) LO - 396 SASG 0/6 10-5 0.9998 0.36 5 x 104
    SaS-G 2D (ver.2) LO - 397 SASG 7 10-5 0.9998 4.0 5 x 104
    SaS-G 2M (ver.2) LO - 398 SASG 8 10-5 0.9998 4.0 5 x 104

    B  Examples

    The example tar file can be downloaded from the website. Untarring the file will create the directory Examples which contains the source code of the 3 examples together with the makefile to generate the executables. Note that the pathnames in the makefile have to be edited for proper execution. When running an example for the first time with the evolution code QCDNUM a grid has to be calculated. This might take some time depending on the grid size. Running with the PDF set after that the initialization time is much shorter as everything can be read in from an external file.

    B.1  Example 1: A PDF table

    The executable example.x is made by the command make 1. The first example code simply runs through all 100 PDF members of the Alekhin set [6], printing out aS(MZ) and the gluon PDF momentum densities at a few (x,Q) points:

      
          program example1
          implicit real*8(a-h,o-z)
          character name*64
          real*8 f(-6:6)
    *
          name='cteq61.LHpdf'
          call InitPDFsetByName(name)
    *
          QMZ=91.18d0
          write(*,*)
          call numberPDF(N)
           do i=0,N
             write(*,*) '---------------------------------------------'
             call InitPDF(i)
             write(*,*) 'PDF set ',i
             write(*,*)
             a=alphasPDF(QMZ)
             write(*,*) 'alpha_S(M_Z) = ',a
             write(*,*)
             write(*,*) 'x*up'
             write(*,*) '   x     Q=10 GeV     Q=100 GeV    Q=1000 GeV'
             do x=0.1d0,0.95d0,0.1d0
                Q=10d0
                call evolvePDF(x,Q,f)
                u1=f(2)
                Q=100d0
                call evolvePDF(x,Q,f)
                u2=f(2)
                Q=1000d0
                call evolvePDF(x,Q,f)
                u3=f(2)
                write(*,*) x,u1,u2,u3
             enddo
          enddo
    *
         end
    
    

    B.2  Example 2: Calculating Uncertainties for Monte Carlo PDF sets

    Warning: only use the following on the Botje99, Fermi02 and Alekhin00 sets!

    The method os NOT appiclable to other error sets such as MRST and CTEQ

    The executable example.x is made by the command make 2. The second example calculates the average value of the gluon PDF and its standard deviation for several x values at Q=100 GeV using the Botje set [7]. Note that the program calculates the quantities in two manners. First by placing the loop over the PDF members inside the loop over the parton momentum fractions. Second, by exchanging this order and storing the first and second moments in an array depending on the x value. The second method is considerably faster in computing time as each PDF member is only initialized once.

    Also calculated is the correlation of the gluon momentum PDF between x=0.001 and x=0.01 and the correlation between the strange quark momentum PDF at x=0.001 and aS(Q) at Q=10 GeV.

          program example2
          implicit real*8(a-h,o-z)
          character*32 name
          real*8 f(-6:6),mom1(9),mom2(9)
    *
          Q=100d0
          name='../PDFsets/Botje_100.LHpdf'
          call InitPDFset(name)
    *
          call numberPDF(Nmem)
          write(*,*)
          write(*,*) 'Calculating the gluon momentum PDF average <g>'
          write(*,*) 'and standard deviaton SD(g) for several x values'
          write(*,*) 'at Q=100 GeV'
          write(*,*)
          write(*,*) '1. The slow way:'
          write(*,*) 
          write(*,*) '   x       <g>         SD(g)'
          do x=0.01d0,0.095d0,0.01d0
             gmom1=0d0
             gmom2=0d0
             do i=1,Nmem
                call InitPDF(i)
                call evolvePDF(x,Q,f)
                gmom1=gmom1+f(0)
                gmom2=gmom2+f(0)**2
             enddo
             av=gmom1/Nmem
             sd=sqrt(gmom2/Nmem-av**2)
             write(*,*) x,av,sd
          enddo
          write(*,*) 
          write(*,*) '2. The fast way:'
          write(*,*) 
          write(*,*) '   x       <g>         SD(g)'
          do i=1,9
             mom1(i)=0d0
             mom2(i)=0d0
          enddo
          do i=1,Nmem
             call InitPDF(i)
             ic=0
             do x=0.01d0,0.095d0,0.01d0
                call evolvePDF(x,Q,f)
                ic=ic+1
                mom1(ic)=mom1(ic)+f(0)
                mom2(ic)=mom2(ic)+f(0)**2
             enddo
          enddo
          ic=0
          do x=0.01d0,0.095d0,0.01d0
             ic=ic+1
             av=mom1(ic)/Nmem
             sd=sqrt(mom2(ic)/Nmem-av**2)
             write(*,*) x,av,sd
          enddo
    *
          Q=10d0
          x1=0.001d0
          x2=0.01d0
          write(*,*)
          write(*,*) 'Calculating the normalized correlation coefficient'
          write(*,*) '<g1g2> between g(x=0.001) and g(x=0.01) and'
          write(*,*) '<sAlpha> between the strange quark momentum PDF'
          write(*,*) 'at x=0.001 and alpha_S(Q) for Q=10 GeV'
          write(*,*)
          avg1=0d0
          avg2=0d0
          avs=0d0
          avAs=0d0
          sdg1=0d0
          sdg2=0d0
          sds=0d0
          sdAs=0d0
          Cg1g2=0d0
          CsAs=0d0
          j=3
          do i=1,Nmem
             call InitPDF(i)
             As=alphasPDF(Q)
             call evolvePDF(x1,Q,f)
             g1=f(0)
             s=f(j)
             call evolvePDF(x2,Q,f)
             g2=f(0)
             avAs=avAs+As
             avg1=avg1+g1
             avg2=avg2+g2
             avs=avs+s
             sdAs=sdAs+As**2
             sdg1=sdg1+g1**2
             sdg2=sdg2+g2**2
             sds=sds+s**2
             CsAs=CsAs+s*As
             Cg1g2=Cg1g2+g1*g2
          enddo
          avAs=avAs/Nmem
          avs=avs/Nmem
          avg1=avg1/Nmem
          avg2=avg2/Nmem
          sdAs=sdAs/Nmem-avAs**2
          sds=sds/Nmem-avs**2
          sdg1=sdg1/Nmem-avg1**2
          sdg2=sdg2/Nmem-avg2**2
          CsAs=CsAs/Nmem-avs*avAs
          Cg1g2=Cg1g2/Nmem-avg1*avg2
          write(*,*) '<g1g2>    = ',Cg1g2/sqrt(sdg1*sdg2)
          write(*,*) '<sAlpha> = ',CsAs/sqrt(sds*sdAs)
          end
    
    

    B.3  Example 3: A Convenient Wrap

    The executable example.x is made by the command make 3. The third example prints out the same as the first example. However it uses a wrapper around the LHAPDF code. The single call wrapper takes care of the initialization calls. Note that the number of PDF members is only known after the first call to the subroutine parden. Also the aS value is only known after the first call to the subroutine parden for a specific member PDF.

          program example3
          implicit real*8(a-h,o-z)
          real*8 f(-6:6)
    *
          QMZ=91.71d0
          Nmem=100
          write(*,*)
          do i=1,Nmem
             write(*,*) '---------------------------------------------'
             write(*,*) 'PDF set ',i
             write(*,*)
             write(*,*) 'x*Gluon'
             write(*,*) '   x     Q=10 GeV     Q=100 GeV    Q=1000 GeV'
             do x=0.01d0,0.095d0,0.01d0
                Q=10d0
                call parden(x,Q,f,i)
                g1=f(0)
                Q=100d0
                call parden(x,Q,f,i)
                g2=f(0)
                Q=1000d0
                call parden(x,Q,f,i)
                g3=f(0)
                write(*,*) x,g1,g2,g3
             enddo
             a=alphasPDF(QMZ)
             write(*,*)
             write(*,*) 'alpha_S(M_Z) = ',a
             write(*,*)
          enddo
    *
          end
    *
          subroutine parden(x,Q,f,imem)
          implicit none
          character*32 name/'../PDFsets/Alekhin_100.LHpdf'/
          real*8 x,Q,f(-6:6),alfas
          integer imem,init/0/,lmem/-1/
          save init,lmem
    *
          if (init.eq.0) then
             init=1
             call InitPDFset(name)
          endif
          if (imem.ne.lmem) then
             lmem=imem
             call InitPDF(lmem)
          endif
          call evolvePDF(x,Q,f)
          return
    *
          end
    
    

    B.4  Example 4: Using LHAGLUE to do Example 1

    This program illustrates using the LHAGLUE routines ro repeat Example 1.

    
          program example4
    c
    c using lhaglue to do example 1
    c
          implicit real*8(a-h,o-z)
          character*20 parm(20)
          double precision value(20)
    *
          parm(1)='DEFAULT'
          call SetLHAPARM('SILENT')
    c      parm(19)='SILENT'
          val = 10100
          do i=0,40
          value(1)=val+i
            write(*,*) '---------------------------------------------'
            call pdfset(parm,value)
            if (i.eq.0) call getdesc()
            qmz = 91.71d0
            a = alphasPDF(qmz)
            print *,'Alpha_s(Mz)=',a
             write(*,*) 'x*up'
             write(*,*) '   x     Q2=10 GeV     Q=100 GeV    Q=1000 GeV'
             do x=0.1d0,0.95d0,0.1d0
                Q=10.0d0
                call structm(x,q,upv,dnv,usea,dsea,str,chm,bot,top,glu)
                g1=upv+usea
                Q=100d0
                call structm(x,q,upv,dnv,usea,dsea,str,chm,bot,top,glu)
                g2=upv+usea
                Q=1000d0
                call structm(x,q,upv,dnv,usea,dsea,str,chm,bot,top,glu)
                g3=upv+usea
                write(*,*) x,g1,g2,g3
             enddo
          enddo
    *
          end
    

    B.4  Example 5: Using Multiset Initialisation

    This program illustrates multiset initialisation LHAglue/LHAPDF.

          program example5
    c
    c using lhaglue for 3 different PDF sets proton/photon/pion
    c using lhaglue for 3 different PDF sets proton/photon/pion
    c using setpdfpath to define the path
    c using PDFsta for statistics
    c
          implicit real*8(a-h,o-z)
          character*20 parm(20)
          character name*64
          double precision value(20),g(3)
          integer inset(3)
          data inset/20200,391,231/
          common/W50513/xmin,xmax,q2min,q2max
    *
          parm(1)='DEFAULT'
    
          call setlhaparm('SILENT')
          call setpdfpath('../PDFsets')
          qmz = 91.180d0
          ip2 = 0
          p2 = 0.0d0
          do j=1,3
            print *,'PDF set ',j,' is PDF set number ',inset(j)
            value(1)=inset(j)
            call pdfset(parm,value)
            call getdescm(j)
            call getlam4m(j,0,xlam4)
            call getlam5m(j,0,xlam5)
            a=alphasPDF(QMZ)
            print *,'PDF number, alpha_s(mz), xmin, xmax, q2min, q2max, lambda4, lambda5'
            print *,value(1),a,xmin,xmax,q2*
          call PDFsta
          end
    wmin,q2max,xlam4,xlam5
          write(*,*) '---------------------------------------------'
          enddo
          Q=100.0d0
          print *,'x*gluon at Q = 100 GeV'
          print *,'PDF sets: ',(inset(j),j=1,3)
          write(*,*) '---------------------------------------------'
          do x=0.1d0,0.95d0,0.1d0
           do j=1,3
            value(1)=inset(j)
            call pdfset(parm,value)
            if(value(1).ge.300.and.value(1).le.399) then
              call structp(x,q2,p2,ip2,upv,dnv,usea,dsea,str,chm,bot,top,glu)
            else
              call structm(x,q,upv,dnv,usea,dsea,str,chm,bot,top,glu)
            endif
                g(j)=glu
           enddo
             write(*,*) x,(g(j),j=1,3)
          enddo
    *
          call PDFsta
          end
    
    

    References

    [1]
    M. Botje, QCDNUM version 16.12, preprint ZEUS-97-066,
    http://www.nikhef.nl/ ~ h24/qcdnum.
    [2]
    S. Alekhin, M. Botje, W. Giele, J. Pumplin, F. Olness, G. Salam and A. Vogt,
    Physics at TeV Colliders II Workshop, Les Houches, France, May 2001.
    [3]
    H. Plothow-Besch, Comput. Phys. Commun. 75, 396 (1993).
    [4]
    W. Giele, S. Keller and D. Kosower, hep-ph/0104052;
    W. Giele and S. Keller, hep-ph/9803393 [Phys. Rev. D58, 1997, 094023].
    [5]
    W. Giele and S. Keller, hep-ph/0104053.
    [6]
    S. I. Alekhin, hep-ph/0011002, [Phys. Rev. D63, 2001, 094022].
    [7]
    M. Botje, hep-ph/9912439, [Eur. Phys. J. C14, 2000, 285].


    Footnotes:

    1W. Giele, Fermilab, giele@fnal.gov and M.R. Whalley, Durham U, m.r.whalley@durham.ac.uk

    2Developed by D. Bourilkov and C. Group, University of Florida hep-ph/0305126.


    File translated from TEX by TTH, version 3.06.
    On 5 Apr 2002, 11:34.


    LHAPDF is maintained by Mike Whalley and Andy Buckley at Durham University (UK)
    email: lhapdf@projects.hepforge.org phone: +44-191-334-3807 fax:+44-191-334-3658
    Last updated: Tue Aug 17 15:17:35 2010