Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-15 10:11:00

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/TrackInitParams.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include "corecel/Types.hh"
0010 #include "corecel/data/CollectionMirror.hh"
0011 #include "corecel/data/ParamsDataInterface.hh"
0012 
0013 #include "TrackInitData.hh"
0014 
0015 namespace celeritas
0016 {
0017 namespace optical
0018 {
0019 //---------------------------------------------------------------------------//
0020 /*!
0021  * Manage persistent track initializer data.
0022  */
0023 class TrackInitParams final : public ParamsDataInterface<TrackInitParamsData>
0024 {
0025   public:
0026     // Construct with capacity
0027     explicit TrackInitParams(size_type capacity);
0028 
0029     //! Access data on host
0030     HostRef const& host_ref() const final { return data_.host_ref(); }
0031 
0032     //! Access data on device
0033     DeviceRef const& device_ref() const final { return data_.device_ref(); }
0034 
0035     //! Maximum number of initializers
0036     size_type capacity() const { return host_ref().capacity; }
0037 
0038   private:
0039     // Host/device storage and reference
0040     CollectionMirror<TrackInitParamsData> data_;
0041 };
0042 
0043 //---------------------------------------------------------------------------//
0044 }  // namespace optical
0045 }  // namespace celeritas