File indexing completed on 2025-01-18 09:27:39
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Geometry/Extent.hpp"
0012 #include "Acts/Geometry/GeometryContext.hpp"
0013 #include "Acts/Surfaces/Surface.hpp"
0014
0015 #include <utility>
0016 #include <vector>
0017
0018 namespace Acts {
0019
0020 struct SurfaceBinningMatcher {
0021
0022 using Range = std::pair<double, double>;
0023 std::vector<Range> tolerances{static_cast<int>(binValues), {0., 0.}};
0024
0025 SurfaceBinningMatcher() = default;
0026
0027 SurfaceBinningMatcher(const std::vector<Range>& tolpars)
0028 : tolerances(tolpars) {}
0029
0030
0031
0032
0033
0034
0035
0036 bool operator()(const Acts::GeometryContext& gctx, Acts::BinningValue bValue,
0037 const Acts::Surface* one, const Acts::Surface* other) const {
0038
0039 if (one == other) {
0040 return true;
0041 }
0042
0043 auto oneExt = one->polyhedronRepresentation(gctx, 1).extent();
0044 auto otherExt = other->polyhedronRepresentation(gctx, 1).extent();
0045
0046 double oneMin = oneExt.min(bValue);
0047 double oneMax = oneExt.max(bValue);
0048
0049 double otherMin = otherExt.min(bValue);
0050 double otherMax = otherExt.max(bValue);
0051
0052 return (std::abs(oneMin - otherMin) <= tolerances[bValue].first &&
0053 std::abs(oneMax - otherMax) <= tolerances[bValue].second);
0054 }
0055 };
0056
0057 }