ECCE @ 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(nullptr, nullptr) {
17  Surface::m_transform = std::make_shared<const Transform3D>(
18  Translation3D(gp.x(), gp.y(), gp.z()));
19 }
20 
22  std::shared_ptr<const Transform3D> tTransform)
23  : GeometryObject(), LineSurface(std::move(tTransform)) {}
24 
26  : GeometryObject(), LineSurface(other) {}
27 
29  const PerigeeSurface& other,
30  const Transform3D& transf)
31  : GeometryObject(), LineSurface(gctx, other, transf) {}
32 
34  const PerigeeSurface& other) {
35  if (this != &other) {
37  }
38  return *this;
39 }
40 
42  return Surface::Perigee;
43 }
44 
45 std::string Acts::PerigeeSurface::name() const {
46  return "Acts::PerigeeSurface";
47 }
48 
50  std::ostream& sl) const {
51  sl << std::setiosflags(std::ios::fixed);
52  sl << std::setprecision(7);
53  sl << "Acts::PerigeeSurface:" << std::endl;
54  const Vector3D& sfCenter = center(gctx);
55  sl << " Center position (x, y, z) = (" << sfCenter.x() << ", "
56  << sfCenter.y() << ", " << sfCenter.z() << ")";
57  sl << std::setprecision(-1);
58  return sl;
59 }
60 
62  const GeometryContext& gctx, size_t /*lseg*/) const {
63  // Prepare vertices and faces
64  std::vector<Vector3D> vertices;
65  std::vector<Polyhedron::FaceType> faces;
66  std::vector<Polyhedron::FaceType> triangularMesh;
67 
68  const Transform3D& ctransform = transform(gctx);
69  Vector3D left(0, 0, -100.);
70  Vector3D right(0, 0, 100.);
71 
72  // The central wire/straw
73  vertices.push_back(ctransform * left);
74  vertices.push_back(ctransform * right);
75  faces.push_back({0, 1});
76  vertices.push_back(ctransform * Vector3D(0., 0., 0.));
77  triangularMesh.push_back({0, 2, 1});
78 
79  return Polyhedron(vertices, faces, triangularMesh);
80 }