Skip to content

Add Grid slicing #166

@cschwan

Description

@cschwan

Sometimes we'd like to work with a slice of a Grid, which means a subset of the contained orders, luminosities and/or bins.

We can already do this using the {order,bin,lumi}_mask parameters of Grid::convolute, but we have to remember these parameters when calling other methods of Grid. Instead it would be useful to add a new method Grid::slice, passing it the desired orders, bins and lumis, which then returns a GridSlice object containing the reference of a Grid object and the corresponding masks. This would allow

  • to have a simpler Grid::convolute function, because the mask parameters are already in the GridSlice object
  • the members GridSlice::{orders,bins,lumis} to return the correct subset of the original set of the Grid.

Furthermore, Grid itself is a GridSlice, so GridSlice would be a trait and Grid::slice would return a struct implementing the trait.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions