EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TrapezoidBounds.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file TrapezoidBounds.cpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2016-2020 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
10 
11 #include <cmath>
12 #include <iomanip>
13 #include <iostream>
14 
16 
19 }
20 
22  const Acts::BoundaryCheck& bcheck) const {
23  return bcheck.isInside(lposition, vertices());
24 }
25 
26 std::vector<Acts::Vector2D> Acts::TrapezoidBounds::vertices(
27  unsigned int /*lseg*/) const {
28  double minhx = get(TrapezoidBounds::eHalfLengthXnegY);
29  double maxhx = get(TrapezoidBounds::eHalfLengthXposY);
30  double hy = get(TrapezoidBounds::eHalfLengthY);
31  return {{-minhx, -hy}, {minhx, -hy}, {maxhx, hy}, {-maxhx, hy}};
32 }
33 
35  return m_boundingBox;
36 }
37 
38 std::ostream& Acts::TrapezoidBounds::toStream(std::ostream& sl) const {
39  sl << std::setiosflags(std::ios::fixed);
40  sl << std::setprecision(7);
41  sl << "Acts::TrapezoidBounds: (halfXnegY, halfXposY, halfY) = "
42  << "(" << get(eHalfLengthXnegY) << ", " << get(eHalfLengthXposY) << ", "
43  << get(eHalfLengthY) << ")";
44  sl << std::setprecision(-1);
45  return sl;
46 }