Back to home page

EIC code displayed by LXR

 
 

    


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

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/WavelengthShiftParams.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include "corecel/Types.hh"
0010 #include "corecel/data/CollectionMirror.hh"
0011 #include "corecel/data/ParamsDataInterface.hh"
0012 #include "celeritas/io/ImportOpticalMaterial.hh"
0013 
0014 #include "WavelengthShiftData.hh"
0015 
0016 namespace celeritas
0017 {
0018 struct ImportData;
0019 
0020 namespace optical
0021 {
0022 //---------------------------------------------------------------------------//
0023 /*!
0024  * Build and manage wavelength shift (WLS) data.
0025  */
0026 class WavelengthShiftParams final
0027     : public ParamsDataInterface<WavelengthShiftData>
0028 {
0029   public:
0030     //! Material-dependent WLS data, indexed by \c OptMatId
0031     struct Input
0032     {
0033         std::vector<ImportWavelengthShift> data;
0034     };
0035 
0036   public:
0037     // Construct with imported data
0038     static std::shared_ptr<WavelengthShiftParams>
0039     from_import(ImportData const& data);
0040 
0041     // Construct with WLS input data
0042     explicit WavelengthShiftParams(Input const& input);
0043 
0044     //! Access WLS data on the host
0045     HostRef const& host_ref() const final { return data_.host_ref(); }
0046 
0047     //! Access WLS data on the device
0048     DeviceRef const& device_ref() const final { return data_.device_ref(); }
0049 
0050   private:
0051     // Host/device storage and reference
0052     CollectionMirror<WavelengthShiftData> data_;
0053 };
0054 
0055 //---------------------------------------------------------------------------//
0056 }  // namespace optical
0057 }  // namespace celeritas