Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-11-19 10:36:42

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/GammaNuclearModel.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include <functional>
0010 #include <memory>
0011 
0012 #include "corecel/data/ParamsDataStore.hh"
0013 #include "corecel/inp/Grid.hh"
0014 #include "celeritas/Quantities.hh"
0015 #include "celeritas/em/data/GammaNuclearData.hh"
0016 #include "celeritas/mat/MaterialView.hh"
0017 #include "celeritas/phys/AtomicNumber.hh"
0018 #include "celeritas/phys/Model.hh"
0019 
0020 namespace celeritas
0021 {
0022 class MaterialParams;
0023 class ParticleParams;
0024 
0025 class EmExtraPhysicsHelper;
0026 
0027 //---------------------------------------------------------------------------//
0028 /*!
0029  * Set up and launch the gamma-nuclear model interaction.
0030  *
0031  * The class also builds element cross-section tables using G4PARTICLEXS/gamma
0032  * (IAEA) data at low energies and CHIPS gamma-nuclear cross sections using
0033  * G4GammaNuclearXS above the IAEA upper energy limit (~130 MeV). The CHIPS
0034  * cross sections are based on the parameterization developed by M. V. Kossov
0035  * (CERN/ITEP Moscow) for the high energy region (106 MeV < E < 50 GeV) and on
0036  * a Reggeon-based parameterization for the ultra high energy region
0037  * (E > 50 GeV), as described in
0038  * \citet{degtyarenko-chiralinvariant-2000,
0039  * https://doi.org/10.1007/s100500070026}.
0040  * G4GammaNuclearXS uses CHIPS (G4PhotoNuclearCrossSection) above 150 MeV and
0041  * performs linear interpolation between the upper limit of the G4PARTICLEXS
0042  * gamma-nuclear (IAEA) data and 150 MeV.
0043  */
0044 class GammaNuclearModel final : public Model, public StaticConcreteAction
0045 {
0046   public:
0047     //!@{
0048     using MevEnergy = units::MevEnergy;
0049     using ReadData = std::function<inp::Grid(AtomicNumber)>;
0050     using HostRef = HostCRef<GammaNuclearData>;
0051     using DeviceRef = DeviceCRef<GammaNuclearData>;
0052     //!@}
0053 
0054   public:
0055     // Construct from model ID and other necessary data
0056     GammaNuclearModel(ActionId id,
0057                       ParticleParams const& particles,
0058                       MaterialParams const& materials,
0059                       ReadData load_data);
0060 
0061     // Particle types and energy ranges that this model applies to
0062     SetApplicability applicability() const final;
0063 
0064     // Get the microscopic cross sections for the given particle and material
0065     XsTable micro_xs(Applicability) const final;
0066 
0067     //! Apply the interaction kernel to host data
0068     void step(CoreParams const&, CoreStateHost&) const final;
0069 
0070     // Apply the interaction kernel to device data
0071     void step(CoreParams const&, CoreStateDevice&) const final;
0072 
0073     //!@{
0074     //! Access model data
0075     HostRef const& host_ref() const { return data_.host_ref(); }
0076     DeviceRef const& device_ref() const { return data_.device_ref(); }
0077     //!@}
0078 
0079   private:
0080     //// DATA ////
0081     std::shared_ptr<EmExtraPhysicsHelper> helper_;
0082 
0083     // Host/device storage and reference
0084     ParamsDataStore<GammaNuclearData> data_;
0085 
0086     //// TYPES ////
0087 
0088     using HostXsData = HostVal<GammaNuclearData>;
0089 
0090     //// HELPER FUNCTIONS ////
0091 
0092     inp::Grid calc_chips_xs(
0093         AtomicNumber atomic_number, double emin, double emax) const;
0094 };
0095 
0096 //---------------------------------------------------------------------------//
0097 }  // namespace celeritas