Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 10:11:31

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/data/WentzelOKVIData.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include "corecel/Macros.hh"
0010 #include "corecel/Types.hh"
0011 #include "corecel/data/Collection.hh"
0012 #include "celeritas/Constants.hh"
0013 #include "celeritas/Quantities.hh"
0014 #include "celeritas/Types.hh"
0015 
0016 namespace celeritas
0017 {
0018 //---------------------------------------------------------------------------//
0019 /*!
0020  * Parameters used in both single Coulomb scattering and Wentzel VI MSC models.
0021  *
0022  * When the single Coulomb scattering and Wentzel VI MSC models are used
0023  * together, the MSC model is used to sample scatterings with angles below the
0024  * polar angle limit, and the single scattering model is used for angles above
0025  * the limit.
0026  */
0027 struct CoulombParameters
0028 {
0029     //! Whether to use combined single and multiple scattering
0030     bool is_combined{};
0031     //! Polar angle limit between single and multiple scattering
0032     real_type costheta_limit{};
0033     //! Factor for the screening coefficient
0034     real_type screening_factor{};
0035     //! Factor used to calculate the maximum scattering angle off of a nucleus
0036     real_type a_sq_factor{};
0037     // Model for the form factor to use
0038     NuclearFormFactorType form_factor_type{NuclearFormFactorType::exponential};
0039 
0040     explicit CELER_FUNCTION operator bool() const
0041     {
0042         return costheta_limit >= -1 && costheta_limit <= 1
0043                && screening_factor > 0 && a_sq_factor >= 0
0044                && form_factor_type != NuclearFormFactorType::size_;
0045     }
0046 };
0047 
0048 //---------------------------------------------------------------------------//
0049 /*!
0050  * Per-element data used by the Coulomb scattering and Wentzel VI models.
0051  *
0052  * The matrix of coefficients used to approximate the ratio of the Mott to
0053  * Rutherford cross sections was developed in \citet{lijian-mott-1995,
0054  * https://doi.org/10.1016/0969-806X(94)00063-8}. Using the same procedure as
0055  * in Lijian, the coefficients were extended in \citet{boschini-mott-1993,
0056  * https://doi.org/10.1016/j.radphyschem.2013.04.020} to include positrons and
0057  * the interaction of electrons and positrons with higher Z nuclei (1 <= Z <=
0058  * 118).
0059  */
0060 struct MottElementData
0061 {
0062     //!@{
0063     //! \name Dimensions for Mott coefficient matrices
0064     static constexpr size_type num_beta = 6;
0065     static constexpr size_type num_theta = 5;
0066     static constexpr size_type num_elements = 118;
0067     //!@}
0068 
0069     using BetaArray = Array<real_type, num_beta>;
0070     using ThetaArray = Array<real_type, num_theta>;
0071     using MottCoeffMatrix = Array<BetaArray, num_theta>;
0072 
0073     //! Matrix of Mott coefficients [theta][beta]
0074     MottCoeffMatrix electron;
0075     MottCoeffMatrix positron;
0076 };
0077 
0078 //---------------------------------------------------------------------------//
0079 /*!
0080  * Constant shared data used by the Coulomb scattering and Wentzel VI models.
0081  */
0082 template<Ownership W, MemSpace M>
0083 struct WentzelOKVIData
0084 {
0085     //// TYPES ////
0086 
0087     template<class T>
0088     using ElementItems = celeritas::Collection<T, W, M, ElementId>;
0089     template<class T>
0090     using IsotopeItems = celeritas::Collection<T, W, M, IsotopeId>;
0091     template<class T>
0092     using MaterialItems = Collection<T, W, M, PhysMatId>;
0093 
0094     //// DATA ////
0095 
0096     //! User-assignable parameters
0097     CoulombParameters params;
0098     //! Mass of electron in MeV
0099     units::MevMass electron_mass;
0100     //! Constant prefactor for the squared momentum transfer [(MeV/c)^{-2}]
0101     IsotopeItems<real_type> nuclear_form_prefactor;
0102     //! Per element form factors
0103     ElementItems<MottElementData> mott_coeffs;
0104     //! Inverse effective A^2/3 [1/mass^2/3]
0105     MaterialItems<real_type> inv_mass_cbrt_sq;
0106 
0107     //// METHODS ////
0108 
0109     //! Check if the data is initialized
0110     explicit CELER_FUNCTION operator bool() const
0111     {
0112         return params && electron_mass > zero_quantity() && !mott_coeffs.empty()
0113                && params.is_combined == !inv_mass_cbrt_sq.empty();
0114     }
0115 
0116     //! Assign from another set of data
0117     template<Ownership W2, MemSpace M2>
0118     WentzelOKVIData& operator=(WentzelOKVIData<W2, M2> const& other)
0119     {
0120         CELER_EXPECT(other);
0121         params = other.params;
0122         electron_mass = other.electron_mass;
0123         nuclear_form_prefactor = other.nuclear_form_prefactor;
0124         mott_coeffs = other.mott_coeffs;
0125         inv_mass_cbrt_sq = other.inv_mass_cbrt_sq;
0126         return *this;
0127     }
0128 };
0129 
0130 //---------------------------------------------------------------------------//
0131 }  // namespace celeritas