PdfGrid¶
-
struct PdfGrid¶
A parton-density grid in the LHAPDF format, loaded from a file.
madspacecarries a built-in PDF interpolator compatible with the LHAPDF grid format so it needs no external PDF library [1, 2]. This struct holds the loaded grid; PartonDensity does the interpolation.initialize_globalsuploads the grid to a Context.Public Functions
-
PdfGrid(const std::string &file)¶
Load an LHAPDF-format grid.
- Parameters:
file – Path to the grid file.
-
std::size_t grid_point_count() const¶
Total number of
(x, q)grid points.
-
std::size_t q_count() const¶
Number of scale knots.
-
std::vector<std::size_t> coefficients_shape(bool batch_dim = false) const¶
Shape of the coefficient tensor, optionally with a leading batch axis.
-
std::vector<std::size_t> logx_shape(bool batch_dim = false) const¶
Shape of the
log(x)tensor.
-
std::vector<std::size_t> logq2_shape(bool batch_dim = false) const¶
Shape of the
log(q^2)tensor.
-
void initialize_globals(ContextPtr context, const std::string &prefix = "") const¶
Upload the grid to
contextas compute-graph globals underprefix.
Public Members
-
std::vector<double> x¶
Momentum-fraction grid knots.
-
std::vector<double> logx¶
log(x)grid knots.
-
std::vector<double> q¶
Scale grid knots.
-
std::vector<double> logq2¶
log(q^2)grid knots.
-
std::vector<int> pids¶
PDG ids of the flavours in the grid.
-
std::vector<std::vector<double>> values¶
Grid values, indexed by flavour then by
(x, q)knot.
-
std::vector<std::size_t> region_sizes¶
Knot counts of the sub-grid regions.
-
PdfGrid(const std::string &file)¶