Celeritas 0.6.0-2+develop.96611fab
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
 

Public Member Functions

 RangeGridCalculator ()
 Default constructor.
 
 RangeGridCalculator (BC)
 Construct with boundary conditions for spline interpolation.
 
inp::UniformGrid operator() (inp::UniformGrid const &) 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()()

inp::UniformGrid celeritas::RangeGridCalculator::operator() ( inp::UniformGrid const dedx_grid) 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: