pub struct LumiEntry { /* private fields */ }
Expand description
This structure represents an entry of a luminosity function. Each entry consists of a tuple, which contains, in the following order, the PDG id of the first incoming parton, then the PDG id of the second parton, and finally a numerical factor that will multiply the result for this specific combination.
Implementations
sourceimpl LumiEntry
impl LumiEntry
sourcepub fn new(entry: Vec<(i32, i32, f64)>) -> Self
pub fn new(entry: Vec<(i32, i32, f64)>) -> Self
Constructor for LumiEntry
. Note that entry
must be non-empty, otherwise this function
panics.
Examples
Ordering of the arguments doesn’t matter:
use pineappl::lumi::LumiEntry;
let entry1 = LumiEntry::new(vec![(2, 2, 1.0), (4, 4, 1.0)]);
let entry2 = LumiEntry::new(vec![(4, 4, 1.0), (2, 2, 1.0)]);
// checks that the ordering doesn't matter
assert_eq!(entry1, entry2);
Same arguments are merged together:
use pineappl::lumi::LumiEntry;
let entry1 = LumiEntry::new(vec![(1, 1, 1.0), (1, 1, 3.0), (3, 3, 1.0), (1, 1, 6.0)]);
let entry2 = LumiEntry::new(vec![(1, 1, 10.0), (3, 3, 1.0)]);
assert_eq!(entry1, entry2);
Panics
Creating an entry with content panics:
ⓘ
use pineappl::lumi::LumiEntry;
let _ = LumiEntry::new(vec![]);
sourcepub fn translate(
entry: &Self,
translator: &dyn Fn(i32) -> Vec<(i32, f64)>
) -> Self
pub fn translate(
entry: &Self,
translator: &dyn Fn(i32) -> Vec<(i32, f64)>
) -> Self
Translates entry
into a different basis using translator
.
Examples
use pineappl::lumi::LumiEntry;
use pineappl::lumi_entry;
let entry = LumiEntry::translate(&lumi_entry![103, 11, 1.0], &|evol_id| match evol_id {
103 => vec![(2, 1.0), (-2, -1.0), (1, -1.0), (-1, 1.0)],
_ => vec![(evol_id, 1.0)],
});
assert_eq!(entry, lumi_entry![2, 11, 1.0; -2, 11, -1.0; 1, 11, -1.0; -1, 11, 1.0]);
Trait Implementations
sourceimpl<'de> Deserialize<'de> for LumiEntry
impl<'de> Deserialize<'de> for LumiEntry
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl PartialOrd<LumiEntry> for LumiEntry
impl PartialOrd<LumiEntry> for LumiEntry
sourcefn partial_cmp(&self, other: &LumiEntry) -> Option<Ordering>
fn partial_cmp(&self, other: &LumiEntry) -> Option<Ordering>
1.0.0 · sourceconst fn le(&self, other: &Rhs) -> bool
const fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl StructuralPartialEq for LumiEntry
Auto Trait Implementations
impl RefUnwindSafe for LumiEntry
impl Send for LumiEntry
impl Sync for LumiEntry
impl Unpin for LumiEntry
impl UnwindSafe for LumiEntry
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more