Step limits

Currently there are only a few, hard-coded step limitation mechanics that apply to a particle at each step. The ordering of these can affect the performance.

Discrete interactions

Most physics processes use pre-calculated cross sections that are tabulated and interpolated.

class XsCalculator

Find and interpolate scaled cross sections.

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

  • The energy grid is uniformly spaced in log(E),

  • Values greater than or equal to an index i’ are scaled by E and are stored on a separate energy grid also uniformly spaced in log(E) but not necessarily with the same spacing,

  • Linear interpolation between energy points is used to calculate the final value, and

  • If the energy is at or above the i’ index, the final result is scaled by 1/E.

This scaling and interpolation exactly reproduces functions below the E’ threshold and above that threshold.

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

XsCalculator calc_xs(grid, params.reals);
real_type xs = calc_xs(particle.energy());

Cross sections for each process are evaluated at the beginning of the step along with range limiters.

inline 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.

If undergoing an interaction, the process is sampled from the stored beginning-of-step cross sections.

template<class Engine>
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).

User-input

See celeritas::inp::TrackingLimits.

Range and energy loss

See Continuous slowing down.

Multiple scattering

See Coulomb scattering.

class UrbanMscSafetyStepLimit

Sample a step limit for the Urban MSC model using the “safety” algorithm.

This distribution is to be used for tracks that have non-negligible steps and are near the boundary. Otherwise, no displacement or step limiting is needed.

Note

This code performs the same method as in ComputeTruePathLengthLimit of G4UrbanMscModel, as documented in section 8.1.6 of the Geant4 10.7 Physics Reference Manual or CERN-OPEN-2006-077 by L. Urban.

class UrbanMscMinimalStepLimit

Sample a step limit for the Urban MSC model using the “minimal” algorithm.

Note

This code performs the same method as in ComputeTruePathLengthLimit of G4UrbanMscModel, as documented in section 8.1.6 of [The Geant4 Collaboration, 2023] or Urbán [2006] .

When multiple scattering is in play, the “physical” step limit must be converted to and from a “geometry” step limit before and after the propagation (movement within geometry) step limiting calculation.

class MscStepFromGeo

Convert the “geometrical” path traveled to the true path with MSC.

The “true” step length is the physical path length taken along the geometrical path length (which is straight without magnetic fields or curved with them), accounting for the extra distance taken between along-step elastic collisions.

The transformation can be written as

or if the geom path is small, where .

Param true_path:

the proposed step before transportation.

Param gstep:

the proposed step after transportation.

Param alpha:

variable from UrbanMscStepLimit.

class MscStepToGeo

Convert the “true” path traveled to a geometrical approximation.

This takes the physical step limit&#8212;whether limited by range, physics interaction, or an MSC step limiter&#8212;and converts it to a “geometrical” path length, which is a smooth curve (straight if in the absence of a magnetic field).

The mean value of the geometrical path length (the first moment) corresponding to a given true path length is given by

where is the first transport mean free path. Due to the fact that depends on the kinetic energy of the path and decreases along the step, the path length correction is approximated as
where or in a simpler form with the range if the kinetic energy of the particle is below its mass - denotes the value of at the start (end) of the step, respectively.

Since the MSC cross section decreases as the energy increases, will be larger than and will be positive. However, in the Geant4 Urban MSC model, different methods are used to calculate the cross section above and below 10 MeV. In the higher energy region the cross sections are identical for electrons and positrons, resulting in a discontinuity in the positron cross section at 10 MeV. This means on fine energy grids it’s possible for the cross section to be increasing with energy just above the 10 MeV threshold and therefore for is negative.

The resulting geometrical step length can be greater than 1 MFP: it’s the MSC step limiter’s job to add additional restrictions.

Note

This performs the same method as in ComputeGeomPathLength of G4UrbanMscModel of the Geant4 10.7 release.

Geometry

See Propagation.