Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-18 09:08:57

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/distribution/EnergyLossDeltaDistribution.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include "celeritas/Quantities.hh"
0010 
0011 #include "EnergyLossHelper.hh"
0012 
0013 namespace celeritas
0014 {
0015 //---------------------------------------------------------------------------//
0016 /*!
0017  * Passthrough model for "no distribution" energy loss.
0018  *
0019  * The distribution is a Delta function so that the "sampled" value is always
0020  * the mean energy.
0021  */
0022 class EnergyLossDeltaDistribution
0023 {
0024   public:
0025     //!@{
0026     //! \name Type aliases
0027     using Energy = units::MevEnergy;
0028     //!@}
0029 
0030   public:
0031     //! Construct from helper-calculated mean
0032     explicit CELER_FUNCTION
0033     EnergyLossDeltaDistribution(EnergyLossHelper const& helper)
0034         : mean_energy_(helper.mean_loss())
0035     {
0036     }
0037 
0038     //! Result is always the mean energy
0039     template<class Generator>
0040     CELER_FUNCTION Energy operator()(Generator&) const
0041     {
0042         return mean_energy_;
0043     }
0044 
0045   private:
0046     Energy mean_energy_;
0047 };
0048 
0049 //---------------------------------------------------------------------------//
0050 }  // namespace celeritas