Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-10-28 08:38:52

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/xs/MottRatioCalculator.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include "corecel/Macros.hh"
0010 #include "corecel/Types.hh"
0011 #include "corecel/math/ArrayUtils.hh"
0012 #include "corecel/math/PolyEvaluator.hh"
0013 #include "celeritas/em/data/WentzelOKVIData.hh"
0014 
0015 namespace celeritas
0016 {
0017 
0018 //---------------------------------------------------------------------------//
0019 /*!
0020  * Calculates the ratio of Mott cross section to the Rutherford cross section.
0021  *
0022  * This ratio is an adjustment of the cross section from a purely classical
0023  * treatment of a point nucleus in an electronic cloud (Rutherford scattering)
0024  * to a quantum mechanical treatment. The implementation is an interpolated
0025  * approximation developed in \citet{lijian-mott-1995,
0026  * https://doi.org/10.1016/0969-806X(94)00063-8} and described in \citet{g4prm,
0027  * https://geant4-userdoc.web.cern.ch/UsersGuides/PhysicsReferenceManual/html/index.html}
0028  * section 8.4.
0029  *
0030  * The input argument \c cos_theta is the cosine of the scattered angle in the
0031  * z-aligned momentum frame.
0032  */
0033 class MottRatioCalculator
0034 {
0035   public:
0036     //!@{
0037     //! \name Type aliases
0038     using MottCoeffMatrix = MottElementData::MottCoeffMatrix;
0039     //!@}
0040 
0041   public:
0042     // Construct with state data
0043     inline CELER_FUNCTION
0044     MottRatioCalculator(MottCoeffMatrix const& coeffs, real_type beta);
0045 
0046     // Ratio of Mott and Rutherford cross sections
0047     inline CELER_FUNCTION real_type operator()(real_type cos_t) const;
0048 
0049   private:
0050     MottCoeffMatrix const& coeffs_;
0051     real_type beta_;
0052 };
0053 
0054 //---------------------------------------------------------------------------//
0055 // INLINE DEFINITIONS
0056 //---------------------------------------------------------------------------//
0057 /*!
0058  * Construct with state data.
0059  */
0060 CELER_FUNCTION
0061 MottRatioCalculator::MottRatioCalculator(MottCoeffMatrix const& coeffs,
0062                                          real_type beta)
0063     : coeffs_(coeffs), beta_(beta)
0064 {
0065     CELER_EXPECT(0 <= beta_ && beta_ < 1);
0066 }
0067 
0068 //---------------------------------------------------------------------------//
0069 /*!
0070  * Compute the ratio of Mott to Rutherford cross sections.
0071  */
0072 CELER_FUNCTION
0073 real_type MottRatioCalculator::operator()(real_type cos_theta) const
0074 {
0075     CELER_EXPECT(cos_theta >= -1 && cos_theta <= 1);
0076 
0077     // (Exponent) Base for theta powers
0078     real_type fcos_t = std::sqrt(1 - cos_theta);
0079 
0080     // Mean velocity of electrons between ~KeV and 900 MeV
0081     real_type const beta_shift = 0.7181228;
0082 
0083     // (Exponent) Base for beta powers
0084     real_type beta0 = beta_ - beta_shift;
0085 
0086     // Evaluate polynomial of powers of beta0 and fcos_t
0087     MottElementData::ThetaArray theta_coeffs;
0088     for (auto i : range(theta_coeffs.size()))
0089     {
0090         theta_coeffs[i] = PolyEvaluator(coeffs_[i])(beta0);
0091     }
0092     real_type result = PolyEvaluator(theta_coeffs)(fcos_t);
0093     CELER_ENSURE(result >= 0);
0094     return result;
0095 }
0096 
0097 //---------------------------------------------------------------------------//
0098 }  // namespace celeritas