Celeritas  0.5.0-86+4a8eea4
Functions
PhysicsStepUtils.hh File Reference

Helper functions for physics step processing. More...

#include "corecel/Assert.hh"
#include "corecel/Types.hh"
#include "corecel/cont/Range.hh"
#include "corecel/math/Algorithms.hh"
#include "corecel/math/NumericLimits.hh"
#include "celeritas/Types.hh"
#include "celeritas/grid/EnergyLossCalculator.hh"
#include "celeritas/grid/InverseRangeCalculator.hh"
#include "celeritas/grid/RangeCalculator.hh"
#include "celeritas/grid/SplineXsCalculator.hh"
#include "celeritas/grid/XsCalculator.hh"
#include "celeritas/mat/MaterialTrackView.hh"
#include "celeritas/random/Selector.hh"
#include "celeritas/random/distribution/GenerateCanonical.hh"
#include "ParticleTrackView.hh"
#include "PhysicsStepView.hh"
#include "PhysicsTrackView.hh"

Functions

CELER_FUNCTION StepLimit celeritas::calc_physics_step_limit (MaterialTrackView const &material, ParticleTrackView const &particle, PhysicsTrackView &physics, PhysicsStepView &pstep)
 Calculate physics step limits based on cross sections and range limiters. More...
 
CELER_FUNCTION ParticleTrackView::Energy celeritas::calc_mean_energy_loss (ParticleTrackView const &particle, PhysicsTrackView const &physics, real_type step)
 Calculate mean energy loss over the given "true" step length. More...
 
template<class Engine >
CELER_FUNCTION ActionId celeritas::select_discrete_interaction (MaterialView const &material, ParticleTrackView const &particle, PhysicsTrackView const &physics, PhysicsStepView &pstep, Engine &rng)
 Choose the physics model for a track's pending interaction. More...
 

Detailed Description

Helper functions for physics step processing.

Function Documentation

◆ calc_mean_energy_loss()

CELER_FUNCTION ParticleTrackView::Energy celeritas::calc_mean_energy_loss ( ParticleTrackView const &  particle,
PhysicsTrackView const &  physics,
real_type  step 
)
inline

Calculate mean energy loss over the given "true" step length.

Stopping power is an integral over low-exiting-energy secondaries. Above some threshold energy T_c we treat exiting secondaries discretely; below it, we lump them into this continuous loss term that varies based on the energy, the atomic number density, and the element number:

\[ \frac{dE}{dx} = N_Z \int_0^{T_c} \frac{d \sigma_Z(E, T)}{dT} T dT \]

Here, the cross section is a function of the primary's energy E and the exiting secondary energy T.

The stopping range R due to these low-energy processes is an integral over the inverse of the stopping power: basically the distance that will take a particle (without discrete processes at play) from its current energy to an energy of zero.

\[ R = \int_0 ^{E_0} - \frac{dx}{dE} dE . \]

Both Celeritas and Geant4 approximate the range limit as the minimum range over all processes, rather than the range as a result from integrating all energy loss processes over the allowed energy range. This is usually not a problem in practice because the range will get automatically decreased by range_to_step , and the above range calculation neglects energy loss by discrete processes.

Both Geant4 and Celeritas integrate the energy loss terms across processes to get a single energy loss vector per particle type. The range table is an integral of the mean stopping power: the total distance for the particle's energy to reach zero.

Note
The inverse range correction assumes range is always the integral of the stopping power/energy loss.
Todo:
The geant3 manual makes the point that linear interpolation of energy loss rate results in a piecewise constant energy deposition curve, which is why they use spline interpolation. Investigate higher-order reconstruction of energy loss curve, e.g. through spline-based interpolation or log-log interpolation.
Note
See section 7.2.4 Run Time Energy Loss Computation of the Geant4 physics manual. See also the longer discussions in section 8 of PHYS010 of the Geant3 manual (1993).

Zero energy loss can occur in the following cases:

  • The energy loss value at the given energy is zero (e.g. high energy particles)
  • The urban model is selected and samples zero collisions (possible in thin materials and/or small steps)

◆ calc_physics_step_limit()

CELER_FUNCTION StepLimit celeritas::calc_physics_step_limit ( MaterialTrackView const &  material,
ParticleTrackView const &  particle,
PhysicsTrackView physics,
PhysicsStepView pstep 
)
inline

Calculate physics step limits based on cross sections and range limiters.

Todo:
For particles with decay, macro XS calculation will incorporate decay probability, dividing decay constant by speed to become 1/len to compete with interactions.
Todo:
For neutral particles that haven't changed material since the last step, we can reuse the previously calculated cross section.

◆ select_discrete_interaction()

template<class Engine >
CELER_FUNCTION ActionId celeritas::select_discrete_interaction ( MaterialView const &  material,
ParticleTrackView const &  particle,
PhysicsTrackView const &  physics,
PhysicsStepView pstep,
Engine &  rng 
)

Choose the physics model for a track's pending interaction.

  • If the interaction MFP is zero, the particle is undergoing a discrete interaction. Otherwise, the result is a false ActionId.
  • Sample from the previously calculated per-process cross section/decay to determine the interacting process ID.
  • From the process ID and (post-slowing-down) particle energy, we obtain the applicable model ID.
  • For energy loss (continuous-discrete) processes, the post-step energy will be different from the pre-step energy, so the assumption that the cross section is constant along the step is no longer valid. Use the "integral approach" to sample the discrete interaction from the correct probability distribution (section 7.4 of the Geant4 Physics Reference release 10.6).