Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-19 08:49:41

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/alongstep/AlongStepCartMapFieldMscAction.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include <memory>
0010 #include <string>
0011 
0012 #include "corecel/Assert.hh"
0013 #include "corecel/Macros.hh"
0014 #include "celeritas/Types.hh"
0015 #include "celeritas/em/data/FluctuationData.hh"
0016 #include "celeritas/em/data/UrbanMscData.hh"
0017 #include "celeritas/field/CartMapFieldParams.hh"
0018 #include "celeritas/global/ActionInterface.hh"
0019 
0020 namespace celeritas
0021 {
0022 class UrbanMscParams;
0023 class FluctuationParams;
0024 class PhysicsParams;
0025 class MaterialParams;
0026 class ParticleParams;
0027 struct CartMapFieldInput;
0028 
0029 //---------------------------------------------------------------------------//
0030 /*!
0031  * Along-step kernel with MSC, energy loss fluctuations, and a CartMapField.
0032  */
0033 class AlongStepCartMapFieldMscAction final : public CoreStepActionInterface
0034 {
0035   public:
0036     //!@{
0037     //! \name Type aliases
0038     using SPConstFluctuations = std::shared_ptr<FluctuationParams const>;
0039     using SPConstMsc = std::shared_ptr<UrbanMscParams const>;
0040     using SPConstFieldParams = std::shared_ptr<CartMapFieldParams const>;
0041     //!@}
0042 
0043   public:
0044     static std::shared_ptr<AlongStepCartMapFieldMscAction>
0045     from_params(ActionId id,
0046                 MaterialParams const& materials,
0047                 ParticleParams const& particles,
0048                 CartMapFieldInput const& field_input,
0049                 SPConstMsc const& msc,
0050                 bool eloss_fluctuation);
0051 
0052     // Construct with next action ID and physics properties
0053     AlongStepCartMapFieldMscAction(ActionId id,
0054                                    CartMapFieldInput const& input,
0055                                    SPConstFluctuations fluct,
0056                                    SPConstMsc msc);
0057 
0058     // Launch kernel with host data
0059     void step(CoreParams const&, CoreStateHost&) const final;
0060 
0061     // Launch kernel with device data
0062     void step(CoreParams const&, CoreStateDevice&) const final;
0063 
0064     //! ID of the model
0065     ActionId action_id() const final { return id_; }
0066 
0067     //! Short name for the interaction kernel
0068     std::string_view label() const final { return "along-step-cartmap-msc"; }
0069 
0070     //! Short description of the action
0071     std::string_view description() const final
0072     {
0073         return "apply along-step in a X-Y-Z map field with Urban MSC";
0074     }
0075 
0076     //! Dependency ordering of the action
0077     StepActionOrder order() const final { return StepActionOrder::along; }
0078 
0079     //// ACCESSORS ////
0080 
0081     //! Whether energy flucutation is in use
0082     bool has_fluct() const { return static_cast<bool>(fluct_); }
0083 
0084     //! Whether MSC is in use
0085     bool has_msc() const { return static_cast<bool>(msc_); }
0086 
0087     //! Field map data
0088     SPConstFieldParams const& field() const { return field_; }
0089 
0090   private:
0091     ActionId id_;
0092     SPConstFieldParams field_;
0093     SPConstFluctuations fluct_;
0094     SPConstMsc msc_;
0095 };
0096 
0097 //---------------------------------------------------------------------------//
0098 }  // namespace celeritas