Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-15 08:54:47

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/optical/CherenkovData.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/grid/NonuniformGridData.hh"
0013 #include "celeritas/Types.hh"
0014 
0015 #include "Types.hh"
0016 
0017 namespace celeritas
0018 {
0019 namespace optical
0020 {
0021 //---------------------------------------------------------------------------//
0022 /*!
0023  * Cherenkov angle integrals tablulated as a function of photon energy.
0024  */
0025 template<Ownership W, MemSpace M>
0026 struct CherenkovData
0027 {
0028     template<class T>
0029     using Items = Collection<T, W, M>;
0030     template<class T>
0031     using OpticalMaterialItems = Collection<T, W, M, OptMatId>;
0032 
0033     //// MEMBER DATA ////
0034 
0035     OpticalMaterialItems<NonuniformGridRecord> 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     CherenkovData& operator=(CherenkovData<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