Back to home page

EIC code displayed by LXR

 
 

    


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

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