Skip to content

Commit

Permalink
Exposes pineappl.convolutions.Conv.pid for validphys
Browse files Browse the repository at this point in the history
  • Loading branch information
Radonirinaunimi committed Nov 18, 2024
1 parent 911557a commit d71ac51
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pineappl_py/src/convolutions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions pineappl_py/tests/test_fk_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions pineappl_py/tests/test_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d71ac51

Please sign in to comment.