File indexing completed on 2025-12-16 09:22:27
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
0029 struct Config {
0030
0031 std::shared_ptr<const IAssignmentFinder> assignmentFinder = nullptr;
0032
0033 std::shared_ptr<const ISurfaceMaterialAccumulater>
0034 surfaceMaterialAccumulater = nullptr;
0035 };
0036
0037
0038
0039
0040 struct State {
0041
0042 std::unique_ptr<ISurfaceMaterialAccumulater::State>
0043 surfaceMaterialAccumulaterState;
0044 };
0045
0046
0047
0048 struct Options {
0049
0050 MaterialInteractionAssignment::Options assignmentOptions;
0051 };
0052
0053
0054
0055
0056
0057 explicit MaterialMapper(
0058 const Config& cfg,
0059 std::unique_ptr<const Logger> mlogger =
0060 getDefaultLogger("BinnedSurfaceMaterialAccumulater", Logging::INFO));
0061
0062
0063
0064 std::unique_ptr<State> createState() const;
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075 std::pair<RecordedMaterialTrack, RecordedMaterialTrack> mapMaterial(
0076 State& state, const GeometryContext& gctx,
0077 const MagneticFieldContext& mctx, const RecordedMaterialTrack& rmTrack,
0078 const Options& options = Options{}) const;
0079
0080
0081
0082
0083 TrackingGeometryMaterial finalizeMaps(const State& state) const;
0084
0085 private:
0086
0087 const Logger& logger() const { return *m_logger; }
0088
0089
0090 Config m_cfg;
0091
0092
0093 std::unique_ptr<const Logger> m_logger;
0094 };
0095
0096 }