File indexing completed on 2025-02-22 10:31:26
0001
0002
0003
0004
0005
0006
0007
0008 #pragma once
0009
0010 #include <memory>
0011
0012 #include "corecel/Macros.hh"
0013 #include "corecel/data/AuxInterface.hh"
0014 #include "corecel/data/Collection.hh"
0015 #include "celeritas/global/ActionInterface.hh"
0016 #include "celeritas/optical/GeneratorDistributionData.hh"
0017
0018 namespace celeritas
0019 {
0020 namespace optical
0021 {
0022 class CerenkovParams;
0023 class MaterialParams;
0024 }
0025
0026 namespace detail
0027 {
0028 class OffloadParams;
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038 class CerenkovGeneratorAction final : public CoreStepActionInterface
0039 {
0040 public:
0041
0042
0043 using SPConstCerenkov
0044 = std::shared_ptr<celeritas::optical::CerenkovParams const>;
0045 using SPConstMaterial
0046 = std::shared_ptr<celeritas::optical::MaterialParams const>;
0047 using SPOffloadParams = std::shared_ptr<OffloadParams>;
0048
0049
0050 public:
0051
0052 CerenkovGeneratorAction(ActionId id,
0053 AuxId offload_id,
0054 AuxId optical_id,
0055 SPConstMaterial material,
0056 SPConstCerenkov cerenkov,
0057 size_type auto_flush);
0058
0059
0060 void step(CoreParams const&, CoreStateHost&) const final;
0061
0062
0063 void step(CoreParams const&, CoreStateDevice&) const final;
0064
0065
0066 ActionId action_id() const final { return id_; }
0067
0068
0069 std::string_view label() const final
0070 {
0071 return "generate-cerenkov-photons";
0072 }
0073
0074
0075 std::string_view description() const final;
0076
0077
0078 StepActionOrder order() const final { return StepActionOrder::user_post; }
0079
0080 private:
0081
0082
0083 ActionId id_;
0084 AuxId offload_id_;
0085 AuxId optical_id_;
0086 SPConstMaterial material_;
0087 SPConstCerenkov cerenkov_;
0088 size_type auto_flush_;
0089
0090
0091
0092 template<MemSpace M>
0093 void step_impl(CoreParams const&, CoreState<M>&) const;
0094
0095 void generate(CoreParams const&, CoreStateHost&) const;
0096 void generate(CoreParams const&, CoreStateDevice&) const;
0097 };
0098
0099
0100 }
0101 }