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/RadialBounds.hpp"
0010 
0011 #include "Acts/Definitions/TrackParametrization.hpp"
0012 #include "Acts/Surfaces/detail/VerticesHelper.hpp"
0013 #include "Acts/Utilities/detail/periodic.hpp"
0014 
0015 #include <iomanip>
0016 #include <iostream>
0017 
0018 Acts::SurfaceBounds::BoundsType Acts::RadialBounds::type() const {
0019   return SurfaceBounds::eDisc;
0020 }
0021 
0022 Acts::Vector2 Acts::RadialBounds::shifted(
0023     const Acts::Vector2& lposition) const {
0024   Vector2 tmp;
0025   tmp[eBoundLoc0] = lposition[eBoundLoc0];
0026   tmp[eBoundLoc1] =
0027       detail::radian_sym(lposition[eBoundLoc1] - get(eAveragePhi));
0028   return tmp;
0029 }
0030 
0031 bool Acts::RadialBounds::inside(const Acts::Vector2& lposition,
0032                                 const Acts::BoundaryCheck& bcheck) const {
0033   return bcheck.isInside(shifted(lposition),
0034                          Vector2(get(eMinR), -get(eHalfPhiSector)),
0035                          Vector2(get(eMaxR), get(eHalfPhiSector)));
0036 }
0037 
0038 std::vector<Acts::Vector2> Acts::RadialBounds::vertices(
0039     unsigned int lseg) const {
0040   return detail::VerticesHelper::circularVertices(
0041       get(eMinR), get(eMaxR), get(eAveragePhi), get(eHalfPhiSector), lseg);
0042 }
0043 
0044 std::ostream& Acts::RadialBounds::toStream(std::ostream& sl) const {
0045   sl << std::setiosflags(std::ios::fixed);
0046   sl << std::setprecision(7);
0047   sl << "Acts::RadialBounds:  (innerRadius, outerRadius, hPhiSector, "
0048         "averagePhi) = ";
0049   sl << "(" << get(eMinR) << ", " << get(eMaxR) << ", " << get(eHalfPhiSector)
0050      << ", " << get(eAveragePhi) << ")";
0051   sl << std::setprecision(-1);
0052   return sl;
0053 }