Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-22 10:31:16

0001 //----------------------------------*-C++-*----------------------------------//
0002 // Copyright 2021-2024 UT-Battelle, LLC, and other Celeritas developers.
0003 // See the top-level COPYRIGHT file for details.
0004 // SPDX-License-Identifier: (Apache-2.0 OR MIT)
0005 //---------------------------------------------------------------------------//
0006 //! \file celeritas/em/executor/KleinNishinaExecutor.hh
0007 //---------------------------------------------------------------------------//
0008 #pragma once
0009 
0010 #include "celeritas/em/data/KleinNishinaData.hh"
0011 #include "celeritas/em/interactor/KleinNishinaInteractor.hh"
0012 #include "celeritas/global/CoreTrackView.hh"
0013 #include "celeritas/phys/Interaction.hh"
0014 
0015 namespace celeritas
0016 {
0017 //---------------------------------------------------------------------------//
0018 struct KleinNishinaExecutor
0019 {
0020     inline CELER_FUNCTION Interaction
0021     operator()(celeritas::CoreTrackView const& track);
0022 
0023     KleinNishinaData params;
0024 };
0025 
0026 //---------------------------------------------------------------------------//
0027 /*!
0028  * Apply the KleinNishinaInteractor to the current track.
0029  */
0030 CELER_FUNCTION Interaction
0031 KleinNishinaExecutor::operator()(CoreTrackView const& track)
0032 {
0033     auto allocate_secondaries
0034         = track.make_physics_step_view().make_secondary_allocator();
0035     auto particle = track.make_particle_view();
0036     auto const& dir = track.make_geo_view().dir();
0037 
0038     KleinNishinaInteractor interact(
0039         params, particle, dir, allocate_secondaries);
0040     auto rng = track.make_rng_engine();
0041     return interact(rng);
0042 }
0043 
0044 //---------------------------------------------------------------------------//
0045 }  // namespace celeritas