Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-10 09:05:46

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/process/EPlusAnnihilationProcess.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include <memory>
0010 
0011 #include "celeritas/Types.hh"
0012 #include "celeritas/phys/ImportedProcessAdapter.hh"
0013 #include "celeritas/phys/ParticleParams.hh"
0014 #include "celeritas/phys/Process.hh"
0015 
0016 namespace celeritas
0017 {
0018 //---------------------------------------------------------------------------//
0019 /*!
0020  * Annihiliation process for positrons.
0021  */
0022 class EPlusAnnihilationProcess final : public Process
0023 {
0024   public:
0025     //!@{
0026     //! \name Type aliases
0027     using SPConstParticles = std::shared_ptr<ParticleParams const>;
0028     using SPConstImported = std::shared_ptr<ImportedProcesses const>;
0029     //!@}
0030 
0031   public:
0032     // Construct from particle data
0033     explicit EPlusAnnihilationProcess(SPConstParticles particles,
0034                                       SPConstImported process_data);
0035 
0036     // Construct the models associated with this process
0037     VecModel build_models(ActionIdIter start_id) const final;
0038 
0039     // Get the interaction cross sections for the given energy range
0040     XsGrid macro_xs(Applicability range) const final;
0041 
0042     // Get the energy loss for the given energy range
0043     EnergyLossGrid energy_loss(Applicability range) const final;
0044 
0045     //! Whether the integral method can be used to sample interaction length
0046     bool supports_integral_xs() const final { return true; }
0047 
0048     //! Whether the process applies when the particle is stopped
0049     bool applies_at_rest() const final { return applies_at_rest_; }
0050 
0051     // Name of the process
0052     std::string_view label() const final;
0053 
0054   private:
0055     SPConstParticles particles_;
0056     ParticleId positron_id_;
0057     bool applies_at_rest_;
0058 };
0059 
0060 //---------------------------------------------------------------------------//
0061 }  // namespace celeritas