[][src]Struct pineappl::grid::Grid

pub struct Grid { /* fields omitted */ }

Main data structure of PineAPPL. This structure contains a Subgrid for each LumiEntry, bin, and coupling order it was created with.

Implementations

impl Grid[src]

#[must_use]pub fn new(
    lumi: Vec<LumiEntry>,
    orders: Vec<Order>,
    bin_limits: Vec<f64>,
    subgrid_params: SubgridParams
) -> Self
[src]

Constructor.

#[must_use]pub fn with_subgrid_type(
    lumi: Vec<LumiEntry>,
    orders: Vec<Order>,
    bin_limits: Vec<f64>,
    subgrid_params: SubgridParams,
    subgrid_type: &str
) -> Result<Self, UnknownSubgrid>
[src]

Constructor. This function can be used like new, but the additional parameter subgrid_type selects the underlying Subgrid type. Supported values are:

  • LagrangeSubgrid
  • NtupleSubgrid

Errors

If subgrid_type is none of the values listed above, an error is returned.

#[must_use]pub const fn bin_limits(&self) -> &BinLimits[src]

Returns the bin limits of the observables.

pub fn convolute(
    &self,
    xfx1: &dyn Fn(i32, f64, f64) -> f64,
    xfx2: &dyn Fn(i32, f64, f64) -> f64,
    alphas: &dyn Fn(f64) -> f64,
    order_mask: &[bool],
    bin_indices: &[usize],
    lumi_mask: &[bool],
    xi: &[(f64, f64)]
) -> Vec<f64>
[src]

Performs a convolution of the contained subgrids with the given PDFs, xfx1 for the first parton and xfx2 for the second parton, alphas for the evaluation of the strong coupling. The parameters order_mask and lumi_mask can be used to selectively enable perturbative orders and luminosities; they must either be empty (everything enabled) or as large as the orders and luminosity function, respectively. If the corresponding entry is true the order/luminosity is enable, false disables the entry. The tuple xi can be used to independently vary the renormalization (first element) and factorization scale (second element) from their central value (1.0, 1.0).

pub fn fill(
    &mut self,
    order: usize,
    observable: f64,
    lumi: usize,
    ntuple: &Ntuple<f64>
)
[src]

Fills the grid with an ntuple for the given order, observable, and lumi.

pub fn read(reader: impl Read + Seek) -> Result<Self>[src]

Constructs a Grid by deserializing it from reader. Reading is not buffered.

Errors

If reading from the compressed or uncompressed stream fails an error is returned.

pub fn write(&self, writer: impl Write) -> Result<()>[src]

Serializes self into writer. Writing is not buffered.

Errors

If writing fails an error is returned.

pub fn fill_all(
    &mut self,
    order: usize,
    observable: f64,
    ntuple: &Ntuple<()>,
    weights: &[f64]
)
[src]

Fills the grid with events for the parton momentum fractions x1 and x2, the scale q2, and the order and observable. The events are stored in weights and must be ordered as the corresponding luminosity function was created.

#[must_use]pub fn lumi(&self) -> &[LumiEntry][src]

Returns the luminosity function.

pub fn merge(&mut self, other: Self) -> Result<(), GridMergeError>[src]

Merges the non-empty Subgrids contained in other into self. This performs one of two possible operations:

  1. If the bin limits of self and other are different and can be concatenated with each other the bins are merged. In this case both grids are assumed to have the same orders and the same luminosity functions. If this is not the case, an error is returned.
  2. If the bin limits of self and other are the same, the luminosity functions and perturbative orders of self and other may be different.

Errors

If in the first case describe above the perturbative orders or the luminosity function is different an error is returned.

pub fn scale(&mut self, factor: f64)[src]

Scale all subgrids by factor.

pub fn scale_by_order(
    &mut self,
    alphas: f64,
    alpha: f64,
    logxir: f64,
    logxif: f64,
    global: f64
)
[src]

Scales each subgrid by a factor which is the product of the given values alphas, alpha, logxir, and logxif, each raised to the corresponding powers for each subgrid. In addition, every subgrid is scaled by a factor global independently of its order.

#[must_use]pub fn orders(&self) -> &[Order][src]

Returns the subgrid parameters.

Trait Implementations

impl<'de> Deserialize<'de> for Grid[src]

impl Serialize for Grid[src]

Auto Trait Implementations

impl RefUnwindSafe for Grid

impl Send for Grid

impl Sync for Grid

impl Unpin for Grid

impl UnwindSafe for Grid

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.