Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-01-07 10:01: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/WavelengthShiftExecutor.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/SimTrackView.hh"
0015 #include "celeritas/optical/interactor/WavelengthShiftInteractor.hh"
0016 
0017 namespace celeritas
0018 {
0019 namespace optical
0020 {
0021 //---------------------------------------------------------------------------//
0022 struct WavelengthShiftExecutor
0023 {
0024     inline CELER_FUNCTION Interaction operator()(CoreTrackView const&);
0025 
0026     NativeCRef<WavelengthShiftData> data;
0027 };
0028 
0029 //---------------------------------------------------------------------------//
0030 /*!
0031  * Sample optical WLS interaction from the current track.
0032  */
0033 CELER_FUNCTION Interaction
0034 WavelengthShiftExecutor::operator()(CoreTrackView const& track)
0035 {
0036     auto particle = track.particle();
0037     auto sim = track.sim();
0038     auto mat_id = track.material_record().material_id();
0039     auto rng = track.rng();
0040 
0041     WavelengthShiftInteractor interact{
0042         data, particle, sim, track.geometry().pos(), mat_id};
0043 
0044     return interact(rng);
0045 }
0046 
0047 //---------------------------------------------------------------------------//
0048 }  // namespace optical
0049 }  // namespace celeritas