From 206d595dde871c130656614a1022b6c457db7c8d Mon Sep 17 00:00:00 2001 From: Andreas Salzburger Date: Thu, 18 Jul 2024 16:39:14 +0200 Subject: [PATCH 01/31] fix segmented view sectors --- .../Acts/Surfaces/detail/VerticesHelper.hpp | 15 ++++++++------- Core/src/Surfaces/AnnulusBounds.cpp | 6 ++---- Core/src/Surfaces/ConeSurface.cpp | 5 ++--- Core/src/Surfaces/CylinderBounds.cpp | 3 +-- Core/src/Surfaces/StrawSurface.cpp | 4 ++-- Core/src/Surfaces/VerticesHelper.cpp | 5 ++--- 6 files changed, 17 insertions(+), 21 deletions(-) diff --git a/Core/include/Acts/Surfaces/detail/VerticesHelper.hpp b/Core/include/Acts/Surfaces/detail/VerticesHelper.hpp index 80d16c8c017..73951b66187 100644 --- a/Core/include/Acts/Surfaces/detail/VerticesHelper.hpp +++ b/Core/include/Acts/Surfaces/detail/VerticesHelper.hpp @@ -43,28 +43,29 @@ std::vector phiSegments(ActsScalar phiMin = -M_PI, /// @param phi1 The first phi value /// @param phi2 The second phi value /// @param lseg The number of segments for full 2*PI -/// @param addon The additional segments to be built /// @param offset The out of plane offset position of the bow +/// @param dropFirst drop the first vertex in case of stiched segments /// @param transform The transform applied (optional) template void createSegment(std::vector& vertices, std::pair rxy, ActsScalar phi1, - ActsScalar phi2, unsigned int lseg, int addon = 0, + ActsScalar phi2, unsigned int lseg, bool dropFirst = false, const vertex_t& offset = vertex_t::Zero(), const transform_t& transform = transform_t::Identity()) { // Calculate the number of segments - 1 is the minimum - unsigned int segs = - static_cast(std::abs(phi2 - phi1) / (2 * M_PI) * lseg); - segs = segs > 0 ? segs : 1; + unsigned int segs = std::max( + static_cast(std::abs(phi2 - phi1) / (2 * M_PI) * lseg), 1u); ActsScalar phistep = (phi2 - phi1) / segs; // Create the segments - for (unsigned int iphi = 0; iphi < segs + addon; ++iphi) { + for (unsigned int iphi = 0; iphi < segs; ++iphi) { ActsScalar phi = phi1 + iphi * phistep; vertex_t vertex = vertex_t::Zero(); vertex(0) = rxy.first * std::cos(phi); vertex(1) = rxy.second * std::sin(phi); - vertex = vertex + offset; + if (dropFirst && iphi == 0) { + continue; + } vertices.push_back(transform * vertex); } } diff --git a/Core/src/Surfaces/AnnulusBounds.cpp b/Core/src/Surfaces/AnnulusBounds.cpp index 0752a41b4ff..f50e2b30e3b 100644 --- a/Core/src/Surfaces/AnnulusBounds.cpp +++ b/Core/src/Surfaces/AnnulusBounds.cpp @@ -118,17 +118,15 @@ std::vector Acts::AnnulusBounds::vertices( // Inner bow from phi_min -> phi_max for (unsigned int iseg = 0; iseg < phisInner.size() - 1; ++iseg) { - int addon = (iseg == phisInner.size() - 2) ? 1 : 0; detail::VerticesHelper::createSegment( rvertices, {get(eMinR), get(eMinR)}, phisInner[iseg], - phisInner[iseg + 1], lseg, addon); + phisInner[iseg + 1], lseg, (iseg > 0u)); } // Upper bow from phi_max -> phi_min for (unsigned int iseg = 0; iseg < phisOuter.size() - 1; ++iseg) { - int addon = (iseg == phisOuter.size() - 2) ? 1 : 0; detail::VerticesHelper::createSegment( rvertices, {get(eMaxR), get(eMaxR)}, phisOuter[iseg], - phisOuter[iseg + 1], lseg, addon); + phisOuter[iseg + 1], lseg, (iseg > 0u)); } std::for_each(rvertices.begin(), rvertices.end(), [&](Acts::Vector2& rv) { rv += m_moduleOrigin; }); diff --git a/Core/src/Surfaces/ConeSurface.cpp b/Core/src/Surfaces/ConeSurface.cpp index 4aee9a679f8..4a8ddbe58aa 100644 --- a/Core/src/Surfaces/ConeSurface.cpp +++ b/Core/src/Surfaces/ConeSurface.cpp @@ -233,10 +233,9 @@ Acts::Polyhedron Acts::ConeSurface::polyhedronRepresentation( double r = std::abs(z) * bounds().tanAlpha(); Vector3 zoffset(0., 0., z); for (unsigned int iseg = 0; iseg < phiSegs.size() - 1; ++iseg) { - int addon = (iseg == phiSegs.size() - 2 && !fullCone) ? 1 : 0; detail::VerticesHelper::createSegment(vertices, {r, r}, phiSegs[iseg], - phiSegs[iseg + 1], lseg, addon, - zoffset, ctransform); + phiSegs[iseg + 1], lseg, + (iseg > 0u), zoffset, ctransform); } // Create the faces if (tipExists) { diff --git a/Core/src/Surfaces/CylinderBounds.cpp b/Core/src/Surfaces/CylinderBounds.cpp index a6c037088bc..dcd8f682918 100644 --- a/Core/src/Surfaces/CylinderBounds.cpp +++ b/Core/src/Surfaces/CylinderBounds.cpp @@ -123,11 +123,10 @@ std::vector Acts::CylinderBounds::createCircles( std::vector sides = {-1, 1}; for (auto& side : sides) { for (std::size_t iseg = 0; iseg < phiSegs.size() - 1; ++iseg) { - int addon = (iseg == phiSegs.size() - 2 && !fullCylinder) ? 1 : 0; /// Helper method to create the segment detail::VerticesHelper::createSegment( vertices, {get(eR), get(eR)}, phiSegs[iseg], phiSegs[iseg + 1], lseg, - addon, Vector3(0., 0., side * get(eHalfLengthZ)), ctrans); + (iseg > 0u), Vector3(0., 0., side * get(eHalfLengthZ)), ctrans); } } diff --git a/Core/src/Surfaces/StrawSurface.cpp b/Core/src/Surfaces/StrawSurface.cpp index 61ba65b0576..fff6d9df49c 100644 --- a/Core/src/Surfaces/StrawSurface.cpp +++ b/Core/src/Surfaces/StrawSurface.cpp @@ -63,10 +63,10 @@ Acts::Polyhedron Acts::StrawSurface::polyhedronRepresentation( std::vector sides = {-1, 1}; for (auto& side : sides) { for (std::size_t iseg = 0; iseg < phiSegs.size() - 1; ++iseg) { - int addon = (iseg == phiSegs.size() - 2) ? 1 : 0; /// Helper method to create the segment detail::VerticesHelper::createSegment( - vertices, {r, r}, phiSegs[iseg], phiSegs[iseg + 1], lseg, addon, + vertices, {r, r}, phiSegs[iseg], phiSegs[iseg + 1], lseg, + (iseg > 0u), Vector3(0., 0., side * m_bounds->get(LineBounds::eHalfLengthZ)), ctransform); } diff --git a/Core/src/Surfaces/VerticesHelper.cpp b/Core/src/Surfaces/VerticesHelper.cpp index a0367936dc9..b4cea23732a 100644 --- a/Core/src/Surfaces/VerticesHelper.cpp +++ b/Core/src/Surfaces/VerticesHelper.cpp @@ -66,15 +66,14 @@ std::vector Acts::detail::VerticesHelper::ellipsoidVertices( // The inner (if exists) and outer bow for (unsigned int iseg = 0; iseg < phiSegs.size() - 1; ++iseg) { - int addon = (iseg == phiSegs.size() - 2 && !closed) ? 1 : 0; if (innerExists) { createSegment(ivertices, {innerRx, innerRy}, phiSegs[iseg], phiSegs[iseg + 1], lseg, - addon); + (iseg > 0u)); } createSegment(overtices, {outerRx, outerRy}, phiSegs[iseg], phiSegs[iseg + 1], lseg, - addon); + (iseg > 0u)); } // We want to keep the same counter-clockwise orientation for displaying From a4df8c83f3e8034c2d26a9b9bd1693de5376215e Mon Sep 17 00:00:00 2001 From: Andreas Salzburger Date: Fri, 19 Jul 2024 17:05:47 +0200 Subject: [PATCH 02/31] fixing polygon drawing --- Core/include/Acts/Geometry/Polyhedron.hpp | 1 + .../Acts/Surfaces/detail/FacesHelper.hpp | 2 +- .../Acts/Surfaces/detail/VerticesHelper.hpp | 63 +++++++------- .../detail/ObjVisualization3D.ipp | 4 +- Core/src/Surfaces/AnnulusBounds.cpp | 39 ++++----- Core/src/Surfaces/ConeSurface.cpp | 54 +++++------- Core/src/Surfaces/CylinderBounds.cpp | 21 ++--- Core/src/Surfaces/CylinderSurface.cpp | 2 - Core/src/Surfaces/StrawSurface.cpp | 15 ++-- Core/src/Surfaces/VerticesHelper.cpp | 87 +++++++++++-------- .../Core/Surfaces/VerticesHelperTests.cpp | 53 +++++++++++ .../Core/Visualization/SurfaceView3DBase.hpp | 24 ++--- .../Plugins/TGeo/TGeoTubeConversionTests.cpp | 5 +- 13 files changed, 209 insertions(+), 161 deletions(-) diff --git a/Core/include/Acts/Geometry/Polyhedron.hpp b/Core/include/Acts/Geometry/Polyhedron.hpp index 69ae109c52d..700a161e145 100644 --- a/Core/include/Acts/Geometry/Polyhedron.hpp +++ b/Core/include/Acts/Geometry/Polyhedron.hpp @@ -36,6 +36,7 @@ struct Polyhedron { /// @param facesIn List of lists of indices for faces. /// @param triangularMeshIn List of lists of indices for a triangular mesh /// @param isExact A dedicated flag if this is exact or not + /// /// @note This creates copies of the input vectors Polyhedron(const std::vector& verticesIn, const std::vector& facesIn, diff --git a/Core/include/Acts/Surfaces/detail/FacesHelper.hpp b/Core/include/Acts/Surfaces/detail/FacesHelper.hpp index a9eaf763db6..075dcf93bd5 100644 --- a/Core/include/Acts/Surfaces/detail/FacesHelper.hpp +++ b/Core/include/Acts/Surfaces/detail/FacesHelper.hpp @@ -21,7 +21,7 @@ namespace Acts::detail { struct FacesHelper { using FaceVector = std::vector; - /// @brief This method words for all convex type surface setups + /// @brief This method works for all convex type surface setups /// It includes: /// /// Rectangle / Triangle / Polygon diff --git a/Core/include/Acts/Surfaces/detail/VerticesHelper.hpp b/Core/include/Acts/Surfaces/detail/VerticesHelper.hpp index 73951b66187..fe641674f3f 100644 --- a/Core/include/Acts/Surfaces/detail/VerticesHelper.hpp +++ b/Core/include/Acts/Surfaces/detail/VerticesHelper.hpp @@ -22,52 +22,57 @@ namespace Acts::detail::VerticesHelper { /// A method that inserts the cartesian extrema points and segments /// a curved segment into sub segments /// -/// @param phiMin the minimum Phi of the bounds object -/// @param phiMax the maximum Phi of the bounds object +/// @param phiMin the minimum phi value +/// @param phiMax The second phi value /// @param phiRef is a vector of reference phi values to be included as well -/// @param phiTolerance is the tolerance for reference phi insertion -/// @return a vector +/// @param minSegments approximation of a circle extrema points - default is 8 segments +/// - needs to be divisible by 4 +/// +/// @return a vector of generated phi values std::vector phiSegments(ActsScalar phiMin = -M_PI, ActsScalar phiMax = M_PI, const std::vector& phiRefs = {}, - ActsScalar phiTolerance = 1e-6); + unsigned int minSegments = 8u); /// Helper method to create a regular 2 or 3 D segment -/// between two phi values +/// between two phi values with a given number of segments +/// +/// It will insert the phi at extrema points and reference points, it uses +/// a minimum approximation of a circle with 8 segments /// /// @tparam vertex_t Type of vertex to be applied /// @tparam transform_t Optional transform /// -/// @param vertices [in,out] The 3D vertices to be filled -/// @param rxy The radius description if first +/= second: ellipse -/// @param phi1 The first phi value -/// @param phi2 The second phi value -/// @param lseg The number of segments for full 2*PI +/// @param rXY The radius description if first +/= second: ellipse +/// @param phiMin the minimum phi value +/// @param phiMax The second phi value +/// @param phiRef is a vector of reference phi values to be included as well +/// @param nSegments The number of segments for full 2*PI - 4 is the minimum approximation +/// must be either -1 or divisible by 4 /// @param offset The out of plane offset position of the bow -/// @param dropFirst drop the first vertex in case of stiched segments /// @param transform The transform applied (optional) +/// +/// @return a vector of vertices template -void createSegment(std::vector& vertices, - std::pair rxy, ActsScalar phi1, - ActsScalar phi2, unsigned int lseg, bool dropFirst = false, - const vertex_t& offset = vertex_t::Zero(), - const transform_t& transform = transform_t::Identity()) { - // Calculate the number of segments - 1 is the minimum - unsigned int segs = std::max( - static_cast(std::abs(phi2 - phi1) / (2 * M_PI) * lseg), 1u); - ActsScalar phistep = (phi2 - phi1) / segs; - // Create the segments - for (unsigned int iphi = 0; iphi < segs; ++iphi) { - ActsScalar phi = phi1 + iphi * phistep; +std::vector createSegment( + std::pair rXY, ActsScalar phiMin, ActsScalar phiMax, + const std::vector& phiRefs = {}, unsigned int nSegments = 8u, + const vertex_t& offset = vertex_t::Zero(), + const transform_t& transform = transform_t::Identity()) { + std::vector vertices; + + unsigned int nSegmentsCorr = std::max(nSegments, 8u); + std::vector phis = + phiSegments(phiMin, phiMax, phiRefs, nSegmentsCorr); + + for (auto phi : phis) { vertex_t vertex = vertex_t::Zero(); - vertex(0) = rxy.first * std::cos(phi); - vertex(1) = rxy.second * std::sin(phi); + vertex(0) = rXY.first * std::cos(phi); + vertex(1) = rXY.second * std::sin(phi); vertex = vertex + offset; - if (dropFirst && iphi == 0) { - continue; - } vertices.push_back(transform * vertex); } + return vertices; } /// Construct vertices on an ellipse-like bound object. diff --git a/Core/include/Acts/Visualization/detail/ObjVisualization3D.ipp b/Core/include/Acts/Visualization/detail/ObjVisualization3D.ipp index 51a0854b85e..8ef5df81068 100644 --- a/Core/include/Acts/Visualization/detail/ObjVisualization3D.ipp +++ b/Core/include/Acts/Visualization/detail/ObjVisualization3D.ipp @@ -157,8 +157,8 @@ void ObjVisualization3D::write(std::ostream& os, std::ostream& mos) const { } } os << "f"; - for (std::size_t i = 0; i < fc.size(); i++) { - os << " " << fc[i] + 1; + for (auto fi : fc) { + os << " " << fi + 1; } os << "\n"; ++is; diff --git a/Core/src/Surfaces/AnnulusBounds.cpp b/Core/src/Surfaces/AnnulusBounds.cpp index f50e2b30e3b..b9725ce792d 100644 --- a/Core/src/Surfaces/AnnulusBounds.cpp +++ b/Core/src/Surfaces/AnnulusBounds.cpp @@ -105,29 +105,24 @@ std::vector Acts::AnnulusBounds::corners() const { std::vector Acts::AnnulusBounds::vertices( unsigned int lseg) const { if (lseg > 0) { - // List of vertices counter-clockwise starting with left inner - std::vector rvertices; - using VectorHelpers::phi; - auto phisInner = detail::VerticesHelper::phiSegments( - phi(m_inRightStripXY - m_moduleOrigin), - phi(m_inLeftStripXY - m_moduleOrigin)); - auto phisOuter = detail::VerticesHelper::phiSegments( - phi(m_outLeftStripXY - m_moduleOrigin), - phi(m_outRightStripXY - m_moduleOrigin)); - - // Inner bow from phi_min -> phi_max - for (unsigned int iseg = 0; iseg < phisInner.size() - 1; ++iseg) { - detail::VerticesHelper::createSegment( - rvertices, {get(eMinR), get(eMinR)}, phisInner[iseg], - phisInner[iseg + 1], lseg, (iseg > 0u)); - } - // Upper bow from phi_max -> phi_min - for (unsigned int iseg = 0; iseg < phisOuter.size() - 1; ++iseg) { - detail::VerticesHelper::createSegment( - rvertices, {get(eMaxR), get(eMaxR)}, phisOuter[iseg], - phisOuter[iseg + 1], lseg, (iseg > 0u)); - } + ActsScalar phiMinInner = phi(m_inRightStripXY - m_moduleOrigin); + ActsScalar phiMaxInner = phi(m_inLeftStripXY - m_moduleOrigin); + + ActsScalar phiMinOuter = phi(m_outRightStripXY - m_moduleOrigin); + ActsScalar phiMaxOuter = phi(m_outLeftStripXY - m_moduleOrigin); + + // Inner bow from phi_min -> phi_max (needs to be reversed) + std::vector rvertices = + detail::VerticesHelper::createSegment( + {get(eMinR), get(eMinR)}, phiMinInner, phiMaxInner, {}, lseg); + std::reverse(rvertices.begin(), rvertices.end()); + + // Outer bow from phi_min -> phi_max + auto overtices = detail::VerticesHelper::createSegment( + {get(eMaxR), get(eMaxR)}, phiMinOuter, phiMaxOuter, {}, lseg); + rvertices.insert(rvertices.end(), overtices.begin(), overtices.end()); + std::for_each(rvertices.begin(), rvertices.end(), [&](Acts::Vector2& rv) { rv += m_moduleOrigin; }); return rvertices; diff --git a/Core/src/Surfaces/ConeSurface.cpp b/Core/src/Surfaces/ConeSurface.cpp index 4a8ddbe58aa..58a8c5329de 100644 --- a/Core/src/Surfaces/ConeSurface.cpp +++ b/Core/src/Surfaces/ConeSurface.cpp @@ -189,73 +189,64 @@ Acts::Polyhedron Acts::ConeSurface::polyhedronRepresentation( std::vector faces; std::vector triangularMesh; - double minZ = bounds().get(ConeBounds::eMinZ); - double maxZ = bounds().get(ConeBounds::eMaxZ); + ActsScalar minZ = bounds().get(ConeBounds::eMinZ); + ActsScalar maxZ = bounds().get(ConeBounds::eMaxZ); if (minZ == -std::numeric_limits::infinity() || maxZ == std::numeric_limits::infinity()) { throw std::domain_error( - "Polyhedron repr of boundless surface not possible"); + "Polyhedron representation of boundless surface is not possible"); } auto ctransform = transform(gctx); // The tip - created only once and only, if it is not a cut-off cone bool tipExists = false; - if (minZ * maxZ <= s_onSurfaceTolerance) { + if (std::abs(minZ) <= s_onSurfaceTolerance) { vertices.push_back(ctransform * Vector3(0., 0., 0.)); tipExists = true; } // Cone parameters - double hPhiSec = bounds().get(ConeBounds::eHalfPhiSector); - double avgPhi = bounds().get(ConeBounds::eAveragePhi); + ActsScalar hPhiSec = bounds().get(ConeBounds::eHalfPhiSector); + ActsScalar avgPhi = bounds().get(ConeBounds::eAveragePhi); bool fullCone = (hPhiSec == M_PI); + std::vector refPhi = {}; + if (not fullCone) { + refPhi = {avgPhi}; + } - // Get the phi segments from the helper - auto phiSegs = fullCone ? detail::VerticesHelper::phiSegments() - : detail::VerticesHelper::phiSegments( - avgPhi - hPhiSec, avgPhi + hPhiSec, - {static_cast(avgPhi)}); - - // Negative cone if exists - std::vector coneSides; + // Add the cone sizes + std::vector coneSides; if (std::abs(minZ) > s_onSurfaceTolerance) { coneSides.push_back(minZ); } if (std::abs(maxZ) > s_onSurfaceTolerance) { coneSides.push_back(maxZ); } + for (auto& z : coneSides) { - // Remember the first vertex std::size_t firstIv = vertices.size(); // Radius and z offset double r = std::abs(z) * bounds().tanAlpha(); Vector3 zoffset(0., 0., z); - for (unsigned int iseg = 0; iseg < phiSegs.size() - 1; ++iseg) { - detail::VerticesHelper::createSegment(vertices, {r, r}, phiSegs[iseg], - phiSegs[iseg + 1], lseg, - (iseg > 0u), zoffset, ctransform); - } - // Create the faces + auto svertices = detail::VerticesHelper::createSegment( + {r, r}, avgPhi - hPhiSec, avgPhi + hPhiSec, refPhi, lseg, zoffset, + ctransform); + vertices.insert(vertices.end(), svertices.begin(), svertices.end()); + // If the tip exists, the faces need to be triangular if (tipExists) { - for (std::size_t iv = firstIv + 2; iv < vertices.size() + 1; ++iv) { - std::size_t one = 0, two = iv - 1, three = iv - 2; + for (std::size_t iv = firstIv + 1; iv < svertices.size() + firstIv; + ++iv) { + std::size_t one = 0, two = iv, three = iv - 1; if (z < 0.) { std::swap(two, three); } faces.push_back({one, two, three}); } - // Complete cone if necessary - if (fullCone) { - if (z > 0.) { - faces.push_back({0, firstIv, vertices.size() - 1}); - } else { - faces.push_back({0, vertices.size() - 1, firstIv}); - } - } } } + // if no tip exists, connect the two bows if (tipExists) { triangularMesh = faces; @@ -265,6 +256,7 @@ Acts::Polyhedron Acts::ConeSurface::polyhedronRepresentation( faces = facesMesh.first; triangularMesh = facesMesh.second; } + return Polyhedron(vertices, faces, triangularMesh, false); } diff --git a/Core/src/Surfaces/CylinderBounds.cpp b/Core/src/Surfaces/CylinderBounds.cpp index dcd8f682918..47d8127b128 100644 --- a/Core/src/Surfaces/CylinderBounds.cpp +++ b/Core/src/Surfaces/CylinderBounds.cpp @@ -112,22 +112,19 @@ std::vector Acts::CylinderBounds::createCircles( double halfPhi = get(eHalfPhiSector); bool fullCylinder = coversFullAzimuth(); - - // Get the phi segments from the helper - ensures extra points - auto phiSegs = fullCylinder ? detail::VerticesHelper::phiSegments() - : detail::VerticesHelper::phiSegments( - avgPhi - halfPhi, avgPhi + halfPhi, - {static_cast(avgPhi)}); + std::vector phiRef = {}; + if (fullCylinder) { + phiRef = {static_cast(avgPhi)}; + } // Write the two bows/circles on either side std::vector sides = {-1, 1}; for (auto& side : sides) { - for (std::size_t iseg = 0; iseg < phiSegs.size() - 1; ++iseg) { - /// Helper method to create the segment - detail::VerticesHelper::createSegment( - vertices, {get(eR), get(eR)}, phiSegs[iseg], phiSegs[iseg + 1], lseg, - (iseg > 0u), Vector3(0., 0., side * get(eHalfLengthZ)), ctrans); - } + /// Helper method to create the segment + auto svertices = detail::VerticesHelper::createSegment( + {get(eR), get(eR)}, avgPhi - halfPhi, avgPhi + halfPhi, {}, lseg, + Vector3(0., 0., side * get(eHalfLengthZ)), ctrans); + vertices.insert(vertices.end(), svertices.begin(), svertices.end()); } double bevelMinZ = get(eBevelMinZ); diff --git a/Core/src/Surfaces/CylinderSurface.cpp b/Core/src/Surfaces/CylinderSurface.cpp index 7920645d074..d5cb7244d2f 100644 --- a/Core/src/Surfaces/CylinderSurface.cpp +++ b/Core/src/Surfaces/CylinderSurface.cpp @@ -195,9 +195,7 @@ Acts::Polyhedron Acts::CylinderSurface::polyhedronRepresentation( std::vector vertices = bounds().createCircles(ctrans, lseg); std::vector faces; std::vector triangularMesh; - bool fullCylinder = bounds().coversFullAzimuth(); - auto facesMesh = detail::FacesHelper::cylindricalFaceMesh(vertices, fullCylinder); return Polyhedron(vertices, facesMesh.first, facesMesh.second, false); diff --git a/Core/src/Surfaces/StrawSurface.cpp b/Core/src/Surfaces/StrawSurface.cpp index fff6d9df49c..4cbbb0fcdd1 100644 --- a/Core/src/Surfaces/StrawSurface.cpp +++ b/Core/src/Surfaces/StrawSurface.cpp @@ -58,18 +58,15 @@ Acts::Polyhedron Acts::StrawSurface::polyhedronRepresentation( // Draw the bounds if more than one segment are chosen if (lseg > 1) { double r = m_bounds->get(LineBounds::eR); - auto phiSegs = detail::VerticesHelper::phiSegments(); // Write the two bows/circles on either side std::vector sides = {-1, 1}; for (auto& side : sides) { - for (std::size_t iseg = 0; iseg < phiSegs.size() - 1; ++iseg) { - /// Helper method to create the segment - detail::VerticesHelper::createSegment( - vertices, {r, r}, phiSegs[iseg], phiSegs[iseg + 1], lseg, - (iseg > 0u), - Vector3(0., 0., side * m_bounds->get(LineBounds::eHalfLengthZ)), - ctransform); - } + /// Helper method to create the segment + auto svertices = detail::VerticesHelper::createSegment( + {r, r}, -M_PI, M_PI, {}, lseg, + Vector3(0., 0., side * m_bounds->get(LineBounds::eHalfLengthZ)), + ctransform); + vertices.insert(vertices.end(), svertices.begin(), svertices.end()); } auto facesMesh = detail::FacesHelper::cylindricalFaceMesh(vertices); faces = facesMesh.first; diff --git a/Core/src/Surfaces/VerticesHelper.cpp b/Core/src/Surfaces/VerticesHelper.cpp index b4cea23732a..3beeed066b8 100644 --- a/Core/src/Surfaces/VerticesHelper.cpp +++ b/Core/src/Surfaces/VerticesHelper.cpp @@ -13,37 +13,56 @@ std::vector Acts::detail::VerticesHelper::phiSegments( ActsScalar phiMin, ActsScalar phiMax, - const std::vector& phiRefs, ActsScalar phiTolerance) { - // This is to ensure that the extrema are built regardless of number - // of segments - std::vector phiSegments; - std::vector quarters = {-M_PI, -0.5 * M_PI, 0., 0.5 * M_PI, M_PI}; - // It does not cover the full azimuth - if (phiMin != -M_PI || phiMax != M_PI) { - phiSegments.push_back(phiMin); - for (unsigned int iq = 1; iq < 4; ++iq) { - if (phiMin < quarters[iq] && phiMax > quarters[iq]) { - phiSegments.push_back(quarters[iq]); - } + const std::vector& phiRefs, unsigned int minSegments) { + // Check that the phi range is valid + if (phiMin > phiMax) { + throw std::invalid_argument( + "VerticesHelper::phiSegments ... Minimum phi must be smaller than " + "maximum phi"); + } + + // First check that no reference phi is outside the range + for (const auto& phiRef : phiRefs) { + if (phiRef < phiMin || phiRef > phiMax) { + throw std::invalid_argument( + "VerticesHelper::phiSegments ... Reference phi is outside the range " + "of the segment"); } - phiSegments.push_back(phiMax); - } else { - phiSegments = quarters; } - // Insert the reference phis if - if (!phiRefs.empty()) { - for (const auto& phiRef : phiRefs) { - // Trying to find the right patch - auto match = std::find_if( - phiSegments.begin(), phiSegments.end(), [&](ActsScalar phiSeg) { - return std::abs(phiSeg - phiRef) < phiTolerance; - }); - if (match == phiSegments.end()) { + // Bail out if minSegmens is smaler 4 or not a multiple of 4 + if (minSegments < 4 || minSegments % 4 != 0) { + throw std::invalid_argument( + "VerticesHelper::phiSegments ...Minimum number of segments must be a " + "multiple " + "of 4 and at least 4"); + } + std::vector phiSegments = {phiMin, phiMax}; + // Minimum approximation for a circle need + for (unsigned int i = 0; i < minSegments + 1; ++i) { + ActsScalar phiExt = -M_PI + i * 2 * M_PI / minSegments; + if (phiExt > phiMin && phiExt < phiMax && + std::find_if(phiSegments.begin(), phiSegments.end(), + [&phiExt](ActsScalar phi) { + return std::abs(phi - phiExt) < + std::numeric_limits::epsilon(); + }) == phiSegments.end()) { + phiSegments.push_back(phiExt); + } + } + // Add the reference phis + for (const auto& phiRef : phiRefs) { + if (phiRef > phiMin && phiRef < phiMax) { + if (std::find_if(phiSegments.begin(), phiSegments.end(), + [&phiRef](ActsScalar phi) { + return std::abs(phi - phiRef) < + std::numeric_limits::epsilon(); + }) == phiSegments.end()) { phiSegments.push_back(phiRef); } } - std::sort(phiSegments.begin(), phiSegments.end()); } + // Sort the phis + std::sort(phiSegments.begin(), phiSegments.end()); return phiSegments; } @@ -60,21 +79,13 @@ std::vector Acts::detail::VerticesHelper::ellipsoidVertices( bool innerExists = (innerRx > 0. && innerRy > 0.); bool closed = std::abs(halfPhi - M_PI) < s_onSurfaceTolerance; - // Get the phi segments from the helper method - auto phiSegs = detail::VerticesHelper::phiSegments( - avgPhi - halfPhi, avgPhi + halfPhi, {avgPhi}); - // The inner (if exists) and outer bow - for (unsigned int iseg = 0; iseg < phiSegs.size() - 1; ++iseg) { - if (innerExists) { - createSegment(ivertices, {innerRx, innerRy}, - phiSegs[iseg], phiSegs[iseg + 1], lseg, - (iseg > 0u)); - } - createSegment(overtices, {outerRx, outerRy}, - phiSegs[iseg], phiSegs[iseg + 1], lseg, - (iseg > 0u)); + if (innerExists) { + ivertices = createSegment( + {innerRx, innerRy}, avgPhi - halfPhi, avgPhi + halfPhi, {}, lseg); } + overtices = createSegment( + {outerRx, outerRy}, avgPhi - halfPhi, avgPhi + halfPhi, {}, lseg); // We want to keep the same counter-clockwise orientation for displaying if (!innerExists) { diff --git a/Tests/UnitTests/Core/Surfaces/VerticesHelperTests.cpp b/Tests/UnitTests/Core/Surfaces/VerticesHelperTests.cpp index 4d59072faa8..6ebc679ddd0 100644 --- a/Tests/UnitTests/Core/Surfaces/VerticesHelperTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/VerticesHelperTests.cpp @@ -92,6 +92,59 @@ BOOST_AUTO_TEST_CASE(VerticesHelperOnHyperPlane) { } } +BOOST_AUTO_TEST_CASE(GeneratePhiSegments) { + // Case (1): a small segment is given, no cartesian maximum vertex + ActsScalar minPhi = 0.1; + ActsScalar maxPhi = 0.3; + + auto phis = VerticesHelper::phiSegments(minPhi, maxPhi); + BOOST_CHECK_EQUAL(phis.size(), 2u); + BOOST_CHECK(phis[0] == minPhi); + BOOST_CHECK(phis[1] == maxPhi); + + // Case (2) a small segment is given, with one maximum vertex at phi = 0 + minPhi = -0.1; + phis = VerticesHelper::phiSegments(minPhi, maxPhi); + BOOST_CHECK_EQUAL(phis.size(), 3u); + BOOST_CHECK(phis[0] == minPhi); + BOOST_CHECK(phis[1] == 0.); + BOOST_CHECK(phis[2] == maxPhi); + + // Case (3) a small segment is given, with one maximum vertex at phi = 2pi, + // and one extra value + phis = VerticesHelper::phiSegments(minPhi, maxPhi, {0.25}); + BOOST_CHECK_EQUAL(phis.size(), 4u); + BOOST_CHECK(phis[0] == minPhi); + BOOST_CHECK(phis[1] == 0.); + BOOST_CHECK(phis[2] == 0.25); + BOOST_CHECK(phis[3] == maxPhi); + + // Case (4) a small segment is given, with one maximum vertex at phi = 2pi, + // and two extra values, one outside & hence throw an exception + BOOST_CHECK_THROW(VerticesHelper::phiSegments(minPhi, maxPhi, {0.25, 0.5}), + std::invalid_argument); + + // Case (5) an invalid phi range is given + BOOST_CHECK_THROW(VerticesHelper::phiSegments(0.8, 0.2, {0.25, 0.5}), + std::invalid_argument); + + // Case (6) a wrong number of minimum segments is given + BOOST_CHECK_THROW(VerticesHelper::phiSegments(0.1, 0.3, {0.25, 0.5}, 3), + std::invalid_argument); +} + +BOOST_AUTO_TEST_CASE(GeneratCircularSegments) { + // Case (1): a small segment is given, no cartesian maximum vertex & 1 step + // segment + ActsScalar rx = 10.; + ActsScalar ry = 10.; + ActsScalar minPhi = 0.1; + ActsScalar maxPhi = 0.3; + + auto vertices = VerticesHelper::createSegment( + {rx, ry}, minPhi, maxPhi, {}, 72); +} + BOOST_AUTO_TEST_SUITE_END() } // namespace Acts::detail::Test diff --git a/Tests/UnitTests/Core/Visualization/SurfaceView3DBase.hpp b/Tests/UnitTests/Core/Visualization/SurfaceView3DBase.hpp index 8de0a7fda5a..960c4e88f95 100644 --- a/Tests/UnitTests/Core/Visualization/SurfaceView3DBase.hpp +++ b/Tests/UnitTests/Core/Visualization/SurfaceView3DBase.hpp @@ -68,7 +68,7 @@ static inline std::string run(IVisualization3D& helper, bool triangulate, coneSurfaces.push_back(cone); GeometryView3D::drawSurface(helper, *cone, gctx, Transform3::Identity(), sConfig); - ; + helper.write(std::string("Surfaces_ConeSurface") + tag); helper.write(cStream); helper.clear(); @@ -80,7 +80,7 @@ static inline std::string run(IVisualization3D& helper, bool triangulate, coneSurfaces.push_back(cone); GeometryView3D::drawSurface(helper, *cone, gctx, Transform3::Identity(), sConfig); - ; + helper.write(std::string("Surfaces_ConeSurfaceSector") + tag); helper.write(cStream); helper.clear(); @@ -92,7 +92,7 @@ static inline std::string run(IVisualization3D& helper, bool triangulate, coneSurfaces.push_back(cone); GeometryView3D::drawSurface(helper, *cone, gctx, Transform3::Identity(), sConfig); - ; + helper.write(std::string("Surfaces_ConeSurfaceSectorShifted") + tag); helper.write(cStream); helper.clear(); @@ -126,7 +126,7 @@ static inline std::string run(IVisualization3D& helper, bool triangulate, cylinderSurfaces.push_back(cylinder); GeometryView3D::drawSurface(helper, *cylinder, gctx, Transform3::Identity(), sConfig); - ; + helper.write(std::string("Surfaces_CylinderSurface") + tag); helper.write(cStream); helper.clear(); @@ -138,7 +138,7 @@ static inline std::string run(IVisualization3D& helper, bool triangulate, cylinderSurfaces.push_back(cylinder); GeometryView3D::drawSurface(helper, *cylinder, gctx, Transform3::Identity(), sConfig); - ; + helper.write(std::string("Surfaces_CylinderSurfaceSector") + tag); helper.write(cStream); helper.clear(); @@ -150,7 +150,7 @@ static inline std::string run(IVisualization3D& helper, bool triangulate, cylinderSurfaces.push_back(cylinder); GeometryView3D::drawSurface(helper, *cylinder, gctx, Transform3::Identity(), sConfig); - ; + helper.write(std::string("Surfaces_CylinderSurfaceSectorShifted") + tag); helper.write(cStream); helper.clear(); @@ -179,7 +179,7 @@ static inline std::string run(IVisualization3D& helper, bool triangulate, auto bbSurface = Surface::makeShared(identity, bbBounds); GeometryView3D::drawSurface(helper, *bbSurface, gctx, Transform3::Identity(), sConfig); - ; + helper.write(bbPath); helper.write(cStream); helper.clear(); @@ -199,7 +199,7 @@ static inline std::string run(IVisualization3D& helper, bool triangulate, radialSurfaces.push_back(disc); GeometryView3D::drawSurface(helper, *disc, gctx, Transform3::Identity(), sConfig); - ; + helper.write(std::string("Surfaces_DiscSurfaceFull") + tag); helper.write(cStream); helper.clear(); @@ -335,7 +335,7 @@ static inline std::string run(IVisualization3D& helper, bool triangulate, planarSurfaces.push_back(plane); GeometryView3D::drawSurface(helper, *plane, gctx, Transform3::Identity(), sConfig); - ; + helper.write(name + tag); helper.write(cStream); helper.clear(); @@ -349,7 +349,7 @@ static inline std::string run(IVisualization3D& helper, bool triangulate, planarSurfaces.push_back(plane); GeometryView3D::drawSurface(helper, *plane, gctx, Transform3::Identity(), sConfig); - ; + helper.write(name + tag); helper.write(cStream); helper.clear(); @@ -363,7 +363,7 @@ static inline std::string run(IVisualization3D& helper, bool triangulate, planarSurfaces.push_back(plane); GeometryView3D::drawSurface(helper, *plane, gctx, Transform3::Identity(), sConfig); - ; + helper.write(name + tag); helper.write(cStream); helper.clear(); @@ -377,7 +377,7 @@ static inline std::string run(IVisualization3D& helper, bool triangulate, planarSurfaces.push_back(plane); GeometryView3D::drawSurface(helper, *plane, gctx, Transform3::Identity(), sConfig); - ; + helper.write(name + tag); helper.write(cStream); helper.clear(); diff --git a/Tests/UnitTests/Plugins/TGeo/TGeoTubeConversionTests.cpp b/Tests/UnitTests/Plugins/TGeo/TGeoTubeConversionTests.cpp index dd9340de81c..e9b38af7ccb 100644 --- a/Tests/UnitTests/Plugins/TGeo/TGeoTubeConversionTests.cpp +++ b/Tests/UnitTests/Plugins/TGeo/TGeoTubeConversionTests.cpp @@ -44,8 +44,8 @@ ViewConfig red({200, 0, 0}); ViewConfig green({0, 200, 0}); ViewConfig blue({0, 0, 200}); -std::vector allowedAxes = {"XY*", "Xy*", "xy*", "xY*", - "YX*", "yx*", "yX*", "Yx*"}; +std::vector allowedAxes = {"XY*"}; //, "Xy*", "xy*", "xY*", + // "YX*", "yx*", "yX*", "Yx*"}; std::vector notAllowedAxes = {"YZ*", "ZX*", "ZY*"}; @@ -99,7 +99,6 @@ BOOST_AUTO_TEST_CASE(TGeoTube_to_CylinderSurface) { objVis, center, center + 1.2 * bR * rotation.col(1), 4., 2.5, green); GeometryView3D::drawArrowForward( objVis, center, center + 1.2 * bhZ * rotation.col(2), 4., 2.5, blue); - objVis.write("TGeoConversion_TGeoTube_CylinderSurface_" + std::to_string(icyl)); objVis.clear(); From 863cc15c45aa0684993795c4dbcf3855eec0fe07 Mon Sep 17 00:00:00 2001 From: Andreas Salzburger Date: Fri, 19 Jul 2024 17:11:15 +0200 Subject: [PATCH 03/31] enable tests --- Tests/UnitTests/Plugins/TGeo/TGeoTubeConversionTests.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/UnitTests/Plugins/TGeo/TGeoTubeConversionTests.cpp b/Tests/UnitTests/Plugins/TGeo/TGeoTubeConversionTests.cpp index e9b38af7ccb..d6817bc14e9 100644 --- a/Tests/UnitTests/Plugins/TGeo/TGeoTubeConversionTests.cpp +++ b/Tests/UnitTests/Plugins/TGeo/TGeoTubeConversionTests.cpp @@ -44,8 +44,8 @@ ViewConfig red({200, 0, 0}); ViewConfig green({0, 200, 0}); ViewConfig blue({0, 0, 200}); -std::vector allowedAxes = {"XY*"}; //, "Xy*", "xy*", "xY*", - // "YX*", "yx*", "yX*", "Yx*"}; +std::vector allowedAxes = {"XY*", "Xy*", "xy*", "xY*", + "YX*", "yx*", "yX*", "Yx*"}; std::vector notAllowedAxes = {"YZ*", "ZX*", "ZY*"}; From dbaa93d837c4c4e197745e380b3e07e330f35806 Mon Sep 17 00:00:00 2001 From: Andreas Salzburger Date: Mon, 22 Jul 2024 16:52:32 +0200 Subject: [PATCH 04/31] change nSegment handling in Polyhedron and Visualization --- .../Acts/Detector/LayerStructureBuilder.hpp | 5 +- Core/include/Acts/Surfaces/AnnulusBounds.hpp | 15 ++-- Core/include/Acts/Surfaces/ConeSurface.hpp | 15 ++-- .../Acts/Surfaces/ConvexPolygonBounds.hpp | 4 +- .../Acts/Surfaces/ConvexPolygonBounds.ipp | 2 +- Core/include/Acts/Surfaces/CylinderBounds.hpp | 16 ++-- .../include/Acts/Surfaces/CylinderSurface.hpp | 16 ++-- Core/include/Acts/Surfaces/DiamondBounds.hpp | 10 +-- Core/include/Acts/Surfaces/DiscBounds.hpp | 11 ++- Core/include/Acts/Surfaces/DiscSurface.hpp | 9 +-- .../Acts/Surfaces/DiscTrapezoidBounds.hpp | 8 +- Core/include/Acts/Surfaces/EllipseBounds.hpp | 11 ++- Core/include/Acts/Surfaces/PerigeeSurface.hpp | 4 +- Core/include/Acts/Surfaces/PlanarBounds.hpp | 11 +-- Core/include/Acts/Surfaces/PlaneSurface.hpp | 12 +-- .../include/Acts/Surfaces/RectangleBounds.hpp | 7 +- Core/include/Acts/Surfaces/StrawSurface.hpp | 8 +- Core/include/Acts/Surfaces/Surface.hpp | 15 ++-- Core/include/Acts/Surfaces/SurfaceConcept.hpp | 2 +- .../include/Acts/Surfaces/TrapezoidBounds.hpp | 6 +- .../Acts/Surfaces/detail/FacesHelper.hpp | 6 +- .../Acts/Surfaces/detail/VerticesHelper.hpp | 31 ++++---- .../include/Acts/Visualization/ViewConfig.hpp | 4 +- Core/src/Detector/LayerStructureBuilder.cpp | 3 +- Core/src/Surfaces/AnnulusBounds.cpp | 16 ++-- Core/src/Surfaces/CMakeLists.txt | 2 +- Core/src/Surfaces/ConeSurface.cpp | 14 ++-- Core/src/Surfaces/CylinderBounds.cpp | 24 +++--- Core/src/Surfaces/CylinderSurface.cpp | 9 +-- Core/src/Surfaces/DiamondBounds.cpp | 2 +- Core/src/Surfaces/DiscSurface.cpp | 6 +- Core/src/Surfaces/DiscTrapezoidBounds.cpp | 2 +- Core/src/Surfaces/EllipseBounds.cpp | 4 +- Core/src/Surfaces/PerigeeSurface.cpp | 2 +- Core/src/Surfaces/PlaneSurface.cpp | 5 +- Core/src/Surfaces/StrawSurface.cpp | 8 +- Core/src/Surfaces/TrapezoidBounds.cpp | 2 +- .../Surfaces/{ => detail}/VerticesHelper.cpp | 35 +++++---- Core/src/Visualization/EventDataView3D.cpp | 4 +- Core/src/Visualization/GeometryView3D.cpp | 7 +- .../TGeoDetector/TGeoITkModuleSplitter.hpp | 2 +- .../ActsExamples/Io/Svg/SvgDefaults.hpp | 6 +- Examples/Python/src/Geometry.cpp | 2 +- Examples/Python/src/Obj.cpp | 4 +- Examples/Python/src/Output.cpp | 2 +- Examples/Python/src/Svg.cpp | 2 +- .../include/Acts/Plugins/ActSVG/SvgUtils.hpp | 4 +- Plugins/ActSVG/src/SurfaceSvgConverter.cpp | 7 +- .../DD4hep/DD4hepDetectorSurfaceFactory.hpp | 4 +- .../Plugins/DD4hep/DD4hepLayerStructure.hpp | 4 +- .../src/DD4hepDetectorSurfaceFactory.cpp | 4 +- Plugins/DD4hep/src/DD4hepLayerStructure.cpp | 2 +- .../GeoModel/GeoModelBlueprintCreater.hpp | 4 +- .../GeoModel/src/GeoModelBlueprintCreater.cpp | 2 +- .../Tests/CommonHelpers/LineSurfaceStub.hpp | 4 +- .../Core/Surfaces/AnnulusBoundsTests.cpp | 27 ++++++- .../Surfaces/ConvexPolygonBoundsTests.cpp | 4 + .../Core/Surfaces/PolyhedronSurfacesTests.cpp | 46 ++++++------ Tests/UnitTests/Core/Surfaces/SurfaceStub.hpp | 2 +- .../Core/Surfaces/VerticesHelperTests.cpp | 74 ++++++++++++++++++- .../Visualization/EventDataView3DTests.cpp | 8 +- .../TrackingGeometryView3DBase.hpp | 6 +- .../IndexedSurfacesSvgConverterTests.cpp | 2 +- .../Plugins/ActSVG/LayerSvgConverterTests.cpp | 23 +++--- .../ActSVG/PortalSvgConverterTests.cpp | 4 +- .../ActSVG/SurfaceSvgConverterTests.cpp | 4 +- .../TrackingGeometrySvgConverterTests.cpp | 2 +- 67 files changed, 374 insertions(+), 254 deletions(-) rename Core/src/Surfaces/{ => detail}/VerticesHelper.cpp (83%) diff --git a/Core/include/Acts/Detector/LayerStructureBuilder.hpp b/Core/include/Acts/Detector/LayerStructureBuilder.hpp index afc04463cc5..caa8c8f9026 100644 --- a/Core/include/Acts/Detector/LayerStructureBuilder.hpp +++ b/Core/include/Acts/Detector/LayerStructureBuilder.hpp @@ -91,8 +91,9 @@ class LayerStructureBuilder : public IInternalStructureBuilder { /// Minimum number of surfaces to build an internal structure /// - otherwise the tryAll options is used unsigned int nMinimalSurfaces = 4u; - /// Polyhedron approximations - unsigned int nSegments = 1u; + /// Polyhedron approximations: number of segments to be used + /// to approximate a quater of a circle + unsigned int quaterSegments = 1u; /// Extra information, mainly for screen output std::string auxiliary = ""; }; diff --git a/Core/include/Acts/Surfaces/AnnulusBounds.hpp b/Core/include/Acts/Surfaces/AnnulusBounds.hpp index 548512f8100..d7324d8d292 100644 --- a/Core/include/Acts/Surfaces/AnnulusBounds.hpp +++ b/Core/include/Acts/Surfaces/AnnulusBounds.hpp @@ -133,19 +133,20 @@ class AnnulusBounds : public DiscBounds { std::vector corners() const; /// This method returns the xy coordinates of the four corners of the - /// bounds in module coordinates (in x/y) + /// bounds in module coordinates (in x/y), and if quarterSegments is bigger of + /// equal to 0, the curved part of the segment is included and approximated + /// by the cooresponding number of segments. + /// /// Starting from the upper right (max R, pos locX) and proceeding clock-wise /// i.e. (max R; pos locX), (min R; pos locX), (min R; neg loc X), (max R: neg /// locX) /// - /// @param lseg the number of segments used to approximate - /// and eventually curved line - /// - /// @note that that if @c lseg > 0, the extrema points are given, - /// which may slightly alter the number of segments returned + /// @param quarterSegments the number of segments used to approximate + /// a quarter of a circle /// /// @return vector for vertices in 2D - std::vector vertices(unsigned int lseg) const override; + std::vector vertices( + unsigned int quarterSegments = 2u) const override; /// This method returns inner radius double rMin() const final; diff --git a/Core/include/Acts/Surfaces/ConeSurface.hpp b/Core/include/Acts/Surfaces/ConeSurface.hpp index 45377c2de68..a7593a83b2d 100644 --- a/Core/include/Acts/Surfaces/ConeSurface.hpp +++ b/Core/include/Acts/Surfaces/ConeSurface.hpp @@ -200,15 +200,16 @@ class ConeSurface : public RegularSurface { /// Return a Polyhedron for the surfaces /// /// @param gctx The current geometry context object, e.g. alignment - /// @param lseg Number of segments along curved lines, it represents - /// the full 2*M_PI coverange, if lseg is set to 1 only the extrema - /// are given - /// @note that a surface transform can invalidate the extrema - /// in the transformed space + /// @param quarterSegments Number of segments used to approximate a quarter + /// + /// @note The phi extrema points at (-pi, -1/2 pi, 0, 1/2 pi) that fall within + /// the surface will be inserted to guarantee an appropriate extent + /// measurement in x and y /// /// @return A list of vertices and a face/facett description of it - Polyhedron polyhedronRepresentation(const GeometryContext& gctx, - std::size_t lseg) const override; + Polyhedron polyhedronRepresentation( + const GeometryContext& gctx, + unsigned int quarterSegments = 2u) const override; /// Return properly formatted class name for screen output std::string name() const override; diff --git a/Core/include/Acts/Surfaces/ConvexPolygonBounds.hpp b/Core/include/Acts/Surfaces/ConvexPolygonBounds.hpp index 96aa0b33bc3..f4add23da7b 100644 --- a/Core/include/Acts/Surfaces/ConvexPolygonBounds.hpp +++ b/Core/include/Acts/Surfaces/ConvexPolygonBounds.hpp @@ -112,13 +112,13 @@ class ConvexPolygonBounds : public ConvexPolygonBoundsBase { /// Return the vertices /// - /// @param lseg the number of segments used to approximate + /// @param ignoredSegments the number of segments used to approximate /// and eventually curved line /// /// @note the number of segments is ignored in this representation /// /// @return vector for vertices in 2D - std::vector vertices(unsigned int lseg = 1) const final; + std::vector vertices(unsigned int ignoredSegments = 0u) const final; /// Return a rectangle bounds object that encloses this polygon. /// @return The rectangular bounds diff --git a/Core/include/Acts/Surfaces/ConvexPolygonBounds.ipp b/Core/include/Acts/Surfaces/ConvexPolygonBounds.ipp index 88ddbe8db10..c0587ba0214 100644 --- a/Core/include/Acts/Surfaces/ConvexPolygonBounds.ipp +++ b/Core/include/Acts/Surfaces/ConvexPolygonBounds.ipp @@ -112,7 +112,7 @@ bool Acts::ConvexPolygonBounds::inside( template std::vector Acts::ConvexPolygonBounds::vertices( - unsigned int /*lseg*/) const { + unsigned int /*ignoredSegments*/) const { return {m_vertices.begin(), m_vertices.end()}; } diff --git a/Core/include/Acts/Surfaces/CylinderBounds.hpp b/Core/include/Acts/Surfaces/CylinderBounds.hpp index c291ae1ea56..3c34f798bea 100644 --- a/Core/include/Acts/Surfaces/CylinderBounds.hpp +++ b/Core/include/Acts/Surfaces/CylinderBounds.hpp @@ -112,12 +112,18 @@ class CylinderBounds : public SurfaceBounds { /// Returns true for full phi coverage bool coversFullAzimuth() const; - /// Create the bows/circles on either side of the cylinder + /// Create the bow/circle vertices on either side of the cylinder /// - /// @param trans is the global transform - /// @param lseg are the numbero if phi segments - std::vector createCircles(const Transform3 trans, - std::size_t lseg) const; + /// @param transform is the global transform + /// @param quarterSegments is the number of segments to approximate a quarter + /// of a circle. In oder to symmetrize fully closed and sectoral cylinders, + /// also in the first case the two end points are given (albeit they overlap) + /// in -pi / pi + /// + /// @return a signle vector containing the vertices from one side and then + /// from the other side consecutively + std::vector circleVertices(const Transform3 transform, + unsigned int quarterSegments) const; /// Output Method for std::ostream std::ostream& toStream(std::ostream& sl) const final; diff --git a/Core/include/Acts/Surfaces/CylinderSurface.hpp b/Core/include/Acts/Surfaces/CylinderSurface.hpp index b7daa6c3f08..8fb5676598f 100644 --- a/Core/include/Acts/Surfaces/CylinderSurface.hpp +++ b/Core/include/Acts/Surfaces/CylinderSurface.hpp @@ -214,14 +214,20 @@ class CylinderSurface : public RegularSurface { /// Return a Polyhedron for a cylinder /// + /// This method represents the cylinder as a polyhedron with a given number + /// of segments to represent the full 2*M_PI curve. The polyedron will consist + /// of the vertices of the cylinder on both sides, and faces between them, + /// both as rectangular faces and as triangular faces. + /// /// @param gctx The current geometry context object, e.g. alignment - /// @param lseg Number of segments along curved lines, it represents - /// the full 2*M_PI coverange, if lseg is set to 1 only the extrema - /// are given + /// @param quarterSegments The number of segmetns to approximate a quarter of the + /// full circle; it it's chosen to be 1, only the extrema points (-pi, -0.5pi, + /// 0., 0.5pi) are inserted to capture the correct extent in the x-y plane /// /// @return A list of vertices and a face/facett description of it - Polyhedron polyhedronRepresentation(const GeometryContext& gctx, - std::size_t lseg) const override; + Polyhedron polyhedronRepresentation( + const GeometryContext& gctx, + unsigned int quarterSegments = 2u) const override; /// Calculate the derivative of path length at the geometry constraint or /// point-of-closest-approach w.r.t. alignment parameters of the surface (i.e. diff --git a/Core/include/Acts/Surfaces/DiamondBounds.hpp b/Core/include/Acts/Surfaces/DiamondBounds.hpp index 3e50e934bbb..d2bf720d0f6 100644 --- a/Core/include/Acts/Surfaces/DiamondBounds.hpp +++ b/Core/include/Acts/Surfaces/DiamondBounds.hpp @@ -90,15 +90,13 @@ class DiamondBounds : public PlanarBounds { bool inside(const Vector2& lposition, const BoundaryTolerance& boundaryTolerance) const final; - /// Return the vertices + /// Return the vertices that describe this shape /// - /// @param lseg the number of segments used to approximate - /// and eventually curved line - /// - /// @note the number of segments is ignored for this representation + /// @param ignoredSegments is an ignored parameter only used for + /// curved bound segments /// /// @return vector for vertices in 2D - std::vector vertices(unsigned int lseg = 1) const final; + std::vector vertices(unsigned int ignoredSegments = 0u) const final; // Bounding box representation const RectangleBounds& boundingBox() const final; diff --git a/Core/include/Acts/Surfaces/DiscBounds.hpp b/Core/include/Acts/Surfaces/DiscBounds.hpp index cc4a8a265ee..7583a33f199 100644 --- a/Core/include/Acts/Surfaces/DiscBounds.hpp +++ b/Core/include/Acts/Surfaces/DiscBounds.hpp @@ -29,14 +29,13 @@ class DiscBounds : public SurfaceBounds { /// Return the vertices /// - /// @param lseg the number of segments used to approximate - /// and eventually curved line, the number refers to full 2*PI - /// - /// @note that the extremas are given, which may slightly alter the - /// number of segments returned + /// @param quarterSegments The number of segments used to describe a quarter + /// of a circle, if it is 1, then only the extrema points in phi are inserted + /// next to the segment corners /// /// @return vector for vertices in 2D - virtual std::vector vertices(unsigned int lseg) const = 0; + virtual std::vector vertices( + unsigned int quarterSegments = 2u) const = 0; /// Returns a reference radius for binning virtual double binningValueR() const = 0; diff --git a/Core/include/Acts/Surfaces/DiscSurface.hpp b/Core/include/Acts/Surfaces/DiscSurface.hpp index 4649516cc8c..24fe1feb687 100644 --- a/Core/include/Acts/Surfaces/DiscSurface.hpp +++ b/Core/include/Acts/Surfaces/DiscSurface.hpp @@ -312,13 +312,12 @@ class DiscSurface : public RegularSurface { /// Return a Polyhedron for the surfaces /// /// @param gctx The current geometry context object, e.g. alignment - /// @param lseg Number of segments along curved lines, it represents - /// the full 2*M_PI coverange, if lseg is set to 1 only the extrema - /// are given + /// @param quarterSegments Number of segments used to describe the + /// quarter of a full cirlce /// /// @return A list of vertices and a face/facett description of it - Polyhedron polyhedronRepresentation(const GeometryContext& gctx, - std::size_t lseg) const override; + Polyhedron polyhedronRepresentation( + const GeometryContext& gctx, unsigned int quarterSegments) const override; /// Calculate the derivative of bound track parameters local position w.r.t. /// position in local 3D Cartesian coordinates diff --git a/Core/include/Acts/Surfaces/DiscTrapezoidBounds.hpp b/Core/include/Acts/Surfaces/DiscTrapezoidBounds.hpp index b1f92d96f5c..5b3131889bd 100644 --- a/Core/include/Acts/Surfaces/DiscTrapezoidBounds.hpp +++ b/Core/include/Acts/Surfaces/DiscTrapezoidBounds.hpp @@ -123,13 +123,11 @@ class DiscTrapezoidBounds : public DiscBounds { /// This method returns the xy coordinates of the four corners of the /// bounds in module coorindates (in xy) /// - /// @param lseg the number of segments used to approximate - /// and eventually curved line - /// - /// @note that the number of segments are ignored for this surface + /// @param ignoredSegments is an ignored parameter only used for + /// curved bound segments /// /// @return vector for vertices in 2D - std::vector vertices(unsigned int lseg) const final; + std::vector vertices(unsigned int ignoredSegments = 0u) const final; private: std::array m_values; diff --git a/Core/include/Acts/Surfaces/EllipseBounds.hpp b/Core/include/Acts/Surfaces/EllipseBounds.hpp index 1f3d03b7d29..b3fa87ffbec 100644 --- a/Core/include/Acts/Surfaces/EllipseBounds.hpp +++ b/Core/include/Acts/Surfaces/EllipseBounds.hpp @@ -92,14 +92,13 @@ class EllipseBounds : public PlanarBounds { /// Return the vertices /// - /// @param lseg the number of segments used to approximate - /// and eventually curved line, here it refers to the full 2PI Ellipse - /// - /// @note the number of segments to may be altered by also providing - /// the extremas in all direction + /// @param quarterSegments is the number of segments to approximate a quarter + /// of a circle. In oder to symmetrize fully closed and sectoral cylinders, + /// also in the first case the two end points are given (albeit they overlap) + /// in -pi / pi /// /// @return vector for vertices in 2D - std::vector vertices(unsigned int lseg) const final; + std::vector vertices(unsigned int quarterSegments) const final; // Bounding box representation const RectangleBounds& boundingBox() const final; diff --git a/Core/include/Acts/Surfaces/PerigeeSurface.hpp b/Core/include/Acts/Surfaces/PerigeeSurface.hpp index c5ea7e957c7..b46620072f1 100644 --- a/Core/include/Acts/Surfaces/PerigeeSurface.hpp +++ b/Core/include/Acts/Surfaces/PerigeeSurface.hpp @@ -76,11 +76,11 @@ class PerigeeSurface : public LineSurface { /// Return a Polyhedron for the surfaces /// /// @param gctx The current geometry context object, e.g. alignment - /// @param lseg is ignored for a perigee @note ignored + /// @param ingoreSegments is an ignored parameter /// /// @return A list of vertices and a face/facett description of it Polyhedron polyhedronRepresentation(const GeometryContext& gctx, - std::size_t lseg) const final; + unsigned int ingoreSegments) const final; protected: /// Output Method for std::ostream diff --git a/Core/include/Acts/Surfaces/PlanarBounds.hpp b/Core/include/Acts/Surfaces/PlanarBounds.hpp index 22762fc3e1e..bf9d5a896c5 100644 --- a/Core/include/Acts/Surfaces/PlanarBounds.hpp +++ b/Core/include/Acts/Surfaces/PlanarBounds.hpp @@ -26,14 +26,15 @@ class PlanarBounds : public SurfaceBounds { public: /// Return the vertices /// - /// @param lseg the number of segments used to approximate - /// and eventually curved line + /// @param quarterSegments is the number of segments used to describe curved + /// segments in a quarter of the phi range. If it is 1, then only the extrema + /// points in phi are inserted next to the segment corners. /// - /// @note that the extremas are given, which may slightly alter the - /// number of segments returned + /// @note for planar bounds without curved segements @c quarterSegments is ignored /// /// @return vector for vertices in 2D - virtual std::vector vertices(unsigned int lseg = 1) const = 0; + virtual std::vector vertices( + unsigned int quarterSegments = 2u) const = 0; /// Bounding box parameters /// diff --git a/Core/include/Acts/Surfaces/PlaneSurface.hpp b/Core/include/Acts/Surfaces/PlaneSurface.hpp index bbfa1374362..8ae044ff95f 100644 --- a/Core/include/Acts/Surfaces/PlaneSurface.hpp +++ b/Core/include/Acts/Surfaces/PlaneSurface.hpp @@ -207,13 +207,15 @@ class PlaneSurface : public RegularSurface { /// Return a Polyhedron for the surfaces /// /// @param gctx The current geometry context object, e.g. alignment - /// @param lseg Number of segments along curved lines, it represents - /// the full 2*M_PI coverange, if lseg is set to 1 only the extrema - /// are given + /// @param quarterSegments is the number of segments used to describe curved + /// segments in a quarter of the phi range. If it is 1, then only the extrema + /// points in phi are inserted next to the segment corners. + /// + /// @note for planar surfaces without curved segements @c quarterSegments is ignored /// /// @return A list of vertices and a face/facett description of it - Polyhedron polyhedronRepresentation(const GeometryContext& gctx, - std::size_t lseg) const override; + Polyhedron polyhedronRepresentation( + const GeometryContext& gctx, unsigned int quarterSegments) const override; /// Return properly formatted class name for screen output std::string name() const override; diff --git a/Core/include/Acts/Surfaces/RectangleBounds.hpp b/Core/include/Acts/Surfaces/RectangleBounds.hpp index 813e9cb2130..7d15b5b61c0 100644 --- a/Core/include/Acts/Surfaces/RectangleBounds.hpp +++ b/Core/include/Acts/Surfaces/RectangleBounds.hpp @@ -86,13 +86,12 @@ class RectangleBounds : public PlanarBounds { /// Return the vertices /// - /// @param lseg the number of segments used to approximate - /// and eventually curved line - /// + /// @param quarterSegments is the number of segments used to describe curved + /// segments in a quarter of the phi range. /// @note the number of segments is ignored in this representation /// /// @return vector for vertices in 2D - std::vector vertices(unsigned int lseg = 1) const final; + std::vector vertices(unsigned int quarterSegments = 0u) const final; // Bounding box representation const RectangleBounds& boundingBox() const final; diff --git a/Core/include/Acts/Surfaces/StrawSurface.hpp b/Core/include/Acts/Surfaces/StrawSurface.hpp index dffa85fc4a4..ead723ce628 100644 --- a/Core/include/Acts/Surfaces/StrawSurface.hpp +++ b/Core/include/Acts/Surfaces/StrawSurface.hpp @@ -92,13 +92,13 @@ class StrawSurface : public LineSurface { /// Return a Polyhedron for the surfaces /// /// @param gctx The current geometry context object, e.g. alignment - /// @param lseg Number of segments along curved lines, it represents - /// the full 2*M_PI coverange, if lseg is set to 1 only the extrema - /// are given @note if lseg is set to 1 then only the straw is created + /// @param quarterSegments is the number of segments used to describe curved + /// segments in a quarter of the phi range. If it is 1, then only the extrema + /// points in phi are inserted next to the segment corners. /// /// @return A list of vertices and a face/facett description of it Polyhedron polyhedronRepresentation(const GeometryContext& gctx, - std::size_t lseg) const final; + unsigned int quarterSegments) const final; }; inline Surface::SurfaceType StrawSurface::type() const { diff --git a/Core/include/Acts/Surfaces/Surface.hpp b/Core/include/Acts/Surfaces/Surface.hpp index f0f204d0791..b0fd2ee9e60 100644 --- a/Core/include/Acts/Surfaces/Surface.hpp +++ b/Core/include/Acts/Surfaces/Surface.hpp @@ -420,20 +420,21 @@ class Surface : public virtual GeometryObject, /// Return properly formatted class name virtual std::string name() const = 0; - /// Return a Polyhedron for this object + /// Return a Polyhedron for surface objecs /// /// @param gctx The current geometry context object, e.g. alignment - /// @param lseg Number of segments along curved lines, if the lseg - /// is set to one, only the corners and the extrema are given, - /// otherwise it represents the number of segments for a full 2*M_PI - /// circle and is scaled to the relevant sector + /// @param quarterSegments The number of segemtns to approximate a 0.5*pi sector, + /// which represents a quarter of the full circle + /// + /// @note In order to symmetrize the code between sectoral and closed cylinders + /// in case of closed cylinders, both (-pi, pi) are given as seperate vertices /// /// @note An internal surface transform can invalidate the extrema /// in the transformed space /// /// @return A list of vertices and a face/facett description of it - virtual Polyhedron polyhedronRepresentation(const GeometryContext& gctx, - std::size_t lseg) const = 0; + virtual Polyhedron polyhedronRepresentation( + const GeometryContext& gctx, unsigned int quarterSegments = 2u) const = 0; /// The derivative of bound track parameters w.r.t. alignment /// parameters of its reference surface (i.e. local frame origin in diff --git a/Core/include/Acts/Surfaces/SurfaceConcept.hpp b/Core/include/Acts/Surfaces/SurfaceConcept.hpp index 2f3117f58c7..2a88c1a47f4 100644 --- a/Core/include/Acts/Surfaces/SurfaceConcept.hpp +++ b/Core/include/Acts/Surfaces/SurfaceConcept.hpp @@ -87,7 +87,7 @@ concept SurfaceConcept = requires(S s, const S cs, S s2, const S cs2, { cs.name() } -> std::same_as; { - cs.polyhedronRepresentation(gctx, std::declval()) + cs.polyhedronRepresentation(gctx, std::declval()) } -> std::same_as; { diff --git a/Core/include/Acts/Surfaces/TrapezoidBounds.hpp b/Core/include/Acts/Surfaces/TrapezoidBounds.hpp index 9aeec429138..c72cf3ea6d8 100644 --- a/Core/include/Acts/Surfaces/TrapezoidBounds.hpp +++ b/Core/include/Acts/Surfaces/TrapezoidBounds.hpp @@ -108,13 +108,13 @@ class TrapezoidBounds : public PlanarBounds { /// Return the vertices /// - /// @param lseg the number of segments used to approximate - /// and eventually curved line + /// @param ignoredSegments is and ignored parameter used to describe + /// the number of segments to approximate curved sectors. /// /// @note the number of segments is ignored in this representation /// /// @return vector for vertices in 2D - std::vector vertices(unsigned int lseg = 1) const final; + std::vector vertices(unsigned int ignoredSegments = 0u) const final; // Bounding box representation const RectangleBounds& boundingBox() const final; diff --git a/Core/include/Acts/Surfaces/detail/FacesHelper.hpp b/Core/include/Acts/Surfaces/detail/FacesHelper.hpp index 075dcf93bd5..b5ce984f54c 100644 --- a/Core/include/Acts/Surfaces/detail/FacesHelper.hpp +++ b/Core/include/Acts/Surfaces/detail/FacesHelper.hpp @@ -60,14 +60,12 @@ struct FacesHelper { /// vector is splittable in half into the two bows. /// /// @param vertices The vector of vertices - /// @param fullTwoPi The indicator if the concentric face is closed static std::pair cylindricalFaceMesh( - const std::vector& vertices, bool fullTwoPi = true) { + const std::vector& vertices) { FaceVector faces; FaceVector triangularMesh; std::size_t nqfaces = static_cast(0.5 * vertices.size()); - std::size_t reduce = (!fullTwoPi) ? 1 : 0; - for (std::size_t iface = 0; iface < nqfaces - reduce; ++iface) { + for (std::size_t iface = 0; iface < nqfaces - 1; ++iface) { std::size_t p2 = (iface + 1 == nqfaces) ? 0 : iface + 1; std::vector face = {iface, p2, p2 + nqfaces, nqfaces + iface}; diff --git a/Core/include/Acts/Surfaces/detail/VerticesHelper.hpp b/Core/include/Acts/Surfaces/detail/VerticesHelper.hpp index fe641674f3f..5669cf0953b 100644 --- a/Core/include/Acts/Surfaces/detail/VerticesHelper.hpp +++ b/Core/include/Acts/Surfaces/detail/VerticesHelper.hpp @@ -25,14 +25,13 @@ namespace Acts::detail::VerticesHelper { /// @param phiMin the minimum phi value /// @param phiMax The second phi value /// @param phiRef is a vector of reference phi values to be included as well -/// @param minSegments approximation of a circle extrema points - default is 8 segments -/// - needs to be divisible by 4 +/// @param quarterSegments number of segments used to approximate a segement quarter /// /// @return a vector of generated phi values std::vector phiSegments(ActsScalar phiMin = -M_PI, ActsScalar phiMax = M_PI, const std::vector& phiRefs = {}, - unsigned int minSegments = 8u); + unsigned int quarterSegments = 2u); /// Helper method to create a regular 2 or 3 D segment /// between two phi values with a given number of segments @@ -47,24 +46,21 @@ std::vector phiSegments(ActsScalar phiMin = -M_PI, /// @param phiMin the minimum phi value /// @param phiMax The second phi value /// @param phiRef is a vector of reference phi values to be included as well -/// @param nSegments The number of segments for full 2*PI - 4 is the minimum approximation -/// must be either -1 or divisible by 4 +/// @param quarterSegments number of segments used to approximate a segement quarter /// @param offset The out of plane offset position of the bow /// @param transform The transform applied (optional) /// /// @return a vector of vertices template -std::vector createSegment( +std::vector segmentVertices( std::pair rXY, ActsScalar phiMin, ActsScalar phiMax, - const std::vector& phiRefs = {}, unsigned int nSegments = 8u, + const std::vector& phiRefs = {}, + unsigned int quarterSegments = 2u, const vertex_t& offset = vertex_t::Zero(), const transform_t& transform = transform_t::Identity()) { std::vector vertices; - - unsigned int nSegmentsCorr = std::max(nSegments, 8u); std::vector phis = - phiSegments(phiMin, phiMax, phiRefs, nSegmentsCorr); - + phiSegments(phiMin, phiMax, phiRefs, quarterSegments); for (auto phi : phis) { vertex_t vertex = vertex_t::Zero(); vertex(0) = rXY.first * std::cos(phi); @@ -82,14 +78,15 @@ std::vector createSegment( /// @param outerRx The radius of the outer ellipse (in x) /// @param outerRy The radius of the outer ellipse (in y) /// @param avgPhi The phi direction of the center if sector -/// @param halfPhi The half phi sector if sector -/// @param lseg The number of segments for for a full 2*pi segment +/// @param halfPhi The half phi sector of the ellipse +/// @param quarterSegments number of segments used to approximate a segement quarter +/// /// @return a vector of 2d-vectors std::vector ellipsoidVertices(ActsScalar innerRx, ActsScalar innerRy, ActsScalar outerRx, ActsScalar outerRy, ActsScalar avgPhi = 0., ActsScalar halfPhi = M_PI, - unsigned int lseg = 1); + unsigned int quarterSegments = 2u); /// Construct vertices on an disc/wheel-like bound object. /// @@ -97,12 +94,14 @@ std::vector ellipsoidVertices(ActsScalar innerRx, ActsScalar innerRy, /// @param outerR The radius of the outer circle (sector) /// @param avgPhi The phi direction of the center if sector /// @param halfPhi The half phi sector if sector -/// @param lseg The number of segments for for a full 2*pi segment +/// @param quarterSegments number of segments used to approximate a segement quarter +/// /// @return a vector of 2d-vectors std::vector circularVertices(ActsScalar innerR, ActsScalar outerR, ActsScalar avgPhi = 0., ActsScalar halfPhi = M_PI, - unsigned int lseg = 1); + unsigned int quarterSegments = 2u); + /// Check if the point is inside the polygon w/o any tolerances. /// /// @tparam vertex_container_t is an iterable container diff --git a/Core/include/Acts/Visualization/ViewConfig.hpp b/Core/include/Acts/Visualization/ViewConfig.hpp index 06c4f7a675b..a0e787e8e32 100644 --- a/Core/include/Acts/Visualization/ViewConfig.hpp +++ b/Core/include/Acts/Visualization/ViewConfig.hpp @@ -37,8 +37,8 @@ struct ViewConfig { double lineThickness = 0.15; /// The visual surface thickness for this object double surfaceThickness = 0.15; - /// The number of segments to approximate full 2pi - unsigned int nSegments = 72; + /// The number of segments to approximate a quarter of the circle + unsigned int quaterSegments = 72; /// Whether to triangulate or not bool triangulate = false; /// Write name - non-empty string indicates writing diff --git a/Core/src/Detector/LayerStructureBuilder.cpp b/Core/src/Detector/LayerStructureBuilder.cpp index 6a421671cf1..dce5f4b38d7 100644 --- a/Core/src/Detector/LayerStructureBuilder.cpp +++ b/Core/src/Detector/LayerStructureBuilder.cpp @@ -256,7 +256,8 @@ Acts::Experimental::LayerStructureBuilder::construct( if (!support.internalConstraints.empty()) { // Estimate the extent from the surfaces for (const auto& s : internalSurfaces) { - auto sPolyhedron = s->polyhedronRepresentation(gctx, m_cfg.nSegments); + auto sPolyhedron = + s->polyhedronRepresentation(gctx, m_cfg.quaterSegments); supportExtent.extend(sPolyhedron.extent(), support.internalConstraints); } diff --git a/Core/src/Surfaces/AnnulusBounds.cpp b/Core/src/Surfaces/AnnulusBounds.cpp index b9725ce792d..a63bf7b2bfe 100644 --- a/Core/src/Surfaces/AnnulusBounds.cpp +++ b/Core/src/Surfaces/AnnulusBounds.cpp @@ -103,9 +103,10 @@ std::vector Acts::AnnulusBounds::corners() const { } std::vector Acts::AnnulusBounds::vertices( - unsigned int lseg) const { - if (lseg > 0) { + unsigned int quarterSegments) const { + if (quarterSegments > 0u) { using VectorHelpers::phi; + ActsScalar phiMinInner = phi(m_inRightStripXY - m_moduleOrigin); ActsScalar phiMaxInner = phi(m_inLeftStripXY - m_moduleOrigin); @@ -114,13 +115,16 @@ std::vector Acts::AnnulusBounds::vertices( // Inner bow from phi_min -> phi_max (needs to be reversed) std::vector rvertices = - detail::VerticesHelper::createSegment( - {get(eMinR), get(eMinR)}, phiMinInner, phiMaxInner, {}, lseg); + detail::VerticesHelper::segmentVertices( + {get(eMinR), get(eMinR)}, phiMinInner, phiMaxInner, {}, + quarterSegments); std::reverse(rvertices.begin(), rvertices.end()); // Outer bow from phi_min -> phi_max - auto overtices = detail::VerticesHelper::createSegment( - {get(eMaxR), get(eMaxR)}, phiMinOuter, phiMaxOuter, {}, lseg); + auto overtices = + detail::VerticesHelper::segmentVertices( + {get(eMaxR), get(eMaxR)}, phiMinOuter, phiMaxOuter, {}, + quarterSegments); rvertices.insert(rvertices.end(), overtices.begin(), overtices.end()); std::for_each(rvertices.begin(), rvertices.end(), diff --git a/Core/src/Surfaces/CMakeLists.txt b/Core/src/Surfaces/CMakeLists.txt index da8d198c407..c292ea38e2b 100644 --- a/Core/src/Surfaces/CMakeLists.txt +++ b/Core/src/Surfaces/CMakeLists.txt @@ -24,10 +24,10 @@ target_sources( SurfaceArray.cpp SurfaceError.cpp TrapezoidBounds.cpp - VerticesHelper.cpp RegularSurface.cpp CurvilinearSurface.cpp detail/AlignmentHelper.cpp detail/AnnulusBoundsHelper.cpp detail/MergeHelper.cpp + detail/VerticesHelper.cpp ) diff --git a/Core/src/Surfaces/ConeSurface.cpp b/Core/src/Surfaces/ConeSurface.cpp index 58a8c5329de..449076f6c7b 100644 --- a/Core/src/Surfaces/ConeSurface.cpp +++ b/Core/src/Surfaces/ConeSurface.cpp @@ -183,12 +183,11 @@ const Acts::ConeBounds& Acts::ConeSurface::bounds() const { } Acts::Polyhedron Acts::ConeSurface::polyhedronRepresentation( - const GeometryContext& gctx, std::size_t lseg) const { + const GeometryContext& gctx, unsigned int quarterSegments) const { // Prepare vertices and faces std::vector vertices; std::vector faces; std::vector triangularMesh; - ActsScalar minZ = bounds().get(ConeBounds::eMinZ); ActsScalar maxZ = bounds().get(ConeBounds::eMaxZ); @@ -202,7 +201,7 @@ Acts::Polyhedron Acts::ConeSurface::polyhedronRepresentation( // The tip - created only once and only, if it is not a cut-off cone bool tipExists = false; - if (std::abs(minZ) <= s_onSurfaceTolerance) { + if (minZ * maxZ <= s_onSurfaceTolerance) { vertices.push_back(ctransform * Vector3(0., 0., 0.)); tipExists = true; } @@ -230,9 +229,9 @@ Acts::Polyhedron Acts::ConeSurface::polyhedronRepresentation( // Radius and z offset double r = std::abs(z) * bounds().tanAlpha(); Vector3 zoffset(0., 0., z); - auto svertices = detail::VerticesHelper::createSegment( - {r, r}, avgPhi - hPhiSec, avgPhi + hPhiSec, refPhi, lseg, zoffset, - ctransform); + auto svertices = detail::VerticesHelper::segmentVertices( + {r, r}, avgPhi - hPhiSec, avgPhi + hPhiSec, refPhi, quarterSegments, + zoffset, ctransform); vertices.insert(vertices.end(), svertices.begin(), svertices.end()); // If the tip exists, the faces need to be triangular if (tipExists) { @@ -251,8 +250,7 @@ Acts::Polyhedron Acts::ConeSurface::polyhedronRepresentation( if (tipExists) { triangularMesh = faces; } else { - auto facesMesh = - detail::FacesHelper::cylindricalFaceMesh(vertices, fullCone); + auto facesMesh = detail::FacesHelper::cylindricalFaceMesh(vertices); faces = facesMesh.first; triangularMesh = facesMesh.second; } diff --git a/Core/src/Surfaces/CylinderBounds.cpp b/Core/src/Surfaces/CylinderBounds.cpp index 47d8127b128..0a445400b59 100644 --- a/Core/src/Surfaces/CylinderBounds.cpp +++ b/Core/src/Surfaces/CylinderBounds.cpp @@ -104,8 +104,8 @@ std::ostream& Acts::CylinderBounds::toStream(std::ostream& sl) const { return sl; } -std::vector Acts::CylinderBounds::createCircles( - const Transform3 ctrans, std::size_t lseg) const { +std::vector Acts::CylinderBounds::circleVertices( + const Transform3 transform, unsigned int quarterSegments) const { std::vector vertices; double avgPhi = get(eAveragePhi); @@ -121,24 +121,24 @@ std::vector Acts::CylinderBounds::createCircles( std::vector sides = {-1, 1}; for (auto& side : sides) { /// Helper method to create the segment - auto svertices = detail::VerticesHelper::createSegment( - {get(eR), get(eR)}, avgPhi - halfPhi, avgPhi + halfPhi, {}, lseg, - Vector3(0., 0., side * get(eHalfLengthZ)), ctrans); + auto svertices = detail::VerticesHelper::segmentVertices( + {get(eR), get(eR)}, avgPhi - halfPhi, avgPhi + halfPhi, phiRef, + quarterSegments, Vector3(0., 0., side * get(eHalfLengthZ)), transform); vertices.insert(vertices.end(), svertices.begin(), svertices.end()); } - double bevelMinZ = get(eBevelMinZ); - double bevelMaxZ = get(eBevelMaxZ); + ActsScalar bevelMinZ = get(eBevelMinZ); + ActsScalar bevelMaxZ = get(eBevelMaxZ); // Modify the vertices position if bevel is defined if ((bevelMinZ != 0. || bevelMaxZ != 0.) && vertices.size() % 2 == 0) { auto halfWay = vertices.end() - vertices.size() / 2; - double mult{1}; - auto invCtrans = ctrans.inverse(); - auto func = [&mult, &ctrans, &invCtrans](Vector3& v) { - v = invCtrans * v; + ActsScalar mult{1}; + auto invTransform = transform.inverse(); + auto func = [&mult, &transform, &invTransform](Vector3& v) { + v = invTransform * v; v(2) += v(1) * mult; - v = ctrans * v; + v = transform * v; }; if (bevelMinZ != 0.) { mult = std::tan(-bevelMinZ); diff --git a/Core/src/Surfaces/CylinderSurface.cpp b/Core/src/Surfaces/CylinderSurface.cpp index d5cb7244d2f..b3a8bd02ba9 100644 --- a/Core/src/Surfaces/CylinderSurface.cpp +++ b/Core/src/Surfaces/CylinderSurface.cpp @@ -188,16 +188,15 @@ const Acts::CylinderBounds& Acts::CylinderSurface::bounds() const { } Acts::Polyhedron Acts::CylinderSurface::polyhedronRepresentation( - const GeometryContext& gctx, std::size_t lseg) const { + const GeometryContext& gctx, unsigned int quarterSegments) const { auto ctrans = transform(gctx); // Prepare vertices and faces - std::vector vertices = bounds().createCircles(ctrans, lseg); + std::vector vertices = + bounds().circleVertices(ctrans, quarterSegments); std::vector faces; std::vector triangularMesh; - bool fullCylinder = bounds().coversFullAzimuth(); - auto facesMesh = - detail::FacesHelper::cylindricalFaceMesh(vertices, fullCylinder); + auto facesMesh = detail::FacesHelper::cylindricalFaceMesh(vertices); return Polyhedron(vertices, facesMesh.first, facesMesh.second, false); } diff --git a/Core/src/Surfaces/DiamondBounds.cpp b/Core/src/Surfaces/DiamondBounds.cpp index 0c30236f31e..fecd04b9638 100644 --- a/Core/src/Surfaces/DiamondBounds.cpp +++ b/Core/src/Surfaces/DiamondBounds.cpp @@ -27,7 +27,7 @@ bool Acts::DiamondBounds::inside( } std::vector Acts::DiamondBounds::vertices( - unsigned int /*lseg*/) const { + unsigned int /*ignoredSegments*/) const { // Vertices starting at lower left (min rel. phi) // counter-clockwise double x1 = get(DiamondBounds::eHalfLengthXnegY); diff --git a/Core/src/Surfaces/DiscSurface.cpp b/Core/src/Surfaces/DiscSurface.cpp index 9c6dd6f31b8..353f41ac230 100644 --- a/Core/src/Surfaces/DiscSurface.cpp +++ b/Core/src/Surfaces/DiscSurface.cpp @@ -154,7 +154,7 @@ const Acts::SurfaceBounds& Acts::DiscSurface::bounds() const { } Acts::Polyhedron Acts::DiscSurface::polyhedronRepresentation( - const GeometryContext& gctx, std::size_t lseg) const { + const GeometryContext& gctx, unsigned int quarterSegments) const { // Prepare vertices and faces std::vector vertices; std::vector faces; @@ -167,7 +167,7 @@ Acts::Polyhedron Acts::DiscSurface::polyhedronRepresentation( bool exactPolyhedron = (m_bounds->type() == SurfaceBounds::eDiscTrapezoid); bool addCentreFromConvexFace = (m_bounds->type() != SurfaceBounds::eAnnulus); if (m_bounds) { - auto vertices2D = m_bounds->vertices(lseg); + auto vertices2D = m_bounds->vertices(quarterSegments); vertices.reserve(vertices2D.size() + 1); Vector3 wCenter(0., 0., 0); for (const auto& v2D : vertices2D) { @@ -189,7 +189,7 @@ Acts::Polyhedron Acts::DiscSurface::polyhedronRepresentation( // Two concentric rings, we use the pure concentric method momentarily, // but that creates too many unneccesarry faces, when only two // are needed to describe the mesh, @todo investigate merging flag - auto facesMesh = detail::FacesHelper::cylindricalFaceMesh(vertices, true); + auto facesMesh = detail::FacesHelper::cylindricalFaceMesh(vertices); faces = facesMesh.first; triangularMesh = facesMesh.second; } diff --git a/Core/src/Surfaces/DiscTrapezoidBounds.cpp b/Core/src/Surfaces/DiscTrapezoidBounds.cpp index d83680dbd54..349eabedbcb 100644 --- a/Core/src/Surfaces/DiscTrapezoidBounds.cpp +++ b/Core/src/Surfaces/DiscTrapezoidBounds.cpp @@ -64,7 +64,7 @@ bool Acts::DiscTrapezoidBounds::inside( } std::vector Acts::DiscTrapezoidBounds::vertices( - unsigned int /*lseg*/) const { + unsigned int /*ignoredSegments*/) const { Vector2 cAxis(std::cos(get(eAveragePhi)), std::sin(get(eAveragePhi))); Vector2 nAxis(cAxis.y(), -cAxis.x()); auto ymin = std::sqrt(get(eMinR) * get(eMinR) - diff --git a/Core/src/Surfaces/EllipseBounds.cpp b/Core/src/Surfaces/EllipseBounds.cpp index 552eb740bf2..e07619b021f 100644 --- a/Core/src/Surfaces/EllipseBounds.cpp +++ b/Core/src/Surfaces/EllipseBounds.cpp @@ -61,10 +61,10 @@ bool Acts::EllipseBounds::inside( } std::vector Acts::EllipseBounds::vertices( - unsigned int lseg) const { + unsigned int quarterSegments) const { return detail::VerticesHelper::ellipsoidVertices( get(eInnerRx), get(eInnerRy), get(eOuterRx), get(eOuterRy), - get(eAveragePhi), get(eHalfPhiSector), lseg); + get(eAveragePhi), get(eHalfPhiSector), quarterSegments); } const Acts::RectangleBounds& Acts::EllipseBounds::boundingBox() const { diff --git a/Core/src/Surfaces/PerigeeSurface.cpp b/Core/src/Surfaces/PerigeeSurface.cpp index cfa85858fe2..361505171d6 100644 --- a/Core/src/Surfaces/PerigeeSurface.cpp +++ b/Core/src/Surfaces/PerigeeSurface.cpp @@ -58,7 +58,7 @@ std::ostream& Acts::PerigeeSurface::toStreamImpl(const GeometryContext& gctx, } Acts::Polyhedron Acts::PerigeeSurface::polyhedronRepresentation( - const GeometryContext& gctx, std::size_t /*lseg*/) const { + const GeometryContext& gctx, unsigned int /*quarterSegments*/) const { // Prepare vertices and faces std::vector vertices; std::vector faces; diff --git a/Core/src/Surfaces/PlaneSurface.cpp b/Core/src/Surfaces/PlaneSurface.cpp index e8b0e90a76f..7cd3f9c8d75 100644 --- a/Core/src/Surfaces/PlaneSurface.cpp +++ b/Core/src/Surfaces/PlaneSurface.cpp @@ -94,13 +94,14 @@ const Acts::SurfaceBounds& Acts::PlaneSurface::bounds() const { } Acts::Polyhedron Acts::PlaneSurface::polyhedronRepresentation( - const GeometryContext& gctx, std::size_t lseg) const { + const GeometryContext& gctx, unsigned int quarterSegments) const { // Prepare vertices and faces std::vector vertices; std::vector faces; std::vector triangularMesh; bool exactPolyhedron = true; + unsigned int lseg = quarterSegments; // If you have bounds you can create a polyhedron representation if (m_bounds) { auto vertices2D = m_bounds->vertices(lseg); @@ -129,7 +130,7 @@ Acts::Polyhedron Acts::PlaneSurface::polyhedronRepresentation( // Two concentric rings, we use the pure concentric method momentarily, // but that creates too many unneccesarry faces, when only two // are needed to describe the mesh, @todo investigate merging flag - auto facesMesh = detail::FacesHelper::cylindricalFaceMesh(vertices, true); + auto facesMesh = detail::FacesHelper::cylindricalFaceMesh(vertices); faces = facesMesh.first; triangularMesh = facesMesh.second; } diff --git a/Core/src/Surfaces/StrawSurface.cpp b/Core/src/Surfaces/StrawSurface.cpp index 4cbbb0fcdd1..35e3cbb4260 100644 --- a/Core/src/Surfaces/StrawSurface.cpp +++ b/Core/src/Surfaces/StrawSurface.cpp @@ -48,7 +48,7 @@ Acts::StrawSurface& Acts::StrawSurface::operator=(const StrawSurface& other) { } Acts::Polyhedron Acts::StrawSurface::polyhedronRepresentation( - const GeometryContext& gctx, std::size_t lseg) const { + const GeometryContext& gctx, unsigned int quarterSegments) const { // Prepare vertices and faces std::vector vertices; std::vector faces; @@ -56,14 +56,14 @@ Acts::Polyhedron Acts::StrawSurface::polyhedronRepresentation( const Transform3& ctransform = transform(gctx); // Draw the bounds if more than one segment are chosen - if (lseg > 1) { + if (quarterSegments > 0u) { double r = m_bounds->get(LineBounds::eR); // Write the two bows/circles on either side std::vector sides = {-1, 1}; for (auto& side : sides) { /// Helper method to create the segment - auto svertices = detail::VerticesHelper::createSegment( - {r, r}, -M_PI, M_PI, {}, lseg, + auto svertices = detail::VerticesHelper::segmentVertices( + {r, r}, -M_PI, M_PI, {}, quarterSegments, Vector3(0., 0., side * m_bounds->get(LineBounds::eHalfLengthZ)), ctransform); vertices.insert(vertices.end(), svertices.begin(), svertices.end()); diff --git a/Core/src/Surfaces/TrapezoidBounds.cpp b/Core/src/Surfaces/TrapezoidBounds.cpp index a065d607ed1..2de2e26a70e 100644 --- a/Core/src/Surfaces/TrapezoidBounds.cpp +++ b/Core/src/Surfaces/TrapezoidBounds.cpp @@ -96,7 +96,7 @@ bool Acts::TrapezoidBounds::inside( } std::vector Acts::TrapezoidBounds::vertices( - unsigned int /*lseg*/) const { + unsigned int /*ignoredSegments*/) const { const double hlXnY = get(TrapezoidBounds::eHalfLengthXnegY); const double hlXpY = get(TrapezoidBounds::eHalfLengthXposY); const double hlY = get(TrapezoidBounds::eHalfLengthY); diff --git a/Core/src/Surfaces/VerticesHelper.cpp b/Core/src/Surfaces/detail/VerticesHelper.cpp similarity index 83% rename from Core/src/Surfaces/VerticesHelper.cpp rename to Core/src/Surfaces/detail/VerticesHelper.cpp index 3beeed066b8..4cde3fd71a8 100644 --- a/Core/src/Surfaces/VerticesHelper.cpp +++ b/Core/src/Surfaces/detail/VerticesHelper.cpp @@ -13,7 +13,7 @@ std::vector Acts::detail::VerticesHelper::phiSegments( ActsScalar phiMin, ActsScalar phiMax, - const std::vector& phiRefs, unsigned int minSegments) { + const std::vector& phiRefs, unsigned int quarterSegments) { // Check that the phi range is valid if (phiMin > phiMax) { throw std::invalid_argument( @@ -30,16 +30,16 @@ std::vector Acts::detail::VerticesHelper::phiSegments( } } // Bail out if minSegmens is smaler 4 or not a multiple of 4 - if (minSegments < 4 || minSegments % 4 != 0) { + if (quarterSegments == 0u) { throw std::invalid_argument( - "VerticesHelper::phiSegments ...Minimum number of segments must be a " - "multiple " - "of 4 and at least 4"); + "VerticesHelper::phiSegments ... Number of segments must be larger " + "than 0."); } std::vector phiSegments = {phiMin, phiMax}; // Minimum approximation for a circle need - for (unsigned int i = 0; i < minSegments + 1; ++i) { - ActsScalar phiExt = -M_PI + i * 2 * M_PI / minSegments; + // - if the circle is closed the last point is given twice + for (unsigned int i = 0; i < 4 * quarterSegments + 1; ++i) { + ActsScalar phiExt = -M_PI + i * 2 * M_PI / (4 * quarterSegments); if (phiExt > phiMin && phiExt < phiMax && std::find_if(phiSegments.begin(), phiSegments.end(), [&phiExt](ActsScalar phi) { @@ -69,7 +69,7 @@ std::vector Acts::detail::VerticesHelper::phiSegments( std::vector Acts::detail::VerticesHelper::ellipsoidVertices( ActsScalar innerRx, ActsScalar innerRy, ActsScalar outerRx, ActsScalar outerRy, ActsScalar avgPhi, ActsScalar halfPhi, - unsigned int lseg) { + unsigned int quarterSegments) { // List of vertices counter-clockwise starting at smallest phi w.r.t center, // for both inner/outer ring/segment std::vector rvertices; // return vertices @@ -79,13 +79,20 @@ std::vector Acts::detail::VerticesHelper::ellipsoidVertices( bool innerExists = (innerRx > 0. && innerRy > 0.); bool closed = std::abs(halfPhi - M_PI) < s_onSurfaceTolerance; + std::vector refPhi = {}; + if (avgPhi != 0.) { + refPhi.push_back(avgPhi); + } + // The inner (if exists) and outer bow if (innerExists) { - ivertices = createSegment( - {innerRx, innerRy}, avgPhi - halfPhi, avgPhi + halfPhi, {}, lseg); + ivertices = segmentVertices( + {innerRx, innerRy}, avgPhi - halfPhi, avgPhi + halfPhi, refPhi, + quarterSegments); } - overtices = createSegment( - {outerRx, outerRy}, avgPhi - halfPhi, avgPhi + halfPhi, {}, lseg); + overtices = segmentVertices( + {outerRx, outerRy}, avgPhi - halfPhi, avgPhi + halfPhi, refPhi, + quarterSegments); // We want to keep the same counter-clockwise orientation for displaying if (!innerExists) { @@ -106,9 +113,9 @@ std::vector Acts::detail::VerticesHelper::ellipsoidVertices( std::vector Acts::detail::VerticesHelper::circularVertices( ActsScalar innerR, ActsScalar outerR, ActsScalar avgPhi, ActsScalar halfPhi, - unsigned int lseg) { + unsigned int quarterSegments) { return ellipsoidVertices(innerR, innerR, outerR, outerR, avgPhi, halfPhi, - lseg); + quarterSegments); } bool Acts::detail::VerticesHelper::onHyperPlane( diff --git a/Core/src/Visualization/EventDataView3D.cpp b/Core/src/Visualization/EventDataView3D.cpp index 656cb020616..14d9ff365f5 100644 --- a/Core/src/Visualization/EventDataView3D.cpp +++ b/Core/src/Visualization/EventDataView3D.cpp @@ -27,7 +27,7 @@ void Acts::EventDataView3D::drawCovarianceCartesian( std::vector ellipse = createEllipse( lambda0 * locErrorScale, lambda1 * locErrorScale, theta, - viewConfig.nSegments, viewConfig.offset, lposition, transform); + viewConfig.quaterSegments, viewConfig.offset, lposition, transform); ellipse.push_back(transform * Vector3(lposition.x(), lposition.y(), viewConfig.offset)); @@ -56,7 +56,7 @@ void Acts::EventDataView3D::drawCovarianceAngular( std::vector ellipse = createEllipse(angularErrorScale * directionScale * lambda0 * sin(dtheta), angularErrorScale * directionScale * lambda1, theta, - viewConfig.nSegments, 0., {0., 0.}, eplane); + viewConfig.quaterSegments, 0., {0., 0.}, eplane); std::vector coneTop = ellipse; coneTop.push_back(anker); diff --git a/Core/src/Visualization/GeometryView3D.cpp b/Core/src/Visualization/GeometryView3D.cpp index 33822f9ac7d..9910de7a086 100644 --- a/Core/src/Visualization/GeometryView3D.cpp +++ b/Core/src/Visualization/GeometryView3D.cpp @@ -91,7 +91,7 @@ void Acts::GeometryView3D::drawSurface(IVisualization3D& helper, const Transform3& transform, const ViewConfig& viewConfig) { Polyhedron surfaceHedron = - surface.polyhedronRepresentation(gctx, viewConfig.nSegments); + surface.polyhedronRepresentation(gctx, viewConfig.quaterSegments); if (!transform.isApprox(Transform3::Identity())) { surfaceHedron.move(transform); } @@ -133,7 +133,6 @@ void Acts::GeometryView3D::drawSurfaceArray( auto phiValues = axes[0]->getBinEdges(); auto zValues = axes[1]->getBinEdges(); ViewConfig gridRadConfig = gridConfig; - gridRadConfig.nSegments = phiValues.size(); // Longitudinal lines for (auto phi : phiValues) { double cphi = std::cos(phi); @@ -158,7 +157,7 @@ void Acts::GeometryView3D::drawSurfaceArray( auto rValues = axes[0]->getBinEdges(); auto phiValues = axes[1]->getBinEdges(); ViewConfig gridRadConfig = gridConfig; - gridRadConfig.nSegments = phiValues.size(); + gridRadConfig.quaterSegments = phiValues.size(); for (auto r : rValues) { CylinderVolumeBounds cvb(r - 0.5 * thickness, r + 0.5 * thickness, 0.5 * thickness); @@ -290,7 +289,7 @@ void Acts::GeometryView3D::drawTrackingVolume( ViewConfig lConfig = layerView; ViewConfig sConfig = sensitiveView; ViewConfig gConfig = gridView; - gConfig.nSegments = 8; + gConfig.quaterSegments = 8; ViewConfig vcConfig = cConfig; std::string vname = tVolume.volumeName(); diff --git a/Examples/Detectors/TGeoDetector/include/ActsExamples/TGeoDetector/TGeoITkModuleSplitter.hpp b/Examples/Detectors/TGeoDetector/include/ActsExamples/TGeoDetector/TGeoITkModuleSplitter.hpp index a08dbebd661..98db7624af6 100644 --- a/Examples/Detectors/TGeoDetector/include/ActsExamples/TGeoDetector/TGeoITkModuleSplitter.hpp +++ b/Examples/Detectors/TGeoDetector/include/ActsExamples/TGeoDetector/TGeoITkModuleSplitter.hpp @@ -90,7 +90,7 @@ class TGeoITkModuleSplitter : public Acts::ITGeoDetectorElementSplitter { splitBarrelModule( const Acts::GeometryContext& gctx, const std::shared_ptr& detElement, - unsigned int nSegments) const; + unsigned int quaterSegments) const; /// Take a geometry context and TGeoElement in the Itk disks and split it /// into sub elements. diff --git a/Examples/Io/Svg/include/ActsExamples/Io/Svg/SvgDefaults.hpp b/Examples/Io/Svg/include/ActsExamples/Io/Svg/SvgDefaults.hpp index 16cde4add16..29478007670 100644 --- a/Examples/Io/Svg/include/ActsExamples/Io/Svg/SvgDefaults.hpp +++ b/Examples/Io/Svg/include/ActsExamples/Io/Svg/SvgDefaults.hpp @@ -22,7 +22,7 @@ static inline Acts::Svg::Style layerStyle() { lStyle.highlights = {"mouseover", "mouseout"}; lStyle.strokeColor = {25, 25, 25}; lStyle.strokeWidth = 0.5; - lStyle.nSegments = 72u; + lStyle.quaterSegments = 72u; return lStyle; } @@ -43,7 +43,7 @@ static inline Acts::Svg::Style backgroundStyle() { bgStyle.highlights = {}; bgStyle.strokeColor = {25, 25, 25}; bgStyle.strokeWidth = 0.5; - bgStyle.nSegments = 72u; + bgStyle.quaterSegments = 72u; return bgStyle; } @@ -55,7 +55,7 @@ static inline Acts::Svg::Style pointStyle() { pStyle.highlights = {"mouseover", "mouseout"}; pStyle.strokeColor = {0, 0, 0}; pStyle.strokeWidth = 0.5; - pStyle.nSegments = 72u; + pStyle.quaterSegments = 72u; return pStyle; } diff --git a/Examples/Python/src/Geometry.cpp b/Examples/Python/src/Geometry.cpp index f8c4390d8c8..8970eca697b 100644 --- a/Examples/Python/src/Geometry.cpp +++ b/Examples/Python/src/Geometry.cpp @@ -305,7 +305,7 @@ void addExperimentalGeometry(Context& ctx) { ACTS_PYTHON_MEMBER(surfacesProvider); ACTS_PYTHON_MEMBER(supports); ACTS_PYTHON_MEMBER(binnings); - ACTS_PYTHON_MEMBER(nSegments); + ACTS_PYTHON_MEMBER(quaterSegments); ACTS_PYTHON_MEMBER(auxiliary); ACTS_PYTHON_STRUCT_END(); diff --git a/Examples/Python/src/Obj.cpp b/Examples/Python/src/Obj.cpp index 378b548707c..8616597a542 100644 --- a/Examples/Python/src/Obj.cpp +++ b/Examples/Python/src/Obj.cpp @@ -34,7 +34,7 @@ void addObj(Context& ctx) { /// @param surfaces is the collection of surfaces /// @param viewContext is the geometry context /// @param viewRgb is the color of the surfaces - /// @param viewSegements is the number of segments to approximate a full circle + /// @param viewSegements is the number of segments to approximate a quarter of a circle /// @param fileName is the path to the output file /// mex.def("writeSurfacesObj", @@ -43,7 +43,7 @@ void addObj(Context& ctx) { const std::array& viewRgb, unsigned int viewSegements, const std::string& fileName) { Acts::ViewConfig sConfig = Acts::ViewConfig{viewRgb}; - sConfig.nSegments = viewSegements; + sConfig.quaterSegments = viewSegements; Acts::GeometryView3D view3D; Acts::ObjVisualization3D obj; diff --git a/Examples/Python/src/Output.cpp b/Examples/Python/src/Output.cpp index 767717fb8dd..8693fc0cf54 100644 --- a/Examples/Python/src/Output.cpp +++ b/Examples/Python/src/Output.cpp @@ -118,7 +118,7 @@ void addOutput(Context& ctx) { ACTS_PYTHON_MEMBER(offset); ACTS_PYTHON_MEMBER(lineThickness); ACTS_PYTHON_MEMBER(surfaceThickness); - ACTS_PYTHON_MEMBER(nSegments); + ACTS_PYTHON_MEMBER(quaterSegments); ACTS_PYTHON_MEMBER(triangulate); ACTS_PYTHON_MEMBER(outputName); ACTS_PYTHON_STRUCT_END(); diff --git a/Examples/Python/src/Svg.cpp b/Examples/Python/src/Svg.cpp index 74d6197ea2f..2a1a7430fbc 100644 --- a/Examples/Python/src/Svg.cpp +++ b/Examples/Python/src/Svg.cpp @@ -220,7 +220,7 @@ void addSvg(Context& ctx) { ACTS_PYTHON_MEMBER(highlights); ACTS_PYTHON_MEMBER(strokeWidth); ACTS_PYTHON_MEMBER(strokeColor); - ACTS_PYTHON_MEMBER(nSegments); + ACTS_PYTHON_MEMBER(quaterSegments); ACTS_PYTHON_STRUCT_END(); } diff --git a/Plugins/ActSVG/include/Acts/Plugins/ActSVG/SvgUtils.hpp b/Plugins/ActSVG/include/Acts/Plugins/ActSVG/SvgUtils.hpp index 8a4b5cb89a0..7c074df0031 100644 --- a/Plugins/ActSVG/include/Acts/Plugins/ActSVG/SvgUtils.hpp +++ b/Plugins/ActSVG/include/Acts/Plugins/ActSVG/SvgUtils.hpp @@ -20,6 +20,7 @@ namespace Acts { namespace Svg { +/// @brief Style struct struct Style { // Fill parameters std::array fillColor = {255, 255, 255}; @@ -39,7 +40,8 @@ struct Style { unsigned int fontSize = 14u; - unsigned int nSegments = 72u; + /// Number of segments to approximate a quarter of a circle + unsigned int quaterSegments = 72u; /// Conversion to fill and stroke object from the base library /// @return a tuple of actsvg digestable objects diff --git a/Plugins/ActSVG/src/SurfaceSvgConverter.cpp b/Plugins/ActSVG/src/SurfaceSvgConverter.cpp index ea827a7bbf3..4e75693be80 100644 --- a/Plugins/ActSVG/src/SurfaceSvgConverter.cpp +++ b/Plugins/ActSVG/src/SurfaceSvgConverter.cpp @@ -21,7 +21,7 @@ Acts::Svg::ProtoSurface Acts::Svg::SurfaceConverter::convert( if (!cOptions.templateSurface) { // Polyhedron surface for vertices needed anyway Polyhedron surfaceHedron = - surface.polyhedronRepresentation(gctx, cOptions.style.nSegments); + surface.polyhedronRepresentation(gctx, cOptions.style.quaterSegments); auto vertices3D = surfaceHedron.vertices; pSurface._vertices = vertices3D; } else { @@ -30,7 +30,7 @@ Acts::Svg::ProtoSurface Acts::Svg::SurfaceConverter::convert( auto planarBounds = dynamic_cast(&(surface.bounds())); if (planarBounds != nullptr) { - auto vertices2D = planarBounds->vertices(cOptions.style.nSegments); + auto vertices2D = planarBounds->vertices(cOptions.style.quaterSegments); pSurface._vertices.reserve(vertices2D.size()); for (const auto& v2 : vertices2D) { pSurface._vertices.push_back({v2[0], v2[1], 0.}); @@ -40,7 +40,8 @@ Acts::Svg::ProtoSurface Acts::Svg::SurfaceConverter::convert( auto annulusBounds = dynamic_cast(&(surface.bounds())); if (annulusBounds != nullptr) { - auto vertices2D = annulusBounds->vertices(cOptions.style.nSegments); + auto vertices2D = + annulusBounds->vertices(cOptions.style.quaterSegments); pSurface._vertices.reserve(vertices2D.size()); for (const auto& v2 : vertices2D) { pSurface._vertices.push_back({v2[0], v2[1], 0.}); diff --git a/Plugins/DD4hep/include/Acts/Plugins/DD4hep/DD4hepDetectorSurfaceFactory.hpp b/Plugins/DD4hep/include/Acts/Plugins/DD4hep/DD4hepDetectorSurfaceFactory.hpp index 4c660dd6d5e..1ff07fb5170 100644 --- a/Plugins/DD4hep/include/Acts/Plugins/DD4hep/DD4hepDetectorSurfaceFactory.hpp +++ b/Plugins/DD4hep/include/Acts/Plugins/DD4hep/DD4hepDetectorSurfaceFactory.hpp @@ -71,8 +71,8 @@ class DD4hepDetectorSurfaceFactory { std::optional pExtent = std::nullopt; /// Optionally provide an Extent constraints to measure the layers std::vector extentConstraints = {}; - /// The approximination for extent measuring - std::size_t nExtentSegments = 1u; + /// The approximination of a circle quater for extent measuring + std::size_t nExtentQSegments = 1u; }; /// Nested options struct to steer the conversion diff --git a/Plugins/DD4hep/include/Acts/Plugins/DD4hep/DD4hepLayerStructure.hpp b/Plugins/DD4hep/include/Acts/Plugins/DD4hep/DD4hepLayerStructure.hpp index 441386857b2..495a2d63e2a 100644 --- a/Plugins/DD4hep/include/Acts/Plugins/DD4hep/DD4hepLayerStructure.hpp +++ b/Plugins/DD4hep/include/Acts/Plugins/DD4hep/DD4hepLayerStructure.hpp @@ -65,8 +65,8 @@ class DD4hepLayerStructure { std::optional extent = std::nullopt; /// The extent constraints - optionally std::vector extentConstraints = {}; - /// Approximation for the polyhedron binning nSegments - unsigned int nSegments = 1u; + /// Approximation for the polyhedron binning + unsigned int quaterSegments = 1u; /// Patch the binning with the extent if possible bool patchBinningWithExtent = true; /// Conversion options diff --git a/Plugins/DD4hep/src/DD4hepDetectorSurfaceFactory.cpp b/Plugins/DD4hep/src/DD4hepDetectorSurfaceFactory.cpp index 99d55278b21..a21c4539efa 100644 --- a/Plugins/DD4hep/src/DD4hepDetectorSurfaceFactory.cpp +++ b/Plugins/DD4hep/src/DD4hepDetectorSurfaceFactory.cpp @@ -108,7 +108,7 @@ Acts::DD4hepDetectorSurfaceFactory::constructSensitiveComponents( // Measure if configured to do so if (cache.sExtent.has_value()) { auto sExtent = - sSurface->polyhedronRepresentation(gctx, cache.nExtentSegments) + sSurface->polyhedronRepresentation(gctx, cache.nExtentQSegments) .extent(); cache.sExtent.value().extend(sExtent, cache.extentConstraints); } @@ -137,7 +137,7 @@ Acts::DD4hepDetectorSurfaceFactory::constructPassiveComponents( // Measure if configured to do so if (cache.pExtent.has_value()) { auto sExtent = - pSurface->polyhedronRepresentation(gctx, cache.nExtentSegments) + pSurface->polyhedronRepresentation(gctx, cache.nExtentQSegments) .extent(); cache.pExtent.value().extend(sExtent, cache.extentConstraints); } diff --git a/Plugins/DD4hep/src/DD4hepLayerStructure.cpp b/Plugins/DD4hep/src/DD4hepLayerStructure.cpp index f2b45ab2e46..e927f5e00f0 100644 --- a/Plugins/DD4hep/src/DD4hepLayerStructure.cpp +++ b/Plugins/DD4hep/src/DD4hepLayerStructure.cpp @@ -38,7 +38,7 @@ Acts::Experimental::DD4hepLayerStructure::builder( fCache.sExtent = options.extent; fCache.pExtent = options.extent; fCache.extentConstraints = options.extentConstraints; - fCache.nExtentSegments = options.nSegments; + fCache.nExtentQSegments = options.quaterSegments; m_surfaceFactory->construct(fCache, gctx, dd4hepElement, options.conversionOptions); diff --git a/Plugins/GeoModel/include/Acts/Plugins/GeoModel/GeoModelBlueprintCreater.hpp b/Plugins/GeoModel/include/Acts/Plugins/GeoModel/GeoModelBlueprintCreater.hpp index ccd9a0495da..07e3224724c 100644 --- a/Plugins/GeoModel/include/Acts/Plugins/GeoModel/GeoModelBlueprintCreater.hpp +++ b/Plugins/GeoModel/include/Acts/Plugins/GeoModel/GeoModelBlueprintCreater.hpp @@ -40,8 +40,8 @@ class GeoModelBlueprintCreater { std::vector> detectorSurfaces = {}; /// The binning values for the KDTree sorting std::vector kdtBinning = {}; - /// Polyhedron approximations - unsigned int nSegments = 1u; + /// Polyhedron approximation: number of segments per circle quater + unsigned int quaterSegments = 1u; }; /// The cache struct diff --git a/Plugins/GeoModel/src/GeoModelBlueprintCreater.cpp b/Plugins/GeoModel/src/GeoModelBlueprintCreater.cpp index 3f12c01037d..3411aa78706 100644 --- a/Plugins/GeoModel/src/GeoModelBlueprintCreater.cpp +++ b/Plugins/GeoModel/src/GeoModelBlueprintCreater.cpp @@ -353,7 +353,7 @@ Acts::GeoModelBlueprintCreater::createInternalStructureBuilder( // Loop over surfaces and create an internal extent for (auto& sf : surfaces) { auto sfExtent = - sf->polyhedronRepresentation(gctx, m_cfg.nSegments).extent(); + sf->polyhedronRepresentation(gctx, m_cfg.quaterSegments).extent(); internalExtent.extend(sfExtent, internalConstraints); } ACTS_VERBOSE("Found " << surfaces.size() << " surfaces in range " diff --git a/Tests/CommonHelpers/Acts/Tests/CommonHelpers/LineSurfaceStub.hpp b/Tests/CommonHelpers/Acts/Tests/CommonHelpers/LineSurfaceStub.hpp index 4070074539c..795d97425da 100644 --- a/Tests/CommonHelpers/Acts/Tests/CommonHelpers/LineSurfaceStub.hpp +++ b/Tests/CommonHelpers/Acts/Tests/CommonHelpers/LineSurfaceStub.hpp @@ -57,11 +57,11 @@ class LineSurfaceStub : public LineSurface { /// Return a Polyhedron for the surfaces /// /// @param gctx The current geometry context object, e.g. alignment - /// @param lseg is ignored for a perigee @note ignored + /// @param ingoredSegmeent is ignored for the srub /// /// @return A list of vertices and a face/facett description of it Polyhedron polyhedronRepresentation(const GeometryContext& /*gctx*/, - std::size_t /*lseg*/) const final { + unsigned int /*lseg*/) const final { return Polyhedron({}, {}, {}); } }; diff --git a/Tests/UnitTests/Core/Surfaces/AnnulusBoundsTests.cpp b/Tests/UnitTests/Core/Surfaces/AnnulusBoundsTests.cpp index 225770f0f76..07f38df4331 100644 --- a/Tests/UnitTests/Core/Surfaces/AnnulusBoundsTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/AnnulusBoundsTests.cpp @@ -23,10 +23,10 @@ namespace Acts::Test { BOOST_AUTO_TEST_SUITE(Surfaces) -double minRadius = 7.2; -double maxRadius = 12.0; -double minPhi = 0.74195; -double maxPhi = 1.33970; +ActsScalar minRadius = 7.2; +ActsScalar maxRadius = 12.0; +ActsScalar minPhi = 0.74195; +ActsScalar maxPhi = 1.33970; Vector2 offset(-2., 2.); @@ -123,6 +123,25 @@ BOOST_AUTO_TEST_CASE(AnnulusBoundsProperties) { BOOST_CHECK_EQUAL(aBounds.get(AnnulusBounds::eMaxPhiRel), maxPhi); } +/// Unit tests for AnnulusBounds vertices +BOOST_AUTO_TEST_CASE(AnnulusBoundsVertices) { + /// Test construction with radii and default sector + AnnulusBounds aBounds(minRadius, maxRadius, minPhi, maxPhi, offset); + + // Retrieve the corners + auto corners = aBounds.corners(); + BOOST_CHECK_EQUAL(corners.size(), 4); + + // Retrieve the vertices + auto vertices = aBounds.vertices(0u); + BOOST_CHECK_EQUAL(vertices.size(), 4); + + // Now generate with more segments + unsigned int nQuarterSegments = 12; + vertices = aBounds.vertices(nQuarterSegments); + BOOST_CHECK_EQUAL(vertices.size(), 14u); +} + BOOST_AUTO_TEST_SUITE_END() } // namespace Acts::Test diff --git a/Tests/UnitTests/Core/Surfaces/ConvexPolygonBoundsTests.cpp b/Tests/UnitTests/Core/Surfaces/ConvexPolygonBoundsTests.cpp index 22136a369fa..3f1eb4ea585 100644 --- a/Tests/UnitTests/Core/Surfaces/ConvexPolygonBoundsTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/ConvexPolygonBoundsTests.cpp @@ -101,6 +101,10 @@ BOOST_AUTO_TEST_CASE(ConvexPolygonBoundsRecreation) { std::copy_n(valvector.begin(), poly<4>::eSize, values.begin()); poly<4> recreated(values); BOOST_CHECK_EQUAL(original, recreated); + + // Get the vertices back + auto rvertices = original.vertices(); + BOOST_CHECK_EQUAL(rvertices.size(), 4u); } BOOST_AUTO_TEST_CASE(ConvexPolygonBoundsDynamicTest) { diff --git a/Tests/UnitTests/Core/Surfaces/PolyhedronSurfacesTests.cpp b/Tests/UnitTests/Core/Surfaces/PolyhedronSurfacesTests.cpp index b37649eebc5..3912fa6f0fa 100644 --- a/Tests/UnitTests/Core/Surfaces/PolyhedronSurfacesTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/PolyhedronSurfacesTests.cpp @@ -42,7 +42,7 @@ namespace Acts::Test { const GeometryContext tgContext = GeometryContext(); const std::vector> testModes = { - {"Triangulate", 72}, {"Extrema", 1}}; + {"Triangulate", 18}, {"Extrema", 1}}; const Transform3 transform = Transform3::Identity(); const double epsAbs = 1e-12; @@ -61,9 +61,8 @@ BOOST_AUTO_TEST_CASE(ConeSurfacePolyhedrons) { const double rMax = hzPos * std::tan(alpha); - for (const auto& mode : testModes) { - ACTS_INFO("\tMode: " << std::get(mode)); - const unsigned int segments = std::get(mode); + for (const auto& [mode, segments] : testModes) { + ACTS_INFO("\tMode: " << mode); /// The full cone on one side { @@ -81,9 +80,10 @@ BOOST_AUTO_TEST_CASE(ConeSurfacePolyhedrons) { CHECK_CLOSE_ABS(extent.range(BinningValue::binZ).min(), 0_mm, epsAbs); CHECK_CLOSE_ABS(extent.range(BinningValue::binZ).max(), hzPos, epsAbs); - const unsigned int expectedFaces = segments < 4 ? 4 : segments; + const unsigned int expectedFaces = 4 * segments; BOOST_CHECK_EQUAL(oneConePh.faces.size(), expectedFaces); - BOOST_CHECK_EQUAL(oneConePh.vertices.size(), expectedFaces + 1); + // full segments + overlap at (pi/pi) + tip + BOOST_CHECK_EQUAL(oneConePh.vertices.size(), expectedFaces + 2); } /// The full cone on one side @@ -106,6 +106,11 @@ BOOST_AUTO_TEST_CASE(ConeSurfacePolyhedrons) { CHECK_CLOSE_ABS(extent.range(BinningValue::binR).max(), rMax, epsAbs); CHECK_CLOSE_ABS(extent.range(BinningValue::binZ).min(), hzpMin, epsAbs); CHECK_CLOSE_ABS(extent.range(BinningValue::binZ).max(), hzPos, epsAbs); + + const unsigned int expectedFaces = 4 * segments; + BOOST_CHECK_EQUAL(oneConePiecePh.faces.size(), expectedFaces); + BOOST_CHECK_EQUAL(oneConePiecePh.vertices.size(), + (expectedFaces + 1) * 2); } /// The full cone on both sides @@ -124,9 +129,11 @@ BOOST_AUTO_TEST_CASE(ConeSurfacePolyhedrons) { CHECK_CLOSE_ABS(extent.range(BinningValue::binZ).min(), hzNeg, epsAbs); CHECK_CLOSE_ABS(extent.range(BinningValue::binZ).max(), hzPos, epsAbs); - const unsigned int expectedFaces = segments < 4 ? 8 : 2 * segments; + const unsigned int expectedFaces = 2 * segments * 4; + const unsigned int expectedVertices = 2 * (4 * segments + 1) + 1; + BOOST_CHECK_EQUAL(twoConesPh.faces.size(), expectedFaces); - BOOST_CHECK_EQUAL(twoConesPh.vertices.size(), expectedFaces + 1); + BOOST_CHECK_EQUAL(twoConesPh.vertices.size(), expectedVertices); } /// A centered sectoral cone on both sides @@ -143,13 +150,16 @@ BOOST_AUTO_TEST_CASE(ConeSurfacePolyhedrons) { const auto extent = sectoralConesPh.extent(); CHECK_CLOSE_ABS(extent.range(BinningValue::binX).min(), 0, epsAbs); CHECK_CLOSE_ABS(extent.range(BinningValue::binX).max(), rMax, epsAbs); - // CHECK_CLOSE_ABS(extent.range(BinningValue::binY).min(), ???, - // epsAbs); CHECK_CLOSE_ABS(extent.range(BinningValue::binY).max(), - // ???, epsAbs); + CHECK_CLOSE_ABS(extent.range(BinningValue::binY).min(), + -rMax * std::sin(phiSector), epsAbs); + CHECK_CLOSE_ABS(extent.range(BinningValue::binY).max(), + rMax * std::sin(phiSector), epsAbs); CHECK_CLOSE_ABS(extent.range(BinningValue::binR).min(), 0_mm, epsAbs); CHECK_CLOSE_ABS(extent.range(BinningValue::binR).max(), rMax, epsAbs); CHECK_CLOSE_ABS(extent.range(BinningValue::binZ).min(), hzNeg, epsAbs); CHECK_CLOSE_ABS(extent.range(BinningValue::binZ).max(), hzPos, epsAbs); + + // Segment numbers are further checked with the VertexHelper checks } } } @@ -185,8 +195,8 @@ BOOST_AUTO_TEST_CASE(CylinderSurfacePolyhedrons) { CHECK_CLOSE_ABS(extent.range(BinningValue::binZ).min(), -hZ, epsAbs); CHECK_CLOSE_ABS(extent.range(BinningValue::binZ).max(), hZ, epsAbs); - const unsigned int expectedFaces = segments < 4 ? 4 : segments; - const unsigned int expectedVertices = segments < 4 ? 8 : 2 * segments; + const unsigned int expectedFaces = 4 * segments; + const unsigned int expectedVertices = (4 * segments + 1) * 2; BOOST_CHECK_EQUAL(fullCylinderPh.faces.size(), expectedFaces); BOOST_CHECK_EQUAL(fullCylinderPh.vertices.size(), expectedVertices); } @@ -248,7 +258,8 @@ BOOST_AUTO_TEST_CASE(DiscSurfacePolyhedrons) { CHECK_CLOSE_ABS(extent.range(BinningValue::binZ).max(), 0., epsAbs); const unsigned int expectedFaces = 1; - const unsigned int expectedVertices = segments > 4 ? segments + 1 : 4 + 1; + // Segments + overlap + center + const unsigned int expectedVertices = 4 * segments + 1 + 1; BOOST_CHECK_EQUAL(fullDiscPh.faces.size(), expectedFaces); BOOST_CHECK_EQUAL(fullDiscPh.vertices.size(), expectedVertices); } @@ -353,14 +364,7 @@ BOOST_AUTO_TEST_CASE(DiscSurfacePolyhedrons) { auto annulusDisc = Surface::makeShared(transform, annulus); auto annulusDiscPh = annulusDisc->polyhedronRepresentation(tgContext, segments); - const auto extent = annulusDiscPh.extent(); - // CHECK_CLOSE_ABS(extent.range(BinningValue::binX).min(), ???, - // epsAbs); CHECK_CLOSE_ABS(extent.range(BinningValue::binX).max(), - // ???, epsAbs); - // CHECK_CLOSE_ABS(extent.range(BinningValue::binY).min(), ???, - // epsAbs); CHECK_CLOSE_ABS(extent.range(BinningValue::binY).max(), - // ???, epsAbs); CHECK_CLOSE_ABS(extent.range(BinningValue::binR).min(), minRadius, epsAbs); CHECK_CLOSE_ABS(extent.range(BinningValue::binR).max(), maxRadius, diff --git a/Tests/UnitTests/Core/Surfaces/SurfaceStub.hpp b/Tests/UnitTests/Core/Surfaces/SurfaceStub.hpp index 7c08978e4fa..fdcd97521d5 100644 --- a/Tests/UnitTests/Core/Surfaces/SurfaceStub.hpp +++ b/Tests/UnitTests/Core/Surfaces/SurfaceStub.hpp @@ -102,7 +102,7 @@ class SurfaceStub : public RegularSurface { /// Return a Polyhedron for the surfaces Polyhedron polyhedronRepresentation(const GeometryContext& /*gctx*/, - std::size_t /*lseg */) const final { + unsigned int /* ignored */) const final { std::vector vertices; std::vector> faces; std::vector> triangularMesh; diff --git a/Tests/UnitTests/Core/Surfaces/VerticesHelperTests.cpp b/Tests/UnitTests/Core/Surfaces/VerticesHelperTests.cpp index 6ebc679ddd0..6e5260960c5 100644 --- a/Tests/UnitTests/Core/Surfaces/VerticesHelperTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/VerticesHelperTests.cpp @@ -133,7 +133,7 @@ BOOST_AUTO_TEST_CASE(GeneratePhiSegments) { std::invalid_argument); } -BOOST_AUTO_TEST_CASE(GeneratCircularSegments) { +BOOST_AUTO_TEST_CASE(GenerateSegmentVertices) { // Case (1): a small segment is given, no cartesian maximum vertex & 1 step // segment ActsScalar rx = 10.; @@ -141,8 +141,76 @@ BOOST_AUTO_TEST_CASE(GeneratCircularSegments) { ActsScalar minPhi = 0.1; ActsScalar maxPhi = 0.3; - auto vertices = VerticesHelper::createSegment( - {rx, ry}, minPhi, maxPhi, {}, 72); + auto vertices = VerticesHelper::segmentVertices( + {rx, ry}, minPhi, maxPhi, {}, 1); + std::size_t expectedVertices = 2u; + BOOST_CHECK_EQUAL(vertices.size(), expectedVertices); + + // Now with a reference phi value + vertices = VerticesHelper::segmentVertices( + {rx, ry}, minPhi, maxPhi, {0.2}, 1); + expectedVertices = 3u; // the reference is inserted + BOOST_CHECK_EQUAL(vertices.size(), expectedVertices); + + // Now with more vertices - the the two corners and the ones from the + // reference + unsigned int quarterVertices = 36; + vertices = VerticesHelper::segmentVertices( + {rx, ry}, minPhi, maxPhi, {}, quarterVertices); + expectedVertices = + static_cast((maxPhi - minPhi) / M_PI_2 * quarterVertices) + + 2u; + BOOST_CHECK_EQUAL(vertices.size(), expectedVertices); + + // Case (2) a small segment is given, with one maximum vertex at phi = 0 + minPhi = -0.1; + vertices = VerticesHelper::segmentVertices( + {rx, ry}, minPhi, maxPhi, {}, 1); + expectedVertices = 3u; + BOOST_CHECK_EQUAL(vertices.size(), expectedVertices); + + // Same with more segments + quarterVertices = 12; + vertices = VerticesHelper::segmentVertices( + {rx, ry}, minPhi, maxPhi, {}, quarterVertices); + // Extrema will be covered by the segments + expectedVertices = + static_cast((maxPhi - minPhi) / M_PI_2 * quarterVertices) + + 2u; + BOOST_CHECK_EQUAL(vertices.size(), expectedVertices); +} + +BOOST_AUTO_TEST_CASE(GenerateCircleEllipseVertices) { + // Case (1): A full disc + ActsScalar ri = 0.; + ActsScalar ro = 10.; + + // Extreme points in phi - only outer radius + auto vertices = VerticesHelper::circularVertices(ri, ro, 0., M_PI, 1u); + unsigned int expectedVertices = 5u; + BOOST_CHECK_EQUAL(vertices.size(), expectedVertices); + + // Case (2): A ring + ri = 3.; + + // Extreme points in phi - only outer radius + vertices = VerticesHelper::circularVertices(ri, ro, 0., M_PI, 1u); + expectedVertices = 10u; + BOOST_CHECK_EQUAL(vertices.size(), expectedVertices); + + // Now with 10 bins per sector + ri = 0.; + + vertices = VerticesHelper::circularVertices(ri, ro, 0., M_PI, 10u); + expectedVertices = 41u; // 4 sectors + 1 overlap at (-pi/pi) + BOOST_CHECK_EQUAL(vertices.size(), expectedVertices); + + // Now ellipsiod + ActsScalar riy = 4.; + ActsScalar roy = 14.; + vertices = VerticesHelper::ellipsoidVertices(ri, riy, ro, roy, 0., M_PI, 10u); + expectedVertices = 41u; // 4 sectors + 1 overlap at (-pi/pi) + BOOST_CHECK_EQUAL(vertices.size(), expectedVertices); } BOOST_AUTO_TEST_SUITE_END() diff --git a/Tests/UnitTests/Core/Visualization/EventDataView3DTests.cpp b/Tests/UnitTests/Core/Visualization/EventDataView3DTests.cpp index e6f3821e40a..4e9e0ba9e4f 100644 --- a/Tests/UnitTests/Core/Visualization/EventDataView3DTests.cpp +++ b/Tests/UnitTests/Core/Visualization/EventDataView3DTests.cpp @@ -29,7 +29,7 @@ BOOST_AUTO_TEST_CASE(BoundTrackParametersVisualizationObj) { for (const auto& objerr : objErrors) { std::cout << objerr << std::endl; } - BOOST_CHECK_EQUAL(std::count(objTest.begin(), objTest.end(), '\n'), 1458); + BOOST_CHECK_EQUAL(std::count(objTest.begin(), objTest.end(), '\n'), 4924); } BOOST_AUTO_TEST_CASE(BoundTrackParametersVisualizationPly) { @@ -40,7 +40,7 @@ BOOST_AUTO_TEST_CASE(BoundTrackParametersVisualizationPly) { for (const auto& plyerr : plyErrors) { std::cout << plyerr << std::endl; } - BOOST_CHECK_EQUAL(std::count(plyTest.begin(), plyTest.end(), '\n'), 973); + BOOST_CHECK_EQUAL(std::count(plyTest.begin(), plyTest.end(), '\n'), 3143); } BOOST_AUTO_TEST_CASE(MeasurementVisualizationObj) { @@ -85,7 +85,7 @@ BOOST_AUTO_TEST_CASE(MultiTrajectoryVisualizationObj) { for (const auto& objerr : objErrors) { std::cout << objerr << std::endl; } - BOOST_CHECK_EQUAL(std::count(objTest.begin(), objTest.end(), '\n'), 31010); + BOOST_CHECK_EQUAL(std::count(objTest.begin(), objTest.end(), '\n'), 103796); } BOOST_AUTO_TEST_CASE(MultiTrajectoryVisualizationPly) { @@ -96,7 +96,7 @@ BOOST_AUTO_TEST_CASE(MultiTrajectoryVisualizationPly) { for (const auto& plyerr : plyErrors) { std::cout << plyerr << std::endl; } - BOOST_CHECK_EQUAL(std::count(plyTest.begin(), plyTest.end(), '\n'), 20521); + BOOST_CHECK_EQUAL(std::count(plyTest.begin(), plyTest.end(), '\n'), 66091); } BOOST_AUTO_TEST_SUITE_END() diff --git a/Tests/UnitTests/Core/Visualization/TrackingGeometryView3DBase.hpp b/Tests/UnitTests/Core/Visualization/TrackingGeometryView3DBase.hpp index 350e08e1490..480040a60b8 100644 --- a/Tests/UnitTests/Core/Visualization/TrackingGeometryView3DBase.hpp +++ b/Tests/UnitTests/Core/Visualization/TrackingGeometryView3DBase.hpp @@ -39,14 +39,18 @@ static inline std::string run(IVisualization3D& helper, bool triangulate, ViewConfig viewSensitive = ViewConfig({0, 180, 240}); viewSensitive.triangulate = triangulate; + viewSensitive.quaterSegments = 72; ViewConfig viewPassive = ViewConfig({240, 280, 0}); viewPassive.triangulate = triangulate; + viewPassive.quaterSegments = 72; ViewConfig viewVolume = ViewConfig({220, 220, 0}); viewVolume.triangulate = triangulate; + viewVolume.quaterSegments = 72; ViewConfig viewContainer = ViewConfig({220, 220, 0}); viewContainer.triangulate = triangulate; + viewContainer.quaterSegments = 72; ViewConfig viewGrid = ViewConfig({220, 0, 0}); - viewGrid.nSegments = 8; + viewGrid.quaterSegments = 8; viewGrid.offset = 3.; viewGrid.triangulate = triangulate; diff --git a/Tests/UnitTests/Plugins/ActSVG/IndexedSurfacesSvgConverterTests.cpp b/Tests/UnitTests/Plugins/ActSVG/IndexedSurfacesSvgConverterTests.cpp index 1f4bcebd77f..945229fe14c 100644 --- a/Tests/UnitTests/Plugins/ActSVG/IndexedSurfacesSvgConverterTests.cpp +++ b/Tests/UnitTests/Plugins/ActSVG/IndexedSurfacesSvgConverterTests.cpp @@ -42,7 +42,7 @@ IndexedSurfacesConverter::Options generateDrawOptions() { sensitiveStyle.highlights = {"onmouseover", "onmouseout"}; sensitiveStyle.strokeWidth = 0.5; sensitiveStyle.strokeColor = {0, 0, 0}; - sensitiveStyle.nSegments = 72u; + sensitiveStyle.quaterSegments = 72u; std::pair allSensitives = {GeometryIdentifier(0u), sensitiveStyle}; diff --git a/Tests/UnitTests/Plugins/ActSVG/LayerSvgConverterTests.cpp b/Tests/UnitTests/Plugins/ActSVG/LayerSvgConverterTests.cpp index 38f4a49df56..85f5233d20c 100644 --- a/Tests/UnitTests/Plugins/ActSVG/LayerSvgConverterTests.cpp +++ b/Tests/UnitTests/Plugins/ActSVG/LayerSvgConverterTests.cpp @@ -45,16 +45,17 @@ void setupTools() { std::shared_ptr generateDiscLayer(Acts::ActsScalar rInner, Acts::ActsScalar rOuter, - unsigned int nSegments, + unsigned int quaterSegments, unsigned int nRings, bool useTrapezoids = false) { // Some preparations setupTools(); + unsigned int fullSegments = 4 * quaterSegments; std::vector> moduleSurfaces; - Acts::ActsScalar phiStep = 2 * M_PI / nSegments; + Acts::ActsScalar phiStep = 2 * M_PI / fullSegments; Acts::ActsScalar rStep = (rOuter - rInner) / nRings; // Reserve & fill - moduleSurfaces.reserve(nSegments * nRings); + moduleSurfaces.reserve(fullSegments * nRings); // Radial disc if (!useTrapezoids) { for (unsigned int ir = 0; ir < nRings; ++ir) { @@ -62,7 +63,7 @@ std::shared_ptr generateDiscLayer(Acts::ActsScalar rInner, rBounds = std::make_shared( rInner + ir * rStep - 0.025 * rInner, rInner + (ir + 1u) * rStep + 0.025 * rInner, 0.55 * phiStep, 0.); - for (unsigned int is = 0; is < nSegments; ++is) { + for (unsigned int is = 0; is < fullSegments; ++is) { // Place the module auto placement = Acts::Transform3::Identity(); if ((is % 2) != 0u) { @@ -82,14 +83,14 @@ std::shared_ptr generateDiscLayer(Acts::ActsScalar rInner, Acts::ActsScalar yHalf = rStep * 0.5125; Acts::ActsScalar xHalfMin = - 1.15 * (rInner + ir * rStep) * M_PI / nSegments; + 1.15 * (rInner + ir * rStep) * M_PI / fullSegments; Acts::ActsScalar xHalfMax = - 1.15 * (rInner + (ir + 1) * rStep) * M_PI / nSegments; + 1.15 * (rInner + (ir + 1) * rStep) * M_PI / fullSegments; std::shared_ptr tBounds = std::make_shared(xHalfMin, xHalfMax, yHalf); - for (unsigned int is = 0; is < nSegments; ++is) { + for (unsigned int is = 0; is < fullSegments; ++is) { // Setting the phi Acts::ActsScalar cphi = -M_PI + is * phiStep; Acts::Vector3 center(radius * std::cos(cphi), radius * std::sin(cphi), @@ -111,7 +112,7 @@ std::shared_ptr generateDiscLayer(Acts::ActsScalar rInner, } } // Let's create the disc layer - return lCreator->discLayer(tgContext, moduleSurfaces, nRings, nSegments); + return lCreator->discLayer(tgContext, moduleSurfaces, nRings, fullSegments); } } // namespace @@ -125,7 +126,7 @@ BOOST_AUTO_TEST_CASE(DiscLayerRadialSvg) { discLayerStyle.highlights = {"mouseover", "mouseout"}; discLayerStyle.strokeColor = {25, 25, 25}; discLayerStyle.strokeWidth = 0.5; - discLayerStyle.nSegments = 72u; + discLayerStyle.quaterSegments = 72u; Acts::GeometryIdentifier geoID{0}; @@ -155,7 +156,7 @@ BOOST_AUTO_TEST_CASE(DiscLayerTrapezoidSvg) { discLayerStyle.highlights = {"mouseover", "mouseout"}; discLayerStyle.strokeColor = {25, 25, 25}; discLayerStyle.strokeWidth = 0.5; - discLayerStyle.nSegments = 72u; + discLayerStyle.quaterSegments = 72u; Acts::GeometryIdentifier geoID{0}; @@ -185,7 +186,7 @@ BOOST_AUTO_TEST_CASE(CylinderLayerSvg) { cylinderLayerStyle.highlights = {"mouseover", "mouseout"}; cylinderLayerStyle.strokeColor = {25, 25, 25}; cylinderLayerStyle.strokeWidth = 0.5; - cylinderLayerStyle.nSegments = 72u; + cylinderLayerStyle.quaterSegments = 72u; Acts::GeometryIdentifier geoID{0}; diff --git a/Tests/UnitTests/Plugins/ActSVG/PortalSvgConverterTests.cpp b/Tests/UnitTests/Plugins/ActSVG/PortalSvgConverterTests.cpp index 9d73ebbc681..288d5e6d820 100644 --- a/Tests/UnitTests/Plugins/ActSVG/PortalSvgConverterTests.cpp +++ b/Tests/UnitTests/Plugins/ActSVG/PortalSvgConverterTests.cpp @@ -35,7 +35,7 @@ BOOST_AUTO_TEST_CASE(CylinderPortalsSvg) { portalStyle.highlights = {}; portalStyle.strokeColor = {25, 25, 25}; portalStyle.strokeWidth = 0.5; - portalStyle.nSegments = 72u; + portalStyle.quaterSegments = 72u; Acts::ActsScalar rInner = 10.; Acts::ActsScalar rOuter = 100.; @@ -94,7 +94,7 @@ BOOST_AUTO_TEST_CASE(CylinderContainerPortalsSvg) { portalStyle.highlights = {}; portalStyle.strokeColor = {25, 25, 25}; portalStyle.strokeWidth = 0.5; - portalStyle.nSegments = 72u; + portalStyle.quaterSegments = 72u; Acts::ActsScalar rInner = 10.; Acts::ActsScalar rMiddle = 100.; diff --git a/Tests/UnitTests/Plugins/ActSVG/SurfaceSvgConverterTests.cpp b/Tests/UnitTests/Plugins/ActSVG/SurfaceSvgConverterTests.cpp index 08c973230e1..62ab6d56d78 100644 --- a/Tests/UnitTests/Plugins/ActSVG/SurfaceSvgConverterTests.cpp +++ b/Tests/UnitTests/Plugins/ActSVG/SurfaceSvgConverterTests.cpp @@ -74,7 +74,7 @@ BOOST_AUTO_TEST_CASE(PlanarSurfaces) { planarStyle.highlightColor = {255, 153, 51}; planarStyle.highlights = {"mouseover", "mouseout"}; planarStyle.strokeWidth = 0.5; - planarStyle.nSegments = 0u; + planarStyle.quaterSegments = 0u; // Rectangle case auto rectangleBounds = std::make_shared(36., 64.); @@ -169,7 +169,7 @@ BOOST_AUTO_TEST_CASE(DiscSurfaces) { discStyle.highlightColor = {153, 204, 0}; discStyle.highlights = {"mouseover", "mouseout"}; discStyle.strokeWidth = 0.5; - discStyle.nSegments = 72u; + discStyle.quaterSegments = 72u; auto transform = Acts::Transform3::Identity(); transform.pretranslate(Acts::Vector3{20., 20., 100.}); diff --git a/Tests/UnitTests/Plugins/ActSVG/TrackingGeometrySvgConverterTests.cpp b/Tests/UnitTests/Plugins/ActSVG/TrackingGeometrySvgConverterTests.cpp index f984984846e..56a3ff0db7a 100644 --- a/Tests/UnitTests/Plugins/ActSVG/TrackingGeometrySvgConverterTests.cpp +++ b/Tests/UnitTests/Plugins/ActSVG/TrackingGeometrySvgConverterTests.cpp @@ -32,7 +32,7 @@ BOOST_AUTO_TEST_CASE(CylindricalTrackingGeometrySvg) { cylinderLayerStyle.highlights = {"mouseover", "mouseout"}; cylinderLayerStyle.strokeColor = {25, 25, 25}; cylinderLayerStyle.strokeWidth = 0.5; - cylinderLayerStyle.nSegments = 72u; + cylinderLayerStyle.quaterSegments = 72u; Acts::GeometryIdentifier geoID{0}; From 6376ad67bb14de0286a9e7d2c8de99a8ca73bb82 Mon Sep 17 00:00:00 2001 From: Andreas Salzburger Date: Tue, 23 Jul 2024 10:53:12 +0200 Subject: [PATCH 05/31] spelling mistake --- Core/include/Acts/Detector/LayerStructureBuilder.hpp | 2 +- Core/include/Acts/Visualization/ViewConfig.hpp | 2 +- Core/src/Detector/LayerStructureBuilder.cpp | 2 +- Core/src/Visualization/EventDataView3D.cpp | 4 ++-- Core/src/Visualization/GeometryView3D.cpp | 6 +++--- .../TGeoDetector/TGeoITkModuleSplitter.hpp | 2 +- .../Io/Svg/include/ActsExamples/Io/Svg/SvgDefaults.hpp | 6 +++--- Examples/Python/src/Geometry.cpp | 2 +- Examples/Python/src/Obj.cpp | 2 +- Examples/Python/src/Output.cpp | 2 +- Examples/Python/src/Svg.cpp | 2 +- .../ActSVG/include/Acts/Plugins/ActSVG/SvgUtils.hpp | 2 +- Plugins/ActSVG/src/SurfaceSvgConverter.cpp | 6 +++--- .../Acts/Plugins/DD4hep/DD4hepLayerStructure.hpp | 2 +- Plugins/DD4hep/src/DD4hepLayerStructure.cpp | 2 +- .../Acts/Plugins/GeoModel/GeoModelBlueprintCreater.hpp | 2 +- Plugins/GeoModel/src/GeoModelBlueprintCreater.cpp | 2 +- .../Core/Visualization/TrackingGeometryView3DBase.hpp | 10 +++++----- .../ActSVG/IndexedSurfacesSvgConverterTests.cpp | 2 +- .../Plugins/ActSVG/LayerSvgConverterTests.cpp | 10 +++++----- .../Plugins/ActSVG/PortalSvgConverterTests.cpp | 4 ++-- .../Plugins/ActSVG/SurfaceSvgConverterTests.cpp | 4 ++-- .../ActSVG/TrackingGeometrySvgConverterTests.cpp | 2 +- 23 files changed, 40 insertions(+), 40 deletions(-) diff --git a/Core/include/Acts/Detector/LayerStructureBuilder.hpp b/Core/include/Acts/Detector/LayerStructureBuilder.hpp index caa8c8f9026..91017b6be5f 100644 --- a/Core/include/Acts/Detector/LayerStructureBuilder.hpp +++ b/Core/include/Acts/Detector/LayerStructureBuilder.hpp @@ -93,7 +93,7 @@ class LayerStructureBuilder : public IInternalStructureBuilder { unsigned int nMinimalSurfaces = 4u; /// Polyhedron approximations: number of segments to be used /// to approximate a quater of a circle - unsigned int quaterSegments = 1u; + unsigned int quarterSegments = 1u; /// Extra information, mainly for screen output std::string auxiliary = ""; }; diff --git a/Core/include/Acts/Visualization/ViewConfig.hpp b/Core/include/Acts/Visualization/ViewConfig.hpp index a0e787e8e32..ed579c1d756 100644 --- a/Core/include/Acts/Visualization/ViewConfig.hpp +++ b/Core/include/Acts/Visualization/ViewConfig.hpp @@ -38,7 +38,7 @@ struct ViewConfig { /// The visual surface thickness for this object double surfaceThickness = 0.15; /// The number of segments to approximate a quarter of the circle - unsigned int quaterSegments = 72; + unsigned int quarterSegments = 72; /// Whether to triangulate or not bool triangulate = false; /// Write name - non-empty string indicates writing diff --git a/Core/src/Detector/LayerStructureBuilder.cpp b/Core/src/Detector/LayerStructureBuilder.cpp index dce5f4b38d7..2391b5a432c 100644 --- a/Core/src/Detector/LayerStructureBuilder.cpp +++ b/Core/src/Detector/LayerStructureBuilder.cpp @@ -257,7 +257,7 @@ Acts::Experimental::LayerStructureBuilder::construct( // Estimate the extent from the surfaces for (const auto& s : internalSurfaces) { auto sPolyhedron = - s->polyhedronRepresentation(gctx, m_cfg.quaterSegments); + s->polyhedronRepresentation(gctx, m_cfg.quarterSegments); supportExtent.extend(sPolyhedron.extent(), support.internalConstraints); } diff --git a/Core/src/Visualization/EventDataView3D.cpp b/Core/src/Visualization/EventDataView3D.cpp index 14d9ff365f5..b2b4b1d8f5b 100644 --- a/Core/src/Visualization/EventDataView3D.cpp +++ b/Core/src/Visualization/EventDataView3D.cpp @@ -27,7 +27,7 @@ void Acts::EventDataView3D::drawCovarianceCartesian( std::vector ellipse = createEllipse( lambda0 * locErrorScale, lambda1 * locErrorScale, theta, - viewConfig.quaterSegments, viewConfig.offset, lposition, transform); + viewConfig.quarterSegments, viewConfig.offset, lposition, transform); ellipse.push_back(transform * Vector3(lposition.x(), lposition.y(), viewConfig.offset)); @@ -56,7 +56,7 @@ void Acts::EventDataView3D::drawCovarianceAngular( std::vector ellipse = createEllipse(angularErrorScale * directionScale * lambda0 * sin(dtheta), angularErrorScale * directionScale * lambda1, theta, - viewConfig.quaterSegments, 0., {0., 0.}, eplane); + viewConfig.quarterSegments, 0., {0., 0.}, eplane); std::vector coneTop = ellipse; coneTop.push_back(anker); diff --git a/Core/src/Visualization/GeometryView3D.cpp b/Core/src/Visualization/GeometryView3D.cpp index 9910de7a086..b57d9e9c28e 100644 --- a/Core/src/Visualization/GeometryView3D.cpp +++ b/Core/src/Visualization/GeometryView3D.cpp @@ -91,7 +91,7 @@ void Acts::GeometryView3D::drawSurface(IVisualization3D& helper, const Transform3& transform, const ViewConfig& viewConfig) { Polyhedron surfaceHedron = - surface.polyhedronRepresentation(gctx, viewConfig.quaterSegments); + surface.polyhedronRepresentation(gctx, viewConfig.quarterSegments); if (!transform.isApprox(Transform3::Identity())) { surfaceHedron.move(transform); } @@ -157,7 +157,7 @@ void Acts::GeometryView3D::drawSurfaceArray( auto rValues = axes[0]->getBinEdges(); auto phiValues = axes[1]->getBinEdges(); ViewConfig gridRadConfig = gridConfig; - gridRadConfig.quaterSegments = phiValues.size(); + gridRadConfig.quarterSegments = phiValues.size(); for (auto r : rValues) { CylinderVolumeBounds cvb(r - 0.5 * thickness, r + 0.5 * thickness, 0.5 * thickness); @@ -289,7 +289,7 @@ void Acts::GeometryView3D::drawTrackingVolume( ViewConfig lConfig = layerView; ViewConfig sConfig = sensitiveView; ViewConfig gConfig = gridView; - gConfig.quaterSegments = 8; + gConfig.quarterSegments = 8; ViewConfig vcConfig = cConfig; std::string vname = tVolume.volumeName(); diff --git a/Examples/Detectors/TGeoDetector/include/ActsExamples/TGeoDetector/TGeoITkModuleSplitter.hpp b/Examples/Detectors/TGeoDetector/include/ActsExamples/TGeoDetector/TGeoITkModuleSplitter.hpp index 98db7624af6..c32c8cc215c 100644 --- a/Examples/Detectors/TGeoDetector/include/ActsExamples/TGeoDetector/TGeoITkModuleSplitter.hpp +++ b/Examples/Detectors/TGeoDetector/include/ActsExamples/TGeoDetector/TGeoITkModuleSplitter.hpp @@ -90,7 +90,7 @@ class TGeoITkModuleSplitter : public Acts::ITGeoDetectorElementSplitter { splitBarrelModule( const Acts::GeometryContext& gctx, const std::shared_ptr& detElement, - unsigned int quaterSegments) const; + unsigned int quarterSegments) const; /// Take a geometry context and TGeoElement in the Itk disks and split it /// into sub elements. diff --git a/Examples/Io/Svg/include/ActsExamples/Io/Svg/SvgDefaults.hpp b/Examples/Io/Svg/include/ActsExamples/Io/Svg/SvgDefaults.hpp index 29478007670..e57255daefa 100644 --- a/Examples/Io/Svg/include/ActsExamples/Io/Svg/SvgDefaults.hpp +++ b/Examples/Io/Svg/include/ActsExamples/Io/Svg/SvgDefaults.hpp @@ -22,7 +22,7 @@ static inline Acts::Svg::Style layerStyle() { lStyle.highlights = {"mouseover", "mouseout"}; lStyle.strokeColor = {25, 25, 25}; lStyle.strokeWidth = 0.5; - lStyle.quaterSegments = 72u; + lStyle.quarterSegments = 72u; return lStyle; } @@ -43,7 +43,7 @@ static inline Acts::Svg::Style backgroundStyle() { bgStyle.highlights = {}; bgStyle.strokeColor = {25, 25, 25}; bgStyle.strokeWidth = 0.5; - bgStyle.quaterSegments = 72u; + bgStyle.quarterSegments = 72u; return bgStyle; } @@ -55,7 +55,7 @@ static inline Acts::Svg::Style pointStyle() { pStyle.highlights = {"mouseover", "mouseout"}; pStyle.strokeColor = {0, 0, 0}; pStyle.strokeWidth = 0.5; - pStyle.quaterSegments = 72u; + pStyle.quarterSegments = 72u; return pStyle; } diff --git a/Examples/Python/src/Geometry.cpp b/Examples/Python/src/Geometry.cpp index 8970eca697b..64ca8b2538e 100644 --- a/Examples/Python/src/Geometry.cpp +++ b/Examples/Python/src/Geometry.cpp @@ -305,7 +305,7 @@ void addExperimentalGeometry(Context& ctx) { ACTS_PYTHON_MEMBER(surfacesProvider); ACTS_PYTHON_MEMBER(supports); ACTS_PYTHON_MEMBER(binnings); - ACTS_PYTHON_MEMBER(quaterSegments); + ACTS_PYTHON_MEMBER(quarterSegments); ACTS_PYTHON_MEMBER(auxiliary); ACTS_PYTHON_STRUCT_END(); diff --git a/Examples/Python/src/Obj.cpp b/Examples/Python/src/Obj.cpp index 8616597a542..069d8a5572c 100644 --- a/Examples/Python/src/Obj.cpp +++ b/Examples/Python/src/Obj.cpp @@ -43,7 +43,7 @@ void addObj(Context& ctx) { const std::array& viewRgb, unsigned int viewSegements, const std::string& fileName) { Acts::ViewConfig sConfig = Acts::ViewConfig{viewRgb}; - sConfig.quaterSegments = viewSegements; + sConfig.quarterSegments = viewSegements; Acts::GeometryView3D view3D; Acts::ObjVisualization3D obj; diff --git a/Examples/Python/src/Output.cpp b/Examples/Python/src/Output.cpp index 8693fc0cf54..0d54136238d 100644 --- a/Examples/Python/src/Output.cpp +++ b/Examples/Python/src/Output.cpp @@ -118,7 +118,7 @@ void addOutput(Context& ctx) { ACTS_PYTHON_MEMBER(offset); ACTS_PYTHON_MEMBER(lineThickness); ACTS_PYTHON_MEMBER(surfaceThickness); - ACTS_PYTHON_MEMBER(quaterSegments); + ACTS_PYTHON_MEMBER(quarterSegments); ACTS_PYTHON_MEMBER(triangulate); ACTS_PYTHON_MEMBER(outputName); ACTS_PYTHON_STRUCT_END(); diff --git a/Examples/Python/src/Svg.cpp b/Examples/Python/src/Svg.cpp index 2a1a7430fbc..efbee02c3a0 100644 --- a/Examples/Python/src/Svg.cpp +++ b/Examples/Python/src/Svg.cpp @@ -220,7 +220,7 @@ void addSvg(Context& ctx) { ACTS_PYTHON_MEMBER(highlights); ACTS_PYTHON_MEMBER(strokeWidth); ACTS_PYTHON_MEMBER(strokeColor); - ACTS_PYTHON_MEMBER(quaterSegments); + ACTS_PYTHON_MEMBER(quarterSegments); ACTS_PYTHON_STRUCT_END(); } diff --git a/Plugins/ActSVG/include/Acts/Plugins/ActSVG/SvgUtils.hpp b/Plugins/ActSVG/include/Acts/Plugins/ActSVG/SvgUtils.hpp index 7c074df0031..ed579a0cb5b 100644 --- a/Plugins/ActSVG/include/Acts/Plugins/ActSVG/SvgUtils.hpp +++ b/Plugins/ActSVG/include/Acts/Plugins/ActSVG/SvgUtils.hpp @@ -41,7 +41,7 @@ struct Style { unsigned int fontSize = 14u; /// Number of segments to approximate a quarter of a circle - unsigned int quaterSegments = 72u; + unsigned int quarterSegments = 72u; /// Conversion to fill and stroke object from the base library /// @return a tuple of actsvg digestable objects diff --git a/Plugins/ActSVG/src/SurfaceSvgConverter.cpp b/Plugins/ActSVG/src/SurfaceSvgConverter.cpp index 4e75693be80..07a7b8fe6e5 100644 --- a/Plugins/ActSVG/src/SurfaceSvgConverter.cpp +++ b/Plugins/ActSVG/src/SurfaceSvgConverter.cpp @@ -21,7 +21,7 @@ Acts::Svg::ProtoSurface Acts::Svg::SurfaceConverter::convert( if (!cOptions.templateSurface) { // Polyhedron surface for vertices needed anyway Polyhedron surfaceHedron = - surface.polyhedronRepresentation(gctx, cOptions.style.quaterSegments); + surface.polyhedronRepresentation(gctx, cOptions.style.quarterSegments); auto vertices3D = surfaceHedron.vertices; pSurface._vertices = vertices3D; } else { @@ -30,7 +30,7 @@ Acts::Svg::ProtoSurface Acts::Svg::SurfaceConverter::convert( auto planarBounds = dynamic_cast(&(surface.bounds())); if (planarBounds != nullptr) { - auto vertices2D = planarBounds->vertices(cOptions.style.quaterSegments); + auto vertices2D = planarBounds->vertices(cOptions.style.quarterSegments); pSurface._vertices.reserve(vertices2D.size()); for (const auto& v2 : vertices2D) { pSurface._vertices.push_back({v2[0], v2[1], 0.}); @@ -41,7 +41,7 @@ Acts::Svg::ProtoSurface Acts::Svg::SurfaceConverter::convert( dynamic_cast(&(surface.bounds())); if (annulusBounds != nullptr) { auto vertices2D = - annulusBounds->vertices(cOptions.style.quaterSegments); + annulusBounds->vertices(cOptions.style.quarterSegments); pSurface._vertices.reserve(vertices2D.size()); for (const auto& v2 : vertices2D) { pSurface._vertices.push_back({v2[0], v2[1], 0.}); diff --git a/Plugins/DD4hep/include/Acts/Plugins/DD4hep/DD4hepLayerStructure.hpp b/Plugins/DD4hep/include/Acts/Plugins/DD4hep/DD4hepLayerStructure.hpp index 495a2d63e2a..4ff0260108f 100644 --- a/Plugins/DD4hep/include/Acts/Plugins/DD4hep/DD4hepLayerStructure.hpp +++ b/Plugins/DD4hep/include/Acts/Plugins/DD4hep/DD4hepLayerStructure.hpp @@ -66,7 +66,7 @@ class DD4hepLayerStructure { /// The extent constraints - optionally std::vector extentConstraints = {}; /// Approximation for the polyhedron binning - unsigned int quaterSegments = 1u; + unsigned int quarterSegments = 1u; /// Patch the binning with the extent if possible bool patchBinningWithExtent = true; /// Conversion options diff --git a/Plugins/DD4hep/src/DD4hepLayerStructure.cpp b/Plugins/DD4hep/src/DD4hepLayerStructure.cpp index e927f5e00f0..f0913a9949c 100644 --- a/Plugins/DD4hep/src/DD4hepLayerStructure.cpp +++ b/Plugins/DD4hep/src/DD4hepLayerStructure.cpp @@ -38,7 +38,7 @@ Acts::Experimental::DD4hepLayerStructure::builder( fCache.sExtent = options.extent; fCache.pExtent = options.extent; fCache.extentConstraints = options.extentConstraints; - fCache.nExtentQSegments = options.quaterSegments; + fCache.nExtentQSegments = options.quarterSegments; m_surfaceFactory->construct(fCache, gctx, dd4hepElement, options.conversionOptions); diff --git a/Plugins/GeoModel/include/Acts/Plugins/GeoModel/GeoModelBlueprintCreater.hpp b/Plugins/GeoModel/include/Acts/Plugins/GeoModel/GeoModelBlueprintCreater.hpp index 07e3224724c..13640034f09 100644 --- a/Plugins/GeoModel/include/Acts/Plugins/GeoModel/GeoModelBlueprintCreater.hpp +++ b/Plugins/GeoModel/include/Acts/Plugins/GeoModel/GeoModelBlueprintCreater.hpp @@ -41,7 +41,7 @@ class GeoModelBlueprintCreater { /// The binning values for the KDTree sorting std::vector kdtBinning = {}; /// Polyhedron approximation: number of segments per circle quater - unsigned int quaterSegments = 1u; + unsigned int quarterSegments = 1u; }; /// The cache struct diff --git a/Plugins/GeoModel/src/GeoModelBlueprintCreater.cpp b/Plugins/GeoModel/src/GeoModelBlueprintCreater.cpp index 3411aa78706..67869e992c7 100644 --- a/Plugins/GeoModel/src/GeoModelBlueprintCreater.cpp +++ b/Plugins/GeoModel/src/GeoModelBlueprintCreater.cpp @@ -353,7 +353,7 @@ Acts::GeoModelBlueprintCreater::createInternalStructureBuilder( // Loop over surfaces and create an internal extent for (auto& sf : surfaces) { auto sfExtent = - sf->polyhedronRepresentation(gctx, m_cfg.quaterSegments).extent(); + sf->polyhedronRepresentation(gctx, m_cfg.quarterSegments).extent(); internalExtent.extend(sfExtent, internalConstraints); } ACTS_VERBOSE("Found " << surfaces.size() << " surfaces in range " diff --git a/Tests/UnitTests/Core/Visualization/TrackingGeometryView3DBase.hpp b/Tests/UnitTests/Core/Visualization/TrackingGeometryView3DBase.hpp index 480040a60b8..f86863d7dd4 100644 --- a/Tests/UnitTests/Core/Visualization/TrackingGeometryView3DBase.hpp +++ b/Tests/UnitTests/Core/Visualization/TrackingGeometryView3DBase.hpp @@ -39,18 +39,18 @@ static inline std::string run(IVisualization3D& helper, bool triangulate, ViewConfig viewSensitive = ViewConfig({0, 180, 240}); viewSensitive.triangulate = triangulate; - viewSensitive.quaterSegments = 72; + viewSensitive.quarterSegments = 72; ViewConfig viewPassive = ViewConfig({240, 280, 0}); viewPassive.triangulate = triangulate; - viewPassive.quaterSegments = 72; + viewPassive.quarterSegments = 72; ViewConfig viewVolume = ViewConfig({220, 220, 0}); viewVolume.triangulate = triangulate; - viewVolume.quaterSegments = 72; + viewVolume.quarterSegments = 72; ViewConfig viewContainer = ViewConfig({220, 220, 0}); viewContainer.triangulate = triangulate; - viewContainer.quaterSegments = 72; + viewContainer.quarterSegments = 72; ViewConfig viewGrid = ViewConfig({220, 0, 0}); - viewGrid.quaterSegments = 8; + viewGrid.quarterSegments = 8; viewGrid.offset = 3.; viewGrid.triangulate = triangulate; diff --git a/Tests/UnitTests/Plugins/ActSVG/IndexedSurfacesSvgConverterTests.cpp b/Tests/UnitTests/Plugins/ActSVG/IndexedSurfacesSvgConverterTests.cpp index 945229fe14c..88f198f8eaa 100644 --- a/Tests/UnitTests/Plugins/ActSVG/IndexedSurfacesSvgConverterTests.cpp +++ b/Tests/UnitTests/Plugins/ActSVG/IndexedSurfacesSvgConverterTests.cpp @@ -42,7 +42,7 @@ IndexedSurfacesConverter::Options generateDrawOptions() { sensitiveStyle.highlights = {"onmouseover", "onmouseout"}; sensitiveStyle.strokeWidth = 0.5; sensitiveStyle.strokeColor = {0, 0, 0}; - sensitiveStyle.quaterSegments = 72u; + sensitiveStyle.quarterSegments = 72u; std::pair allSensitives = {GeometryIdentifier(0u), sensitiveStyle}; diff --git a/Tests/UnitTests/Plugins/ActSVG/LayerSvgConverterTests.cpp b/Tests/UnitTests/Plugins/ActSVG/LayerSvgConverterTests.cpp index 85f5233d20c..2472ff19fd0 100644 --- a/Tests/UnitTests/Plugins/ActSVG/LayerSvgConverterTests.cpp +++ b/Tests/UnitTests/Plugins/ActSVG/LayerSvgConverterTests.cpp @@ -45,12 +45,12 @@ void setupTools() { std::shared_ptr generateDiscLayer(Acts::ActsScalar rInner, Acts::ActsScalar rOuter, - unsigned int quaterSegments, + unsigned int quarterSegments, unsigned int nRings, bool useTrapezoids = false) { // Some preparations setupTools(); - unsigned int fullSegments = 4 * quaterSegments; + unsigned int fullSegments = 4 * quarterSegments; std::vector> moduleSurfaces; Acts::ActsScalar phiStep = 2 * M_PI / fullSegments; Acts::ActsScalar rStep = (rOuter - rInner) / nRings; @@ -126,7 +126,7 @@ BOOST_AUTO_TEST_CASE(DiscLayerRadialSvg) { discLayerStyle.highlights = {"mouseover", "mouseout"}; discLayerStyle.strokeColor = {25, 25, 25}; discLayerStyle.strokeWidth = 0.5; - discLayerStyle.quaterSegments = 72u; + discLayerStyle.quarterSegments = 72u; Acts::GeometryIdentifier geoID{0}; @@ -156,7 +156,7 @@ BOOST_AUTO_TEST_CASE(DiscLayerTrapezoidSvg) { discLayerStyle.highlights = {"mouseover", "mouseout"}; discLayerStyle.strokeColor = {25, 25, 25}; discLayerStyle.strokeWidth = 0.5; - discLayerStyle.quaterSegments = 72u; + discLayerStyle.quarterSegments = 72u; Acts::GeometryIdentifier geoID{0}; @@ -186,7 +186,7 @@ BOOST_AUTO_TEST_CASE(CylinderLayerSvg) { cylinderLayerStyle.highlights = {"mouseover", "mouseout"}; cylinderLayerStyle.strokeColor = {25, 25, 25}; cylinderLayerStyle.strokeWidth = 0.5; - cylinderLayerStyle.quaterSegments = 72u; + cylinderLayerStyle.quarterSegments = 72u; Acts::GeometryIdentifier geoID{0}; diff --git a/Tests/UnitTests/Plugins/ActSVG/PortalSvgConverterTests.cpp b/Tests/UnitTests/Plugins/ActSVG/PortalSvgConverterTests.cpp index 288d5e6d820..f065973b002 100644 --- a/Tests/UnitTests/Plugins/ActSVG/PortalSvgConverterTests.cpp +++ b/Tests/UnitTests/Plugins/ActSVG/PortalSvgConverterTests.cpp @@ -35,7 +35,7 @@ BOOST_AUTO_TEST_CASE(CylinderPortalsSvg) { portalStyle.highlights = {}; portalStyle.strokeColor = {25, 25, 25}; portalStyle.strokeWidth = 0.5; - portalStyle.quaterSegments = 72u; + portalStyle.quarterSegments = 72u; Acts::ActsScalar rInner = 10.; Acts::ActsScalar rOuter = 100.; @@ -94,7 +94,7 @@ BOOST_AUTO_TEST_CASE(CylinderContainerPortalsSvg) { portalStyle.highlights = {}; portalStyle.strokeColor = {25, 25, 25}; portalStyle.strokeWidth = 0.5; - portalStyle.quaterSegments = 72u; + portalStyle.quarterSegments = 72u; Acts::ActsScalar rInner = 10.; Acts::ActsScalar rMiddle = 100.; diff --git a/Tests/UnitTests/Plugins/ActSVG/SurfaceSvgConverterTests.cpp b/Tests/UnitTests/Plugins/ActSVG/SurfaceSvgConverterTests.cpp index 62ab6d56d78..af670b99410 100644 --- a/Tests/UnitTests/Plugins/ActSVG/SurfaceSvgConverterTests.cpp +++ b/Tests/UnitTests/Plugins/ActSVG/SurfaceSvgConverterTests.cpp @@ -74,7 +74,7 @@ BOOST_AUTO_TEST_CASE(PlanarSurfaces) { planarStyle.highlightColor = {255, 153, 51}; planarStyle.highlights = {"mouseover", "mouseout"}; planarStyle.strokeWidth = 0.5; - planarStyle.quaterSegments = 0u; + planarStyle.quarterSegments = 0u; // Rectangle case auto rectangleBounds = std::make_shared(36., 64.); @@ -169,7 +169,7 @@ BOOST_AUTO_TEST_CASE(DiscSurfaces) { discStyle.highlightColor = {153, 204, 0}; discStyle.highlights = {"mouseover", "mouseout"}; discStyle.strokeWidth = 0.5; - discStyle.quaterSegments = 72u; + discStyle.quarterSegments = 72u; auto transform = Acts::Transform3::Identity(); transform.pretranslate(Acts::Vector3{20., 20., 100.}); diff --git a/Tests/UnitTests/Plugins/ActSVG/TrackingGeometrySvgConverterTests.cpp b/Tests/UnitTests/Plugins/ActSVG/TrackingGeometrySvgConverterTests.cpp index 56a3ff0db7a..f95c46e3b58 100644 --- a/Tests/UnitTests/Plugins/ActSVG/TrackingGeometrySvgConverterTests.cpp +++ b/Tests/UnitTests/Plugins/ActSVG/TrackingGeometrySvgConverterTests.cpp @@ -32,7 +32,7 @@ BOOST_AUTO_TEST_CASE(CylindricalTrackingGeometrySvg) { cylinderLayerStyle.highlights = {"mouseover", "mouseout"}; cylinderLayerStyle.strokeColor = {25, 25, 25}; cylinderLayerStyle.strokeWidth = 0.5; - cylinderLayerStyle.quaterSegments = 72u; + cylinderLayerStyle.quarterSegments = 72u; Acts::GeometryIdentifier geoID{0}; From 301da028166f2f75b324c43b0caf723d59179d06 Mon Sep 17 00:00:00 2001 From: Andreas Salzburger Date: Tue, 23 Jul 2024 11:04:12 +0200 Subject: [PATCH 06/31] spelling --- Core/include/Acts/Detector/LayerStructureBuilder.hpp | 2 +- Core/include/Acts/Surfaces/AnnulusBounds.hpp | 2 +- Core/include/Acts/Surfaces/CylinderBounds.hpp | 4 ++-- Core/include/Acts/Surfaces/CylinderSurface.hpp | 6 +++--- Core/include/Acts/Surfaces/DiscSurface.hpp | 2 +- Core/include/Acts/Surfaces/EllipseBounds.hpp | 2 +- Core/include/Acts/Surfaces/PlanarBounds.hpp | 2 +- Core/include/Acts/Surfaces/PlaneSurface.hpp | 2 +- Core/include/Acts/Surfaces/Surface.hpp | 4 ++-- Core/src/Surfaces/detail/VerticesHelper.cpp | 2 +- Examples/Python/src/Obj.cpp | 6 +++--- .../Acts/Plugins/DD4hep/DD4hepDetectorSurfaceFactory.hpp | 2 +- 12 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Core/include/Acts/Detector/LayerStructureBuilder.hpp b/Core/include/Acts/Detector/LayerStructureBuilder.hpp index 91017b6be5f..c902926b356 100644 --- a/Core/include/Acts/Detector/LayerStructureBuilder.hpp +++ b/Core/include/Acts/Detector/LayerStructureBuilder.hpp @@ -92,7 +92,7 @@ class LayerStructureBuilder : public IInternalStructureBuilder { /// - otherwise the tryAll options is used unsigned int nMinimalSurfaces = 4u; /// Polyhedron approximations: number of segments to be used - /// to approximate a quater of a circle + /// to approximate a quarter of a circle unsigned int quarterSegments = 1u; /// Extra information, mainly for screen output std::string auxiliary = ""; diff --git a/Core/include/Acts/Surfaces/AnnulusBounds.hpp b/Core/include/Acts/Surfaces/AnnulusBounds.hpp index d7324d8d292..bbab52e02ba 100644 --- a/Core/include/Acts/Surfaces/AnnulusBounds.hpp +++ b/Core/include/Acts/Surfaces/AnnulusBounds.hpp @@ -135,7 +135,7 @@ class AnnulusBounds : public DiscBounds { /// This method returns the xy coordinates of the four corners of the /// bounds in module coordinates (in x/y), and if quarterSegments is bigger of /// equal to 0, the curved part of the segment is included and approximated - /// by the cooresponding number of segments. + /// by the correspondingnumber of segments. /// /// Starting from the upper right (max R, pos locX) and proceeding clock-wise /// i.e. (max R; pos locX), (min R; pos locX), (min R; neg loc X), (max R: neg diff --git a/Core/include/Acts/Surfaces/CylinderBounds.hpp b/Core/include/Acts/Surfaces/CylinderBounds.hpp index 3c34f798bea..030d18cb16b 100644 --- a/Core/include/Acts/Surfaces/CylinderBounds.hpp +++ b/Core/include/Acts/Surfaces/CylinderBounds.hpp @@ -116,11 +116,11 @@ class CylinderBounds : public SurfaceBounds { /// /// @param transform is the global transform /// @param quarterSegments is the number of segments to approximate a quarter - /// of a circle. In oder to symmetrize fully closed and sectoral cylinders, + /// of a circle. In order to symmetrize fully closed and sectoral cylinders, /// also in the first case the two end points are given (albeit they overlap) /// in -pi / pi /// - /// @return a signle vector containing the vertices from one side and then + /// @return a singlevector containing the vertices from one side and then /// from the other side consecutively std::vector circleVertices(const Transform3 transform, unsigned int quarterSegments) const; diff --git a/Core/include/Acts/Surfaces/CylinderSurface.hpp b/Core/include/Acts/Surfaces/CylinderSurface.hpp index 8fb5676598f..d5ae97df5cd 100644 --- a/Core/include/Acts/Surfaces/CylinderSurface.hpp +++ b/Core/include/Acts/Surfaces/CylinderSurface.hpp @@ -215,9 +215,9 @@ class CylinderSurface : public RegularSurface { /// Return a Polyhedron for a cylinder /// /// This method represents the cylinder as a polyhedron with a given number - /// of segments to represent the full 2*M_PI curve. The polyedron will consist - /// of the vertices of the cylinder on both sides, and faces between them, - /// both as rectangular faces and as triangular faces. + /// of segments to represent a quarter of a full circle. The polyedron will + /// consist of the vertices of the cylinder on both sides, and faces between + /// them, both as rectangular faces and as triangular faces. /// /// @param gctx The current geometry context object, e.g. alignment /// @param quarterSegments The number of segmetns to approximate a quarter of the diff --git a/Core/include/Acts/Surfaces/DiscSurface.hpp b/Core/include/Acts/Surfaces/DiscSurface.hpp index 24fe1feb687..7f90900ce09 100644 --- a/Core/include/Acts/Surfaces/DiscSurface.hpp +++ b/Core/include/Acts/Surfaces/DiscSurface.hpp @@ -313,7 +313,7 @@ class DiscSurface : public RegularSurface { /// /// @param gctx The current geometry context object, e.g. alignment /// @param quarterSegments Number of segments used to describe the - /// quarter of a full cirlce + /// quarter of a full circle /// /// @return A list of vertices and a face/facett description of it Polyhedron polyhedronRepresentation( diff --git a/Core/include/Acts/Surfaces/EllipseBounds.hpp b/Core/include/Acts/Surfaces/EllipseBounds.hpp index b3fa87ffbec..891c8b0b0e8 100644 --- a/Core/include/Acts/Surfaces/EllipseBounds.hpp +++ b/Core/include/Acts/Surfaces/EllipseBounds.hpp @@ -93,7 +93,7 @@ class EllipseBounds : public PlanarBounds { /// Return the vertices /// /// @param quarterSegments is the number of segments to approximate a quarter - /// of a circle. In oder to symmetrize fully closed and sectoral cylinders, + /// of a circle. In order to symmetrize fully closed and sectoral cylinders, /// also in the first case the two end points are given (albeit they overlap) /// in -pi / pi /// diff --git a/Core/include/Acts/Surfaces/PlanarBounds.hpp b/Core/include/Acts/Surfaces/PlanarBounds.hpp index bf9d5a896c5..aace47d7916 100644 --- a/Core/include/Acts/Surfaces/PlanarBounds.hpp +++ b/Core/include/Acts/Surfaces/PlanarBounds.hpp @@ -30,7 +30,7 @@ class PlanarBounds : public SurfaceBounds { /// segments in a quarter of the phi range. If it is 1, then only the extrema /// points in phi are inserted next to the segment corners. /// - /// @note for planar bounds without curved segements @c quarterSegments is ignored + /// @note for planar bounds without curved segments @c quarterSegments is ignored /// /// @return vector for vertices in 2D virtual std::vector vertices( diff --git a/Core/include/Acts/Surfaces/PlaneSurface.hpp b/Core/include/Acts/Surfaces/PlaneSurface.hpp index 8ae044ff95f..78cb8f5acc6 100644 --- a/Core/include/Acts/Surfaces/PlaneSurface.hpp +++ b/Core/include/Acts/Surfaces/PlaneSurface.hpp @@ -211,7 +211,7 @@ class PlaneSurface : public RegularSurface { /// segments in a quarter of the phi range. If it is 1, then only the extrema /// points in phi are inserted next to the segment corners. /// - /// @note for planar surfaces without curved segements @c quarterSegments is ignored + /// @note for planar surfaces without curved segments @c quarterSegments is ignored /// /// @return A list of vertices and a face/facett description of it Polyhedron polyhedronRepresentation( diff --git a/Core/include/Acts/Surfaces/Surface.hpp b/Core/include/Acts/Surfaces/Surface.hpp index b0fd2ee9e60..0e9f68b641b 100644 --- a/Core/include/Acts/Surfaces/Surface.hpp +++ b/Core/include/Acts/Surfaces/Surface.hpp @@ -420,14 +420,14 @@ class Surface : public virtual GeometryObject, /// Return properly formatted class name virtual std::string name() const = 0; - /// Return a Polyhedron for surface objecs + /// Return a Polyhedron for surface objects /// /// @param gctx The current geometry context object, e.g. alignment /// @param quarterSegments The number of segemtns to approximate a 0.5*pi sector, /// which represents a quarter of the full circle /// /// @note In order to symmetrize the code between sectoral and closed cylinders - /// in case of closed cylinders, both (-pi, pi) are given as seperate vertices + /// in case of closed cylinders, both (-pi, pi) are given as separate vertices /// /// @note An internal surface transform can invalidate the extrema /// in the transformed space diff --git a/Core/src/Surfaces/detail/VerticesHelper.cpp b/Core/src/Surfaces/detail/VerticesHelper.cpp index 4cde3fd71a8..9cfc4b5d130 100644 --- a/Core/src/Surfaces/detail/VerticesHelper.cpp +++ b/Core/src/Surfaces/detail/VerticesHelper.cpp @@ -29,7 +29,7 @@ std::vector Acts::detail::VerticesHelper::phiSegments( "of the segment"); } } - // Bail out if minSegmens is smaler 4 or not a multiple of 4 + // Bail out if minSegmens is smaller 4 or not a multiple of 4 if (quarterSegments == 0u) { throw std::invalid_argument( "VerticesHelper::phiSegments ... Number of segments must be larger " diff --git a/Examples/Python/src/Obj.cpp b/Examples/Python/src/Obj.cpp index 069d8a5572c..80e9f622225 100644 --- a/Examples/Python/src/Obj.cpp +++ b/Examples/Python/src/Obj.cpp @@ -34,16 +34,16 @@ void addObj(Context& ctx) { /// @param surfaces is the collection of surfaces /// @param viewContext is the geometry context /// @param viewRgb is the color of the surfaces - /// @param viewSegements is the number of segments to approximate a quarter of a circle + /// @param viewsegments is the number of segments to approximate a quarter of a circle /// @param fileName is the path to the output file /// mex.def("writeSurfacesObj", [](const std::vector>& surfaces, const GeometryContext& viewContext, - const std::array& viewRgb, unsigned int viewSegements, + const std::array& viewRgb, unsigned int viewsegments, const std::string& fileName) { Acts::ViewConfig sConfig = Acts::ViewConfig{viewRgb}; - sConfig.quarterSegments = viewSegements; + sConfig.quarterSegments = viewsegments; Acts::GeometryView3D view3D; Acts::ObjVisualization3D obj; diff --git a/Plugins/DD4hep/include/Acts/Plugins/DD4hep/DD4hepDetectorSurfaceFactory.hpp b/Plugins/DD4hep/include/Acts/Plugins/DD4hep/DD4hepDetectorSurfaceFactory.hpp index 1ff07fb5170..23934a3ef7e 100644 --- a/Plugins/DD4hep/include/Acts/Plugins/DD4hep/DD4hepDetectorSurfaceFactory.hpp +++ b/Plugins/DD4hep/include/Acts/Plugins/DD4hep/DD4hepDetectorSurfaceFactory.hpp @@ -71,7 +71,7 @@ class DD4hepDetectorSurfaceFactory { std::optional pExtent = std::nullopt; /// Optionally provide an Extent constraints to measure the layers std::vector extentConstraints = {}; - /// The approximination of a circle quater for extent measuring + /// The approximination of a circle quarter for extent measuring std::size_t nExtentQSegments = 1u; }; From 18bc32389d49a402232cee84ea36cb1496b7a876 Mon Sep 17 00:00:00 2001 From: Andreas Salzburger Date: Tue, 23 Jul 2024 11:57:15 +0200 Subject: [PATCH 07/31] spelling --- Core/include/Acts/Surfaces/CylinderSurface.hpp | 2 +- Core/include/Acts/Surfaces/detail/VerticesHelper.hpp | 8 ++++---- Fatras/include/ActsFatras/Digitization/Segmentizer.hpp | 2 +- .../Acts/Plugins/GeoModel/GeoModelBlueprintCreater.hpp | 2 +- Tests/UnitTests/Fatras/Digitization/SegmentizerTests.cpp | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Core/include/Acts/Surfaces/CylinderSurface.hpp b/Core/include/Acts/Surfaces/CylinderSurface.hpp index d5ae97df5cd..6f771bb78ac 100644 --- a/Core/include/Acts/Surfaces/CylinderSurface.hpp +++ b/Core/include/Acts/Surfaces/CylinderSurface.hpp @@ -220,7 +220,7 @@ class CylinderSurface : public RegularSurface { /// them, both as rectangular faces and as triangular faces. /// /// @param gctx The current geometry context object, e.g. alignment - /// @param quarterSegments The number of segmetns to approximate a quarter of the + /// @param quarterSegments The number of segments to approximate a quarter of the /// full circle; it it's chosen to be 1, only the extrema points (-pi, -0.5pi, /// 0., 0.5pi) are inserted to capture the correct extent in the x-y plane /// diff --git a/Core/include/Acts/Surfaces/detail/VerticesHelper.hpp b/Core/include/Acts/Surfaces/detail/VerticesHelper.hpp index 5669cf0953b..cba9e316c2c 100644 --- a/Core/include/Acts/Surfaces/detail/VerticesHelper.hpp +++ b/Core/include/Acts/Surfaces/detail/VerticesHelper.hpp @@ -25,7 +25,7 @@ namespace Acts::detail::VerticesHelper { /// @param phiMin the minimum phi value /// @param phiMax The second phi value /// @param phiRef is a vector of reference phi values to be included as well -/// @param quarterSegments number of segments used to approximate a segement quarter +/// @param quarterSegments number of segments used to approximate a segment quarter /// /// @return a vector of generated phi values std::vector phiSegments(ActsScalar phiMin = -M_PI, @@ -46,7 +46,7 @@ std::vector phiSegments(ActsScalar phiMin = -M_PI, /// @param phiMin the minimum phi value /// @param phiMax The second phi value /// @param phiRef is a vector of reference phi values to be included as well -/// @param quarterSegments number of segments used to approximate a segement quarter +/// @param quarterSegments number of segments used to approximate a segment quarter /// @param offset The out of plane offset position of the bow /// @param transform The transform applied (optional) /// @@ -79,7 +79,7 @@ std::vector segmentVertices( /// @param outerRy The radius of the outer ellipse (in y) /// @param avgPhi The phi direction of the center if sector /// @param halfPhi The half phi sector of the ellipse -/// @param quarterSegments number of segments used to approximate a segement quarter +/// @param quarterSegments number of segments used to approximate a segment quarter /// /// @return a vector of 2d-vectors std::vector ellipsoidVertices(ActsScalar innerRx, ActsScalar innerRy, @@ -94,7 +94,7 @@ std::vector ellipsoidVertices(ActsScalar innerRx, ActsScalar innerRy, /// @param outerR The radius of the outer circle (sector) /// @param avgPhi The phi direction of the center if sector /// @param halfPhi The half phi sector if sector -/// @param quarterSegments number of segments used to approximate a segement quarter +/// @param quarterSegments number of segments used to approximate a segment quarter /// /// @return a vector of 2d-vectors std::vector circularVertices(ActsScalar innerR, ActsScalar outerR, diff --git a/Fatras/include/ActsFatras/Digitization/Segmentizer.hpp b/Fatras/include/ActsFatras/Digitization/Segmentizer.hpp index e6e8ac6327d..309faa75ff2 100644 --- a/Fatras/include/ActsFatras/Digitization/Segmentizer.hpp +++ b/Fatras/include/ActsFatras/Digitization/Segmentizer.hpp @@ -74,7 +74,7 @@ struct Segmentizer { /// Constructor with arguments /// /// @param bin_ The bin corresponding to this step - /// @param path2D_ The start/end 2D position of the segement + /// @param path2D_ The start/end 2D position of the segment /// @param activation_ The segment activation (clean: length) for this bin ChannelSegment(Bin2D bin_, Segment2D path2D_, double activation_) : bin(bin_), path2D(std::move(path2D_)), activation(activation_) {} diff --git a/Plugins/GeoModel/include/Acts/Plugins/GeoModel/GeoModelBlueprintCreater.hpp b/Plugins/GeoModel/include/Acts/Plugins/GeoModel/GeoModelBlueprintCreater.hpp index 13640034f09..f6c16f2d3fa 100644 --- a/Plugins/GeoModel/include/Acts/Plugins/GeoModel/GeoModelBlueprintCreater.hpp +++ b/Plugins/GeoModel/include/Acts/Plugins/GeoModel/GeoModelBlueprintCreater.hpp @@ -40,7 +40,7 @@ class GeoModelBlueprintCreater { std::vector> detectorSurfaces = {}; /// The binning values for the KDTree sorting std::vector kdtBinning = {}; - /// Polyhedron approximation: number of segments per circle quater + /// Polyhedron approximation: number of segments per circlequarter unsigned int quarterSegments = 1u; }; diff --git a/Tests/UnitTests/Fatras/Digitization/SegmentizerTests.cpp b/Tests/UnitTests/Fatras/Digitization/SegmentizerTests.cpp index 4680d39f974..d364702699f 100644 --- a/Tests/UnitTests/Fatras/Digitization/SegmentizerTests.cpp +++ b/Tests/UnitTests/Fatras/Digitization/SegmentizerTests.cpp @@ -217,9 +217,9 @@ BOOST_DATA_TEST_CASE( ".csv"); /// Run the Segmentizer - auto cSegement = cl.segments(geoCtx, *surface, segmentation, {start, end}); + auto csegment = cl.segments(geoCtx, *surface, segmentation, {start, end}); - for (const auto& cs : cSegement) { + for (const auto& cs : csegment) { csvHelper.writeLine(segments, cs.path2D[0], cs.path2D[1]); } From 9df071707a9b5a922167419ab26b9a6e8e9fe1e9 Mon Sep 17 00:00:00 2001 From: Andreas Salzburger Date: Tue, 23 Jul 2024 21:17:26 +0200 Subject: [PATCH 08/31] Update TGeoITkModuleSplitter.hpp --- .../include/ActsExamples/TGeoDetector/TGeoITkModuleSplitter.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Examples/Detectors/TGeoDetector/include/ActsExamples/TGeoDetector/TGeoITkModuleSplitter.hpp b/Examples/Detectors/TGeoDetector/include/ActsExamples/TGeoDetector/TGeoITkModuleSplitter.hpp index c32c8cc215c..a08dbebd661 100644 --- a/Examples/Detectors/TGeoDetector/include/ActsExamples/TGeoDetector/TGeoITkModuleSplitter.hpp +++ b/Examples/Detectors/TGeoDetector/include/ActsExamples/TGeoDetector/TGeoITkModuleSplitter.hpp @@ -90,7 +90,7 @@ class TGeoITkModuleSplitter : public Acts::ITGeoDetectorElementSplitter { splitBarrelModule( const Acts::GeometryContext& gctx, const std::shared_ptr& detElement, - unsigned int quarterSegments) const; + unsigned int nSegments) const; /// Take a geometry context and TGeoElement in the Itk disks and split it /// into sub elements. From ca1843fd189a189472e604fe339c9071422b34cb Mon Sep 17 00:00:00 2001 From: Andreas Salzburger Date: Wed, 24 Jul 2024 20:47:55 +0200 Subject: [PATCH 09/31] Update Core/include/Acts/Surfaces/AnnulusBounds.hpp Co-authored-by: Andreas Stefl --- Core/include/Acts/Surfaces/AnnulusBounds.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/include/Acts/Surfaces/AnnulusBounds.hpp b/Core/include/Acts/Surfaces/AnnulusBounds.hpp index bbab52e02ba..0f95b3b26d2 100644 --- a/Core/include/Acts/Surfaces/AnnulusBounds.hpp +++ b/Core/include/Acts/Surfaces/AnnulusBounds.hpp @@ -133,7 +133,7 @@ class AnnulusBounds : public DiscBounds { std::vector corners() const; /// This method returns the xy coordinates of the four corners of the - /// bounds in module coordinates (in x/y), and if quarterSegments is bigger of + /// bounds in module coordinates (in x/y), and if quarterSegments is bigger or /// equal to 0, the curved part of the segment is included and approximated /// by the correspondingnumber of segments. /// From 4749f8587a869a90d99c541e6d4c26abc094389d Mon Sep 17 00:00:00 2001 From: Andreas Salzburger Date: Wed, 24 Jul 2024 20:48:10 +0200 Subject: [PATCH 10/31] Update Core/include/Acts/Surfaces/AnnulusBounds.hpp Co-authored-by: Andreas Stefl --- Core/include/Acts/Surfaces/AnnulusBounds.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/include/Acts/Surfaces/AnnulusBounds.hpp b/Core/include/Acts/Surfaces/AnnulusBounds.hpp index 0f95b3b26d2..979f073e1c2 100644 --- a/Core/include/Acts/Surfaces/AnnulusBounds.hpp +++ b/Core/include/Acts/Surfaces/AnnulusBounds.hpp @@ -135,7 +135,7 @@ class AnnulusBounds : public DiscBounds { /// This method returns the xy coordinates of the four corners of the /// bounds in module coordinates (in x/y), and if quarterSegments is bigger or /// equal to 0, the curved part of the segment is included and approximated - /// by the correspondingnumber of segments. + /// by the corresponding number of segments. /// /// Starting from the upper right (max R, pos locX) and proceeding clock-wise /// i.e. (max R; pos locX), (min R; pos locX), (min R; neg loc X), (max R: neg From 896b44f70a0dab97edbbfd67a3f8317f3270a75b Mon Sep 17 00:00:00 2001 From: Andreas Salzburger Date: Wed, 24 Jul 2024 20:49:18 +0200 Subject: [PATCH 11/31] Update Core/include/Acts/Surfaces/CylinderSurface.hpp Co-authored-by: Andreas Stefl --- Core/include/Acts/Surfaces/CylinderSurface.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/include/Acts/Surfaces/CylinderSurface.hpp b/Core/include/Acts/Surfaces/CylinderSurface.hpp index 6f771bb78ac..757a45d97e4 100644 --- a/Core/include/Acts/Surfaces/CylinderSurface.hpp +++ b/Core/include/Acts/Surfaces/CylinderSurface.hpp @@ -221,7 +221,7 @@ class CylinderSurface : public RegularSurface { /// /// @param gctx The current geometry context object, e.g. alignment /// @param quarterSegments The number of segments to approximate a quarter of the - /// full circle; it it's chosen to be 1, only the extrema points (-pi, -0.5pi, + /// full circle; it's chosen to be 1, only the extrema points (-pi, -0.5pi, /// 0., 0.5pi) are inserted to capture the correct extent in the x-y plane /// /// @return A list of vertices and a face/facett description of it From efa9a36b71af521e2e1299b45ff32a81215a32bb Mon Sep 17 00:00:00 2001 From: Andreas Salzburger Date: Wed, 24 Jul 2024 20:49:31 +0200 Subject: [PATCH 12/31] Update Core/include/Acts/Surfaces/detail/VerticesHelper.hpp Co-authored-by: Andreas Stefl --- Core/include/Acts/Surfaces/detail/VerticesHelper.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/include/Acts/Surfaces/detail/VerticesHelper.hpp b/Core/include/Acts/Surfaces/detail/VerticesHelper.hpp index cba9e316c2c..17b22a2d051 100644 --- a/Core/include/Acts/Surfaces/detail/VerticesHelper.hpp +++ b/Core/include/Acts/Surfaces/detail/VerticesHelper.hpp @@ -34,7 +34,7 @@ std::vector phiSegments(ActsScalar phiMin = -M_PI, unsigned int quarterSegments = 2u); /// Helper method to create a regular 2 or 3 D segment -/// between two phi values with a given number of segments +/// between two phi values with a given number of segments /// /// It will insert the phi at extrema points and reference points, it uses /// a minimum approximation of a circle with 8 segments From af64e6423de905797f6f2eb11f57fae2b25bed40 Mon Sep 17 00:00:00 2001 From: Andreas Salzburger Date: Wed, 24 Jul 2024 20:50:20 +0200 Subject: [PATCH 13/31] Update Core/include/Acts/Surfaces/detail/VerticesHelper.hpp Co-authored-by: Andreas Stefl --- Core/include/Acts/Surfaces/detail/VerticesHelper.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/include/Acts/Surfaces/detail/VerticesHelper.hpp b/Core/include/Acts/Surfaces/detail/VerticesHelper.hpp index 17b22a2d051..82134673c6b 100644 --- a/Core/include/Acts/Surfaces/detail/VerticesHelper.hpp +++ b/Core/include/Acts/Surfaces/detail/VerticesHelper.hpp @@ -44,7 +44,7 @@ std::vector phiSegments(ActsScalar phiMin = -M_PI, /// /// @param rXY The radius description if first +/= second: ellipse /// @param phiMin the minimum phi value -/// @param phiMax The second phi value +/// @param phiMax the second phi value /// @param phiRef is a vector of reference phi values to be included as well /// @param quarterSegments number of segments used to approximate a segment quarter /// @param offset The out of plane offset position of the bow From 45dcdef817d302c28a616cd7be0414469638e0e4 Mon Sep 17 00:00:00 2001 From: Andreas Salzburger Date: Wed, 24 Jul 2024 20:50:57 +0200 Subject: [PATCH 14/31] Update Core/src/Surfaces/ConeSurface.cpp Co-authored-by: Andreas Stefl --- Core/src/Surfaces/ConeSurface.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Core/src/Surfaces/ConeSurface.cpp b/Core/src/Surfaces/ConeSurface.cpp index 449076f6c7b..01eab58dfe6 100644 --- a/Core/src/Surfaces/ConeSurface.cpp +++ b/Core/src/Surfaces/ConeSurface.cpp @@ -209,9 +209,8 @@ Acts::Polyhedron Acts::ConeSurface::polyhedronRepresentation( // Cone parameters ActsScalar hPhiSec = bounds().get(ConeBounds::eHalfPhiSector); ActsScalar avgPhi = bounds().get(ConeBounds::eAveragePhi); - bool fullCone = (hPhiSec == M_PI); std::vector refPhi = {}; - if (not fullCone) { + if (bool fullCone = (hPhiSec == M_PI); !fullCone) { refPhi = {avgPhi}; } From ba816e14e13c8a494a7f6e538a7067ae4cff6771 Mon Sep 17 00:00:00 2001 From: Andreas Salzburger Date: Wed, 24 Jul 2024 20:53:09 +0200 Subject: [PATCH 15/31] Update Examples/Python/src/Obj.cpp Co-authored-by: Andreas Stefl --- Examples/Python/src/Obj.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Examples/Python/src/Obj.cpp b/Examples/Python/src/Obj.cpp index 80e9f622225..38096ed019b 100644 --- a/Examples/Python/src/Obj.cpp +++ b/Examples/Python/src/Obj.cpp @@ -34,7 +34,7 @@ void addObj(Context& ctx) { /// @param surfaces is the collection of surfaces /// @param viewContext is the geometry context /// @param viewRgb is the color of the surfaces - /// @param viewsegments is the number of segments to approximate a quarter of a circle + /// @param viewSegments is the number of segments to approximate a quarter of a circle /// @param fileName is the path to the output file /// mex.def("writeSurfacesObj", From a7dffffe6fbfdcd8ab0a2b7a0cfd9ecb3c18e2aa Mon Sep 17 00:00:00 2001 From: Andreas Salzburger Date: Wed, 24 Jul 2024 20:53:19 +0200 Subject: [PATCH 16/31] Update Examples/Python/src/Obj.cpp Co-authored-by: Andreas Stefl --- Examples/Python/src/Obj.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Examples/Python/src/Obj.cpp b/Examples/Python/src/Obj.cpp index 38096ed019b..3a2c60b27ff 100644 --- a/Examples/Python/src/Obj.cpp +++ b/Examples/Python/src/Obj.cpp @@ -40,7 +40,7 @@ void addObj(Context& ctx) { mex.def("writeSurfacesObj", [](const std::vector>& surfaces, const GeometryContext& viewContext, - const std::array& viewRgb, unsigned int viewsegments, + const std::array& viewRgb, unsigned int viewSegments, const std::string& fileName) { Acts::ViewConfig sConfig = Acts::ViewConfig{viewRgb}; sConfig.quarterSegments = viewsegments; From 8928e653a60bb3c10ba9b0b4dca004dfd9a64f9a Mon Sep 17 00:00:00 2001 From: Andreas Salzburger Date: Wed, 24 Jul 2024 20:53:33 +0200 Subject: [PATCH 17/31] Update Examples/Python/src/Obj.cpp Co-authored-by: Andreas Stefl --- Examples/Python/src/Obj.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Examples/Python/src/Obj.cpp b/Examples/Python/src/Obj.cpp index 3a2c60b27ff..0114568d001 100644 --- a/Examples/Python/src/Obj.cpp +++ b/Examples/Python/src/Obj.cpp @@ -43,7 +43,7 @@ void addObj(Context& ctx) { const std::array& viewRgb, unsigned int viewSegments, const std::string& fileName) { Acts::ViewConfig sConfig = Acts::ViewConfig{viewRgb}; - sConfig.quarterSegments = viewsegments; + sConfig.quarterSegments = viewSegments; Acts::GeometryView3D view3D; Acts::ObjVisualization3D obj; From 7fd3779187de23d62745a0b73176c8fdee465a79 Mon Sep 17 00:00:00 2001 From: Andreas Salzburger Date: Wed, 24 Jul 2024 20:53:42 +0200 Subject: [PATCH 18/31] Update Tests/UnitTests/Fatras/Digitization/SegmentizerTests.cpp Co-authored-by: Andreas Stefl --- Tests/UnitTests/Fatras/Digitization/SegmentizerTests.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/UnitTests/Fatras/Digitization/SegmentizerTests.cpp b/Tests/UnitTests/Fatras/Digitization/SegmentizerTests.cpp index d364702699f..2e56a25b8bd 100644 --- a/Tests/UnitTests/Fatras/Digitization/SegmentizerTests.cpp +++ b/Tests/UnitTests/Fatras/Digitization/SegmentizerTests.cpp @@ -217,7 +217,7 @@ BOOST_DATA_TEST_CASE( ".csv"); /// Run the Segmentizer - auto csegment = cl.segments(geoCtx, *surface, segmentation, {start, end}); + auto cSegments = cl.segments(geoCtx, *surface, segmentation, {start, end}); for (const auto& cs : csegment) { csvHelper.writeLine(segments, cs.path2D[0], cs.path2D[1]); From 28145d2914e099c4d241a919d355c749102695ab Mon Sep 17 00:00:00 2001 From: Andreas Salzburger Date: Wed, 24 Jul 2024 20:53:53 +0200 Subject: [PATCH 19/31] Update Tests/UnitTests/Fatras/Digitization/SegmentizerTests.cpp Co-authored-by: Andreas Stefl --- Tests/UnitTests/Fatras/Digitization/SegmentizerTests.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/UnitTests/Fatras/Digitization/SegmentizerTests.cpp b/Tests/UnitTests/Fatras/Digitization/SegmentizerTests.cpp index 2e56a25b8bd..21d7f8fa2c9 100644 --- a/Tests/UnitTests/Fatras/Digitization/SegmentizerTests.cpp +++ b/Tests/UnitTests/Fatras/Digitization/SegmentizerTests.cpp @@ -219,7 +219,7 @@ BOOST_DATA_TEST_CASE( /// Run the Segmentizer auto cSegments = cl.segments(geoCtx, *surface, segmentation, {start, end}); - for (const auto& cs : csegment) { + for (const auto& cs : cSegments) { csvHelper.writeLine(segments, cs.path2D[0], cs.path2D[1]); } From 07f190f3b9439614217ba12e47109a3899c3802a Mon Sep 17 00:00:00 2001 From: Andreas Salzburger Date: Wed, 24 Jul 2024 20:54:48 +0200 Subject: [PATCH 20/31] Update Core/src/Surfaces/CylinderBounds.cpp Co-authored-by: Andreas Stefl --- Core/src/Surfaces/CylinderBounds.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/src/Surfaces/CylinderBounds.cpp b/Core/src/Surfaces/CylinderBounds.cpp index 0a445400b59..dabb6ba786c 100644 --- a/Core/src/Surfaces/CylinderBounds.cpp +++ b/Core/src/Surfaces/CylinderBounds.cpp @@ -113,7 +113,7 @@ std::vector Acts::CylinderBounds::circleVertices( bool fullCylinder = coversFullAzimuth(); std::vector phiRef = {}; - if (fullCylinder) { + if (bool fullCylinder = coversFullAzimuth(); fullCylinder) { phiRef = {static_cast(avgPhi)}; } From b7939b14f31020041b226959529ca600f873c462 Mon Sep 17 00:00:00 2001 From: Andreas Salzburger Date: Wed, 24 Jul 2024 20:55:05 +0200 Subject: [PATCH 21/31] Update Core/src/Surfaces/CylinderBounds.cpp Co-authored-by: Andreas Stefl --- Core/src/Surfaces/CylinderBounds.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Core/src/Surfaces/CylinderBounds.cpp b/Core/src/Surfaces/CylinderBounds.cpp index dabb6ba786c..5c8b88a69ae 100644 --- a/Core/src/Surfaces/CylinderBounds.cpp +++ b/Core/src/Surfaces/CylinderBounds.cpp @@ -111,7 +111,6 @@ std::vector Acts::CylinderBounds::circleVertices( double avgPhi = get(eAveragePhi); double halfPhi = get(eHalfPhiSector); - bool fullCylinder = coversFullAzimuth(); std::vector phiRef = {}; if (bool fullCylinder = coversFullAzimuth(); fullCylinder) { phiRef = {static_cast(avgPhi)}; From 94f95a91ee6fdcbfc078f395cdd2a539e3f087dc Mon Sep 17 00:00:00 2001 From: Andreas Salzburger Date: Wed, 24 Jul 2024 20:55:31 +0200 Subject: [PATCH 22/31] Update Core/src/Surfaces/PlaneSurface.cpp Co-authored-by: Andreas Stefl --- Core/src/Surfaces/PlaneSurface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/src/Surfaces/PlaneSurface.cpp b/Core/src/Surfaces/PlaneSurface.cpp index 7cd3f9c8d75..64693b41e71 100644 --- a/Core/src/Surfaces/PlaneSurface.cpp +++ b/Core/src/Surfaces/PlaneSurface.cpp @@ -104,7 +104,7 @@ Acts::Polyhedron Acts::PlaneSurface::polyhedronRepresentation( unsigned int lseg = quarterSegments; // If you have bounds you can create a polyhedron representation if (m_bounds) { - auto vertices2D = m_bounds->vertices(lseg); + auto vertices2D = m_bounds->vertices(quarterSegments); vertices.reserve(vertices2D.size() + 1); for (const auto& v2D : vertices2D) { vertices.push_back(transform(gctx) * Vector3(v2D.x(), v2D.y(), 0.)); From 97d517e4fc8b48a613d1b1b2811c585fd2633257 Mon Sep 17 00:00:00 2001 From: Andreas Salzburger Date: Wed, 24 Jul 2024 20:55:52 +0200 Subject: [PATCH 23/31] Update Core/src/Surfaces/PlaneSurface.cpp Co-authored-by: Andreas Stefl --- Core/src/Surfaces/PlaneSurface.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Core/src/Surfaces/PlaneSurface.cpp b/Core/src/Surfaces/PlaneSurface.cpp index 64693b41e71..1bf7ebdfa2c 100644 --- a/Core/src/Surfaces/PlaneSurface.cpp +++ b/Core/src/Surfaces/PlaneSurface.cpp @@ -101,7 +101,6 @@ Acts::Polyhedron Acts::PlaneSurface::polyhedronRepresentation( std::vector triangularMesh; bool exactPolyhedron = true; - unsigned int lseg = quarterSegments; // If you have bounds you can create a polyhedron representation if (m_bounds) { auto vertices2D = m_bounds->vertices(quarterSegments); From 5212e6c9a5abddab4542d27a93dd861ca84aebf4 Mon Sep 17 00:00:00 2001 From: Andreas Salzburger Date: Thu, 25 Jul 2024 14:14:49 +0200 Subject: [PATCH 24/31] Update Core/include/Acts/Surfaces/detail/VerticesHelper.hpp Co-authored-by: Paul Gessinger --- Core/include/Acts/Surfaces/detail/VerticesHelper.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/include/Acts/Surfaces/detail/VerticesHelper.hpp b/Core/include/Acts/Surfaces/detail/VerticesHelper.hpp index 82134673c6b..2f430d36fb4 100644 --- a/Core/include/Acts/Surfaces/detail/VerticesHelper.hpp +++ b/Core/include/Acts/Surfaces/detail/VerticesHelper.hpp @@ -61,7 +61,7 @@ std::vector segmentVertices( std::vector vertices; std::vector phis = phiSegments(phiMin, phiMax, phiRefs, quarterSegments); - for (auto phi : phis) { + for (ActsScalar phi : phis) { vertex_t vertex = vertex_t::Zero(); vertex(0) = rXY.first * std::cos(phi); vertex(1) = rXY.second * std::sin(phi); From 163e26e8a2834b26a112a5cab364b3cad8324d88 Mon Sep 17 00:00:00 2001 From: Andreas Salzburger Date: Fri, 26 Jul 2024 16:24:45 +0200 Subject: [PATCH 25/31] Update Core/src/Surfaces/detail/VerticesHelper.cpp Co-authored-by: Paul Gessinger --- Core/src/Surfaces/detail/VerticesHelper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/src/Surfaces/detail/VerticesHelper.cpp b/Core/src/Surfaces/detail/VerticesHelper.cpp index 9cfc4b5d130..2f2a513b434 100644 --- a/Core/src/Surfaces/detail/VerticesHelper.cpp +++ b/Core/src/Surfaces/detail/VerticesHelper.cpp @@ -22,7 +22,7 @@ std::vector Acts::detail::VerticesHelper::phiSegments( } // First check that no reference phi is outside the range - for (const auto& phiRef : phiRefs) { + for (ActsScalar phiRef : phiRefs) { if (phiRef < phiMin || phiRef > phiMax) { throw std::invalid_argument( "VerticesHelper::phiSegments ... Reference phi is outside the range " From 2b54a854622653fa9dba8787c6025a9d925e9dff Mon Sep 17 00:00:00 2001 From: Andreas Salzburger Date: Fri, 26 Jul 2024 16:25:45 +0200 Subject: [PATCH 26/31] Update VerticesHelper.cpp --- Core/src/Surfaces/detail/VerticesHelper.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Core/src/Surfaces/detail/VerticesHelper.cpp b/Core/src/Surfaces/detail/VerticesHelper.cpp index 2f2a513b434..bf40fe8a6a3 100644 --- a/Core/src/Surfaces/detail/VerticesHelper.cpp +++ b/Core/src/Surfaces/detail/VerticesHelper.cpp @@ -29,7 +29,6 @@ std::vector Acts::detail::VerticesHelper::phiSegments( "of the segment"); } } - // Bail out if minSegmens is smaller 4 or not a multiple of 4 if (quarterSegments == 0u) { throw std::invalid_argument( "VerticesHelper::phiSegments ... Number of segments must be larger " From 2d6a66048d9b17568790d2fca480ae615b527cd8 Mon Sep 17 00:00:00 2001 From: Andreas Salzburger Date: Fri, 26 Jul 2024 16:26:31 +0200 Subject: [PATCH 27/31] Update Core/src/Surfaces/PlaneSurface.cpp Co-authored-by: Paul Gessinger --- Core/src/Surfaces/PlaneSurface.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Core/src/Surfaces/PlaneSurface.cpp b/Core/src/Surfaces/PlaneSurface.cpp index 1bf7ebdfa2c..c148c171456 100644 --- a/Core/src/Surfaces/PlaneSurface.cpp +++ b/Core/src/Surfaces/PlaneSurface.cpp @@ -129,9 +129,7 @@ Acts::Polyhedron Acts::PlaneSurface::polyhedronRepresentation( // Two concentric rings, we use the pure concentric method momentarily, // but that creates too many unneccesarry faces, when only two // are needed to describe the mesh, @todo investigate merging flag - auto facesMesh = detail::FacesHelper::cylindricalFaceMesh(vertices); - faces = facesMesh.first; - triangularMesh = facesMesh.second; + auto [faces, triangularMesh] = detail::FacesHelper::cylindricalFaceMesh(vertices); } } else { throw std::domain_error( From 37812f2e8a101f8f45059beb6f4f813b6d784844 Mon Sep 17 00:00:00 2001 From: Andreas Salzburger Date: Fri, 26 Jul 2024 16:42:42 +0200 Subject: [PATCH 28/31] addressing PR comments --- Core/src/Surfaces/CylinderSurface.cpp | 7 +++---- Core/src/Surfaces/DiscSurface.cpp | 17 +++++++---------- Core/src/Surfaces/PlaneSurface.cpp | 16 ++++++++-------- Core/src/Visualization/EventDataView3D.cpp | 15 +++++++++------ 4 files changed, 27 insertions(+), 28 deletions(-) diff --git a/Core/src/Surfaces/CylinderSurface.cpp b/Core/src/Surfaces/CylinderSurface.cpp index b3a8bd02ba9..4c0b58e1591 100644 --- a/Core/src/Surfaces/CylinderSurface.cpp +++ b/Core/src/Surfaces/CylinderSurface.cpp @@ -194,10 +194,9 @@ Acts::Polyhedron Acts::CylinderSurface::polyhedronRepresentation( // Prepare vertices and faces std::vector vertices = bounds().circleVertices(ctrans, quarterSegments); - std::vector faces; - std::vector triangularMesh; - auto facesMesh = detail::FacesHelper::cylindricalFaceMesh(vertices); - return Polyhedron(vertices, facesMesh.first, facesMesh.second, false); + auto [faces, triangularMesh] = + detail::FacesHelper::cylindricalFaceMesh(vertices); + return Polyhedron(vertices, faces, triangularMesh, false); } Acts::Vector3 Acts::CylinderSurface::rotSymmetryAxis( diff --git a/Core/src/Surfaces/DiscSurface.cpp b/Core/src/Surfaces/DiscSurface.cpp index 353f41ac230..217563805ec 100644 --- a/Core/src/Surfaces/DiscSurface.cpp +++ b/Core/src/Surfaces/DiscSurface.cpp @@ -182,22 +182,19 @@ Acts::Polyhedron Acts::DiscSurface::polyhedronRepresentation( if (addCentreFromConvexFace) { vertices.push_back(wCenter); } - auto facesMesh = detail::FacesHelper::convexFaceMesh(vertices, true); - faces = facesMesh.first; - triangularMesh = facesMesh.second; + auto [faces, triangularMesh] = + detail::FacesHelper::convexFaceMesh(vertices, true); + return Polyhedron(vertices, faces, triangularMesh, exactPolyhedron); } else { // Two concentric rings, we use the pure concentric method momentarily, // but that creates too many unneccesarry faces, when only two // are needed to describe the mesh, @todo investigate merging flag - auto facesMesh = detail::FacesHelper::cylindricalFaceMesh(vertices); - faces = facesMesh.first; - triangularMesh = facesMesh.second; + auto [faces, triangularMesh] = + detail::FacesHelper::cylindricalFaceMesh(vertices); + return Polyhedron(vertices, faces, triangularMesh, exactPolyhedron); } - } else { - throw std::domain_error( - "Polyhedron repr of boundless surface not possible."); } - return Polyhedron(vertices, faces, triangularMesh, exactPolyhedron); + throw std::domain_error("Polyhedron repr of boundless surface not possible."); } Acts::Vector2 Acts::DiscSurface::localPolarToCartesian( diff --git a/Core/src/Surfaces/PlaneSurface.cpp b/Core/src/Surfaces/PlaneSurface.cpp index c148c171456..4e308af6908 100644 --- a/Core/src/Surfaces/PlaneSurface.cpp +++ b/Core/src/Surfaces/PlaneSurface.cpp @@ -122,20 +122,20 @@ Acts::Polyhedron Acts::PlaneSurface::polyhedronRepresentation( // @todo same as for Discs: coversFull is not the right criterium // for triangulation if (!isEllipse || !innerExists || !coversFull) { - auto facesMesh = detail::FacesHelper::convexFaceMesh(vertices); - faces = facesMesh.first; - triangularMesh = facesMesh.second; + auto [faces, triangularMesh] = + detail::FacesHelper::convexFaceMesh(vertices); + return Polyhedron(vertices, faces, triangularMesh, exactPolyhedron); } else { // Two concentric rings, we use the pure concentric method momentarily, // but that creates too many unneccesarry faces, when only two // are needed to describe the mesh, @todo investigate merging flag - auto [faces, triangularMesh] = detail::FacesHelper::cylindricalFaceMesh(vertices); + auto [faces, triangularMesh] = + detail::FacesHelper::cylindricalFaceMesh(vertices); + return Polyhedron(vertices, faces, triangularMesh, exactPolyhedron); } - } else { - throw std::domain_error( - "Polyhedron repr of boundless surface not possible."); } - return Polyhedron(vertices, faces, triangularMesh, exactPolyhedron); + throw std::domain_error( + "Polyhedron representation of boundless surface not possible."); } Acts::Vector3 Acts::PlaneSurface::normal(const GeometryContext& gctx, diff --git a/Core/src/Visualization/EventDataView3D.cpp b/Core/src/Visualization/EventDataView3D.cpp index b2b4b1d8f5b..3b2a2993828 100644 --- a/Core/src/Visualization/EventDataView3D.cpp +++ b/Core/src/Visualization/EventDataView3D.cpp @@ -31,8 +31,9 @@ void Acts::EventDataView3D::drawCovarianceCartesian( ellipse.push_back(transform * Vector3(lposition.x(), lposition.y(), viewConfig.offset)); - auto faces = detail::FacesHelper::convexFaceMesh(ellipse, true); - Polyhedron ellipseHedron(ellipse, faces.first, faces.second); + auto [faces, triangularMesh] = + detail::FacesHelper::convexFaceMesh(ellipse, true); + Polyhedron ellipseHedron(ellipse, faces, triangularMesh); Acts::GeometryView3D::drawPolyhedron(helper, ellipseHedron, viewConfig); } @@ -60,8 +61,9 @@ void Acts::EventDataView3D::drawCovarianceAngular( std::vector coneTop = ellipse; coneTop.push_back(anker); - auto coneTopFaces = detail::FacesHelper::convexFaceMesh(coneTop, true); - Polyhedron coneTopHedron(coneTop, coneTopFaces.first, coneTopFaces.second); + auto [faces, triangularMesh] = + detail::FacesHelper::convexFaceMesh(coneTop, true); + Polyhedron coneTopHedron(coneTop, faces, triangularMesh); GeometryView3D::drawPolyhedron(helper, coneTopHedron, viewConfig); std::vector cone = ellipse; @@ -69,7 +71,8 @@ void Acts::EventDataView3D::drawCovarianceAngular( // Force triangular ViewConfig coneViewConfig = viewConfig; coneViewConfig.triangulate = true; - auto coneFaces = detail::FacesHelper::convexFaceMesh(cone, true); - Polyhedron coneHedron(cone, coneFaces.first, coneFaces.second); + auto [faces, triangularMesh] = + detail::FacesHelper::convexFaceMesh(cone, true); + Polyhedron coneHedron(cone, faces, triangularMesh); GeometryView3D::drawPolyhedron(helper, coneHedron, coneViewConfig); } From 1e7803c6e91be44b83cd7c5789860eba3f59d383 Mon Sep 17 00:00:00 2001 From: Andreas Salzburger Date: Fri, 26 Jul 2024 16:48:22 +0200 Subject: [PATCH 29/31] fixing CI --- Core/src/Surfaces/DiscSurface.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/Core/src/Surfaces/DiscSurface.cpp b/Core/src/Surfaces/DiscSurface.cpp index 217563805ec..ad3b1b75dc1 100644 --- a/Core/src/Surfaces/DiscSurface.cpp +++ b/Core/src/Surfaces/DiscSurface.cpp @@ -157,9 +157,6 @@ Acts::Polyhedron Acts::DiscSurface::polyhedronRepresentation( const GeometryContext& gctx, unsigned int quarterSegments) const { // Prepare vertices and faces std::vector vertices; - std::vector faces; - std::vector triangularMesh; - // Understand the disc bool fullDisc = m_bounds->coversFullAzimuth(); bool toCenter = m_bounds->rMin() < s_onSurfaceTolerance; From 7dce2f630649973128dd692466343efb6a5216f1 Mon Sep 17 00:00:00 2001 From: Paul Gessinger Date: Thu, 3 Oct 2024 09:12:35 +0200 Subject: [PATCH 30/31] update after merge --- Core/src/Surfaces/Surface.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Core/src/Surfaces/Surface.cpp b/Core/src/Surfaces/Surface.cpp index 3ebf11d8e92..cadef176cda 100644 --- a/Core/src/Surfaces/Surface.cpp +++ b/Core/src/Surfaces/Surface.cpp @@ -359,6 +359,7 @@ void Acts::Surface::associateLayer(const Acts::Layer& lay) { void Acts::Surface::visualize(IVisualization3D& helper, const GeometryContext& gctx, const ViewConfig& viewConfig) const { - Polyhedron polyhedron = polyhedronRepresentation(gctx, viewConfig.nSegments); + Polyhedron polyhedron = + polyhedronRepresentation(gctx, viewConfig.quarterSegments); polyhedron.visualize(helper, viewConfig); } From a2bf7cc2888436bb4b7037c5c3480db147e57ce1 Mon Sep 17 00:00:00 2001 From: Paul Gessinger Date: Thu, 3 Oct 2024 10:21:35 +0200 Subject: [PATCH 31/31] compile fixes --- Core/src/Surfaces/PlaneSurface.cpp | 2 -- Core/src/Visualization/EventDataView3D.cpp | 4 ++-- Examples/Algorithms/Geant4/src/SensitiveSurfaceMapper.cpp | 2 +- Tests/UnitTests/Core/TrackFitting/Gx2fTests.cpp | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Core/src/Surfaces/PlaneSurface.cpp b/Core/src/Surfaces/PlaneSurface.cpp index d1bbe3961e2..b33ef82eb46 100644 --- a/Core/src/Surfaces/PlaneSurface.cpp +++ b/Core/src/Surfaces/PlaneSurface.cpp @@ -91,8 +91,6 @@ Acts::Polyhedron Acts::PlaneSurface::polyhedronRepresentation( const GeometryContext& gctx, unsigned int quarterSegments) const { // Prepare vertices and faces std::vector vertices; - std::vector faces; - std::vector triangularMesh; bool exactPolyhedron = true; // If you have bounds you can create a polyhedron representation diff --git a/Core/src/Visualization/EventDataView3D.cpp b/Core/src/Visualization/EventDataView3D.cpp index 99f6aa2c0ea..ac3a62a1e79 100644 --- a/Core/src/Visualization/EventDataView3D.cpp +++ b/Core/src/Visualization/EventDataView3D.cpp @@ -71,8 +71,8 @@ void Acts::EventDataView3D::drawCovarianceAngular( // Force triangular ViewConfig coneViewConfig = viewConfig; coneViewConfig.triangulate = true; - auto [faces, triangularMesh] = + auto [facesCone, triangularMeshCone] = detail::FacesHelper::convexFaceMesh(cone, true); - Polyhedron coneHedron(cone, faces, triangularMesh); + Polyhedron coneHedron(cone, facesCone, triangularMeshCone); GeometryView3D::drawPolyhedron(helper, coneHedron, coneViewConfig); } diff --git a/Examples/Algorithms/Geant4/src/SensitiveSurfaceMapper.cpp b/Examples/Algorithms/Geant4/src/SensitiveSurfaceMapper.cpp index ced44d89e94..2fd1a924d94 100644 --- a/Examples/Algorithms/Geant4/src/SensitiveSurfaceMapper.cpp +++ b/Examples/Algorithms/Geant4/src/SensitiveSurfaceMapper.cpp @@ -331,7 +331,7 @@ bool ActsExamples::SensitiveSurfaceMapper::checkMapping( if (writeMissingSurfacesAsObj) { Acts::ObjVisualization3D visualizer; Acts::ViewConfig vcfg; - vcfg.nSegments = 720; + vcfg.quarterSegments = 720; for (auto srf : missing) { Acts::GeometryView3D::drawSurface(visualizer, *srf, gctx, Acts::Transform3::Identity(), vcfg); diff --git a/Tests/UnitTests/Core/TrackFitting/Gx2fTests.cpp b/Tests/UnitTests/Core/TrackFitting/Gx2fTests.cpp index 7ef5373f41b..bce69cba0b2 100644 --- a/Tests/UnitTests/Core/TrackFitting/Gx2fTests.cpp +++ b/Tests/UnitTests/Core/TrackFitting/Gx2fTests.cpp @@ -1054,7 +1054,7 @@ BOOST_AUTO_TEST_CASE(Material) { ViewConfig viewContainer = {.color = {220, 220, 0}}; viewContainer.triangulate = triangulate; ViewConfig viewGrid = {.color = {220, 0, 0}}; - viewGrid.nSegments = 8; + viewGrid.quarterSegments = 8; viewGrid.offset = 3.; viewGrid.triangulate = triangulate;