Closed t7phy closed 1 month ago
Great @t7phy, thank you very much for this. I will review it as soon as possible!
I thought about this over the weekend and I think we should refactor this:
enum
:
#[derive(Eq, PartialEq)]
enum Convolution {
UnpolPdf(i32),
PolPdf(i32),
UnpolFf(i32),
// we can add more types as they are needed
}
impl Grid {
pub fn convolutions(&self) -> Vec<Convolution> {
todo!()
}
}
symmetrize_channels
.what is the 'convolutions' function supposed to do actually?
what is the 'convolutions' function supposed to do actually?
It should return a Vec
with the convolution types for the grid, so for a proton-proton grid we'll return vec![UnpolPdf(2212), UnpolPdf(2212)]
.
@t7phy I simplified the implementation a bit in commit cc7fd091b01e355b606cf0d16233ac9a45a3333f. What's missing is the following:
initial_state_1 = id
is set, and the channel has that same id
set everywhere in the right place, then Convolution::None
should be returned. The is necessary to not break the DIS grids which have the PDG ID of a lepton in one of the convolutionsGrid::has_pdf1
, Grid::has_pdf2
, Grid::initial_state_1
and Grid::initial_state_2
and use the new method Grid::convolutions
instead; added in commits de6d9a3, 3a9a787, e232e67 and d7fc831Grid::set_convolution(usize, Convolution)
used to set the convolution and use it everywhere initial_state_1
and initial_state_2
was directly set; added in commit d7fc831grid.convolutions()[0]
or grid.convolutions()[1]
we should make sure to prefix the code with assertion statement assert_eq!(grid.convolutions().len(), 2);
or make the code generic for every length
This PR aims to make it possible to optimize grids that perform a double convolution between unpolarized and polarized PDFs or PDFs and FFs by not only checking the PID of the convolution particle but also the convolution type. The grids will require the following new keys: