Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:09:41

0001 // This file is part of the Acts project.
0002 //
0003 // Copyright (C) 2016-2020 CERN for the benefit of the Acts project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
0008 
0009 #include "Acts/Surfaces/RectangleBounds.hpp"
0010 
0011 #include <iomanip>
0012 #include <iostream>
0013 
0014 bool Acts::RectangleBounds::inside(const Acts::Vector2& lposition,
0015                                    const Acts::BoundaryCheck& bcheck) const {
0016   return bcheck.isInside(lposition, m_min, m_max);
0017 }
0018 
0019 std::vector<Acts::Vector2> Acts::RectangleBounds::vertices(
0020     unsigned int /*lseg*/) const {
0021   // counter-clockwise starting from bottom-left corner
0022   return {m_min, {m_max.x(), m_min.y()}, m_max, {m_min.x(), m_max.y()}};
0023 }
0024 
0025 const Acts::RectangleBounds& Acts::RectangleBounds::boundingBox() const {
0026   return (*this);
0027 }
0028 
0029 // ostream operator overload
0030 std::ostream& Acts::RectangleBounds::toStream(std::ostream& sl) const {
0031   sl << std::setiosflags(std::ios::fixed);
0032   sl << std::setprecision(7);
0033   sl << "Acts::RectangleBounds:  (hlX, hlY) = "
0034      << "(" << 0.5 * (get(eMaxX) - get(eMinX)) << ", "
0035      << 0.5 * (get(eMaxY) - get(eMinY)) << ")";
0036   sl << "\n(lower left, upper right):\n";
0037   sl << min().transpose() << "\n" << max().transpose();
0038   sl << std::setprecision(-1);
0039   return sl;
0040 }