File indexing completed on 2025-08-05 08:09:40
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include "Acts/Surfaces/DiamondBounds.hpp"
0010
0011 #include <iomanip>
0012 #include <iostream>
0013
0014 Acts::SurfaceBounds::BoundsType Acts::DiamondBounds::type() const {
0015 return SurfaceBounds::eDiamond;
0016 }
0017
0018 bool Acts::DiamondBounds::inside(const Acts::Vector2& lposition,
0019 const Acts::BoundaryCheck& bcheck) const {
0020 return bcheck.isInside(lposition, vertices());
0021 }
0022
0023 std::vector<Acts::Vector2> Acts::DiamondBounds::vertices(
0024 unsigned int ) const {
0025
0026
0027 double x1 = get(DiamondBounds::eHalfLengthXnegY);
0028 double y1 = get(DiamondBounds::eHalfLengthYneg);
0029 double x2 = get(DiamondBounds::eHalfLengthXzeroY);
0030 double y2 = 0.;
0031 double x3 = get(DiamondBounds::eHalfLengthXposY);
0032 double y3 = get(DiamondBounds::eHalfLengthYpos);
0033 return {{-x1, -y1}, {x1, -y1}, {x2, y2}, {x3, y3}, {-x3, y3}, {-x2, y2}};
0034 }
0035
0036 const Acts::RectangleBounds& Acts::DiamondBounds::boundingBox() const {
0037 return m_boundingBox;
0038 }
0039
0040 std::ostream& Acts::DiamondBounds::toStream(std::ostream& sl) const {
0041 sl << std::setiosflags(std::ios::fixed);
0042 sl << std::setprecision(7);
0043 sl << "Acts::DiamondBounds: (halfXatYneg, halfXatYzero, halfXatYpos, "
0044 "halfYneg, halfYpos) = ";
0045 sl << "(" << get(DiamondBounds::eHalfLengthXnegY) << ", "
0046 << get(DiamondBounds::eHalfLengthXzeroY) << ", "
0047 << get(DiamondBounds::eHalfLengthXposY) << ", "
0048 << get(DiamondBounds::eHalfLengthYneg) << ", "
0049 << get(DiamondBounds::eHalfLengthYpos) << ")";
0050 sl << std::setprecision(-1);
0051 return sl;
0052 }