Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-11-27 10:26:31

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/gen/detail/OffloadPrePostGatherExecutor.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include "corecel/Macros.hh"
0010 #include "corecel/Types.hh"
0011 #include "celeritas/global/CoreTrackView.hh"
0012 
0013 #include "../OffloadData.hh"
0014 
0015 namespace celeritas
0016 {
0017 namespace detail
0018 {
0019 //---------------------------------------------------------------------------//
0020 // LAUNCHER
0021 //---------------------------------------------------------------------------//
0022 /*!
0023  * Gather state data needed to generate optical distributions.
0024  */
0025 struct OffloadPrePostGatherExecutor
0026 {
0027     inline CELER_FUNCTION void operator()(
0028         celeritas::CoreTrackView const& track);
0029 
0030     NativeRef<OffloadPrePostStateData> const state;
0031 };
0032 
0033 //---------------------------------------------------------------------------//
0034 // INLINE DEFINITIONS
0035 //---------------------------------------------------------------------------//
0036 /*!
0037  * Gather post-along-step data needed for scintillation optical distributions.
0038  */
0039 CELER_FUNCTION void OffloadPrePostGatherExecutor::operator()(
0040     CoreTrackView const& track)
0041 {
0042     CELER_EXPECT(state);
0043     CELER_EXPECT(track.track_slot_id() < state.step.size());
0044 
0045     OffloadPrePostStepData& step = state.step[track.track_slot_id()];
0046     step.speed = track.particle().speed();
0047     step.energy_deposition = track.physics_step().energy_deposition();
0048 }
0049 
0050 //---------------------------------------------------------------------------//
0051 }  // namespace detail
0052 }  // namespace celeritas