Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-16 08:52:17

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/BetheHeitlerExecutor.hh
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/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 
0021 namespace celeritas
0022 {
0023 //---------------------------------------------------------------------------//
0024 struct BetheHeitlerExecutor
0025 {
0026     inline CELER_FUNCTION Interaction
0027     operator()(celeritas::CoreTrackView const& track);
0028 
0029     BetheHeitlerData params;
0030 };
0031 
0032 //---------------------------------------------------------------------------//
0033 /*!
0034  * Sample a Bethe-Heitler pair production from the current track.
0035  */
0036 CELER_FUNCTION Interaction
0037 BetheHeitlerExecutor::operator()(CoreTrackView const& track)
0038 {
0039     auto material = track.material().material_record();
0040     auto particle = track.particle();
0041     auto elcomp_id = track.physics_step().element();
0042     CELER_ASSERT(elcomp_id);
0043     auto element = material.element_record(elcomp_id);
0044     auto allocate_secondaries = track.physics_step().make_secondary_allocator();
0045     auto const& dir = track.geometry().dir();
0046 
0047     BetheHeitlerInteractor interact(
0048         params, particle, dir, allocate_secondaries, material, element);
0049 
0050     auto rng = track.rng();
0051     return interact(rng);
0052 }
0053 
0054 //---------------------------------------------------------------------------//
0055 }  // namespace celeritas