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