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