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