Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
da1b703
Add key_values to grid interface
alecandido Oct 4, 2021
c323ab2
Add get subgrid and syntactic sugar
alecandido Oct 4, 2021
982168e
Add separe target pids for eko convolution
alecandido Oct 5, 2021
d0c6493
Sync python interface with pids update
alecandido Oct 5, 2021
18bee8f
Allow additional metadata in FkTable generation
felixhekhorn Oct 5, 2021
32d0b51
Introduce new Eko related structs
alecandido Oct 12, 2021
7b78670
Improve documentation strings
cschwan Oct 12, 2021
558db3e
Add temporary axes test
alecandido Oct 13, 2021
b527d9d
Add broken test for convolute_eko
alecandido Oct 14, 2021
36bf0c6
Fix convolute_eko test
alecandido Oct 15, 2021
0533666
Remove the too flexible additional metadata from EkoInfo
alecandido Oct 15, 2021
4c5f2e5
Fix bug in conv_eko, expose optimize
felixhekhorn Oct 18, 2021
2cef20e
Update lumi_id_types docstring
alecandido Oct 18, 2021
3030b7e
Always optimize FkTables
alecandido Oct 18, 2021
d12b42c
Remove FkTable.optimize even from python interface
alecandido Oct 18, 2021
69b2a15
Remove use of `RefCell`
cschwan Oct 7, 2021
18ee483
Add new struct `LumiCache`
cschwan Oct 13, 2021
2f9f6e3
Add methods `clear` and `set_grids` to `LumiCache`
cschwan Oct 13, 2021
1439bf0
Cache mu2/x1/x2 grids and use mu2 grid
cschwan Oct 14, 2021
a8a27b3
Use imu2 grid also in `LumiCache::xfx`
cschwan Oct 14, 2021
52111e7
Use x1/x2 grid
cschwan Oct 14, 2021
92b603d
Always optimize the luminosity function
cschwan Oct 15, 2021
e1dfa0d
Add preliminary support for evolution basis
cschwan Oct 15, 2021
939eaad
Add implementation of merge from file
alecandido Oct 18, 2021
9ef4c8a
Merge branch 'master' into py-improved
cschwan Oct 25, 2021
2a22432
Migrate remaining `convolute` calls
cschwan Oct 25, 2021
4d6ddca
Remove scale variations from `FkTable`
cschwan Oct 25, 2021
6c4dbba
Fix Python tests
cschwan Oct 25, 2021
13e01f2
Fix examples
cschwan Oct 25, 2021
cdefdbe
Fix documentation of CAPI convolute functions
cschwan Oct 26, 2021
8352253
Rename `Grid::convolute2` to `Grid::convolute`
cschwan Oct 26, 2021
f06d629
Remove `order_mask` parameter for `FkTable`
cschwan Oct 26, 2021
f64cec5
Fix broken test
cschwan Oct 26, 2021
dfdcdcc
Migrate from lz-fear to lz4_flex
cschwan Oct 26, 2021
2ad8571
Fix a few clippy warnings
cschwan Oct 26, 2021
9c7215e
Add TODO item
cschwan Oct 26, 2021
9445166
Add missing dev-dependency
cschwan Oct 26, 2021
b1bba7e
Fix leftovers of convolute migration
alecandido Oct 26, 2021
a4bf1f2
Expose write_lz4 within python API
alecandido Oct 27, 2021
714b559
Add `order_mask` param to `Grid::convolute_eko`
cschwan Oct 27, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/appl2pine/appl2pine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -444,9 +444,9 @@ pineappl_grid* convert_grid(appl::grid& grid, bool reweight)
auto const& results = grid.vconvolute(evolvepdf, evolvepdf, alphaspdf, 1);
std::vector<double> other_results(results.size());

pineappl_grid_convolute(
pineappl_grid_convolute_with_one(
grids.at(0),
xfx,
2212,
xfx,
alphas,
pdf.get(),
Expand Down
2 changes: 1 addition & 1 deletion examples/cpp/dyaa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ int main() {
};

std::vector<double> dxsec(24);
pineappl_grid_convolute(grid, xfx, xfx, alphas, pdf, nullptr,
pineappl_grid_convolute_with_one(grid, 2212, xfx, alphas, pdf, nullptr,
nullptr, 1.0, 1.0, dxsec.data());

// print the results
Expand Down
8 changes: 2 additions & 6 deletions examples/fnlo2pine/fnlo2pine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -550,8 +550,6 @@ int main(int argc, char* argv[])

std::vector<pineappl_grid*> grids;

std::size_t pdfs = 0;

for (auto const id : ids)
{
auto coeff_table = file.GetCoeffTable(id);
Expand All @@ -561,7 +559,6 @@ int main(int argc, char* argv[])

if (converted != nullptr)
{
pdfs = converted->GetNPDF();
grids.push_back(convert_coeff_add_fix(converted, file, bins, alpha));
}
else
Expand All @@ -570,7 +567,6 @@ int main(int argc, char* argv[])

if (converted != nullptr)
{
pdfs = converted->GetNPDF();
auto const mur_ff = file.GetMuRFunctionalForm();
auto const muf_ff = file.GetMuFFunctionalForm();

Expand Down Expand Up @@ -612,10 +608,10 @@ int main(int argc, char* argv[])
auto const& results = file.GetCrossSection();
std::vector<double> other_results(results.size());

pineappl_grid_convolute(
pineappl_grid_convolute_with_one(
grids.at(0),
2212,
xfx,
pdfs == 2 ? xfx : xfx2,
alphas,
pdf.get(),
nullptr,
Expand Down
3 changes: 2 additions & 1 deletion examples/python/dyaa.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,9 @@ def main(calls, pdfname, filename):
import lhapdf # pylint: disable=import-outside-toplevel

pdf = lhapdf.mkPDF(pdfname, 0)
pdg_id = int(pdf.set().get_entry('Particle'))
# perform convolution
dxsec = grid.convolute(pdf.xfxQ2, pdf.xfxQ2, pdf.alphasQ2)
dxsec = grid.convolute_with_one(pdg_id, pdf.xfxQ2, pdf.alphasQ2)
for i in range(len(dxsec)):
print(f"{bins[i]:.1f} {bins[i + 1]:.1f} {dxsec[i]:.3e}")

Expand Down
4 changes: 2 additions & 2 deletions pineappl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@ categories = ["science"]
description = "PineAPPL is not an extension of APPLgrid"

[dependencies]
anyhow = "1.0"
arrayvec = "0.5"
bincode = "1.0"
enum_dispatch = "0.3.5"
float-cmp = "0.8"
git-version = "0.3"
itertools = "0.10"
lz-fear = "0.1"
lz4_flex = "0.8.2"
ndarray = { features = ["serde"], version = "0.15.3" }
rustc-hash = "1.1.0"
serde = { features = ["derive"], version = "1.0" }
thiserror = "1.0"
indicatif = "0.15.0"

[dev-dependencies]
anyhow = "1.0"
lhapdf = "0.1.8"
rand = { default-features = false, version = "0.7" }
rand_pcg = { default-features = false, version = "0.2" }
21 changes: 14 additions & 7 deletions pineappl/src/fk_table.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//! Provides the [`FkTable`] type.

use super::grid::{Grid, Order};
use super::grid::{Grid, GridError, Order};
use super::lumi::LumiCache;
use super::subgrid::Subgrid;
use ndarray::Array4;
use std::convert::TryFrom;
Expand Down Expand Up @@ -139,22 +140,28 @@ impl FkTable {
/// # Errors
///
/// TODO
pub fn write(&self, writer: impl Write) -> anyhow::Result<()> {
pub fn write(&self, writer: impl Write) -> Result<(), GridError> {
self.grid.write(writer)
}

/// Propagate `write_lz4` to `Grid`.
///
/// # Errors
///
/// See [`Grid::write_lz4`].
pub fn write_lz4(&self, writer: impl Write) -> Result<(), GridError> {
self.grid.write_lz4(writer)
}

/// Propagate convolute to grid
pub fn convolute(
&self,
xfx1: &dyn Fn(i32, f64, f64) -> f64,
xfx2: &dyn Fn(i32, f64, f64) -> f64,
order_mask: &[bool],
lumi_cache: &mut LumiCache,
bin_indices: &[usize],
lumi_mask: &[bool],
xi: &[(f64, f64)],
) -> Vec<f64> {
self.grid
.convolute(xfx1, xfx2, &|_| 1.0, order_mask, bin_indices, lumi_mask, xi)
.convolute(lumi_cache, &[], bin_indices, lumi_mask, &[(1.0, 1.0)])
}
}

Expand Down
Loading