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