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/model/RayleighExecutor.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include "corecel/Macros.hh"
0010 #include "celeritas/geo/GeoFwd.hh"
0011 #include "celeritas/optical/CoreTrackView.hh"
0012 #include "celeritas/optical/Interaction.hh"
0013 #include "celeritas/optical/ParticleTrackView.hh"
0014 #include "celeritas/optical/interactor/RayleighInteractor.hh"
0015 
0016 namespace celeritas
0017 {
0018 namespace optical
0019 {
0020 //---------------------------------------------------------------------------//
0021 struct RayleighExecutor
0022 {
0023     inline CELER_FUNCTION Interaction operator()(CoreTrackView const&);
0024 };
0025 
0026 //---------------------------------------------------------------------------//
0027 /*!
0028  * Sample optical Rayleigh interaction from the current track.
0029  */
0030 CELER_FUNCTION Interaction
0031 RayleighExecutor::operator()(CoreTrackView const& track)
0032 {
0033     auto particle = track.particle();
0034     auto const& direction = track.geometry().dir();
0035     auto rng = track.rng();
0036 
0037     RayleighInteractor interact{particle, direction};
0038 
0039     return interact(rng);
0040 }
0041 
0042 //---------------------------------------------------------------------------//
0043 }  // namespace optical
0044 }  // namespace celeritas