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.
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}_maskparameters ofGrid::convolute, but we have to remember these parameters when calling other methods ofGrid. Instead it would be useful to add a new methodGrid::slice, passing it the desired orders, bins and lumis, which then returns aGridSliceobject containing the reference of aGridobject and the corresponding masks. This would allowGrid::convolutefunction, because the mask parameters are already in theGridSliceobjectGridSlice::{orders,bins,lumis}to return the correct subset of the original set of theGrid.Furthermore,
Griditself is aGridSlice, soGridSlicewould be a trait andGrid::slicewould return a struct implementing the trait.