Analysis Software
Documentation for sPHENIX simulation 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 
12 
13 #include <iomanip>
14 #include <iostream>
15 #include <memory>
16 #include <vector>
17 
19  : LineSurface(Transform3(Translation3(gp.x(), gp.y(), gp.z())), nullptr) {}
20 
22  : GeometryObject(), LineSurface(transform) {}
23 
25  : GeometryObject(), LineSurface(other) {}
26 
28  const PerigeeSurface& other,
29  const Transform3& shift)
30  : GeometryObject(), LineSurface(gctx, other, shift) {}
31 
33  const PerigeeSurface& other) {
34  if (this != &other) {
36  }
37  return *this;
38 }
39 
41  return Surface::Perigee;
42 }
43 
45  return "Acts::PerigeeSurface";
46 }
47 
49  std::ostream& sl) const {
50  sl << std::setiosflags(std::ios::fixed);
51  sl << std::setprecision(7);
52  sl << "Acts::PerigeeSurface:" << std::endl;
53  const Vector3& sfCenter = center(gctx);
54  sl << " Center position (x, y, z) = (" << sfCenter.x() << ", "
55  << sfCenter.y() << ", " << sfCenter.z() << ")";
56  sl << std::setprecision(-1);
57  return sl;
58 }
59 
61  const GeometryContext& gctx, size_t /*lseg*/) const {
62  // Prepare vertices and faces
63  std::vector<Vector3> vertices;
64  std::vector<Polyhedron::FaceType> faces;
65  std::vector<Polyhedron::FaceType> triangularMesh;
66 
67  const Transform3& ctransform = transform(gctx);
68  Vector3 left(0, 0, -100.);
69  Vector3 right(0, 0, 100.);
70 
71  // The central wire/straw
72  vertices.push_back(ctransform * left);
73  vertices.push_back(ctransform * right);
74  faces.push_back({0, 1});
75  vertices.push_back(ctransform * Vector3(0., 0., 0.));
76  triangularMesh.push_back({0, 2, 1});
77 
78  return Polyhedron(vertices, faces, triangularMesh);
79 }