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/MuPairProductionModel.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include <functional>
0010 #include <memory>
0011 
0012 #include "corecel/data/CollectionMirror.hh"
0013 #include "celeritas/Quantities.hh"
0014 #include "celeritas/em/data/MuPairProductionData.hh"
0015 #include "celeritas/io/ImportMuPairProductionTable.hh"
0016 #include "celeritas/phys/ImportedModelAdapter.hh"
0017 #include "celeritas/phys/ImportedProcessAdapter.hh"
0018 #include "celeritas/phys/Model.hh"
0019 
0020 namespace celeritas
0021 {
0022 class ParticleParams;
0023 
0024 //---------------------------------------------------------------------------//
0025 /*!
0026  * Set up and launch the muon pair production model.
0027  */
0028 class MuPairProductionModel final : public Model, public StaticConcreteAction
0029 {
0030   public:
0031     //!@{
0032     //! \name Type aliases
0033     using HostRef = HostCRef<MuPairProductionData>;
0034     using DeviceRef = DeviceCRef<MuPairProductionData>;
0035     using SPConstImported = std::shared_ptr<ImportedProcesses const>;
0036     //!@}
0037 
0038   public:
0039     // Construct from model ID and other necessary data
0040     MuPairProductionModel(ActionId,
0041                           ParticleParams const&,
0042                           SPConstImported,
0043                           ImportMuPairProductionTable const&);
0044 
0045     // Particle types and energy ranges that this model applies to
0046     SetApplicability applicability() const final;
0047 
0048     // Get the microscopic cross sections for the given particle and material
0049     MicroXsBuilders micro_xs(Applicability) const final;
0050 
0051     // Apply the interaction kernel on device
0052     void step(CoreParams const&, CoreStateHost&) const final;
0053 
0054     // Apply the interaction kernel
0055     void step(CoreParams const&, CoreStateDevice&) const final;
0056 
0057     //!@{
0058     //! Access model data
0059     HostRef const& host_ref() const { return data_.host_ref(); }
0060     DeviceRef const& device_ref() const { return data_.device_ref(); }
0061     //!@}
0062 
0063   private:
0064     CollectionMirror<MuPairProductionData> data_;
0065     ImportedModelAdapter imported_;
0066 
0067     using HostTable = HostVal<MuPairProductionTableData>;
0068     void build_table(ImportMuPairProductionTable const&, HostTable*) const;
0069 };
0070 
0071 //---------------------------------------------------------------------------//
0072 }  // namespace celeritas