Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-01-10 10:05:50

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/phys/SurfaceModel.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include "corecel/OpaqueId.hh"
0010 #include "corecel/sys/ActionInterface.hh"
0011 #include "celeritas/Types.hh"
0012 
0013 namespace celeritas
0014 {
0015 //---------------------------------------------------------------------------//
0016 /*!
0017  * Physics to be applied during a surface crossing.
0018  *
0019  * Each surface model is constructed independently given some \c inp data. It
0020  * internally maps a sequence of "global" \c SurfaceId to a "local" \c
0021  * ModelSurfaceId. If a \c SurfaceModel with action ID 10 returns a list of
0022  * surfaces {3, 1, 5} and another with ID 11 returns {0, 4}, then the \c
0023  * SurfacePhysicsMap class will store
0024  * \code
0025  * [{11, 0}, {10, 1}, <null>, {10, 0}, {11, 1}, {10, 2}]
0026  * \endcode
0027  * Since neither model specified surface 2, it is null.
0028  *
0029  * With this setup, \c Collection data can be accessed locally by indexing on
0030  * \c ModelSurfaceId .
0031  *
0032  * This is currently only used by optical physics classes. Daughters will also
0033  * inherit from \c OpticalStepActionInterface, \c  ConcreteAction .
0034  */
0035 class SurfaceModel : virtual public ActionInterface
0036 {
0037   public:
0038     //!@{
0039     //! \name Type aliases
0040 
0041     //! Eventually to be a pair of surface+layer
0042     using SurfaceLayer = SurfaceId;
0043     //! Vector of surfaces
0044     using VecSurfaceLayer = std::vector<SurfaceLayer>;
0045     //! Opaque index of surface data in the list for a particular surface model
0046     using ModelSurfaceId = OpaqueId<struct ModelSurface_>;
0047 
0048     //!@}
0049 
0050   public:
0051     // Get the list of surfaces/layers this applies to
0052     virtual VecSurfaceLayer get_surfaces() const = 0;
0053 };
0054 
0055 //---------------------------------------------------------------------------//
0056 }  // namespace celeritas