Celeritas 0.6.0-dev.115+3b60a5fd
Loading...
Searching...
No Matches
Public Member Functions | List of all members
celeritas::RangeGridCalculator Class Reference

Calculate the range from the energy loss. More...

#include <RangeGridCalculator.hh>

Public Types

Type aliases
using BC = SplineDerivCalculator::BoundaryCondition
 
using Values = Collection< real_type, Ownership::const_reference, MemSpace::host >
 
using VecReal = std::vector< real_type >
 

Public Member Functions

 RangeGridCalculator ()
 Default constructor.
 
 RangeGridCalculator (BC)
 Construct with boundary conditions for spline interpolation.
 
VecReal operator() (XsGridData const &data, Values const &reals) const
 Calculate the range from the energy loss.
 

Detailed Description

Calculate the range from the energy loss.

The range of a particle with energy \( E_0 \) is calculated by integrating the reciprocal of the stopping power over the energy:

\[ R(E_0) = \int_0^{E_0} - \difd{x}{E} \dif E. \]

Given an energy loss grid for a single particle type and material, this numerically integrates the range. To keep the range tables as consistent as possible with what we've been importing from Geant4, this performs the same calculation as in Geant4's G4LossTableBuilder::BuildRangeTable, which uses the midpoint rule with 100 substeps for improved accuracy.

The calculator is constructed with the boundary conditions for cubic spline interpolation. If the default constructor is used, or if the number of grid points is less than 5, linear interpolation will be used instead.

Todo:
support polynomial interpolation as well?

Member Function Documentation

◆ operator()()

auto celeritas::RangeGridCalculator::operator() ( XsGridData const orig_data,
Values const orig_reals 
) const

Calculate the range from the energy loss.

This assumes the same log energy grid is used for range and energy loss.


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