Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 08:53:32

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/CombinedBremData.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/Types.hh"
0013 
0014 #include "RelativisticBremData.hh"
0015 #include "SeltzerBergerData.hh"
0016 
0017 namespace celeritas
0018 {
0019 //---------------------------------------------------------------------------//
0020 /*!
0021  * Device data for sampling CombinedBremInteractor.
0022  */
0023 template<Ownership W, MemSpace M>
0024 struct CombinedBremData
0025 {
0026     // Differential cross section data for SeltzerBerger
0027     SeltzerBergerTableData<W, M> sb_differential_xs;
0028 
0029     // Device data for RelativisticBrem
0030     RelativisticBremData<W, M> rb_data;
0031 
0032     //! Whether all data are assigned and valid
0033     explicit CELER_FUNCTION operator bool() const
0034     {
0035         return sb_differential_xs && rb_data;
0036     }
0037 
0038     //! Assign from another set of data
0039     template<Ownership W2, MemSpace M2>
0040     CombinedBremData& operator=(CombinedBremData<W2, M2> const& other)
0041     {
0042         CELER_EXPECT(other);
0043         sb_differential_xs = other.sb_differential_xs;
0044         rb_data = other.rb_data;
0045         return *this;
0046     }
0047 };
0048 
0049 using CombinedBremDeviceRef = DeviceCRef<CombinedBremData>;
0050 using CombinedBremHostRef = HostCRef<CombinedBremData>;
0051 using CombinedBremRef = NativeCRef<CombinedBremData>;
0052 
0053 //---------------------------------------------------------------------------//
0054 }  // namespace celeritas