Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 08:53:33

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