EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PerigeeSurface.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PerigeeSurface.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 #include <utility>
14 
16  : LineSurface(Transform3D(Translation3D(gp.x(), gp.y(), gp.z())), nullptr) {
17 }
18 
20  : GeometryObject(), LineSurface(transform) {}
21 
23  : GeometryObject(), LineSurface(other) {}
24 
26  const PerigeeSurface& other,
27  const Transform3D& shift)
28  : GeometryObject(), LineSurface(gctx, other, shift) {}
29 
31  const PerigeeSurface& other) {
32  if (this != &other) {
34  }
35  return *this;
36 }
37 
39  return Surface::Perigee;
40 }
41 
42 std::string Acts::PerigeeSurface::name() const {
43  return "Acts::PerigeeSurface";
44 }
45 
47  std::ostream& sl) const {
48  sl << std::setiosflags(std::ios::fixed);
49  sl << std::setprecision(7);
50  sl << "Acts::PerigeeSurface:" << std::endl;
51  const Vector3D& sfCenter = center(gctx);
52  sl << " Center position (x, y, z) = (" << sfCenter.x() << ", "
53  << sfCenter.y() << ", " << sfCenter.z() << ")";
54  sl << std::setprecision(-1);
55  return sl;
56 }
57 
59  const GeometryContext& gctx, size_t /*lseg*/) const {
60  // Prepare vertices and faces
61  std::vector<Vector3D> vertices;
62  std::vector<Polyhedron::FaceType> faces;
63  std::vector<Polyhedron::FaceType> triangularMesh;
64 
65  const Transform3D& ctransform = transform(gctx);
66  Vector3D left(0, 0, -100.);
67  Vector3D right(0, 0, 100.);
68 
69  // The central wire/straw
70  vertices.push_back(ctransform * left);
71  vertices.push_back(ctransform * right);
72  faces.push_back({0, 1});
73  vertices.push_back(ctransform * Vector3D(0., 0., 0.));
74  triangularMesh.push_back({0, 2, 1});
75 
76  return Polyhedron(vertices, faces, triangularMesh);
77 }