Trait pineappl::subgrid::Subgrid

source ·
pub trait Subgrid {
Show 13 methods // Required methods fn mu2_grid(&self) -> Cow<'_, [Mu2]>; fn x1_grid(&self) -> Cow<'_, [f64]>; fn x2_grid(&self) -> Cow<'_, [f64]>; fn convolute( &self, x1: &[f64], x2: &[f64], mu2: &[Mu2], lumi: &mut dyn FnMut(usize, usize, usize) -> f64 ) -> f64; fn fill(&mut self, ntuple: &Ntuple<f64>); fn is_empty(&self) -> bool; fn merge(&mut self, other: &mut SubgridEnum, transpose: bool); fn scale(&mut self, factor: f64); fn symmetrize(&mut self); fn clone_empty(&self) -> SubgridEnum; fn indexed_iter(&self) -> SubgridIndexedIter<'_>; fn stats(&self) -> Stats; fn static_scale(&self) -> Option<Mu2>;
}
Expand description

Trait each subgrid must implement.

Required Methods§

source

fn mu2_grid(&self) -> Cow<'_, [Mu2]>

Return a slice of Mu2 values corresponding to the (squared) renormalization and factorization values of the grid. If the subgrid does not use a grid, this method should return an empty slice.

source

fn x1_grid(&self) -> Cow<'_, [f64]>

Return a slice of values of x1. If the subgrid does not use a grid, this method should return an empty slice.

source

fn x2_grid(&self) -> Cow<'_, [f64]>

Return a slice of values of x2. If the subgrid does not use a grid, this method should return an empty slice.

source

fn convolute( &self, x1: &[f64], x2: &[f64], mu2: &[Mu2], lumi: &mut dyn FnMut(usize, usize, usize) -> f64 ) -> f64

Convolute the subgrid with a luminosity function, which takes indices as arguments that correspond to the entries given in the slices x1, x2 and mu2.

source

fn fill(&mut self, ntuple: &Ntuple<f64>)

Fills the subgrid with weight for the parton momentum fractions x1 and x2, and the scale q2. Filling is currently only support where both renormalization and factorization scale have the same value.

source

fn is_empty(&self) -> bool

Returns true if fill was never called for this grid.

source

fn merge(&mut self, other: &mut SubgridEnum, transpose: bool)

Merges other into this subgrid.

source

fn scale(&mut self, factor: f64)

Scale the subgrid by factor.

source

fn symmetrize(&mut self)

Assumes that the initial states for this grid are the same and uses this to optimize the grid by getting rid of almost half of the entries.

source

fn clone_empty(&self) -> SubgridEnum

Returns an empty copy of the current subgrid.

source

fn indexed_iter(&self) -> SubgridIndexedIter<'_>

Return an iterator over all non-zero elements of the subgrid.

source

fn stats(&self) -> Stats

Return statistics for this subgrid.

source

fn static_scale(&self) -> Option<Mu2>

Return the static (single) scale, if this subgrid has one.

Implementors§