From efdabd4a91701f5c0d111cd2c18bd3b411108d4c Mon Sep 17 00:00:00 2001 From: Christopher Schwan Date: Mon, 19 Aug 2024 09:57:26 +0200 Subject: [PATCH] Revert unintended changes from commit cb937f --- pineappl/src/empty_subgrid.rs | 5 ---- pineappl/src/grid.rs | 18 +------------- pineappl/src/lagrange_subgrid.rs | 9 ------- pineappl/src/packed_subgrid.rs | 15 ------------ pineappl/src/pids.rs | 1 - pineappl/src/subgrid.rs | 40 -------------------------------- 6 files changed, 1 insertion(+), 87 deletions(-) diff --git a/pineappl/src/empty_subgrid.rs b/pineappl/src/empty_subgrid.rs index 8e43d766..7a543d25 100644 --- a/pineappl/src/empty_subgrid.rs +++ b/pineappl/src/empty_subgrid.rs @@ -1,6 +1,5 @@ //! TODO -use super::grid::Grid; use super::subgrid::{Mu2, Stats, Subgrid, SubgridEnum, SubgridIndexedIter}; use serde::{Deserialize, Serialize}; use std::borrow::Cow; @@ -11,10 +10,6 @@ use std::iter; pub struct EmptySubgridV1; impl Subgrid for EmptySubgridV1 { - fn nodes(&self, _: &Grid) -> Cow<[Vec]> { - Cow::Borrowed(&[]) - } - fn fill(&mut self, _: &[f64], _: f64) { panic!("EmptySubgridV1 doesn't support the fill operation"); } diff --git a/pineappl/src/grid.rs b/pineappl/src/grid.rs index 81f77ec0..83ff711b 100644 --- a/pineappl/src/grid.rs +++ b/pineappl/src/grid.rs @@ -10,7 +10,7 @@ use super::lagrange_subgrid::LagrangeSubgridV2; use super::packed_array::PackedArray; use super::packed_subgrid::PackedQ1X2SubgridV1; use super::pids::{self, PidBasis}; -use super::subgrid::{ExtraSubgridParams, Kinematics, Mu2, Subgrid, SubgridEnum, SubgridParams}; +use super::subgrid::{ExtraSubgridParams, Mu2, Subgrid, SubgridEnum, SubgridParams}; use bitflags::bitflags; use float_cmp::approx_eq; use git_version::git_version; @@ -149,7 +149,6 @@ pub struct Grid { metadata: BTreeMap, convolutions: Vec, pid_basis: PidBasis, - kinematics: Kinematics, more_members: MoreMembers, } @@ -179,8 +178,6 @@ impl Grid { convolutions, // TODO: make this a new parameter pid_basis: PidBasis::Pdg, - // TODO: make this a new parameter - kinematics: Kinematics::Q2rfX1X2, channels, subgrid_params, } @@ -202,8 +199,6 @@ impl Grid { extra: ExtraSubgridParams, subgrid_type: &str, ) -> Result { - // TODO: remove this constructor - let subgrid_template: SubgridEnum = match subgrid_type { "LagrangeSubgrid" | "LagrangeSubgridV2" => { LagrangeSubgridV2::new(&subgrid_params, &extra).into() @@ -222,18 +217,11 @@ impl Grid { metadata: default_metadata(), convolutions: vec![Convolution::UnpolPDF(2212); channels[0].entry()[0].0.len()], pid_basis: PidBasis::Pdg, - kinematics: Kinematics::Q2rfX1X2, channels, more_members: MoreMembers::V3(Mmv3::new(subgrid_template)), }) } - /// Return the meaning of kinematic variables which each subgrid interpolates. - #[must_use] - pub const fn kinematics(&self) -> Kinematics { - self.kinematics - } - /// Return the convention by which the channels' PIDs are encoded. #[must_use] pub const fn pid_basis(&self) -> &PidBasis { @@ -570,8 +558,6 @@ impl Grid { _ => panic!("unknown PID basis '{lumi_id_types}'"), } }), - // TODO: when reading DIS grids, change this value - kinematics: Kinematics::Q2rfX1X2, // TODO: make these proper members more_members: MoreMembers::V3(Mmv3 { remapper: grid.remapper().map(|r| { @@ -1448,7 +1434,6 @@ impl Grid { metadata: self.metadata.clone(), convolutions: self.convolutions.clone(), pid_basis: info.pid_basis, - kinematics: self.kinematics, more_members: self.more_members.clone(), }; @@ -1585,7 +1570,6 @@ impl Grid { metadata: self.metadata.clone(), convolutions: self.convolutions.clone(), pid_basis: infos[0].pid_basis, - kinematics: self.kinematics, more_members: self.more_members.clone(), }; diff --git a/pineappl/src/lagrange_subgrid.rs b/pineappl/src/lagrange_subgrid.rs index 216c2c73..28e28a1e 100644 --- a/pineappl/src/lagrange_subgrid.rs +++ b/pineappl/src/lagrange_subgrid.rs @@ -1,7 +1,6 @@ //! Module containing the Lagrange-interpolation subgrid. use super::convert::{f64_from_usize, usize_from_f64}; -use super::grid::Grid; use super::subgrid::{ ExtraSubgridParams, Mu2, Stats, Subgrid, SubgridEnum, SubgridIndexedIter, SubgridParams, }; @@ -163,14 +162,6 @@ impl LagrangeSubgridV2 { } impl Subgrid for LagrangeSubgridV2 { - fn nodes(&self, _: &Grid) -> Cow<[Vec]> { - Cow::Owned(vec![ - (0..self.ny1).map(|iy| fx(self.gety1(iy))).collect(), - (0..self.ny2).map(|iy| fx(self.gety2(iy))).collect(), - (0..self.ntau).map(|itau| fq2(self.gettau(itau))).collect(), - ]) - } - fn fill(&mut self, ntuple: &[f64], weight: f64) { if weight == 0.0 { return; diff --git a/pineappl/src/packed_subgrid.rs b/pineappl/src/packed_subgrid.rs index 5df59b10..6904c65e 100644 --- a/pineappl/src/packed_subgrid.rs +++ b/pineappl/src/packed_subgrid.rs @@ -1,6 +1,5 @@ //! TODO -use super::grid::Grid; use super::packed_array::PackedArray; use super::subgrid::{Mu2, Stats, Subgrid, SubgridEnum, SubgridIndexedIter}; use serde::{Deserialize, Serialize}; @@ -40,20 +39,6 @@ impl PackedQ1X2SubgridV1 { } impl Subgrid for PackedQ1X2SubgridV1 { - fn nodes(&self, _: &Grid) -> Cow<[Vec]> { - Cow::Owned(vec![ - self.x1_grid.clone(), - self.x2_grid.clone(), - self.mu2_grid - .iter() - .map(|&Mu2 { ren, fac, frg: _ }| { - assert_eq!(ren, fac); - ren - }) - .collect(), - ]) - } - fn fill(&mut self, _: &[f64], _: f64) { panic!("PackedQ1X2SubgridV1 doesn't support the fill operation"); } diff --git a/pineappl/src/pids.rs b/pineappl/src/pids.rs index 828b4051..75eeb732 100644 --- a/pineappl/src/pids.rs +++ b/pineappl/src/pids.rs @@ -44,7 +44,6 @@ impl PidBasis { // TODO: in the general case we should allow to return a vector of tuples (Self::Evol, 100 | 103 | 108 | 115 | 124 | 135) => (pid, 1.0), (Self::Evol, 200 | 203 | 208 | 215 | 224 | 235) => (pid, -1.0), - (Self::Evol | Self::Pdg, 21 | 22) => (pid, 1.0), (Self::Evol | Self::Pdg, _) => (charge_conjugate_pdg_pid(pid), 1.0), } } diff --git a/pineappl/src/subgrid.rs b/pineappl/src/subgrid.rs index c12ae5d9..6c62e3b2 100644 --- a/pineappl/src/subgrid.rs +++ b/pineappl/src/subgrid.rs @@ -1,7 +1,6 @@ //! Module containing the trait `Subgrid` and supporting structs. use super::empty_subgrid::EmptySubgridV1; -use super::grid::Grid; use super::lagrange_subgrid::LagrangeSubgridV2; use super::packed_subgrid::PackedQ1X2SubgridV1; use enum_dispatch::enum_dispatch; @@ -33,41 +32,6 @@ pub struct Mu2 { pub frg: f64, } -/// Enumeration describing the kinematic variables that are interpolated in a [`Subgrid`]. -#[derive(Clone, Copy, Deserialize, Serialize)] -pub enum Kinematics { - /// Denotes a [`Subgrid`] with three kinematic variables: 1) one scale, which is the value of - /// both the renormalization and factorization scale, 2) a momentum fraction for the first - /// convolution and 3) a momentum fraction for the second convolution. - Q2rfX1X2, - // /// Denotes a [`Subgrid`] with four kinematic variables: two scales, 1) the renormalization and - // /// 2) factorization scale, 3) a momentum fraction for the first convolution and 3) a momentum - // /// fraction for the second convolution. - // Q2rQ2fX1X2, - // /// FK-table. - // Q2fX1X2, -} - -// /// Return the renormalization scales for the `subgrid` contained in `grid`. -// pub fn ren<'a, 'b>(grid: &'a Grid, subgrid: &'b SubgridEnum) -> Cow<'b, [f64]> { -// match grid.kinematics() { -// Kinematics::Q2rfX1X2 => match subgrid.nodes(grid) { -// Cow::Borrowed(vec) => Cow::Borrowed(&vec[0]), -// Cow::Owned(mut vec) => Cow::Owned(vec.remove(0)), -// }, -// } -// } -// -// /// Return the factorization scales for the `subgrid` contained in `grid`. -// pub fn fac<'a, 'b>(grid: &'a Grid, subgrid: &'b SubgridEnum) -> Cow<'b, [f64]> { -// match grid.kinematics() { -// Kinematics::Q2rfX1X2 => match subgrid.nodes(grid) { -// Cow::Borrowed(vec) => Cow::Borrowed(&vec[0]), -// Cow::Owned(mut vec) => Cow::Owned(vec.remove(0)), -// }, -// } -// } - /// Size-related statistics for a subgrid. #[derive(Debug, Eq, PartialEq)] pub struct Stats { @@ -91,10 +55,6 @@ pub struct Stats { /// Trait each subgrid must implement. #[enum_dispatch] pub trait Subgrid { - /// Return the values of node points for each kinematical variable interpolated in this - /// subgrid. - fn nodes(&self, grid: &Grid) -> Cow<[Vec]>; - /// Return a slice of [`Mu2`] values corresponding to the (squared) renormalization and /// factorization values of the grid. If the subgrid does not use a grid, this method should /// return an empty slice.