File indexing completed on 2025-02-22 10:31:27
0001
0002
0003
0004
0005
0006
0007
0008 #pragma once
0009
0010 #include <memory>
0011
0012 #include "corecel/data/AuxInterface.hh"
0013 #include "celeritas/Types.hh"
0014
0015 #include "OffloadData.hh"
0016
0017 namespace celeritas
0018 {
0019
0020 class ActionRegistry;
0021 class CoreParams;
0022
0023 namespace optical
0024 {
0025 class CerenkovParams;
0026 class MaterialParams;
0027 class ScintillationParams;
0028 }
0029
0030 namespace detail
0031 {
0032 class CerenkovOffloadAction;
0033 class CerenkovGeneratorAction;
0034 class OffloadGatherAction;
0035 class OpticalLaunchAction;
0036 class OffloadParams;
0037 class ScintOffloadAction;
0038 class ScintGeneratorAction;
0039 }
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060 class OpticalCollector
0061 {
0062 public:
0063
0064
0065 using SPConstCerenkov = std::shared_ptr<optical::CerenkovParams const>;
0066 using SPConstMaterial = std::shared_ptr<optical::MaterialParams const>;
0067 using SPConstScintillation
0068 = std::shared_ptr<optical::ScintillationParams const>;
0069
0070
0071 struct Input
0072 {
0073
0074 SPConstMaterial material;
0075 SPConstCerenkov cerenkov;
0076 SPConstScintillation scintillation;
0077
0078
0079 size_type buffer_capacity{};
0080
0081
0082 size_type primary_capacity{};
0083
0084
0085 size_type auto_flush{};
0086
0087
0088 explicit operator bool() const
0089 {
0090 return material && (scintillation || cerenkov)
0091 && buffer_capacity > 0 && primary_capacity > 0
0092 && auto_flush > 0;
0093 }
0094 };
0095
0096 public:
0097
0098 OpticalCollector(CoreParams const&, Input&&);
0099
0100
0101 AuxId offload_aux_id() const;
0102
0103
0104 AuxId optical_aux_id() const;
0105
0106 private:
0107
0108
0109 using SPOffloadParams = std::shared_ptr<detail::OffloadParams>;
0110 using SPCerenkovAction = std::shared_ptr<detail::CerenkovOffloadAction>;
0111 using SPScintAction = std::shared_ptr<detail::ScintOffloadAction>;
0112 using SPGatherAction = std::shared_ptr<detail::OffloadGatherAction>;
0113 using SPCerenkovGenAction
0114 = std::shared_ptr<detail::CerenkovGeneratorAction>;
0115 using SPScintGenAction = std::shared_ptr<detail::ScintGeneratorAction>;
0116 using SPLaunchAction = std::shared_ptr<detail::OpticalLaunchAction>;
0117
0118
0119
0120 SPOffloadParams offload_params_;
0121
0122 SPGatherAction gather_action_;
0123 SPCerenkovAction cerenkov_action_;
0124 SPScintAction scint_action_;
0125 SPCerenkovGenAction cerenkov_gen_action_;
0126 SPScintGenAction scint_gen_action_;
0127 SPLaunchAction launch_action_;
0128
0129
0130 };
0131
0132
0133 }