lhapdf is hosted by Hepforge, IPPP Durham
LHAPDF 6.5.3
Loading...
Searching...
No Matches
/examples/compatibility.cc
// -*- C++ -*-
// LHAPDFv5/v6 compatibility example
#include "LHAPDF/LHAPDF.h"
#include <iostream>
int main() {
const double x = 1e-3, Q = 200;
#if LHAPDF_MAJOR_VERSION == 6
LHAPDF::PDF* pdf = LHAPDF::mkPDF("CT10nlo", 0);
std::cout << "xf_g = " << pdf->xfxQ(21, x, Q) << std::endl;
delete pdf;
#else
LHAPDF::initPDFSet("CT10nlo", LHAPDF::LHGRID, 0);
std::cout << "xf_g = " << LHAPDF::xfx(x, Q, 0) << std::endl;
#endif
return 0;
}
PDF is the general interface for access to parton density information.
Definition: PDF.h:40
double xfxQ(int id, double x, double q) const
Get the PDF xf(x) value at (x,q) for the given PID.
Definition: PDF.h:108
PDF * mkPDF(const std::string &setname, int member)