Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-01-07 10:01:42

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/gen/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 //---------------------------------------------------------------------------//
0020 /*!
0021  * Cherenkov angle integrals tablulated as a function of photon energy.
0022  */
0023 template<Ownership W, MemSpace M>
0024 struct CherenkovData
0025 {
0026     template<class T>
0027     using Items = Collection<T, W, M>;
0028     template<class T>
0029     using OpticalMaterialItems = Collection<T, W, M, OptMatId>;
0030 
0031     //// MEMBER DATA ////
0032 
0033     OpticalMaterialItems<NonuniformGridRecord> angle_integral;
0034 
0035     // Backend data
0036     Items<real_type> reals;
0037 
0038     //// MEMBER FUNCTIONS ////
0039 
0040     //! Whether all data are assigned and valid
0041     explicit CELER_FUNCTION operator bool() const
0042     {
0043         return !angle_integral.empty() && !reals.empty();
0044     }
0045 
0046     //! Assign from another set of data
0047     template<Ownership W2, MemSpace M2>
0048     CherenkovData& operator=(CherenkovData<W2, M2> const& other)
0049     {
0050         CELER_EXPECT(other);
0051         angle_integral = other.angle_integral;
0052         reals = other.reals;
0053         return *this;
0054     }
0055 };
0056 
0057 //---------------------------------------------------------------------------//
0058 }  // namespace celeritas