Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-15 08:54:38

0001 //------------------------------- -*- C++ -*- -------------------------------//
0002 // Copyright Celeritas contributors: see top-level COPYRIGHT file for details
0003 // SPDX-License-Identifier: (Apache-2.0 OR MIT)
0004 //---------------------------------------------------------------------------//
0005 //! \file celeritas/em/distribution/detail/Utils.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include "corecel/Types.hh"
0010 #include "celeritas/Constants.hh"
0011 #include "celeritas/Quantities.hh"
0012 #include "celeritas/phys/ParticleTrackView.hh"
0013 
0014 namespace celeritas
0015 {
0016 namespace detail
0017 {
0018 //---------------------------------------------------------------------------//
0019 /*!
0020  * Calculate the maximum energy transferable to a free electron in ionizaation.
0021  *
0022  * This calculates the maximum kinematically allowed kinetic energy of the
0023  * delta ray produced in muon or hadron ionization,
0024  * \f[
0025    T_{max} = \frac{2 m_e c^2 (\gamma^2 - 1)}{1 + 2\gamma (m_e/M) + (m_e/M)^2},
0026  * \f]
0027  * where \f$ m_e \f$ is the electron mass and \f$ M \f$ is the mass of the
0028  * incident particle.
0029  */
0030 inline CELER_FUNCTION units::MevEnergy
0031 calc_max_secondary_energy(ParticleTrackView const& particle,
0032                           units::MevMass electron_mass)
0033 {
0034     real_type inc_mass = value_as<units::MevMass>(particle.mass());
0035     real_type mass_ratio = value_as<units::MevMass>(electron_mass) / inc_mass;
0036     real_type tau = value_as<units::MevEnergy>(particle.energy()) / inc_mass;
0037     return units::MevEnergy{
0038         2 * value_as<units::MevMass>(electron_mass) * tau * (tau + 2)
0039         / (1 + 2 * (tau + 1) * mass_ratio + ipow<2>(mass_ratio))};
0040 }
0041 
0042 //---------------------------------------------------------------------------//
0043 }  // namespace detail
0044 }  // namespace celeritas