Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-22 10:31:16

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