Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 08:53:35

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/model/RelativisticBremModel.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include <memory>
0010 
0011 #include "corecel/data/CollectionMirror.hh"
0012 #include "celeritas/em/data/RelativisticBremData.hh"
0013 #include "celeritas/mat/ElementView.hh"
0014 #include "celeritas/phys/AtomicNumber.hh"
0015 #include "celeritas/phys/ImportedModelAdapter.hh"
0016 #include "celeritas/phys/ImportedProcessAdapter.hh"
0017 #include "celeritas/phys/Model.hh"
0018 
0019 namespace celeritas
0020 {
0021 class MaterialParams;
0022 class ParticleParams;
0023 
0024 //---------------------------------------------------------------------------//
0025 /*!
0026  * Set up and launch the relativistic Bremsstrahlung model for high-energy
0027  * electrons and positrons with the Landau-Pomeranchuk-Migdal (LPM) effect
0028  */
0029 class RelativisticBremModel final : public Model, public StaticConcreteAction
0030 {
0031   public:
0032     //@{
0033     //! Type aliases
0034     using HostRef = HostCRef<RelativisticBremData>;
0035     using DeviceRef = DeviceCRef<RelativisticBremData>;
0036     using SPConstImported = std::shared_ptr<ImportedProcesses const>;
0037     //@}
0038 
0039   public:
0040     // Construct from model ID and other necessary data
0041     RelativisticBremModel(ActionId id,
0042                           ParticleParams const& particles,
0043                           MaterialParams const& materials,
0044                           SPConstImported data,
0045                           bool enable_lpm);
0046 
0047     // Particle types and energy ranges that this model applies to
0048     SetApplicability applicability() const final;
0049 
0050     // Get the microscopic cross sections for the given particle and material
0051     MicroXsBuilders micro_xs(Applicability) const final;
0052 
0053     // Apply the interaction kernel to host data
0054     void step(CoreParams const&, CoreStateHost&) const final;
0055 
0056     // Apply the interaction kernel to device data
0057     void step(CoreParams const&, CoreStateDevice&) const final;
0058 
0059     //! Access data on the host
0060     HostRef const& host_ref() const { return data_.host_ref(); }
0061 
0062     //! Access data on the device
0063     DeviceRef const& device_ref() const { return data_.device_ref(); }
0064 
0065   private:
0066     //// DATA ////
0067 
0068     // Host/device storage and reference
0069     CollectionMirror<RelativisticBremData> data_;
0070 
0071     ImportedModelAdapter imported_;
0072 
0073     //// TYPES ////
0074 
0075     using HostValue = HostVal<RelativisticBremData>;
0076 
0077     using FormFactor = RelBremFormFactor;
0078     using ElementData = RelBremElementData;
0079 
0080     //// HELPER FUNCTIONS ////
0081 
0082     void build_data(HostValue* host_data,
0083                     MaterialParams const& materials,
0084                     real_type particle_mass);
0085 
0086     static FormFactor const& get_form_factor(AtomicNumber index);
0087     ElementData
0088     compute_element_data(ElementView const& elem, real_type particle_mass);
0089 };
0090 
0091 //---------------------------------------------------------------------------//
0092 }  // namespace celeritas