File indexing completed on 2025-10-13 08:15:42
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Geometry/GeometryContext.hpp"
0012 #include "Acts/MagneticField/MagneticFieldContext.hpp"
0013 #include "Acts/Material/MaterialInteraction.hpp"
0014 #include "Acts/Material/MaterialInteractionAssignment.hpp"
0015 #include "Acts/Material/TrackingGeometryMaterial.hpp"
0016 #include "Acts/Material/interface/IAssignmentFinder.hpp"
0017 #include "Acts/Material/interface/ISurfaceMaterialAccumulater.hpp"
0018 #include "Acts/Utilities/Logger.hpp"
0019
0020 #include <memory>
0021 #include <utility>
0022 #include <vector>
0023
0024 namespace Acts {
0025
0026 class MaterialMapper {
0027 public:
0028 using SurfaceMaterialMap
0029 [[deprecated("Use Acts::SurfaceMaterialMaps directly")]] =
0030 SurfaceMaterialMaps;
0031 using VolumeMaterialMap
0032 [[deprecated("Use Acts::VolumeMaterialMaps directly")]] =
0033 VolumeMaterialMaps;
0034 using DetectorMaterialMaps
0035 [[deprecated("Use Acts::TrackingGeometryMaterial directly")]] =
0036 TrackingGeometryMaterial;
0037
0038
0039 struct Config {
0040
0041 std::shared_ptr<const IAssignmentFinder> assignmentFinder = nullptr;
0042
0043 std::shared_ptr<const ISurfaceMaterialAccumulater>
0044 surfaceMaterialAccumulater = nullptr;
0045 };
0046
0047
0048
0049
0050 struct State {
0051
0052 std::unique_ptr<ISurfaceMaterialAccumulater::State>
0053 surfaceMaterialAccumulaterState;
0054 };
0055
0056
0057
0058 struct Options {
0059
0060 MaterialInteractionAssignment::Options assignmentOptions;
0061 };
0062
0063
0064
0065
0066
0067 explicit MaterialMapper(
0068 const Config& cfg,
0069 std::unique_ptr<const Logger> mlogger =
0070 getDefaultLogger("BinnedSurfaceMaterialAccumulater", Logging::INFO));
0071
0072
0073
0074 std::unique_ptr<State> createState() const;
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085 std::pair<RecordedMaterialTrack, RecordedMaterialTrack> mapMaterial(
0086 State& state, const GeometryContext& gctx,
0087 const MagneticFieldContext& mctx, const RecordedMaterialTrack& rmTrack,
0088 const Options& options = Options{}) const;
0089
0090
0091
0092
0093 TrackingGeometryMaterial finalizeMaps(const State& state) const;
0094
0095 private:
0096
0097 const Logger& logger() const { return *m_logger; }
0098
0099
0100 Config m_cfg;
0101
0102
0103 std::unique_ptr<const Logger> m_logger;
0104 };
0105
0106 }