File indexing completed on 2025-09-13 08:12:47
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 std::unique_ptr<ISurfaceMaterialAccumulater::State>
0052 surfaceMaterialAccumulaterState;
0053 };
0054
0055
0056
0057 struct Options {
0058
0059 MaterialInteractionAssignment::Options assignmentOptions;
0060 };
0061
0062
0063
0064
0065
0066 explicit MaterialMapper(
0067 const Config& cfg,
0068 std::unique_ptr<const Logger> mlogger =
0069 getDefaultLogger("BinnedSurfaceMaterialAccumulater", Logging::INFO));
0070
0071
0072 std::unique_ptr<State> createState() const;
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083 std::pair<RecordedMaterialTrack, RecordedMaterialTrack> mapMaterial(
0084 State& state, const GeometryContext& gctx,
0085 const MagneticFieldContext& mctx, const RecordedMaterialTrack& rmTrack,
0086 const Options& options = Options{}) const;
0087
0088
0089 TrackingGeometryMaterial finalizeMaps(const State& state) const;
0090
0091 private:
0092
0093 const Logger& logger() const { return *m_logger; }
0094
0095
0096 Config m_cfg;
0097
0098
0099 std::unique_ptr<const Logger> m_logger;
0100 };
0101
0102 }