Back to home page

EIC code displayed by LXR

 
 

    


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

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