Back to home page

EIC code displayed by LXR

 
 

    


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

0001 //----------------------------------*-C++-*----------------------------------//
0002 // Copyright 2020-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/model/SeltzerBergerModel.hh
0007 //---------------------------------------------------------------------------//
0008 #pragma once
0009 
0010 #include <functional>
0011 #include <memory>
0012 
0013 #include "corecel/data/CollectionMirror.hh"
0014 #include "celeritas/Quantities.hh"
0015 #include "celeritas/em/data/SeltzerBergerData.hh"
0016 #include "celeritas/io/ImportSBTable.hh"
0017 #include "celeritas/phys/AtomicNumber.hh"
0018 #include "celeritas/phys/ImportedModelAdapter.hh"
0019 #include "celeritas/phys/ImportedProcessAdapter.hh"
0020 #include "celeritas/phys/Model.hh"
0021 
0022 namespace celeritas
0023 {
0024 class MaterialParams;
0025 class ParticleParams;
0026 
0027 //---------------------------------------------------------------------------//
0028 /*!
0029  * Manage the Seltzer-Berger model for Bremsstrahlung.
0030  *
0031  * The total scaled bremsstrahlung differential cross section for an element Z
0032  * is defined as
0033  * \f[
0034  *   \chi(Z,E,\kappa) = \frac{\beta^2}{Z^2} k \difd{\sigma}{k},
0035  * \f]
0036  * where \f$ \kappa = k / E \f$ is the ratio of the emitted photon energy to
0037  * the incident charged particle energy, \f$ \beta \f$ is the ratio of the
0038  * charged particle velocity to the speed of light, and
0039  * \f$ \difd{\sigma}{k} \f$ is the bremsstrahlung differential cross
0040  * section.
0041  *
0042  * Seltzer and Berger have tabulated the scaled DCS (in mb) for elements Z = 1
0043  * - 100 and for incident charged particle energies from 1 keV to 10 GeV
0044  * (reported in MeV) in Seltzer S.M. and M.J. Berger (1986), "Bremsstrahlung
0045  * energy spectra from electrons with kinetic energy 1 keV–10 GeV incident on
0046  * screened nuclei and orbital electrons of neutral atoms with Z = 1–100", At.
0047  * Data Nucl. Data Tables 35, 345–418.
0048  */
0049 class SeltzerBergerModel final : public Model, public StaticConcreteAction
0050 {
0051   public:
0052     //!@{
0053     using Mass = units::MevMass;
0054     using ReadData = std::function<ImportSBTable(AtomicNumber)>;
0055     using HostRef = HostCRef<SeltzerBergerData>;
0056     using DeviceRef = DeviceCRef<SeltzerBergerData>;
0057     using SPConstImported = std::shared_ptr<ImportedProcesses const>;
0058     //!@}
0059 
0060   public:
0061     // Construct from model ID and other necessary data
0062     SeltzerBergerModel(ActionId id,
0063                        ParticleParams const& particles,
0064                        MaterialParams const& materials,
0065                        SPConstImported data,
0066                        ReadData load_sb_table);
0067 
0068     // Particle types and energy ranges that this model applies to
0069     SetApplicability applicability() const final;
0070 
0071     // Get the microscopic cross sections for the given particle and material
0072     MicroXsBuilders micro_xs(Applicability) const final;
0073 
0074     // Apply the interaction kernel on device
0075     void step(CoreParams const&, CoreStateHost&) const final;
0076 
0077     // Apply the interaction kernel
0078     void step(CoreParams const&, CoreStateDevice&) const final;
0079 
0080     //! Access SB data on the host
0081     HostRef const& host_ref() const { return data_.host_ref(); }
0082 
0083     //! Access SB data on the device
0084     DeviceRef const& device_ref() const { return data_.device_ref(); }
0085 
0086   private:
0087     // Host/device storage and reference
0088     CollectionMirror<SeltzerBergerData> data_;
0089 
0090     ImportedModelAdapter imported_;
0091 
0092     using HostXsTables = HostVal<SeltzerBergerTableData>;
0093     void append_table(ImportSBTable const& table, HostXsTables* tables) const;
0094 };
0095 
0096 //---------------------------------------------------------------------------//
0097 }  // namespace celeritas