Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-11-08 10:11:15

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/ext/detail/GeantSurfacePhysicsLoader.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include "celeritas/inp/OpticalPhysics.hh"
0010 #include "celeritas/io/ImportOpticalMaterial.hh"
0011 
0012 namespace celeritas
0013 {
0014 namespace detail
0015 {
0016 class GeantSurfacePhysicsHelper;
0017 //---------------------------------------------------------------------------//
0018 /*!
0019  * Populate \c inp::OpticalSurfacePhysics data from Geant4 by looping over
0020  * \c SurfaceIds .
0021  */
0022 class GeantSurfacePhysicsLoader
0023 {
0024   public:
0025     //! Construct with \c SurfacePhysics input
0026     GeantSurfacePhysicsLoader(inp::OpticalSurfacePhysics& surface_phys,
0027                               std::vector<ImportOpticalMaterial>& materials);
0028 
0029     //! Populate surface physics data
0030     void operator()(SurfaceId sid);
0031 
0032   private:
0033     //// DATA ////
0034     inp::OpticalSurfacePhysics& models_;  // Populated by operator()
0035     std::vector<ImportOpticalMaterial>& materials_;  // Populated by operator()
0036 
0037     PhysSurfaceId current_surface_{0};
0038 
0039     //// HELPER FUNCTIONS ////
0040 
0041     // Insert a value for the current surface into a model map in place
0042     template<class T>
0043     void emplace(std::map<PhysSurfaceId, T>& m, T&& value);
0044 
0045     // Check that unimplemented properties are not present
0046     void check_unimplemented_properties(
0047         GeantSurfacePhysicsHelper const& helper) const;
0048 
0049     // Insert GLISUR model surface
0050     void insert_glisur(GeantSurfacePhysicsHelper const& helper);
0051 
0052     // Insert Unified model surface
0053     void insert_unified(GeantSurfacePhysicsHelper const& helper);
0054 
0055     // Insert grid or analytic reflectivity into models_
0056     void insert_reflectivity(GeantSurfacePhysicsHelper const& helper);
0057 
0058     // Insert reflection form for di/di or di/met
0059     void insert_interaction(GeantSurfacePhysicsHelper const& helper,
0060                             inp::ReflectionForm&& rf);
0061 
0062     // Insert gap material and surface for back-painted surfaces
0063     void insert_gap_material(GeantSurfacePhysicsHelper const& helper);
0064 
0065     // Insert painted surface (reflection only)
0066     void insert_painted_surface(optical::ReflectionMode mode);
0067 };
0068 
0069 //---------------------------------------------------------------------------//
0070 }  // namespace detail
0071 }  // namespace celeritas