EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DiamondBounds.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file DiamondBounds.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 
12 
13 #include <iomanip>
14 #include <iostream>
15 
18 }
19 
21  const Acts::BoundaryCheck& bcheck) const {
22  return bcheck.isInside(lposition, vertices());
23 }
24 
25 std::vector<Acts::Vector2D> Acts::DiamondBounds::vertices(
26  unsigned int /*lseg*/) const {
27  // Vertices starting at lower left (min rel. phi)
28  // counter-clockwise
29  double x1 = get(DiamondBounds::eHalfLengthXnegY);
30  double y1 = get(DiamondBounds::eHalfLengthYneg);
32  double y2 = 0.;
33  double x3 = get(DiamondBounds::eHalfLengthXposY);
34  double y3 = get(DiamondBounds::eHalfLengthYpos);
35  return {{-x1, -y1}, {x1, -y1}, {x2, y2}, {x3, y3}, {-x3, y3}, {-x2, y2}};
36 }
37 
39  return m_boundingBox;
40 }
41 
42 std::ostream& Acts::DiamondBounds::toStream(std::ostream& sl) const {
43  sl << std::setiosflags(std::ios::fixed);
44  sl << std::setprecision(7);
45  sl << "Acts::DiamondBounds: (halfXatYneg, halfXatYzero, halfXatYpos, "
46  "halfYneg, halfYpos) = ";
47  sl << "(" << get(DiamondBounds::eHalfLengthXnegY) << ", "
48  << get(DiamondBounds::eHalfLengthXzeroY) << ", "
49  << get(DiamondBounds::eHalfLengthXposY) << ", "
50  << get(DiamondBounds::eHalfLengthYneg) << ", "
51  << get(DiamondBounds::eHalfLengthYpos) << ")";
52  sl << std::setprecision(-1);
53  return sl;
54 }