Skip to content

Commit 6f4c6f9

Browse files
author
rabemananjara-l
committed
Merge branch 'master' into capi-set-subgrid
2 parents 1468365 + 41e8af5 commit 6f4c6f9

36 files changed

Lines changed: 1179 additions & 240 deletions

CHANGELOG.md

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,52 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
12+
- added a `fix_convolution` method to integrate out one of the convolution
13+
dimensions in a grid by convolving it with a non-perturbative function
14+
15+
## [1.3.0] - 06/12/2025
16+
17+
### Added
18+
19+
- added a `pineappl_grid_delete_bins` method to the C-API
20+
21+
### Fixed
22+
23+
- fixed bugs in stopping condition of the Newton iteration method
24+
- fixed a bug in comparing `interpolation::Interp` objects when one of the
25+
boundaries is `NaN`
26+
27+
## [1.2.0] - 22/08/2025
28+
29+
### Added
30+
31+
- added `Grid::repair` to repair bugs that survived by writing bugged grids to
32+
disk, for example <https://github.com/NNPDF/pineappl/issues/338>. The CLI
33+
offers this functionality via `pineappl write --repair` and it can also be
34+
accessed via Python
35+
36+
### Fixed
37+
38+
- added a missing implementation for a branch in `Grid::merge` that was
39+
triggered when exporting some PineAPPL grids generated from the 'pinejet'
40+
group
41+
- fixed wrong coupling orders when exporting to APPLgrid. This happened when
42+
the PineAPPL grid had orders that had any other ordering than 'LO', 'NLO',
43+
'NNLO'
44+
- fixed a bug that caused exported grids to compare unsuccessfully when the
45+
convolution functions were proton-anti-proton; APPLgrid doesn't store the
46+
types of convolution functions, so we simply convert the grid to use only
47+
proton PDFs
48+
49+
### Changed
50+
51+
- the function `Grid::evolve` now makes use of parallelization to take advantage
52+
of the number of CPU cores available using the Rayon crate; the number of CPU
53+
cores to be used can be controlled via the `RAYON_NUM_THREADS` environment
54+
variable
55+
1056
## [1.1.0] - 08/07/2025
1157

1258
### Added
@@ -782,7 +828,9 @@ the old file format can still be read with this new version.
782828

783829
- first release
784830

785-
[Unreleased]: https://github.com/NNPDF/pineappl/compare/v1.1.0...HEAD
831+
[Unreleased]: https://github.com/NNPDF/pineappl/compare/v1.3.0...HEAD
832+
[1.3.0]: https://github.com/NNPDF/pineappl/compare/v1.2.0...v1.3.0
833+
[1.2.0]: https://github.com/NNPDF/pineappl/compare/v1.1.0...v1.2.0
786834
[1.1.0]: https://github.com/NNPDF/pineappl/compare/v1.0.0...v1.1.0
787835
[1.0.0]: https://github.com/NNPDF/pineappl/compare/v0.8.2...v1.0.0
788836
[0.8.7]: https://github.com/NNPDF/pineappl/compare/v0.8.6...v0.8.7

Cargo.lock

Lines changed: 25 additions & 51 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ keywords = ["high-energy-physics", "physics"]
2222
license = "GPL-3.0-or-later"
2323
repository = "https://github.com/NNPDF/pineappl"
2424
rust-version = "1.80.1"
25-
version = "1.1.0"
25+
version = "1.3.0"
2626

2727
[workspace.lints.clippy]
2828
all = { level = "warn", priority = -1 }

examples/cpp/Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ PROGRAMS = \
2323
display-orders \
2424
display-orders-deprecated \
2525
merge-grids \
26-
modify-grid
26+
modify-grid \
27+
fix-convolution
2728

2829
all: $(PROGRAMS)
2930

@@ -48,6 +49,9 @@ convolve-grid-deprecated: convolve-grid-deprecated.cpp
4849
convolve-grid: convolve-grid.cpp
4950
$(CXX) $(CXXFLAGS) $< $(LHAPDF_DEPS) $(PINEAPPL_DEPS) -o $@
5051

52+
fix-convolution: fix-convolution.cpp
53+
$(CXX) $(CXXFLAGS) $< $(LHAPDF_DEPS) $(PINEAPPL_DEPS) -o $@
54+
5155
deprecated: deprecated.cpp
5256
$(CXX) $(CXXFLAGS) $< $(LHAPDF_DEPS) $(PINEAPPL_DEPS) -o $@
5357

examples/cpp/advanced-filling.cpp

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,37 @@ int main() {
173173

174174
pineappl_grid_write(grid, "advanced-filling.pineappl.lz4");
175175

176+
//-----------------------------------------------------------------------//
177+
178+
// Remove the bins for which the convolution is zero.
179+
std::vector<uintptr_t> zero_indices;
180+
zero_indices.reserve(dxsec.size());
181+
for (size_t i = 0; i < dxsec.size(); ++i) {
182+
if (dxsec[i] == 0.0) {
183+
zero_indices.push_back(static_cast<uintptr_t>(i));
184+
}
185+
}
186+
pineappl_grid_delete_bins(grid, zero_indices.data(), zero_indices.size());
187+
188+
std::vector<double> dxsec_no_zeros(pineappl_grid_bin_count(grid));
189+
pineappl_grid_convolve(grid, xfx, alphas, pdf_states, pdf.get(), order_mask, channel_mask,
190+
nullptr, 1, mmu_scales.data(), dxsec_no_zeros.data());
191+
192+
// Print table header
193+
std::cout << " " << std::endl;
194+
std::cout << std::setw(10) << "bin left"
195+
<< std::setw(12) << "bin right"
196+
<< std::setw(15) << "dsig/dx" << std::endl;
197+
std::cout << std::string(37, '-') << std::endl;
198+
199+
// Loop through bins and print results
200+
for (size_t i = 0; i < dxsec_no_zeros.size(); ++i) {
201+
std::cout << std::setw(10) << bins[i]
202+
<< std::setw(12) << bins[i + 1]
203+
<< std::setw(15) << std::scientific << std::setprecision(3) << dxsec_no_zeros[i]
204+
<< std::endl;
205+
}
206+
176207
// release memory
177208
pineappl_grid_delete(grid);
178209
}

examples/cpp/advanced-filling.output

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,7 @@
2424
2.100e+00 2.200e+00 0.000e+00
2525
2.200e+00 2.300e+00 0.000e+00
2626
2.300e+00 2.400e+00 0.000e+00
27+
28+
bin left bin right dsig/dx
29+
-------------------------------------
30+
0.000e+00 1.000e-01 6.683e+03

0 commit comments

Comments
 (0)