pub struct Grid { /* private fields */ }
Expand description

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

Implementations

Constructor.

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

  • LagrangeSubgrid
  • LagrangeSparseSubgrid
  • NtupleSubgrid
Errors

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

Perform a convolution using the PDFs and strong coupling in lumi_cache, and only selecting only the orders, bins and luminosities corresponding to order_mask, bin_indices and lumi_mask. A variation of the scales is performed using the factors in xi; the first factor varies the renormalization scale, the second the factorization scale. Note that for the variation to be trusted all non-zero log-grids must be contained.

Panics

TODO

Convolutes a single subgrid (order, bin, lumi) with the PDFs strong coupling given by xfx1, xfx2 and alphas. The convolution result is fully differentially, such that the axes of the result correspond to the values given by the subgrid q2, x1 and x2 grid values.

Panics

TODO

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

Panics

TODO

Construct a Grid by deserializing it from reader. Reading is buffered.

Errors

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

Serializes self into writer. Writing is buffered.

Errors

If writing fails an error is returned.

Serializes self into writer, using LZ4 compression. Writing is buffered.

Errors

If writing or compression fails an error is returned.

Panics

TODO

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.

Returns the luminosity function.

Merges the bins for the corresponding range together in a single one.

Errors

When the given bins are non-consecutive, an error is returned.

Merges the non-empty Subgrids contained in other into self.

Errors

If the bin limits of self and other are different and if the bin limits of other can not be merged with self an error is returned.

Panics

TODO

Scale all subgrids by factor.

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.

Panics

TODO

Scales each subgrid by a bin-dependent factor given in factors. If a bin does not have a corresponding entry in factors it is not rescaled. If factors has more entries than there are bins the superfluous entries do not have an effect.

Returns the subgrid parameters.

Set the luminosity function for this grid.

Returns the subgrid with the specified indices order, bin, and lumi.

Returns all subgrids as an Array3.

Replaces the subgrid for the specified indices order, bin, and lumi with subgrid.

Sets a remapper. A remapper can change the dimensions and limits of each bin in this grid. This is useful because many Monte Carlo integrators and also PineAPPL do not support multi-dimensional bins. To work around the problem the multi-dimensional bins can be projected to one-dimensional bins, and the remapper can be used to restore the multi dimensionality. Furthermore, it allows to normalize each bin separately, and independently of the bin widths.

Errors

Returns an error if the number of bins in the grid and in the remapper do not agree.

Panics

TODO

Return the currently set remapper, if there is any.

Returns all information about the bins in this grid.

Optimize the internal datastructures for space efficiency. This changes all subgrids of type LagrangeSubgrid to LagrangeSparseSubgrid.

Panics

TODO

Upgrades the internal data structures to their latest versions.

Returns a map with key-value pairs, if there are any stored in this grid.

Returns a map with key-value pairs, if there are any stored in this grid.

Panics

TODO

Sets a specific key-value pair in this grid.

Panics

TODO

Provide information used to compute a suitable EKO for the current grid. More specific, the x_grid and muf2_grid are extracted and checked.

Panics

TODO

Applies an evolution kernel operator (EKO) to the grids to evolve them from different values of the factorization scale to a single one given by the parameter q2. Using xir and xif you can trigger renormalization and factorization scale variations respectively in the grid.

Panics

Panics if the parameters do not match with the given grid.

Converts this Grid into an FkTable using an evolution kernel operator (EKO) given as operator. The dimensions and properties of this operator must be described using info. The parameter order_mask can be used to include or exclude orders from this operation, and must correspond to the ordering given by Grid::orders. Orders that are not given are enabled, and in particular if order_mask is empty all orders are activated.

Errors

Returns a GridError::EvolutionFailure if either the operator or its info is incompatible with this Grid.

Deletes bins with the corresponding bin_indices. Repeated indices and indices larger or equal the bin length are ignored.

Returns true if the first initial state needs a convolution, false otherwise.

Returns true if the second initial state needs a convolution, false otherwise.

Returns the particle identifier of the first initial state. This is usually but not always a proton, which is represented by the PDG ID 2212.

Returns the particle identifier of the second initial state. This is usually but not always a proton, which is represented by the PDG ID 2212.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Deserialize this value from the given Serde deserializer. Read more
Serialize this value into the given Serde serializer. Read more
The type returned in the event of a conversion error.
Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.