Back to home page

EIC code displayed by LXR

 
 

    


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

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/interactor/AbsorptionInteractor.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include "corecel/Macros.hh"
0010 #include "celeritas/optical/Interaction.hh"
0011 
0012 namespace celeritas
0013 {
0014 namespace optical
0015 {
0016 //---------------------------------------------------------------------------//
0017 /*!
0018  * Sample optical absorption interaction.
0019  *
0020  * Absorption rate is governed by sampling its mean free path in the action
0021  * loop. The interactor simply returns an interaction saying the optical
0022  * photon has been absorbed.
0023  */
0024 class AbsorptionInteractor
0025 {
0026   public:
0027     // Sample an interaction (no RNG needed)
0028     inline CELER_FUNCTION Interaction operator()() const;
0029 };
0030 
0031 //---------------------------------------------------------------------------//
0032 // INLINE DEFINITIONS
0033 //---------------------------------------------------------------------------//
0034 /*!
0035  * Sample an absorption interaction.
0036  */
0037 CELER_FUNCTION Interaction AbsorptionInteractor::operator()() const
0038 {
0039     return Interaction::from_absorption();
0040 }
0041 
0042 //---------------------------------------------------------------------------//
0043 }  // namespace optical
0044 }  // namespace celeritas