Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-22 10:31:15

0001 //----------------------------------*-C++-*----------------------------------//
0002 // Copyright 2024 UT-Battelle, LLC, and other Celeritas developers.
0003 // See the top-level COPYRIGHT file for details.
0004 // SPDX-License-Identifier: (Apache-2.0 OR MIT)
0005 //---------------------------------------------------------------------------//
0006 //! \file celeritas/em/data/WentzelOKVIData.hh
0007 //---------------------------------------------------------------------------//
0008 #pragma once
0009 
0010 #include "corecel/Macros.hh"
0011 #include "corecel/Types.hh"
0012 #include "corecel/data/Collection.hh"
0013 #include "celeritas/Constants.hh"
0014 #include "celeritas/Quantities.hh"
0015 #include "celeritas/Types.hh"
0016 
0017 namespace celeritas
0018 {
0019 //---------------------------------------------------------------------------//
0020 /*!
0021  * Parameters used in both single Coulomb scattering and Wentzel VI MSC models.
0022  *
0023  * When the single Coulomb scattering and Wentzel VI MSC models are used
0024  * together, the MSC model is used to sample scatterings with angles below the
0025  * polar angle limit, and the single scattering model is used for angles above
0026  * the limit.
0027  */
0028 struct CoulombParameters
0029 {
0030     //! Whether to use combined single and multiple scattering
0031     bool is_combined{};
0032     //! Polar angle limit between single and multiple scattering
0033     real_type costheta_limit{};
0034     //! Factor for the screening coefficient
0035     real_type screening_factor{};
0036     //! Factor used to calculate the maximum scattering angle off of a nucleus
0037     real_type a_sq_factor{};
0038     // Model for the form factor to use
0039     NuclearFormFactorType form_factor_type{NuclearFormFactorType::exponential};
0040 
0041     explicit CELER_FUNCTION operator bool() const
0042     {
0043         return costheta_limit >= -1 && costheta_limit <= 1
0044                && screening_factor > 0 && a_sq_factor >= 0
0045                && form_factor_type != NuclearFormFactorType::size_;
0046     }
0047 };
0048 
0049 //---------------------------------------------------------------------------//
0050 /*!
0051  * Per-element data used by the Coulomb scattering and Wentzel VI models.
0052  *
0053  * The matrix of coefficients used to approximate the ratio of the Mott to
0054  * Rutherford cross sections was developed in T. Lijian, H. Quing and L.
0055  * Zhengming, Radiat. Phys. Chem. 45 (1995), 235-245. Using the same procedure
0056  * as in Lijian, the coefficients were extended in M.J. Boschini et al, Radiat.
0057  * Phys. Chem. 90 (2013), 39-66 (doi.org/10.1016/j.radphyschem.2013.04.020) to
0058  * include positrons and the interaction of electrons and positrons with higher
0059  * Z nuclei (1 <= Z <= 118).
0060  */
0061 struct MottElementData
0062 {
0063     //!@{
0064     //! \name Dimensions for Mott coefficient matrices
0065     static constexpr size_type num_beta = 6;
0066     static constexpr size_type num_theta = 5;
0067     static constexpr size_type num_elements = 118;
0068     //!@}
0069 
0070     using BetaArray = Array<real_type, num_beta>;
0071     using ThetaArray = Array<real_type, num_theta>;
0072     using MottCoeffMatrix = Array<BetaArray, num_theta>;
0073 
0074     //! Matrix of Mott coefficients [theta][beta]
0075     MottCoeffMatrix electron;
0076     MottCoeffMatrix positron;
0077 };
0078 
0079 //---------------------------------------------------------------------------//
0080 /*!
0081  * Constant shared data used by the Coulomb scattering and Wentzel VI models.
0082  */
0083 template<Ownership W, MemSpace M>
0084 struct WentzelOKVIData
0085 {
0086     template<class T>
0087     using ElementItems = celeritas::Collection<T, W, M, ElementId>;
0088     template<class T>
0089     using IsotopeItems = celeritas::Collection<T, W, M, IsotopeId>;
0090     template<class T>
0091     using MaterialItems = Collection<T, W, M, MaterialId>;
0092 
0093     // User-assignable parameters
0094     CoulombParameters params;
0095 
0096     // Constant prefactor for the squared momentum transfer [(MeV/c)^{-2}]
0097     IsotopeItems<real_type> nuclear_form_prefactor;
0098 
0099     // Per element form factors
0100     ElementItems<MottElementData> mott_coeffs;
0101 
0102     // Inverse effective A^2/3 [1/mass^2/3]
0103     MaterialItems<real_type> inv_mass_cbrt_sq;
0104 
0105     // Check if the data is initialized
0106     explicit CELER_FUNCTION operator bool() const
0107     {
0108         return params && !mott_coeffs.empty()
0109                && params.is_combined == !inv_mass_cbrt_sq.empty();
0110     }
0111 
0112     template<Ownership W2, MemSpace M2>
0113     WentzelOKVIData& operator=(WentzelOKVIData<W2, M2> const& other)
0114     {
0115         CELER_EXPECT(other);
0116         params = other.params;
0117         nuclear_form_prefactor = other.nuclear_form_prefactor;
0118         mott_coeffs = other.mott_coeffs;
0119         inv_mass_cbrt_sq = other.inv_mass_cbrt_sq;
0120         return *this;
0121     }
0122 };
0123 
0124 //---------------------------------------------------------------------------//
0125 }  // namespace celeritas