lhapdf is hosted by Hepforge, IPPP Durham
LHAPDF  6.3.0
LHAPDF::KnotArray1F Class Reference

Internal storage class for PDF data point grids. More...

#include <KnotArray.h>

Public Member Functions

 KnotArray1F ()
 Default constructor just for std::map insertability.
 
 KnotArray1F (const std::vector< double > &xknots, const std::vector< double > &q2knots, const std::vector< double > &xfs)
 Constructor from x and Q2 knot values, and an xf value grid as strided list.
 
 KnotArray1F (const std::vector< double > &xknots, const std::vector< double > &q2knots)
 Constructor of a zero-valued array from x and Q2 knot values.
 
x stuff
void setxs (const std::vector< double > &xs)
 
size_t xsize () const
 Number of x knots.
 
const std::vector< double > & xs () const
 x knot accessor
 
const std::vector< double > & logxs () const
 log(x) knot accessor
 
bool samexs (const KnotArray1F &other) const
 Hash comparator.
 
size_t xhash () const
 
size_t ixbelow (double x) const
 Get the index of the closest x knot row <= x. More...
 
Q2 stuff
void setq2s (const std::vector< double > &q2s)
 
size_t q2size () const
 Number of Q2 knots.
 
const std::vector< double > & q2s () const
 Q2 knot accessor.
 
const std::vector< double > & logq2s () const
 log(Q2) knot accessor
 
bool sameq2s (const KnotArray1F &other) const
 Hash comparator for Q2 knots.
 
size_t q2hash () const
 
size_t iq2below (double q2) const
 
PDF values at (x, Q2) points
size_t size () const
 Number of x knots.
 
const std::vector< double > & xfs () const
 xf value accessor (const)
 
std::vector< double > & xfs ()
 xf value accessor (non-const)
 
void setxfs (const std::vector< double > &xfs)
 xf value setter
 
const double & xf (size_t ix, size_t iq2) const
 Get the xf value at a particular indexed x,Q2 knot.
 

Private Member Functions

void _syncx ()
 Synchronise log(x) array and hash from the x array.
 
void _syncq2 ()
 Synchronise log(x) and log(Q2) arrays from the x and Q2 ones.
 
size_t _mkhash (const std::vector< double > &xx) const
 Utility function for making a hash code from a vector<double>
 

Private Attributes

std::vector< double > _xs
 List of x knots.
 
std::vector< double > _logxs
 List of log(x) knots, precomputed for efficiency.
 
size_t _xgridhash = 0
 Hash for this set of x knots.
 
std::vector< double > _q2s
 List of Q2 knots.
 
std::vector< double > _logq2s
 List of log(Q2) knots, precomputed for efficiency.
 
size_t _q2gridhash = 0
 Hash for this set of Q2 knots.
 
std::vector< double > _xfs
 List of xf values across the 2D knot array, stored as a strided [ix][iQ2] 1D array.
 

Detailed Description

Internal storage class for PDF data point grids.

We use "array" to refer to the "raw" knot grid, while "grid" means a grid-based PDF. The "1F" means that this is a single-flavour array

Member Function Documentation

◆ iq2below()

size_t LHAPDF::KnotArray1F::iq2below ( double  q2) const
inline

Get the index of the closest Q2 knot row <= q2

If the value is >= q2_max, return i_max-1 (for polynomial spine construction)

Find the closest knot below the requested value

◆ ixbelow()

size_t LHAPDF::KnotArray1F::ixbelow ( double  x) const
inline

Get the index of the closest x knot row <= x.

If the value is >= x_max, return i_max-1 (for polynomial spine construction)

◆ setq2s()

void LHAPDF::KnotArray1F::setq2s ( const std::vector< double > &  q2s)
inline

Q2 knot setter

Note
Also zeros the xfs array, which is invalidated by resetting the Q2 knots

◆ setxs()

void LHAPDF::KnotArray1F::setxs ( const std::vector< double > &  xs)
inline

x knot setter

Note
Also zeros the xfs array, which is invalidated by resetting the x knots

The documentation for this class was generated from the following file: