PDF is the general interface for access to parton density information. More...
#include <PDF.h>
Public Member Functions | |
virtual | ~PDF () |
Virtual destructor, to allow unfettered inheritance. | |
void | print (std::ostream &os=std::cout, int verbosity=1) const |
Summary printout. | |
Ranges of validity | |
virtual double | xMin () |
Minimum valid x value for this PDF. | |
virtual double | xMax () |
Maximum valid x value for this PDF. | |
virtual double | qMin () |
virtual double | qMax () |
Maximum valid Q value for this PDF (in GeV). | |
virtual double | q2Min () |
Minimum valid Q2 value for this PDF (in GeV2). | |
virtual double | q2Max () |
Maximum valid Q2 value for this PDF (in GeV2). | |
int | forcePositive () const |
Check whether the PDF is set to only return positive (definite) values or not. | |
void | setForcePositive (int mode) |
Set whether the PDF will only return positive (definite) values or not. | |
bool | inPhysicalRangeX (double x) const |
Check whether the given x is physically valid. | |
bool | inPhysicalRangeQ2 (double q2) const |
Check whether the given Q2 is physically valid. | |
bool | inPhysicalRangeQ (double q) const |
Check whether the given Q is physically valid. | |
bool | inPhysicalRangeXQ2 (double x, double q2) const |
Check whether the given (x,Q2) is physically valid. | |
bool | inPhysicalRangeXQ (double x, double q) const |
Check whether the given (x,Q) is physically valid. | |
virtual bool | inRangeQ (double q) const |
Grid range check for Q. | |
virtual bool | inRangeQ2 (double q2) const =0 |
Grid range check for Q2. | |
virtual bool | inRangeX (double x) const =0 |
Grid range check for x. | |
virtual bool | inRangeXQ (double x, double q) const |
Combined range check for x and Q. | |
bool | inRangeXQ2 (double x, double q2) const |
Combined range check for x and Q2. | |
Generic member-level metadata (including cascaded metadata from set & config level) | |
PDFInfo & | info () |
Get the info class that actually stores and handles the metadata. | |
const PDFInfo & | info () const |
Get the info class that actually stores and handles the metadata (const version) | |
PDFSet & | set () const |
Get the PDF set of which this is a member. | |
Member-level metadata | |
int | memberID () const |
PDF member local ID number. | |
int | lhapdfID () const |
PDF member global LHAPDF ID number. | |
std::string | description () const |
Description of this PDF member. | |
int | dataversion () const |
Version of this PDF's data file. | |
std::string | type () const |
Get the type of PDF member that this object represents (central, error) | |
Parton content and QCD parameters | |
virtual const std::vector< int > & | flavors () const |
List of flavours defined by this PDF set. | |
void | setFlavors (std::vector< int > const &flavors) |
Manually set/override the list of flavours defined by this PDF set. | |
bool | hasFlavor (int id) const |
Checks whether id is a valid parton for this PDF. | |
int | orderQCD () const |
Order of QCD at which this PDF has been constructed. | |
int | qcdOrder () const |
double | quarkMass (int id) const |
Get a quark mass in GeV by PDG code (|PID| = 1-6 only) | |
double | quarkThreshold (int id) const |
Get a flavor scale threshold in GeV by PDG code (|PID| = 1-6 only) Convenience interface to the Mass* and Threshold* info keywords. Returns -1 for an undefined PID. | |
QCD running coupling calculation | |
void | setAlphaS (AlphaS *alphas) |
Set the AlphaS calculator by pointer. | |
void | setAlphaS (AlphaSPtr alphas) |
Set the AlphaS calculator by smart pointer. | |
bool | hasAlphaS () const |
Check if an AlphaS calculator is set. | |
AlphaS & | alphaS () |
Retrieve the AlphaS object for this PDF. | |
const AlphaS & | alphaS () const |
Retrieve the AlphaS object for this PDF (const) | |
double | alphasQ (double q) const |
Value of alpha_s(Q2) used by this PDF. | |
double | alphasQ2 (double q2) const |
Value of alpha_s(Q2) used by this PDF. | |
Protected Types | |
typedef unique_ptr< AlphaS > | AlphaSPtr |
Internal convenience typedef for the AlphaS object handle. | |
Protected Attributes | |
std::string | _mempath |
Member data file path. | |
PDFInfo | _info |
Metadata container. | |
vector< int > | _flavors |
Locally cached list of supported PIDs (mutable for laziness/caching) | |
AlphaSPtr | _alphas |
Optionally loaded AlphaS object (mutable for laziness/caching) | |
int | _forcePos |
Cached flag for whether to return only positive (or positive definite) PDF values. | |
PDF values | |
virtual double | _xfxQ2 (int id, double x, double q2) const =0 |
Calculate the PDF xf(x) value at (x,q2) for the given PID. | |
virtual void | _xfxQ2 (double x, double q2, std::vector< double > &ret) const =0 |
double | xfxQ2 (int id, double x, double q2) const |
Get the PDF xf(x) value at (x,q2) for the given PID. | |
double | xfxQ (int id, double x, double q) const |
Get the PDF xf(x) value at (x,q) for the given PID. | |
void | xfxQ2 (double x, double q2, std::map< int, double > &rtn) const |
Get the PDF xf(x) value at (x,q2) for all supported PIDs. | |
void | xfxQ (double x, double q, std::map< int, double > &rtn) const |
Get the PDF xf(x) value at (x,q) for all supported PIDs. | |
void | xfxQ2 (double x, double q2, std::vector< double > &rtn) const |
Get the PDF xf(x) value at (x,q2) for "standard" PIDs. | |
void | xfxQ (double x, double q, std::vector< double > &rtn) const |
Get the PDF xf(x) value at (x,q) for "standard" PIDs. | |
std::map< int, double > | xfxQ2 (double x, double q2) const |
Get the PDF xf(x) value at (x,q2) for all supported PIDs. | |
std::map< int, double > | xfxQ (double x, double q) const |
Get the PDF xf(x) value at (x,q) for all supported PIDs. | |
PDF is the general interface for access to parton density information.
The PDF interface declares the general form of all PDF types, such as Grid based or analytic.
|
protectedpure virtual |
Calculate the PDF xf(x) value at (x,q2) for the given PID.
This is the key function to be overridden in concrete PDF types, since it actually does the calculation of xf(x,Q2) by analytic, interpolation, or other means. The user-called xfxQ2 method exists so that the physical range and PID checks need only be done in one place, rather than need to be re-implemented in each concrete implementation.
id | Parton ID in the PDG scheme |
x | Momentum fraction |
q2 | Squared energy (renormalization) scale |
Implemented in LHAPDF::GridPDF.
|
inline |
|
inline |
Value of alpha_s(Q2) used by this PDF.
Calculated numerically, analytically, or interpolated according to metadata, using the AlphaS classes.
|
inlinevirtual |
List of flavours defined by this PDF set.
This list is stored locally after its initial read from the Info object to avoid unnecessary lookups and string decoding, since e.g. it is looked at by every call to the GridPDF's Interpolator and Extrapolator classes.
|
inline |
Check whether the PDF is set to only return positive (definite) values or not.
This is to avoid overshooting in to negative values when interpolating/extrapolating PDFs that sharply decrease towards zero. 0 = unforced, 1 = forced positive, 2 = forced positive definite (>= 1e-10)
|
inline |
Check whether the given Q is physically valid.
Returns false for Q less than 0 (Q must be positive).
|
inline |
Check whether the given Q2 is physically valid.
Returns false for Q2 less than 0 (Q must be real-valued).
|
inline |
Check whether the given x is physically valid.
Returns false for x less than 0 or greater than 1, since it is a momentum fraction and not valid outside those values.
|
inlinevirtual |
Grid range check for Q.
Return true when given Q is in the coverage range of this PDF. It actually squares the given Q and returns value from inRangeQ2.
q | Energy scale |
|
pure virtual |
Grid range check for Q2.
Return true when given Q2 is in the coverage range of this PDF.
q2 | Squared energy scale |
Implemented in LHAPDF::GridPDF.
|
pure virtual |
Grid range check for x.
Return true when given x is in the coverage range of this PDF.
x | Momentum fraction |
Implemented in LHAPDF::GridPDF.
int LHAPDF::PDF::lhapdfID | ( | ) | const |
|
inline |
PDF member local ID number.
Obtained from the member file path, not Info-based metadata.
|
inline |
|
inline |
|
inlinevirtual |
|
inlinevirtual |
double LHAPDF::PDF::quarkMass | ( | int | id | ) | const |
Get a quark mass in GeV by PDG code (|PID| = 1-6 only)
Convenience interface to the Mass* info keywords. Returns -1 for an undefined PID.
double LHAPDF::PDF::quarkThreshold | ( | int | id | ) | const |
Get a flavor scale threshold in GeV by PDG code (|PID| = 1-6 only) Convenience interface to the Mass* and Threshold* info keywords. Returns -1 for an undefined PID.
|
inline |
Get the PDF set of which this is a member.
Obtained from the member file path, not Info-based metadata.
|
inline |
|
inline |
Manually set/override the list of flavours defined by this PDF set.
|
inline |
Get the PDF xf(x) value at (x,q) for all supported PIDs.
This version creates a new map on every call: prefer to use the fill-in-place version with a user-supplied map for many calls.
xfxQ will square the given q and return the value from xfxQ2. All grids are defined in q2 rather than q since the natural value in MC programs is squared, so we typically avoid an expensive sqrt() call.
x | Momentum fraction |
q | Energy (renormalization) scale |
|
inline |
|
inline |
Get the PDF xf(x) value at (x,q) for "standard" PIDs.
This version fills a user-supplied vector to avoid container construction costs on every call.
The filled vector follows the LHAPDF5 convention, with 13 entries running in the PDF ID order [-6, -5, ..., -1, 21, 1, ... 5, 6], i.e. quark PDF values will be at vector index pid+6 and the gluon at index 6.
x | Momentum fraction |
q | Energy (renormalization) scale |
rtn | Vector of PDF xf(x,q) values, to be filled |
|
inline |
Get the PDF xf(x) value at (x,q) for the given PID.
xfxQ will square the given q and return the value from xfxQ2. All grids are defined in q2 rather than q since the natural value in MC programs is squared, so we typically avoid an expensive sqrt() call.
id | PDG parton ID |
x | Momentum fraction |
q | Energy (renormalization) scale |
std::map< int, double > LHAPDF::PDF::xfxQ2 | ( | double | x, |
double | q2 ) const |
void LHAPDF::PDF::xfxQ2 | ( | double | x, |
double | q2, | ||
std::map< int, double > & | rtn ) const |
void LHAPDF::PDF::xfxQ2 | ( | double | x, |
double | q2, | ||
std::vector< double > & | rtn ) const |
Get the PDF xf(x) value at (x,q2) for "standard" PIDs.
This version fills a user-supplied vector to avoid container construction costs on every call.
The filled vector follows the LHAPDF5 convention, with 13 entries running in the PDF ID order [-6, -5, ..., -1, 21, 1, ... 5, 6], i.e. quark PDF values will be at vector index pid+6 and the gluon at index 6.
x | Momentum fraction |
q2 | Squared energy (renormalization) scale |
rtn | Vector of PDF xf(x,q2) values, to be filled |
double LHAPDF::PDF::xfxQ2 | ( | int | id, |
double | x, | ||
double | q2 ) const |
Get the PDF xf(x) value at (x,q2) for the given PID.
All grids are defined in Q2 rather than Q since the natural value in MC programs is squared, so we typically avoid an expensive sqrt() call.
id | PDG parton ID |
x | Momentum fraction |
q2 | Squared energy (renormalization) scale |
|
mutableprotected |
Cached flag for whether to return only positive (or positive definite) PDF values.
A negative value indicates that the flag has not been set. 0 = no forcing, 1 = force positive (i.e. 0 is permitted, negative values are not), 2 = force positive definite (i.e. no values less than 1e-10).