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/BetheHeitlerExecutor.hh
0007 //---------------------------------------------------------------------------//
0008 #pragma once
0009 
0010 #include "corecel/Assert.hh"
0011 #include "corecel/Macros.hh"
0012 #include "celeritas/em/data/BetheHeitlerData.hh"
0013 #include "celeritas/em/interactor/BetheHeitlerInteractor.hh"
0014 #include "celeritas/geo/GeoFwd.hh"
0015 #include "celeritas/global/CoreTrackView.hh"
0016 #include "celeritas/mat/MaterialTrackView.hh"
0017 #include "celeritas/mat/MaterialView.hh"
0018 #include "celeritas/phys/Interaction.hh"
0019 #include "celeritas/phys/PhysicsStepView.hh"
0020 #include "celeritas/random/RngEngine.hh"
0021 
0022 namespace celeritas
0023 {
0024 //---------------------------------------------------------------------------//
0025 struct BetheHeitlerExecutor
0026 {
0027     inline CELER_FUNCTION Interaction
0028     operator()(celeritas::CoreTrackView const& track);
0029 
0030     BetheHeitlerData params;
0031 };
0032 
0033 //---------------------------------------------------------------------------//
0034 /*!
0035  * Sample a Bethe-Heitler pair production from the current track.
0036  */
0037 CELER_FUNCTION Interaction
0038 BetheHeitlerExecutor::operator()(CoreTrackView const& track)
0039 {
0040     auto material_track = track.make_material_view();
0041     auto material = material_track.make_material_view();
0042     auto particle = track.make_particle_view();
0043     auto elcomp_id = track.make_physics_step_view().element();
0044     CELER_ASSERT(elcomp_id);
0045     auto element = material.make_element_view(elcomp_id);
0046     auto allocate_secondaries
0047         = track.make_physics_step_view().make_secondary_allocator();
0048     auto const& dir = track.make_geo_view().dir();
0049 
0050     BetheHeitlerInteractor interact(
0051         params, particle, dir, allocate_secondaries, material, element);
0052 
0053     auto rng = track.make_rng_engine();
0054     return interact(rng);
0055 }
0056 
0057 //---------------------------------------------------------------------------//
0058 }  // namespace celeritas