Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-27 10:47:00

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