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