File indexing completed on 2025-09-18 09:08:58
0001
0002
0003
0004
0005
0006
0007 #pragma once
0008
0009 #include "corecel/Assert.hh"
0010 #include "corecel/Macros.hh"
0011 #include "corecel/random/engine/RngEngine.hh"
0012 #include "celeritas/em/data/CoulombScatteringData.hh"
0013 #include "celeritas/em/data/WentzelOKVIData.hh"
0014 #include "celeritas/em/interactor/CoulombScatteringInteractor.hh"
0015 #include "celeritas/global/CoreTrackView.hh"
0016 #include "celeritas/mat/MaterialTrackView.hh"
0017 #include "celeritas/phys/CutoffView.hh"
0018 #include "celeritas/phys/Interaction.hh"
0019 #include "celeritas/phys/PhysicsStepView.hh"
0020 #include "celeritas/random/IsotopeSelector.hh"
0021
0022 namespace celeritas
0023 {
0024
0025 struct CoulombScatteringExecutor
0026 {
0027 inline CELER_FUNCTION Interaction
0028 operator()(celeritas::CoreTrackView const& track);
0029
0030 CoulombScatteringData params;
0031 NativeCRef<WentzelOKVIData> wentzel;
0032 };
0033
0034
0035
0036
0037
0038 CELER_FUNCTION Interaction
0039 CoulombScatteringExecutor::operator()(CoreTrackView const& track)
0040 {
0041
0042 auto particle = track.particle();
0043 auto const& dir = track.geometry().dir();
0044
0045
0046 auto material = track.material().material_record();
0047 auto elcomp_id = track.physics_step().element();
0048 auto element_id = material.element_id(elcomp_id);
0049 auto cutoffs = track.cutoff();
0050
0051 auto rng = track.rng();
0052
0053
0054 ElementView element = material.element_record(elcomp_id);
0055 IsotopeSelector iso_select(element);
0056 IsotopeView target = element.isotope_record(iso_select(rng));
0057
0058
0059 CoulombScatteringInteractor interact(
0060 params, wentzel, particle, dir, material, target, element_id, cutoffs);
0061
0062
0063 return interact(rng);
0064 }
0065
0066
0067 }