diff --git a/pineappl_py/src/convolutions.rs b/pineappl_py/src/convolutions.rs index c7a0f050..57251c37 100644 --- a/pineappl_py/src/convolutions.rs +++ b/pineappl_py/src/convolutions.rs @@ -70,6 +70,13 @@ impl PyConv { convtype: self.conv.conv_type(), } } + + /// Return the PID of this convolution. + #[getter] + #[must_use] + pub const fn pid(&self) -> i32 { + self.conv.pid() + } } /// Register submodule in parent. diff --git a/pineappl_py/tests/test_fk_table.py b/pineappl_py/tests/test_fk_table.py index dbf32740..8a7b7cdb 100644 --- a/pineappl_py/tests/test_fk_table.py +++ b/pineappl_py/tests/test_fk_table.py @@ -153,6 +153,9 @@ def test_polarized_convolution( assert not convolutions[0].conv_type.time_like assert not convolutions[1].conv_type.polarized assert not convolutions[1].conv_type.time_like + # Check that the initial states are protons + assert convolutions[0].pid == 2212 + assert convolutions[1].pid == 2212 # Convolution object of the 1st hadron - Polarized h1 = ConvType(polarized=True, time_like=False) diff --git a/pineappl_py/tests/test_grid.py b/pineappl_py/tests/test_grid.py index 6a5a88fb..0a1ad2ce 100644 --- a/pineappl_py/tests/test_grid.py +++ b/pineappl_py/tests/test_grid.py @@ -340,6 +340,9 @@ def test_polarized_convolution( assert not convolutions[0].conv_type.time_like assert not convolutions[1].conv_type.polarized assert not convolutions[1].conv_type.time_like + # Check that the initial states are protons + assert convolutions[0].pid == 2212 + assert convolutions[1].pid == 2212 # Convolution object of the 1st hadron - Polarized h1 = ConvType(polarized=True, time_like=False)