Warning, file /include/Acts/Material/VolumeMaterialMapper.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/GeometryIdentifier.hpp"
0014 #include "Acts/Geometry/TrackingVolume.hpp"
0015 #include "Acts/MagneticField/MagneticFieldContext.hpp"
0016 #include "Acts/Material/AccumulatedVolumeMaterial.hpp"
0017 #include "Acts/Material/MaterialGridHelper.hpp"
0018 #include "Acts/Material/MaterialInteraction.hpp"
0019 #include "Acts/Material/MaterialSlab.hpp"
0020 #include "Acts/Propagator/Navigator.hpp"
0021 #include "Acts/Propagator/Propagator.hpp"
0022 #include "Acts/Propagator/StraightLineStepper.hpp"
0023 #include "Acts/Surfaces/Surface.hpp"
0024 #include "Acts/Utilities/BinUtility.hpp"
0025 #include "Acts/Utilities/Logger.hpp"
0026
0027 #include <functional>
0028 #include <map>
0029 #include <memory>
0030 #include <utility>
0031
0032 namespace Acts {
0033
0034 class ISurfaceMaterial;
0035 class IVolumeMaterial;
0036 class TrackingGeometry;
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062 class VolumeMaterialMapper {
0063 public:
0064
0065 using StraightLinePropagator = Propagator<StraightLineStepper, Navigator>;
0066
0067
0068
0069
0070 struct Config {
0071
0072 float mappingStep = 1.;
0073 };
0074
0075
0076
0077
0078 struct State {
0079
0080
0081
0082 State(const GeometryContext& gctx, const MagneticFieldContext& mctx)
0083 : geoContext(gctx), magFieldContext(mctx) {}
0084
0085
0086 std::map<const GeometryIdentifier, Acts::AccumulatedVolumeMaterial>
0087 homogeneousGrid;
0088
0089
0090 std::map<const GeometryIdentifier,
0091 std::function<Acts::Vector2(Acts::Vector3)>>
0092 transform2D;
0093
0094
0095 std::map<const GeometryIdentifier, Grid2D> grid2D;
0096
0097
0098
0099 std::map<const GeometryIdentifier,
0100 std::function<Acts::Vector3(Acts::Vector3)>>
0101 transform3D;
0102
0103
0104 std::map<const GeometryIdentifier, Grid3D> grid3D;
0105
0106
0107 std::map<const GeometryIdentifier, BinUtility> materialBin;
0108
0109
0110 std::map<GeometryIdentifier, std::shared_ptr<const ISurfaceMaterial>>
0111 surfaceMaterial;
0112
0113
0114 std::map<GeometryIdentifier, std::unique_ptr<const IVolumeMaterial>>
0115 volumeMaterial;
0116
0117
0118 std::reference_wrapper<const GeometryContext> geoContext;
0119
0120
0121 std::reference_wrapper<const MagneticFieldContext> magFieldContext;
0122 };
0123
0124
0125 VolumeMaterialMapper() = delete;
0126
0127
0128
0129
0130
0131
0132 VolumeMaterialMapper(const Config& cfg, StraightLinePropagator propagator,
0133 std::unique_ptr<const Logger> slogger = getDefaultLogger(
0134 "VolumeMaterialMapper", Logging::INFO));
0135
0136
0137
0138
0139
0140
0141
0142
0143
0144
0145
0146 State createState(const GeometryContext& gctx,
0147 const MagneticFieldContext& mctx,
0148 const TrackingGeometry& tGeometry) const;
0149
0150
0151
0152
0153
0154
0155
0156
0157 void finalizeMaps(State& mState) const;
0158
0159
0160
0161
0162
0163
0164
0165
0166 void mapMaterialTrack(State& mState, RecordedMaterialTrack& mTrack) const;
0167
0168 private:
0169
0170 struct BoundSurfaceSelector {
0171 bool operator()(const Surface& sf) const {
0172 return (sf.geometryId().boundary() != 0);
0173 }
0174 };
0175
0176
0177 struct MaterialVolumeSelector {
0178 bool operator()(const TrackingVolume& vf) const {
0179 return (vf.volumeMaterial() != nullptr);
0180 }
0181 };
0182
0183
0184
0185
0186
0187 void resolveMaterialVolume(State& mState,
0188 const TrackingVolume& tVolume) const;
0189
0190
0191
0192
0193
0194 void checkAndInsert(State& mState, const TrackingVolume& volume) const;
0195
0196
0197
0198
0199
0200 void collectMaterialSurfaces(State& mState,
0201 const TrackingVolume& tVolume) const;
0202
0203
0204
0205
0206
0207
0208
0209
0210 void createExtraHits(
0211 State& mState,
0212 std::pair<const GeometryIdentifier, BinUtility>& currentBinning,
0213 Acts::MaterialSlab properties, const Vector3& position,
0214 Vector3 direction) const;
0215
0216
0217 const Logger& logger() const { return *m_logger; }
0218
0219
0220 Config m_cfg;
0221
0222
0223 StraightLinePropagator m_propagator;
0224
0225
0226 std::unique_ptr<const Logger> m_logger;
0227 };
0228
0229 }