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/EPlusGGExecutor.hh
0007 //---------------------------------------------------------------------------//
0008 #pragma once
0009 
0010 #include "corecel/Macros.hh"
0011 #include "celeritas/em/data/EPlusGGData.hh"
0012 #include "celeritas/em/interactor/EPlusGGInteractor.hh"
0013 #include "celeritas/global/CoreTrackView.hh"
0014 
0015 namespace celeritas
0016 {
0017 //---------------------------------------------------------------------------//
0018 struct EPlusGGExecutor
0019 {
0020     inline CELER_FUNCTION Interaction
0021     operator()(celeritas::CoreTrackView const& track);
0022 
0023     EPlusGGData params;
0024 };
0025 
0026 //---------------------------------------------------------------------------//
0027 /*!
0028  * Sample a positron annihilation from the current track.
0029  */
0030 CELER_FUNCTION Interaction EPlusGGExecutor::operator()(CoreTrackView const& track)
0031 {
0032     auto allocate_secondaries
0033         = track.make_physics_step_view().make_secondary_allocator();
0034     auto particle = track.make_particle_view();
0035     auto const& dir = track.make_geo_view().dir();
0036 
0037     EPlusGGInteractor interact(params, particle, dir, allocate_secondaries);
0038     auto rng = track.make_rng_engine();
0039     return interact(rng);
0040 }
0041 
0042 //---------------------------------------------------------------------------//
0043 }  // namespace celeritas