Warning, file /include/Acts/Geometry/CuboidVolumeBuilder.hpp was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Definitions/Algebra.hpp"
0012 #include "Acts/Geometry/GeometryContext.hpp"
0013 #include "Acts/Geometry/ITrackingVolumeBuilder.hpp"
0014 #include "Acts/Utilities/BinningType.hpp"
0015
0016 #include <array>
0017 #include <cstddef>
0018 #include <functional>
0019 #include <iosfwd>
0020 #include <memory>
0021 #include <optional>
0022 #include <string>
0023 #include <utility>
0024 #include <vector>
0025
0026 namespace Acts {
0027
0028 class TrackingVolume;
0029 class VolumeBounds;
0030 class RectangleBounds;
0031 class ISurfaceMaterial;
0032 class IVolumeMaterial;
0033 class DetectorElementBase;
0034 class Surface;
0035 class Layer;
0036
0037
0038
0039
0040
0041
0042 class CuboidVolumeBuilder : public ITrackingVolumeBuilder {
0043 public:
0044
0045
0046 struct SurfaceConfig {
0047
0048 Vector3 position;
0049
0050 RotationMatrix3 rotation = RotationMatrix3::Identity();
0051
0052 std::shared_ptr<const RectangleBounds> rBounds = nullptr;
0053
0054 std::shared_ptr<const ISurfaceMaterial> surMat = nullptr;
0055
0056 double thickness = 0.;
0057
0058
0059 std::function<DetectorElementBase*(
0060 const Transform3&, std::shared_ptr<const RectangleBounds>, double)>
0061 detElementConstructor;
0062 };
0063
0064
0065 struct LayerConfig {
0066
0067 std::vector<SurfaceConfig> surfaceCfg;
0068
0069 std::vector<std::shared_ptr<const Surface>> surfaces;
0070
0071 bool active = false;
0072
0073 std::size_t binsY = 1;
0074
0075 std::size_t binsZ = 1;
0076
0077 std::array<ActsScalar, 2u> envelopeX{0, 0};
0078
0079 std::array<ActsScalar, 2u> envelopeY{0, 0};
0080
0081 std::array<ActsScalar, 2u> envelopeZ{0, 0};
0082
0083 std::optional<RotationMatrix3> rotation{std::nullopt};
0084
0085 Acts::BinningValue binningDimension = Acts::BinningValue::binX;
0086 };
0087
0088
0089
0090 struct VolumeConfig {
0091
0092 Vector3 position;
0093
0094 Vector3 length;
0095
0096 std::vector<LayerConfig> layerCfg;
0097
0098 std::vector<std::shared_ptr<const Layer>> layers;
0099
0100 std::vector<VolumeConfig> volumeCfg;
0101
0102 std::vector<std::shared_ptr<TrackingVolume>> trackingVolumes;
0103
0104 std::string name = "Volume";
0105
0106 std::shared_ptr<const IVolumeMaterial> volumeMaterial = nullptr;
0107
0108 Acts::BinningValue binningDimension = Acts::BinningValue::binX;
0109 };
0110
0111
0112 struct Config {
0113
0114 Vector3 position = Vector3(0., 0., 0.);
0115
0116 Vector3 length = Vector3(0., 0., 0.);
0117
0118 std::vector<VolumeConfig> volumeCfg = {};
0119 };
0120
0121
0122 CuboidVolumeBuilder() = default;
0123
0124
0125
0126
0127 CuboidVolumeBuilder(Config& cfg) : m_cfg(cfg) {}
0128
0129
0130
0131
0132 void setConfig(Config& cfg) { m_cfg = cfg; }
0133
0134
0135
0136
0137
0138
0139
0140
0141 std::shared_ptr<const Surface> buildSurface(const GeometryContext& gctx,
0142 const SurfaceConfig& cfg) const;
0143
0144
0145
0146
0147
0148
0149
0150
0151
0152 std::shared_ptr<const Layer> buildLayer(const GeometryContext& gctx,
0153 LayerConfig& cfg) const;
0154
0155
0156
0157
0158
0159
0160
0161
0162
0163 std::shared_ptr<TrackingVolume> buildVolume(const GeometryContext& gctx,
0164 VolumeConfig& cfg) const;
0165
0166
0167
0168
0169
0170
0171
0172
0173
0174
0175 std::pair<double, double> binningRange(const GeometryContext& gctx,
0176 const VolumeConfig& cfg) const;
0177
0178 void sortVolumes(std::vector<std::pair<TrackingVolumePtr, Vector3>>& tapVec,
0179 BinningValue bValue) const;
0180
0181
0182
0183
0184
0185
0186
0187 std::shared_ptr<TrackingVolume> trackingVolume(
0188 const GeometryContext& gctx,
0189 std::shared_ptr<const TrackingVolume> ,
0190 std::shared_ptr<const VolumeBounds> ) const override;
0191
0192 private:
0193
0194 Config m_cfg;
0195 };
0196 }