File indexing completed on 2025-09-17 08:53:48
0001
0002
0003
0004
0005
0006
0007 #pragma once
0008
0009 #include "corecel/data/AuxInterface.hh"
0010 #include "corecel/data/CollectionMirror.hh"
0011 #include "corecel/data/ParamsDataInterface.hh"
0012 #include "celeritas/geo/GeoFwd.hh"
0013
0014 #include "../StepData.hh"
0015
0016 namespace celeritas
0017 {
0018 class AuxStateVec;
0019 class StepInterface;
0020
0021 namespace detail
0022 {
0023
0024
0025
0026
0027
0028
0029
0030 class StepParams : public ParamsDataInterface<StepParamsData>,
0031 public AuxParamsInterface
0032 {
0033 public:
0034
0035
0036 using SPStepInterface = std::shared_ptr<StepInterface>;
0037 using VecInterface = std::vector<SPStepInterface>;
0038
0039
0040 public:
0041
0042 StepParams(AuxId aux_id,
0043 GeoParams const& geo,
0044 VecInterface const& interfaces);
0045
0046
0047
0048
0049
0050 std::string_view label() const final { return "detector-step"; }
0051
0052 AuxId aux_id() const final { return aux_id_; }
0053
0054 UPState create_state(MemSpace, StreamId, size_type) const final;
0055
0056
0057
0058
0059
0060
0061 HostRef const& host_ref() const final { return mirror_.host_ref(); }
0062
0063 DeviceRef const& device_ref() const final { return mirror_.device_ref(); }
0064
0065
0066
0067 template<MemSpace M>
0068 StepStateData<Ownership::reference, M>& state_ref(AuxStateVec&) const;
0069
0070
0071 inline StepSelection const& selection() const;
0072
0073
0074 inline bool has_detectors() const;
0075
0076 private:
0077 AuxId aux_id_;
0078 CollectionMirror<StepParamsData> mirror_;
0079 };
0080
0081
0082
0083
0084
0085 StepSelection const& StepParams::selection() const
0086 {
0087 return this->host_ref().selection;
0088 }
0089
0090
0091
0092
0093 bool StepParams::has_detectors() const
0094 {
0095 return !this->host_ref().detector.empty();
0096 }
0097
0098
0099 }
0100 }