Celeritas  0.5.0-56+6b053cd
Public Member Functions | List of all members
celeritas::XsCalculator Class Reference

Find and interpolate scaled cross sections on a uniform log grid. More...

#include <XsCalculator.hh>

Public Types

Type aliases
using Energy = Quantity< XsGridData::EnergyUnits >
 
using Values = Collection< real_type, Ownership::const_reference, MemSpace::native >
 

Public Member Functions

CELER_FUNCTION XsCalculator (XsGridData const &grid, Values const &values)
 Construct from cross section data.
 
CELER_FUNCTION real_type operator() (Energy energy) const
 Calculate the cross section. More...
 
CELER_FUNCTION real_type operator[] (size_type index) const
 Get the cross section at the given index.
 
CELER_FUNCTION Energy energy_min () const
 
CELER_FUNCTION Energy energy_max () const
 

Detailed Description

Find and interpolate scaled cross sections on a uniform log grid.

This cross section calculator uses the same representation and interpolation as Geant4's physics tables for EM physics:

This scaling and interpolation exactly reproduces functions \( f(E) \sim a E + b \) below the E' threshold and \( f(E) \sim \frac{a'}{E} + b' \) above that threshold.

Note that linear interpolation is applied with energy points, not log-energy points.

XsCalculator calc_xs(xs_grid, xs_params.reals);
real_type xs = calc_xs(particle.energy());
CELER_FUNCTION XsCalculator(XsGridData const &grid, Values const &values)
Construct from cross section data.
Definition: XsCalculator.hh:93
double real_type
Numerical type for real numbers.
Definition: corecel/Types.hh:35

Member Function Documentation

◆ operator()()

CELER_FUNCTION real_type celeritas::XsCalculator::operator() ( Energy  energy) const
inline

Calculate the cross section.

If needed, we can add a "log(energy/MeV)" accessor if we constantly reuse that value and don't want to repeat the std::log operation.


The documentation for this class was generated from the following file: