File indexing completed on 2025-01-18 10:05:59
0001
0002
0003
0004
0005
0006
0007
0008 #pragma once
0009
0010 #include <string>
0011 #include <vector>
0012
0013 #include "corecel/Types.hh"
0014 #include "corecel/cont/LabelIdMultiMap.hh"
0015 #include "corecel/data/CollectionMirror.hh"
0016 #include "corecel/data/ParamsDataInterface.hh"
0017 #include "corecel/io/Label.hh"
0018 #include "geocel/BoundingBox.hh"
0019 #include "geocel/GeoParamsInterface.hh"
0020
0021 #include "OrangeData.hh"
0022 #include "OrangeTypes.hh"
0023
0024 class G4VPhysicalVolume;
0025
0026 namespace celeritas
0027 {
0028 struct OrangeInput;
0029
0030
0031
0032
0033
0034
0035
0036
0037 class OrangeParams final : public GeoParamsSurfaceInterface,
0038 public ParamsDataInterface<OrangeParamsData>
0039 {
0040 public:
0041
0042 explicit OrangeParams(std::string const& filename);
0043
0044
0045 explicit OrangeParams(G4VPhysicalVolume const*);
0046
0047
0048 explicit OrangeParams(OrangeInput&& input);
0049
0050
0051 bool supports_safety() const final { return supports_safety_; }
0052
0053
0054 BBox const& bbox() const final { return bbox_; }
0055
0056
0057 size_type max_depth() const { return this->host_ref().scalars.max_depth; }
0058
0059
0060
0061
0062 inline VolumeId::size_type num_volumes() const final;
0063
0064
0065 Label const& id_to_label(VolumeId vol_id) const final;
0066
0067
0068 using GeoParamsSurfaceInterface::find_volume;
0069
0070
0071
0072 VolumeId find_volume(std::string const& name) const final;
0073
0074
0075 VolumeId find_volume(Label const& label) const final;
0076
0077
0078 inline VolumeId find_volume(G4LogicalVolume const* volume) const final;
0079
0080
0081 SpanConstVolumeId find_volumes(std::string const& name) const final;
0082
0083
0084
0085
0086 Label const& id_to_label(SurfaceId surf_id) const final;
0087
0088
0089 SurfaceId find_surface(std::string const& name) const final;
0090
0091
0092 inline SurfaceId::size_type num_surfaces() const final;
0093
0094
0095
0096
0097 Label const& id_to_label(UniverseId surf_id) const;
0098
0099
0100 UniverseId find_universe(std::string const& name) const;
0101
0102
0103 inline UniverseId::size_type num_universes() const;
0104
0105
0106
0107
0108 HostRef const& host_ref() const final { return data_.host_ref(); }
0109
0110
0111 DeviceRef const& device_ref() const final { return data_.device_ref(); }
0112
0113 private:
0114
0115 LabelIdMultiMap<UniverseId> univ_labels_;
0116 LabelIdMultiMap<SurfaceId> surf_labels_;
0117 LabelIdMultiMap<VolumeId> vol_labels_;
0118 BBox bbox_;
0119 bool supports_safety_{};
0120
0121
0122 CollectionMirror<OrangeParamsData> data_;
0123 };
0124
0125
0126
0127
0128
0129
0130
0131
0132
0133 VolumeId OrangeParams::find_volume(G4LogicalVolume const*) const
0134 {
0135 return VolumeId{};
0136 }
0137
0138
0139
0140
0141
0142 VolumeId::size_type OrangeParams::num_volumes() const
0143 {
0144 return vol_labels_.size();
0145 }
0146
0147
0148
0149
0150
0151 SurfaceId::size_type OrangeParams::num_surfaces() const
0152 {
0153 return surf_labels_.size();
0154 }
0155
0156
0157
0158
0159
0160 UniverseId::size_type OrangeParams::num_universes() const
0161 {
0162 return univ_labels_.size();
0163 }
0164
0165
0166 }