10 #include "PDFxTMDLib/external/mlinterp/mlinterp.hpp"
14 template <
class ReaderType>
23 m_dimensions = {
static_cast<int>(m_tmdShape.
x_vec.size()),
24 static_cast<int>(m_tmdShape.
kt2_vec.size()),
25 static_cast<int>(m_tmdShape.
mu2_vec.size())};
29 using namespace mlinterp;
30 double *selectedPdf = &m_tmdShape.grids[flavor][0];
32 double logX = std::log(x);
33 double logkt2 = std::log(
kt2);
34 double logMu2 = std::log(
mu2);
35 interp(m_dimensions.data(), 1, selectedPdf, output, m_tmdShape.log_x_vec.data(), &logX, m_tmdShape.log_kt2_vec.data(), &logkt2
36 , m_tmdShape.log_mu2_vec.data(), &logMu2);
38 return output[0] < 0 ? 0 : output[0] /
kt2;
41 std::array<double, DEFAULT_TOTAL_PDFS> &output)
const
43 using namespace mlinterp;
45 double logX = std::log(x);
46 double logkt2 = std::log(
kt2);
47 double logMu2 = std::log(
mu2);
52 interp(m_dimensions.data(), 1, selectedPdf, output_, m_tmdShape.log_x_vec.data(), &logX,
53 m_tmdShape.log_kt2_vec.data(), &logkt2, m_tmdShape.log_mu2_vec.data(), &logMu2);
55 output[i] = (output_[0] < 0 ? 0 : output_[0] /
kt2);
65 std::array<int, 3> m_dimensions;
#define DEFAULT_TOTAL_PDFS
Definition: PartonUtils.h:17
auto getData() const
Definition: IReader.h:18
Definition: IInterpolator.h:37
Definition: TTrilinearInterpolator.h:16
const IReader< ReaderType > * getReader() const
Definition: TTrilinearInterpolator.h:58
double interpolate(PartonFlavor flavor, double x, double kt2, double mu2) const
Definition: TTrilinearInterpolator.h:27
void initialize(const IReader< ReaderType > *reader)
Definition: TTrilinearInterpolator.h:19
TTrilinearInterpolator()=default
void interpolate(double x, double kt2, double mu2, std::array< double, DEFAULT_TOTAL_PDFS > &output) const
Definition: TTrilinearInterpolator.h:40
Definition: AllFlavorsShape.h:14
PartonFlavor
Definition: PartonUtils.h:58
constexpr std::array< PartonFlavor, DEFAULT_TOTAL_PDFS > standardPartonFlavors
Definition: PartonUtils.h:80
int mu2
Definition: pdfset_tutorial.py:14
int kt2
Definition: pdfset_tutorial.py:15
std::vector< double > mu2_vec
Definition: AllFlavorsShape.h:40
std::vector< double > x_vec
Definition: AllFlavorsShape.h:39
Definition: AllFlavorsShape.h:92
std::vector< double > kt2_vec
Definition: AllFlavorsShape.h:95