Back to home page

EIC code displayed by LXR

 
 

    


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

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