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.

batch is 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 when dynamic_pid is true.

Returns

  • pdf – float, shape (batch,) when dynamic_pid is true, otherwise (batch, len(pids)) – the interpolated x f(x, q).

References

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_index argument 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_index argument is returned.