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/Material/AccumulatedSurfaceMaterial.hpp"
0013 #include "Acts/Material/interface/ISurfaceMaterialAccumulater.hpp"
0014 #include "Acts/Utilities/Logger.hpp"
0015
0016 namespace Acts {
0017
0018
0019
0020
0021
0022
0023 class BinnedSurfaceMaterialAccumulater final
0024 : public ISurfaceMaterialAccumulater {
0025 public:
0026
0027 struct Config {
0028 GeometryContext geoContext;
0029
0030
0031 bool emptyBinCorrection = true;
0032
0033
0034 std::vector<const Surface*> materialSurfaces = {};
0035 };
0036
0037
0038 struct State final : public ISurfaceMaterialAccumulater::State {
0039
0040 std::map<GeometryIdentifier, AccumulatedSurfaceMaterial>
0041 accumulatedMaterial;
0042 };
0043
0044
0045
0046
0047
0048 BinnedSurfaceMaterialAccumulater(
0049 const Config& cfg,
0050 std::unique_ptr<const Logger> mlogger =
0051 getDefaultLogger("BinnedSurfaceMaterialAccumulater", Logging::INFO));
0052
0053
0054 std::unique_ptr<ISurfaceMaterialAccumulater::State> createState()
0055 const override;
0056
0057
0058
0059
0060
0061
0062
0063
0064 void accumulate(ISurfaceMaterialAccumulater::State& state,
0065 const std::vector<MaterialInteraction>& interactions,
0066 const std::vector<IAssignmentFinder::SurfaceAssignment>&
0067 surfacesWithoutAssignment) const override;
0068
0069
0070
0071
0072
0073
0074 std::map<GeometryIdentifier, std::shared_ptr<const ISurfaceMaterial>>
0075 finalizeMaterial(ISurfaceMaterialAccumulater::State& state) const override;
0076
0077 private:
0078
0079 const Logger& logger() const { return *m_logger; }
0080
0081
0082 Config m_cfg;
0083
0084
0085 std::unique_ptr<const Logger> m_logger;
0086 };
0087
0088 }