From 745bb30c616236efdf402ef79e232bcf92418fc7 Mon Sep 17 00:00:00 2001 From: Christopher Schwan Date: Wed, 8 Jan 2025 14:24:40 +0100 Subject: [PATCH] Fix binning --- pineappl_cli/src/export/fastnlo.rs | 4 +--- pineappl_fastnlo/src/fastnlo.cpp | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/pineappl_cli/src/export/fastnlo.rs b/pineappl_cli/src/export/fastnlo.rs index 2ef1a538..0b7a77d8 100644 --- a/pineappl_cli/src/export/fastnlo.rs +++ b/pineappl_cli/src/export/fastnlo.rs @@ -101,12 +101,10 @@ pub fn convert_into_fastnlo( &convolutions, &channels, ); - - todo!() } pub fn convolve_fastnlo(_grid: Pin<&mut fastNLOLHAPDF>, conv_funs: &mut [Pdf]) -> Vec { - // TODO: add support for convolving an APPLgrid with two functions + // TODO: add support for convolving an fastNLO table with two functions assert_eq!(conv_funs.len(), 1); todo!() diff --git a/pineappl_fastnlo/src/fastnlo.cpp b/pineappl_fastnlo/src/fastnlo.cpp index 1b94d1e4..93865738 100644 --- a/pineappl_fastnlo/src/fastnlo.cpp +++ b/pineappl_fastnlo/src/fastnlo.cpp @@ -189,7 +189,22 @@ std::unique_ptr make_fastnlo_create( sconst.Mu2_NNodeCounting = "NodesPerBin"; fastNLO::WarmupConstants wconst(sconst); - wconst.Binning = bin_limits; + + for (std::size_t bin = 0; bin != bins; ++bin) { + std::vector limits; + + // TODO: the following code assumes one dimension + assert(dimensions == 1); + + // TODO: don't know the meaning of this field + limits.push_back(-1.0); + // left bin limit + limits.push_back(bin_limits.at(0).at(2 * bin + 0)); + // right bin limit + limits.push_back(bin_limits.at(0).at(2 * bin + 1)); + + wconst.Binning.push_back(limits); + } // these values are probably irrelevant but must nevertheless given wconst.Values.resize(bins, std::vector{