PartonDensity¶
-
class PartonDensity : public madspace::FunctionGenerator¶
Parton-density interpolation as a compute-graph function.
Interpolates a PdfGrid at the sampled \((x, q)\), returning \(x f(x, q)\) for the requested flavours; the numerical output agrees with LHAPDF to double precision [1] (Sec. 3.2.3 of [2]). With a CustomPdf, the user-supplied library is called once per requested flavour instead.
batchis the leading batch dimension.Arguments
x–float, shape(batch,)– momentum fraction.q–float, shape(batch,)– factorization scale.flavor_index–int, shape(batch,)– which flavour to return. Present only whendynamic_pidis true.
Returns
pdf–float, shape(batch,)whendynamic_pidis true, otherwise(batch, len(pids))– the interpolatedx f(x, q).
References
[1] A. Buckley et al., “LHAPDF6: parton density access in the LHC
precision era”,
https://arxiv.org/abs/1412.7420[2] T. Heimel, O. Mattelaer, R. Winterhalder, “MadSpace”, https://arxiv.org/abs/2602.06895 (Sec. 3.2.3)
Public Functions
-
PartonDensity(const PdfGrid &grid, const std::vector<int> &pids, bool dynamic_pid = false, const std::string &prefix = "")¶
- Parameters:
grid – The parton-density grid to interpolate.
pids – PDG ids of the flavours to return.
dynamic_pid – If true, a single flavour selected per event by the
flavor_indexargument is returned.prefix – Prefix for the grid global names.
-
PartonDensity(const CustomPdf &custom_pdf, const std::vector<int> &pids, int beam_index, bool dynamic_pid = false)¶
- Parameters:
custom_pdf – The user-supplied parton density.
pids – PDG ids of the flavours to return.
beam_index – Index of the beam (0 or 1), passed to the library.
dynamic_pid – If true, a single flavour selected per event by the
flavor_indexargument is returned.