7 #ifndef LHAPDF_GridPDF_H
8 #define LHAPDF_GridPDF_H
10 #include "LHAPDF/PDF.h"
11 #include "LHAPDF/Interpolator.h"
12 #include "LHAPDF/Extrapolator.h"
13 #include "LHAPDF/KnotArray.h"
44 GridPDF(
const std::string& setname,
int member) {
45 _loadInfo(setname, member);
79 void _loadData(
const std::string& mempath);
103 template <
typename INTERPOLATOR>
134 template <
typename EXTRAPOLATOR>
157 double _xfxQ2(
int id,
double x,
double q2)
const;
159 void _xfxQ2(
double x,
double q2, std::vector<double>& ret)
const;
179 const vector<double>&
xKnots()
const;
184 const vector<double>&
q2Knots()
const;
PDF is the general interface for access to parton density information.
Definition: PDF.h:40
const vector< double > & xKnots() const
Return a representative list of interpolation knots in x.
bool inRangeQ2(double q2) const
check if value within the boundaries of q2knots
Definition: KnotArray.h:97
void _loadExtrapolator()
Load the PDF grid data block, based on current metadata.
unique_ptr< Extrapolator > ExtrapolatorPtr
Typedef of smart pointer for xpol memory handling.
Definition: GridPDF.h:208
InterpolatorPtr _interpolator
Associated interpolator (mutable to allow laziness)
Definition: GridPDF.h:211
bool inRangeX(double x) const
check if value within the boundaries of xknots
Definition: KnotArray.h:90
const vector< double > & q2Knots() const
Return a representative list of interpolation knots in Q2.
void _loadData(const std::string &mempath)
Load the PDF grid data block (not the metadata) from the given PDF member file.
void _computePolynomialCoefficients(bool logspace)
Precompute polynomial coefficients and approximate derivatives at knot positions. ...
const Interpolator & interpolator() const
Get the current interpolator.
bool hasInterpolator() const
Find whether an extrapolator has been set on this PDF.
Definition: GridPDF.h:115
Internal storage class for PDF data point grids.
Definition: KnotArray.h:45
void _loadPlugins()
Load the alphaS, interpolator, and extrapolator based on current metadata.
Definition: GridPDF.h:72
A PDF defined via an interpolation grid.
Definition: GridPDF.h:19
void setInterpolator(Interpolator *ipol)
Set the interpolator by pointer.
GridPDF(int lhaid)
Constructor from an LHAPDF ID.
Definition: GridPDF.h:52
GridPDF(const std::string &setname, int member)
Constructor from a set name and member ID.
Definition: GridPDF.h:44
void _loadInterpolator()
Load the interpolator, based on current metadata.
const Extrapolator & extrapolator() const
Get the current extrapolator.
void setExtrapolator(Extrapolator *xpol)
Set the extrapolator by pointer.
void setExtrapolator(EXTRAPOLATOR xpol)
Set the extrapolator by value.
Definition: GridPDF.h:135
virtual ~GridPDF()
Virtual destructor to allow inheritance.
Definition: GridPDF.h:60
Metadata class for PDF members.
Definition: PDFInfo.h:18
PDFInfo _info
Metadata container.
Definition: PDF.h:535
GridPDF(const std::string &path)
Constructor from a file path.
Definition: GridPDF.h:36
bool inRangeQ2(double q2) const
Check if q2 is in the grid range.
Definition: GridPDF.h:194
The general interface for interpolating between grid points.
Definition: Interpolator.h:21
bool hasExtrapolator() const
Find whether an extrapolator has been set on this PDF.
Definition: GridPDF.h:146
void setInterpolator(INTERPOLATOR ipol)
Set the interpolator by value.
Definition: GridPDF.h:104
double _xfxQ2(int id, double x, double q2) const
Get PDF xf(x,Q2) value (via grid inter/extrapolators)
int _forcePos
Cached flag for whether to return only positive (or positive definite) PDF values.
Definition: PDF.h:548
std::string _mempath
Member data file path.
Definition: PDF.h:532
ExtrapolatorPtr _extrapolator
Associated extrapolator (mutable to allow laziness)
Definition: GridPDF.h:214
bool inRangeX(double x) const
Check if x is in the grid range.
Definition: GridPDF.h:189
unique_ptr< Interpolator > InterpolatorPtr
Typedef of smart pointer for ipol memory handling.
Definition: GridPDF.h:205
GridPDF()
Default constructor, making an empty PDF to be populated by hand.
Definition: GridPDF.h:23