Skip to content

Commit

Permalink
Fix binning
Browse files Browse the repository at this point in the history
  • Loading branch information
cschwan committed Jan 8, 2025
1 parent 7d2389f commit 745bb30
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
4 changes: 1 addition & 3 deletions pineappl_cli/src/export/fastnlo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<f64> {
// 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!()
Expand Down
17 changes: 16 additions & 1 deletion pineappl_fastnlo/src/fastnlo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,22 @@ std::unique_ptr<fastNLOCreate> 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<double> 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<double>{
Expand Down

0 comments on commit 745bb30

Please sign in to comment.