Back to home page

EIC code displayed by LXR

 
 

    


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

0001 //----------------------------------*-C++-*----------------------------------//
0002 // Copyright 2021-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/RelativisticBremData.hh
0007 //---------------------------------------------------------------------------//
0008 #pragma once
0009 
0010 #include "corecel/Macros.hh"
0011 #include "corecel/Types.hh"
0012 #include "corecel/cont/Array.hh"
0013 #include "corecel/data/Collection.hh"
0014 #include "corecel/math/Quantity.hh"
0015 #include "celeritas/Quantities.hh"
0016 #include "celeritas/Types.hh"
0017 
0018 #include "ElectronBremsData.hh"
0019 
0020 namespace celeritas
0021 {
0022 //---------------------------------------------------------------------------//
0023 /*!
0024  * The atomic form factors used in the differential cross section of the
0025  * bremsstrahlung process by an ultrarelativistic electron.
0026  */
0027 struct RelBremFormFactor
0028 {
0029     real_type el;  //!< elastic component
0030     real_type inel;  //!< inelastic component
0031 };
0032 
0033 //---------------------------------------------------------------------------//
0034 /*!
0035  * A special metadata structure per element used in the differential cross
0036  * section calculation.
0037  */
0038 struct RelBremElementData
0039 {
0040     real_type fz;  //!< \f$ \ln(Z)/3 + f_c (Coulomb correction) \f$
0041     real_type factor1;  //!< \f$ ((Fel-fc)+Finel*invZ)\f$
0042     real_type factor2;  //!< \f$ (1.0+invZ)/12 \f$
0043     real_type gamma_factor;  //!< Constant for evaluating screening functions
0044     real_type epsilon_factor;  //!< Constant for evaluating screening functions
0045 };
0046 
0047 //---------------------------------------------------------------------------//
0048 /*!
0049  * Device data for creating an interactor.
0050  */
0051 template<Ownership W, MemSpace M>
0052 struct RelativisticBremData
0053 {
0054     template<class T>
0055     using ElementItems = celeritas::Collection<T, W, M, ElementId>;
0056 
0057     //// MEMBER DATA ////
0058 
0059     //! IDs
0060     ElectronBremIds ids;
0061 
0062     //! Electron mass [MeVMass]
0063     units::MevMass electron_mass;
0064 
0065     //! LPM flag
0066     bool enable_lpm{};
0067 
0068     //! Element data
0069     ElementItems<RelBremElementData> elem_data;
0070 
0071     //// MEMBER FUNCTIONS ////
0072 
0073     //! Include a dielectric suppression effect in LPM functions
0074     static CELER_CONSTEXPR_FUNCTION bool dielectric_suppression()
0075     {
0076         return true;
0077     }
0078 
0079     //! Whether all data are assigned and valid
0080     explicit CELER_FUNCTION operator bool() const
0081     {
0082         return ids && electron_mass > zero_quantity() && !elem_data.empty();
0083     }
0084 
0085     //! Assign from another set of data
0086     template<Ownership W2, MemSpace M2>
0087     RelativisticBremData& operator=(RelativisticBremData<W2, M2> const& other)
0088     {
0089         CELER_EXPECT(other);
0090         ids = other.ids;
0091         electron_mass = other.electron_mass;
0092         enable_lpm = other.enable_lpm;
0093         elem_data = other.elem_data;
0094         return *this;
0095     }
0096 };
0097 
0098 using RelativisticBremDeviceRef = DeviceCRef<RelativisticBremData>;
0099 using RelativisticBremHostRef = HostCRef<RelativisticBremData>;
0100 using RelativisticBremRef = NativeCRef<RelativisticBremData>;
0101 
0102 }  // namespace celeritas