LHAPDF C++ wrapper  5.4
Classes | Enumerations
LHAPDF Namespace Reference

Namespace containing all the LHAPDF wrapper functions. More...

Classes

class  PDFSetInfo
 Structure containing metadata about a PDF set. More...
 

Enumerations

enum  Flavour {
  TBAR = -6, BBAR = -5, CBAR = -4, SBAR = -3,
  UBAR = -2, DBAR = -1, GLUON = 0, DOWN = 1,
  UP = 2, STRANGE = 3, CHARM = 4, BOTTOM = 5,
  TOP = 6, PHOTON = 7
}
 Enum of flavours which map to LHAPDF integer codes. Useful for improving readability of client code. Note that these codes can't be used to access elements of returned vector<double>, which don't use the LHAPDF scheme (they use "LHAPDF code + 6").
 
enum  SetType { EVOLVE = 0, LHPDF = 0, INTERPOLATE = 1, LHGRID = 1 }
 Distinction between evolution or interpolation PDF sets. Enum to choose whether evolution (i.e. LHpdf data file) or interpolation (i.e. LHgrid data file) is used.
 
enum  Verbosity { SILENT =0, LOWKEY =1, DEFAULT =2 }
 Level of noisiness.
 

Functions

Global functions
std::string getVersion ()
 Get LHAPDF version string.
 
int getMaxNumSets ()
 Get max allowed number of concurrent sets.
 
void initLHAPDF ()
 Global initialisation.
 
void setVerbosity (Verbosity noiselevel)
 Choose level of noisiness.
 
void extrapolate (bool extrapolate=true)
 Extrapolate beyond grid edges.
 
void setPDFPath (const std::string &path)
 Set the LHAPATH variable (the location of the PDF sets directory).
 
void setParameter (const std::string &parm)
 Set a steering parameter (direct map to Fortran setlhaparm(parm) function).
 
Set metadata
std::ostream & operator<< (std::ostream &os, const PDFSetInfo &info)
 
PDFSetInfo getPDFSetInfo (const std::string &filename, int memid)
 Get a PDF set info object by filename and member number.
 
PDFSetInfo getPDFSetInfo (int id)
 Get a PDF set info object by the LHAPDF ID number.
 
std::vector< PDFSetInfogetAllPDFSetInfo ()
 Get a vector of PDF set info objects for all known sets.
 
Path info functions
std::string prefixPath ()
 Get path to LHAPDF installation (the "prefix" path).
 
std::string pdfsetsPath ()
 Get path to LHAPDF PDF sets directory.
 
std::string pdfsetsIndexPath ()
 Get path to LHAPDF PDF sets index file.
 
Initialisation functions

LHAPDF functions for initialising PDF sets. If you need to use more than one set simultaneously, use the multi-set functions, which have a integer nset first argument.

void initPDFSet (int setid, int member)
 Initialise member in PDF set setid.
 
void initPDFSet (int nset, int setid, int member)
 Initialise member in PDF set setid (multi-set version).
 
void initPDFSet (const std::string &name, SetType type, int member=0)
 Initialise member in PDF set name, of type type.
 
void initPDFSet (int nset, const std::string &name, SetType type, int member=0)
 Initialise member in PDF set name, of type type (multi-set version).
 
void initPDFSet (const std::string &filename, int member=0)
 Initialise member in PDF set file filename. If filename contains a "/" character, it will be used as a path, otherwise it will be assumed to be a PDF file in the LHAPDF PDFsets directory.
 
void initPDFSet (int nset, const std::string &filename, int member=0)
 Initialise member in PDF set file filename (multi-set version). If filename contains a "/" character, it will be used as a path, otherwise it will be assumed to be a PDF file in the LHAPDF PDFsets directory.
 
void usePDFMember (int member)
 Use member in current PDF set. This operation is computationally cheap.
 
void usePDFMember (int nset, int member)
 Use member in PDF set nset (multi-set version). This operation is computationally cheap.
 
PDF set information
void getDescription ()
 Prints a brief description of the current PDF set to stdout.
 
void getDescription (int nset)
 Prints a brief description of the current PDF set to stdout.
 
bool hasPhoton ()
 Does the current set have a photon member?
 
int numberPDF ()
 Number of members available in the current set.
 
int numberPDF (int nset)
 Number of members available in the current set.
 
double alphasPDF (double Q)
 $ \alpha_\mathrm{s} $ used by the current PDF.
 
double alphasPDF (int nset, double Q)
 $ \alpha_\mathrm{s} $ used by the current PDF.
 
int getOrderPDF ()
 Get order at which the PDF was fitted.
 
int getOrderPDF (int nset)
 Get order at which the PDF was fitted.
 
int getOrderAlphaS ()
 Perturbative order of parton evolution and $ \alpha_\mathrm{s} $ respectively.
 
int getOrderAlphaS (int nset)
 Perturbative order of parton evolution and $ \alpha_\mathrm{s} $ respectively.
 
double getQMass (int f)
 Quark mass used for flavour f.
 
double getQMass (int nset, int f)
 Quark mass used for flavour f.
 
double getThreshold (int f)
 Threshold for flavour f.
 
double getThreshold (int nset, int f)
 Threshold for flavour f.
 
int getNf ()
 Number of flavours used in the current PDF set.
 
int getNf (int nset)
 Number of flavours used in the current PDF set.
 
double getLam4 (int m)
 Value of QCD $ \lambda_4 $ for member m.
 
double getLam4 (int nset, int m)
 Value of QCD $ \lambda_4 $ for member m.
 
double getLam5 (int m)
 Value of QCD $ \lambda_5 $ for member m.
 
double getLam5 (int nset, int m)
 Value of QCD $ \lambda_5 $ for member m.
 
double getXmin (int m)
 Minimum $ x $ value considered valid for this set, as specified by the set authors.
 
double getXmin (int nset, int m)
 Minimum $ x $ value considered valid for this set, as specified by the set authors.
 
double getXmax (int m)
 Maximum $ x $ value considered valid for this set, as specified by the set authors.
 
double getXmax (int nset, int m)
 Maximum $ x $ value considered valid for this set, as specified by the set authors.
 
double getQ2min (int m)
 Minimum $ Q^2 $ value considered valid for this set, as specified by the set authors.
 
double getQ2min (int nset, int m)
 Minimum $ Q^2 $ value considered valid for this set, as specified by the set authors.
 
double getQ2max (int m)
 Maximum $ Q^2 $ value considered valid for this set, as specified by the set authors.
 
double getQ2max (int nset, int m)
 Maximum $ Q^2 $ value considered valid for this set, as specified by the set authors.
 
Nucleon PDFs

These PDFs are defined for protons — neutron PDFs are usually obtained by isospin conjugation.

std::vector< double > xfx (double x, double Q)
 
std::vector< double > xfx (int nset, double x, double Q)
 
void xfx (double x, double Q, double *results)
 
void xfx (int nset, double x, double Q, double *results)
 
double xfx (double x, double Q, int fl)
 
double xfx (int nset, double x, double Q, int fl)
 
Photon PDFs
std::vector< double > xfxp (double x, double Q, double P2, int ip)
 
std::vector< double > xfxp (int nset, double x, double Q, double P2, int ip)
 
void xfxp (double x, double Q, double P2, int ip, double *results)
 
void xfxp (int nset, double x, double Q, double P2, int ip, double *results)
 
double xfxp (double x, double Q, double P2, int ip, int fl)
 
double xfxp (int nset, double x, double Q, double P2, int ip, int fl)
 
Nuclear PDFs
std::vector< double > xfxa (double x, double Q, double a)
 
std::vector< double > xfxa (int nset, double x, double Q, double a)
 
void xfxa (double x, double Q, double a, double *results)
 
void xfxa (int nset, double x, double Q, double a, double *results)
 
double xfxa (double x, double Q, double a, int fl)
 
double xfxa (int nset, double x, double Q, double a, int fl)
 
Nucleon MRST QED PDF

These functions only apply to the MRST QED PDF set, since they return an extra element for the additional photon.

std::vector< double > xfxphoton (double x, double Q)
 
std::vector< double > xfxphoton (int nset, double x, double Q)
 
void xfxphoton (double x, double Q, double *results)
 
void xfxphoton (int nset, double x, double Q, double *results)
 
double xfxphoton (double x, double Q, int fl)
 
double xfxphoton (int nset, double x, double Q, int fl)
 
Deprecated initialisation functions

LHAPDF functions for initialising PDF sets. If you need to use more than one set simultaneously, use the multi-set functions, which have a integer nset first argument.

Deprecated:
These init methods are deprecated.
void initPDFSetByName (const std::string &name, SetType type)
 The PDF set by file path, see subdir PDFsets of LHAPDF for choices. More...
 
void initPDFSetByName (int nset, const std::string &name, SetType type)
 The PDF set by name and type, see subdir PDFsets of LHAPDF for choices.
 
void initPDFSetByName (const std::string &filename)
 The PDF set by filename, see subdir PDFsets of LHAPDF for choices.
 
void initPDFSetByName (int nset, const std::string &filename)
 The PDF set by filename, see subdir PDFsets of LHAPDF for choices.
 
void initPDF (int memset)
 The choice of PDF member out of one distribution.
 
void initPDF (int nset, int memset)
 The choice of PDF member out of one distribution.
 
void initPDFByName (const std::string &name, SetType type, int memset)
 Convenient initializer with PDF set name, set type type and member memset. More...
 
void initPDFByName (int nset, const std::string &name, SetType type, int memset)
 Typical initializer for multiple PDF sets with PDF set name and member memset. More...
 
void initPDFByName (const std::string &filename, int memset)
 Convenient initializer with PDF set filename and member memset. More...
 
void initPDFByName (int nset, const std::string &filename, int memset)
 Typical initializer for multiple PDF sets with PDF set name and member memset. More...
 

Detailed Description

Namespace containing all the LHAPDF wrapper functions.

Function Documentation

◆ initPDFByName() [1/4]

void LHAPDF::initPDFByName ( const std::string &  name,
SetType  type,
int  memset 
)

Convenient initializer with PDF set name, set type type and member memset.

Parameters
nameThe name of the desired set.
typeThe type of PDF set (grid or data) by enum.
memsetPDF number within set name. Equivalent to initPDFSetByName + initPDF.

Referenced by LHAPDF::PDFSetInfo::toString().

◆ initPDFByName() [2/4]

void LHAPDF::initPDFByName ( int  nset,
const std::string &  name,
SetType  type,
int  memset 
)

Typical initializer for multiple PDF sets with PDF set name and member memset.

Parameters
nsetSpecifies the reference number for the set to be initialized.
nameName of the desired set.
typeThe type of PDF set (grid or data) by enum.
memsetPDF number within set name. Equivalent to initPDFSetByNameM + initPDFM.

◆ initPDFByName() [3/4]

void LHAPDF::initPDFByName ( const std::string &  filename,
int  memset 
)

Convenient initializer with PDF set filename and member memset.

Parameters
filenameThe name of the grid or data file of the desired set.
memsetPDF number within set name. Equivalent to initPDFSetByName + initPDF.

◆ initPDFByName() [4/4]

void LHAPDF::initPDFByName ( int  nset,
const std::string &  filename,
int  memset 
)

Typical initializer for multiple PDF sets with PDF set name and member memset.

Parameters
nsetSpecifies the reference number for the set to be initialized.
filenameName of the grid or data file of the desired set.
memsetPDF number within set name. Equivalent to initPDFSetByNameM + initPDFM.

◆ initPDFSetByName()

void LHAPDF::initPDFSetByName ( const std::string &  name,
SetType  type 
)

The PDF set by file path, see subdir PDFsets of LHAPDF for choices.

The PDF set by file path, see subdir PDFsets of LHAPDF for choices. The PDF set by name and type, see subdir PDFsets of LHAPDF for choices.

Referenced by LHAPDF::PDFSetInfo::toString().

◆ xfx() [1/6]

std::vector<double> LHAPDF::xfx ( double  x,
double  Q 
)

Nucleon PDF: returns a vector $ x f_i(x, Q) $ with index $ 0 < i < 12 $.

  • 0..5 = $ \bar{t} $, ..., $ \bar{u} $, $ \bar{d} $;
  • 6 = $ g $;
  • 7..12 = $ d $, $ u $, ..., $ t $.
Examples:
/examples/CCTest1.cc.

Referenced by LHAPDF::PDFSetInfo::toString().

◆ xfx() [2/6]

std::vector<double> LHAPDF::xfx ( int  nset,
double  x,
double  Q 
)

Nucleon PDF: returns a vector x f_i(x, Q) with index $ 0 < i < 12 $.

  • 0..5 = $ \bar{t} $, ..., $ \bar{u} $, $ \bar{d} $;
  • 6 = $ g $;
  • 7..12 = $ d $, $ u $, ..., $ t $.

◆ xfx() [3/6]

void LHAPDF::xfx ( double  x,
double  Q,
double *  results 
)

Nucleon PDF: fills primitive 13 element array pointed at by results with $ x f(x, Q) $ with index $ 0 < i < 12 $.

  • 0..5 = $ \bar{t} $, ..., $ \bar{u} $, $ \bar{d} $;
  • 6 = $ g $;
  • 7..12 = $ d $, $ u $, ..., $ t $.

◆ xfx() [4/6]

void LHAPDF::xfx ( int  nset,
double  x,
double  Q,
double *  results 
)

Nucleon PDF: fills primitive 13 element array pointed at by results with $ x f(x, Q) $ with index $ 0 < i < 12 $.

  • 0..5 = $ \bar{t} $, ..., $ \bar{u} $, $ \bar{d} $;
  • 6 = $ g $;
  • 7..12 = $ d $, $ u $, ..., $ t $.

◆ xfx() [5/6]

double LHAPDF::xfx ( double  x,
double  Q,
int  fl 
)

Nucleon PDF: returns $ x f(x, Q) $ for flavour fl - this time the flavour encoding is as in the LHAPDF manual.

  • -6..-1 = $ \bar{t} $, ..., $ \bar{u} $, $ \bar{d} $;
  • 0 = $ g $
  • 1..6 = $ d $, $ u $, ..., $ t $.

◆ xfx() [6/6]

double LHAPDF::xfx ( int  nset,
double  x,
double  Q,
int  fl 
)

Nucleon PDF: returns x f(x, Q) for flavour fl - this time the flavour encoding is as in the LHAPDF manual.

  • -6..-1 = $ \bar{t} $, ..., $ \bar{u} $, $ \bar{d} $;
  • 0 = $ g $
  • 1..6 = $ d $, $ u $, ..., $ t $.

◆ xfxa() [1/6]

std::vector<double> LHAPDF::xfxa ( double  x,
double  Q,
double  a 
)

Nuclear PDF: returns a vector $ x f_i(x, Q) $ with index $ 0 < i < 12 $.

  • 0..5 = $ \bar{t} $, ..., $ \bar{u} $, $ \bar{d} $;
  • 6 = $ g $;
  • 7..12 = $ d $, $ u $, ..., $ t $.

NB. Extra a param for atomic mass number.

Referenced by LHAPDF::PDFSetInfo::toString().

◆ xfxa() [2/6]

std::vector<double> LHAPDF::xfxa ( int  nset,
double  x,
double  Q,
double  a 
)

Nuclear PDF: returns a vector $ x f_i(x, Q) $ with index $ 0 < i < 12 $.

  • 0..5 = $ \bar{t} $, ..., $ \bar{u} $, $ \bar{d} $;
  • 6 = $ g $;
  • 7..12 = $ d $, $ u $, ..., $ t $.

NB. Extra a param for atomic mass number.

◆ xfxa() [3/6]

void LHAPDF::xfxa ( double  x,
double  Q,
double  a,
double *  results 
)

Nuclear PDF: fills primitive 13 element array pointed at by results with $ x f(x, Q) $ with index $ 0 < i < 12 $.

  • 0..5 = $ \bar{t} $, ..., $ \bar{u} $, $ \bar{d} $;
  • 6 = $ g $;
  • 7..12 = $ d $, $ u $, ..., $ t $.

NB. Extra a param for atomic mass number.

◆ xfxa() [4/6]

void LHAPDF::xfxa ( int  nset,
double  x,
double  Q,
double  a,
double *  results 
)

Nuclear PDF: fills primitive 13 element array pointed at by results with $ x f(x, Q) $ with index $ 0 < i < 12 $.

  • 0..5 = $ \bar{t} $, ..., $ \bar{u} $, $ \bar{d} $;
  • 6 = $ g $;
  • 7..12 = $ d $, $ u $, ..., $ t $.

NB. Extra a param for atomic mass number.

◆ xfxa() [5/6]

double LHAPDF::xfxa ( double  x,
double  Q,
double  a,
int  fl 
)

Nuclear PDF: returns $ x f(x, Q) $ for flavour fl - this time the flavour encoding is as in the LHAPDF manual.

  • -6..-1 = $ \bar{t} $, ..., $ \bar{u} $, $ \bar{d} $;
  • 0 = $ g $
  • 1..6 = $ d $, $ u $, ..., $ t $.

NB. Extra a param for atomic mass number.

◆ xfxa() [6/6]

double LHAPDF::xfxa ( int  nset,
double  x,
double  Q,
double  a,
int  fl 
)

Nuclear PDF: returns $ x f(x, Q) $ for flavour fl - this time the flavour encoding is as in the LHAPDF manual.

  • -6..-1 = $ \bar{t} $, ..., $ \bar{u} $, $ \bar{d} $;
  • 0 = $ g $
  • 1..6 = $ d $, $ u $, ..., $ t $.

NB. Extra a param for atomic mass number.

◆ xfxp() [1/6]

std::vector<double> LHAPDF::xfxp ( double  x,
double  Q,
double  P2,
int  ip 
)

Photon PDF: returns a vector $ x f_i(x, Q) $ with index $ 0 < i < 12 $.

  • 0..5 = $ \bar{t} $, ..., $ \bar{u} $, $ \bar{d} $;
  • 6 = $ g $;
  • 7..12 = $ d $, $ u $, ..., $ t $.

NB. Extra P2 and ip params.

Referenced by LHAPDF::PDFSetInfo::toString().

◆ xfxp() [2/6]

std::vector<double> LHAPDF::xfxp ( int  nset,
double  x,
double  Q,
double  P2,
int  ip 
)

Photon PDF: returns a vector $ x f_i(x, Q) $ with index $ 0 < i < 12 $.

  • 0..5 = $ \bar{t} $, ..., $ \bar{u} $, $ \bar{d} $;
  • 6 = $ g $;
  • 7..12 = $ d $, $ u $, ..., $ t $.

NB. Extra P2 and ip params.

◆ xfxp() [3/6]

void LHAPDF::xfxp ( double  x,
double  Q,
double  P2,
int  ip,
double *  results 
)

Photon PDF: fills primitive 13 element array pointed at by results with $ x f(x, Q) $ with index $ 0 < i < 12 $.

  • 0..5 = $ \bar{t} $, ..., $ \bar{u} $, $ \bar{d} $;
  • 6 = $ g $;
  • 7..12 = $ d $, $ u $, ..., $ t $.

NB. Extra P2 and ip params.

◆ xfxp() [4/6]

void LHAPDF::xfxp ( int  nset,
double  x,
double  Q,
double  P2,
int  ip,
double *  results 
)

Photon PDF: fills primitive 13 element array pointed at by results with $ x f(x, Q) $ with index $ 0 < i < 12 $.

  • 0..5 = $ \bar{t} $, ..., $ \bar{u} $, $ \bar{d} $;
  • 6 = $ g $;
  • 7..12 = $ d $, $ u $, ..., $ t $.

NB. Extra P2 and ip params.

◆ xfxp() [5/6]

double LHAPDF::xfxp ( double  x,
double  Q,
double  P2,
int  ip,
int  fl 
)

Photon PDF: returns $ x f(x, Q) $ for flavour fl - this time the flavour encoding is as in the LHAPDF manual.

  • -6..-1 = $ \bar{t} $, ..., $ \bar{u} $, $ \bar{d} $;
  • 0 = $ g $
  • 1..6 = $ d $, $ u $, ..., $ t $.

NB. Extra P2 and ip params.

◆ xfxp() [6/6]

double LHAPDF::xfxp ( int  nset,
double  x,
double  Q,
double  P2,
int  ip,
int  fl 
)

Photon PDF: returns $ x f(x, Q) $ for flavour fl - this time the flavour encoding is as in the LHAPDF manual.

  • -6..-1 = $ \bar{t} $, ..., $ \bar{u} $, $ \bar{d} $;
  • 0 = $ g $
  • 1..6 = $ d $, $ u $, ..., $ t $.

NB. Extra P2 and ip params.

◆ xfxphoton() [1/6]

std::vector<double> LHAPDF::xfxphoton ( double  x,
double  Q 
)

MRST QED PDF: returns a vector $ x f_i(x, Q) $ with index $ 0 < i < 12 $.

  • 0..5 = $ \bar{t} $, ..., $ \bar{u} $, $ \bar{d} $;
  • 6 = $ g $;
  • 7..12 = $ d $, $ u $, ..., $ t $;
  • 13 = $ \gamma $.

NB. Note extra element in this set for MRST photon.

Referenced by LHAPDF::PDFSetInfo::toString().

◆ xfxphoton() [2/6]

std::vector<double> LHAPDF::xfxphoton ( int  nset,
double  x,
double  Q 
)

MRST QED PDF: returns a vector $ x f_i(x, Q) $ with index $ 0 < i < 12 $.

  • 0..5 = $ \bar{t} $, ..., $ \bar{u} $, $ \bar{d} $;
  • 6 = $ g $;
  • 7..12 = $ d $, $ u $, ..., $ t $;
  • 13 = $ \gamma $.

◆ xfxphoton() [3/6]

void LHAPDF::xfxphoton ( double  x,
double  Q,
double *  results 
)

MRST QED PDF: fills primitive 14 element array pointed at by results with $ x f(x, Q) $ with index $ 0 < i < 12 $.

  • 0..5 = $ \bar{t} $, ..., $ \bar{u} $, $ \bar{d} $;
  • 6 = $ g $;
  • 7..12 = $ d $, $ u $, ..., $ t $.
  • 13 = $ \gamma $.

NB. Note extra element in this set for MRST photon.

◆ xfxphoton() [4/6]

void LHAPDF::xfxphoton ( int  nset,
double  x,
double  Q,
double *  results 
)

MRST QED PDF: fills primitive 14 element array pointed at by results with $ x f(x, Q) $ with index $ 0 < i < 12 $.

  • 0..5 = $ \bar{t} $, ..., $ \bar{u} $, $ \bar{d} $;
  • 6 = $ g $;
  • 7..12 = $ d $, $ u $, ..., $ t $.
  • 13 = $ \gamma $.

NB. Note extra element in this set for MRST photon.

◆ xfxphoton() [5/6]

double LHAPDF::xfxphoton ( double  x,
double  Q,
int  fl 
)

MRST QED PDF: returns $ x f(x, Q) $ for flavour fl - this time the flavour encoding is as in the LHAPDF manual.

  • -6..-1 = $ \bar{t} $, ..., $ \bar{u} $, $ \bar{d} $;
  • 0 = $ g $
  • 1..6 = $ d $, $ u $, ..., $ t $;
  • 7 = $ \gamma $.

NB. Note extra element in this set for MRST photon.

◆ xfxphoton() [6/6]

double LHAPDF::xfxphoton ( int  nset,
double  x,
double  Q,
int  fl 
)

MRST QED PDF: returns $ x f(x, Q) $ for flavour fl - this time the flavour encoding is as in the LHAPDF manual.

  • -6..-1 = $ \bar{t} $, ..., $ \bar{u} $, $ \bar{d} $;
  • 0 = $ g $
  • 1..6 = $ d $, $ u $, ..., $ t $;
  • 7 = $ \gamma $.