File indexing completed on 2026-05-12 08:00:18
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/ISurfaceMaterialAccumulator.hpp"
0018 #include "Acts/Utilities/Logger.hpp"
0019
0020 #include <memory>
0021 #include <utility>
0022 #include <vector>
0023
0024 namespace Acts {
0025
0026
0027 class MaterialMapper {
0028 public:
0029
0030 struct Config {
0031
0032 std::shared_ptr<const IAssignmentFinder> assignmentFinder = nullptr;
0033
0034 std::shared_ptr<const ISurfaceMaterialAccumulator>
0035 surfaceMaterialAccumulator = nullptr;
0036 };
0037
0038
0039
0040
0041 struct State {
0042
0043 std::unique_ptr<ISurfaceMaterialAccumulator::State>
0044 surfaceMaterialAccumulatorState;
0045 };
0046
0047
0048
0049 struct Options {
0050
0051 MaterialInteractionAssignment::Options assignmentOptions;
0052 };
0053
0054
0055
0056
0057
0058 explicit MaterialMapper(
0059 const Config& cfg,
0060 std::unique_ptr<const Logger> mlogger =
0061 getDefaultLogger("BinnedSurfaceMaterialAccumulator", Logging::INFO));
0062
0063
0064
0065
0066 std::unique_ptr<State> createState(const GeometryContext& gctx) const;
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077 std::pair<RecordedMaterialTrack, RecordedMaterialTrack> mapMaterial(
0078 State& state, const GeometryContext& gctx,
0079 const MagneticFieldContext& mctx, const RecordedMaterialTrack& rmTrack,
0080 const Options& options = Options{}) const;
0081
0082
0083
0084
0085
0086 TrackingGeometryMaterial finalizeMaps(const State& state,
0087 const GeometryContext& gctx) const;
0088
0089 private:
0090
0091 const Logger& logger() const { return *m_logger; }
0092
0093
0094 Config m_cfg;
0095
0096
0097 std::unique_ptr<const Logger> m_logger;
0098 };
0099
0100 }