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/detail/AlongStepNeutralImpl.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include "corecel/Assert.hh"
0010 #include "corecel/Macros.hh"
0011 #include "corecel/Types.hh"
0012 #include "corecel/math/Quantity.hh"
0013 
0014 #include "../AlongStep.hh"
0015 
0016 namespace celeritas
0017 {
0018 //---------------------------------------------------------------------------//
0019 class CoreTrackView;
0020 
0021 namespace detail
0022 {
0023 //---------------------------------------------------------------------------//
0024 /*!
0025  * Helper class for along-step kernel when no MSC is in use.
0026  */
0027 struct NoMsc
0028 {
0029     //! MSC never applies to the current track
0030     CELER_FUNCTION bool
0031     is_applicable(CoreTrackView const&, real_type step) const
0032     {
0033         CELER_ASSERT(step > 0);
0034         return false;
0035     }
0036 
0037     //! No updates needed to the physical and geometric step lengths
0038     CELER_FUNCTION void limit_step(CoreTrackView const&) const {}
0039 
0040     //! MSC is never applied
0041     CELER_FUNCTION void apply_step(CoreTrackView const&) const {}
0042 };
0043 
0044 //---------------------------------------------------------------------------//
0045 /*!
0046  * Class that returns zero energy loss.
0047  */
0048 struct NoELoss
0049 {
0050     //! This calculator never returns energy loss
0051     CELER_CONSTEXPR_FUNCTION bool is_applicable(CoreTrackView const&)
0052     {
0053         return false;
0054     }
0055 
0056     //! No energy loss
0057     CELER_FUNCTION auto
0058     calc_eloss(CoreTrackView const&, real_type, bool) const -> decltype(auto)
0059     {
0060         return zero_quantity();
0061     }
0062 
0063     //! No slowing down
0064     static CELER_CONSTEXPR_FUNCTION bool imprecise_range() { return false; }
0065 };
0066 
0067 //---------------------------------------------------------------------------//
0068 }  // namespace detail
0069 }  // namespace celeritas