Analysis Software
Documentation for sPHENIX simulation 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 
11 #include <iomanip>
12 #include <iostream>
13 
16 }
17 
19  const Acts::BoundaryCheck& bcheck) const {
20  return bcheck.isInside(lposition, vertices());
21 }
22 
23 std::vector<Acts::Vector2> Acts::DiamondBounds::vertices(
24  unsigned int /*lseg*/) const {
25  // Vertices starting at lower left (min rel. phi)
26  // counter-clockwise
27  double x1 = get(DiamondBounds::eHalfLengthXnegY);
28  double y1 = get(DiamondBounds::eHalfLengthYneg);
29  double x2 = get(DiamondBounds::eHalfLengthXzeroY);
30  double y2 = 0.;
31  double x3 = get(DiamondBounds::eHalfLengthXposY);
32  double y3 = get(DiamondBounds::eHalfLengthYpos);
33  return {{-x1, -y1}, {x1, -y1}, {x2, y2}, {x3, y3}, {-x3, y3}, {-x2, y2}};
34 }
35 
37  return m_boundingBox;
38 }
39 
40 std::ostream& Acts::DiamondBounds::toStream(std::ostream& sl) const {
41  sl << std::setiosflags(std::ios::fixed);
42  sl << std::setprecision(7);
43  sl << "Acts::DiamondBounds: (halfXatYneg, halfXatYzero, halfXatYpos, "
44  "halfYneg, halfYpos) = ";
45  sl << "(" << get(DiamondBounds::eHalfLengthXnegY) << ", "
46  << get(DiamondBounds::eHalfLengthXzeroY) << ", "
47  << get(DiamondBounds::eHalfLengthXposY) << ", "
48  << get(DiamondBounds::eHalfLengthYneg) << ", "
49  << get(DiamondBounds::eHalfLengthYpos) << ")";
50  sl << std::setprecision(-1);
51  return sl;
52 }