Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-19 08:49:41

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/alongstep/AlongStep.hh
0006 //! \brief Along-step function and helper classes
0007 //---------------------------------------------------------------------------//
0008 #pragma once
0009 
0010 #include "celeritas/global/CoreTrackView.hh"
0011 
0012 #include "detail/ElossApplier.hh"  // IWYU pragma: associated
0013 #include "detail/MscApplier.hh"  // IWYU pragma: associated
0014 #include "detail/MscStepLimitApplier.hh"  // IWYU pragma: associated
0015 #include "detail/PropagationApplier.hh"  // IWYU pragma: associated
0016 #include "detail/TimeUpdater.hh"  // IWYU pragma: associated
0017 #include "detail/TrackUpdater.hh"  // IWYU pragma: associated
0018 
0019 namespace celeritas
0020 {
0021 //---------------------------------------------------------------------------//
0022 /*!
0023  * Perform the along-step action using helper functions.
0024  *
0025  * \tparam MH MSC helper, e.g. \c detail::NoMsc
0026  * \tparam MP Propagator factory, e.g. \c detail::LinearPropagatorFactory
0027  * \tparam EH Energy loss helper, e.g. \c detail::TrackNoEloss
0028  */
0029 template<class MH, class MP, class EH>
0030 struct AlongStep
0031 {
0032     inline CELER_FUNCTION void operator()(CoreTrackView& track);
0033 
0034     MH msc;
0035     MP make_propagator;
0036     EH eloss;
0037 };
0038 
0039 //---------------------------------------------------------------------------//
0040 // DEDUCTION GUIDES
0041 //---------------------------------------------------------------------------//
0042 template<class MH, class MP, class EH>
0043 CELER_FUNCTION AlongStep(MH&&, MP&&, EH&&) -> AlongStep<MH, MP, EH>;
0044 
0045 //---------------------------------------------------------------------------//
0046 // INLINE DEFINITIONS
0047 //---------------------------------------------------------------------------//
0048 template<class MH, class MP, class EH>
0049 CELER_FUNCTION void AlongStep<MH, MP, EH>::operator()(CoreTrackView& track)
0050 {
0051     detail::MscStepLimitApplier{msc}(track);
0052     detail::PropagationApplier{make_propagator}(track);
0053     detail::MscApplier{msc}(track);
0054     detail::TimeUpdater{}(track);
0055     detail::ElossApplier{eloss}(track);
0056     detail::TrackUpdater{}(track);
0057 }
0058 
0059 //---------------------------------------------------------------------------//
0060 }  // namespace celeritas