Struct pineappl::lumi::LumiCache

source ·
pub struct LumiCache<'a> { /* private fields */ }
Expand description

A cache for evaluating PDFs. Methods like Grid::convolute accept instances of this struct instead of the PDFs themselves.

Implementations§

source§

impl<'a> LumiCache<'a>

source

pub fn with_two( pdg1: i32, xfx1: &'a mut dyn FnMut(i32, f64, f64) -> f64, pdg2: i32, xfx2: &'a mut dyn FnMut(i32, f64, f64) -> f64, alphas: &'a mut dyn FnMut(f64) -> f64 ) -> Self

Construct a luminosity cache with two PDFs, xfx1 and xfx2. The types of hadrons the PDFs correspond to must be given as pdg1 and pdg2. The function to evaluate the strong coupling must be given as alphas. The grid that the cache will be used with must be given as grid; this parameter determines which of the initial states are hadronic, and if an initial states is not hadronic the corresponding ‘PDF’ is set to xfx = x. If some of the PDFs must be charge-conjugated, this is automatically done in this function.

source

pub fn with_one( pdg: i32, xfx: &'a mut dyn FnMut(i32, f64, f64) -> f64, alphas: &'a mut dyn FnMut(f64) -> f64 ) -> Self

Construct a luminosity cache with a single PDF xfx. The type of hadron the PDF corresponds to must be given as pdg. The function to evaluate the strong coupling must be given as alphas. The grid that the cache should be used with must be given as grid; this parameter determines which of the initial states are hadronic, and if an initial states is not hadronic the corresponding ‘PDF’ is set to xfx = x. If some of the PDFs must be charge-conjugated, this is automatically done in this function.

source

pub fn xfx1(&mut self, pdg_id: i32, ix1: usize, imu2: usize) -> f64

Return the PDF (multiplied with x) for the first initial state.

source

pub fn xfx2(&mut self, pdg_id: i32, ix2: usize, imu2: usize) -> f64

Return the PDF (multiplied with x) for the second initial state.

source

pub fn alphas(&mut self, imu2: usize) -> f64

Return the strong coupling for the renormalization scale set with LumiCache::set_grids, in the grid mu2_grid at the index imu2.

source

pub fn clear(&mut self)

Clears the cache.

source

pub fn set_grids( &mut self, mu2_grid: &[Mu2], x1_grid: &[f64], x2_grid: &[f64], xir: f64, xif: f64 )

Set the grids.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for LumiCache<'a>

§

impl<'a> !Send for LumiCache<'a>

§

impl<'a> !Sync for LumiCache<'a>

§

impl<'a> Unpin for LumiCache<'a>

§

impl<'a> !UnwindSafe for LumiCache<'a>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.