Back to home page

EIC code displayed by LXR

 
 

    


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

0001 //----------------------------------*-C++-*----------------------------------//
0002 // Copyright 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/optical/CerenkovData.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 #include "celeritas/grid/GenericGridData.hh"
0015 #include "celeritas/optical/Types.hh"
0016 
0017 namespace celeritas
0018 {
0019 namespace optical
0020 {
0021 //---------------------------------------------------------------------------//
0022 /*!
0023  * Cerenkov angle integrals tablulated as a function of photon energy.
0024  */
0025 template<Ownership W, MemSpace M>
0026 struct CerenkovData
0027 {
0028     template<class T>
0029     using Items = Collection<T, W, M>;
0030     template<class T>
0031     using OpticalMaterialItems = Collection<T, W, M, OpticalMaterialId>;
0032 
0033     //// MEMBER DATA ////
0034 
0035     OpticalMaterialItems<GenericGridRecord> angle_integral;
0036 
0037     // Backend data
0038     Items<real_type> reals;
0039 
0040     //// MEMBER FUNCTIONS ////
0041 
0042     //! Whether all data are assigned and valid
0043     explicit CELER_FUNCTION operator bool() const
0044     {
0045         return !angle_integral.empty() && !reals.empty();
0046     }
0047 
0048     //! Assign from another set of data
0049     template<Ownership W2, MemSpace M2>
0050     CerenkovData& operator=(CerenkovData<W2, M2> const& other)
0051     {
0052         CELER_EXPECT(other);
0053         angle_integral = other.angle_integral;
0054         reals = other.reals;
0055         return *this;
0056     }
0057 };
0058 
0059 //---------------------------------------------------------------------------//
0060 }  // namespace optical
0061 }  // namespace celeritas