Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /acts/Core/src/Surfaces/PerigeeSurface.cpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008 
0009 #include "Acts/Surfaces/PerigeeSurface.hpp"
0010 
0011 #include "Acts/Geometry/GeometryObject.hpp"
0012 #include "Acts/Utilities/detail/OstreamStateGuard.hpp"
0013 
0014 #include <iomanip>
0015 #include <iostream>
0016 #include <memory>
0017 #include <vector>
0018 
0019 namespace Acts {
0020 
0021 PerigeeSurface::PerigeeSurface(const Vector3& gp)
0022     : LineSurface(Transform3(Translation3(gp.x(), gp.y(), gp.z())), nullptr) {}
0023 
0024 PerigeeSurface::PerigeeSurface(const Transform3& transform)
0025     : GeometryObject(), LineSurface(transform) {}
0026 
0027 PerigeeSurface::PerigeeSurface(const PerigeeSurface& other)
0028     : GeometryObject(), LineSurface(other) {}
0029 
0030 PerigeeSurface::PerigeeSurface(const GeometryContext& gctx,
0031                                const PerigeeSurface& other,
0032                                const Transform3& shift)
0033     : GeometryObject(), LineSurface(gctx, other, shift) {}
0034 
0035 PerigeeSurface& PerigeeSurface::operator=(const PerigeeSurface& other) {
0036   if (this != &other) {
0037     LineSurface::operator=(other);
0038   }
0039   return *this;
0040 }
0041 
0042 Surface::SurfaceType PerigeeSurface::type() const {
0043   return Surface::Perigee;
0044 }
0045 
0046 std::string PerigeeSurface::name() const {
0047   return "Acts::PerigeeSurface";
0048 }
0049 
0050 std::ostream& PerigeeSurface::toStreamImpl(const GeometryContext& gctx,
0051                                            std::ostream& sl) const {
0052   detail::OstreamStateGuard guard{sl};
0053   sl << std::fixed << std::setprecision(7);
0054   sl << "Acts::PerigeeSurface:" << std::endl;
0055   const Vector3& sfCenter = center(gctx);
0056   sl << "     Center position  (x, y, z) = (" << sfCenter.x() << ", "
0057      << sfCenter.y() << ", " << sfCenter.z() << ")";
0058   return sl;
0059 }
0060 
0061 Polyhedron PerigeeSurface::polyhedronRepresentation(
0062     const GeometryContext& gctx, unsigned int /*quarterSegments*/) const {
0063   // Prepare vertices and faces
0064   std::vector<Vector3> vertices;
0065   std::vector<Polyhedron::FaceType> faces;
0066   std::vector<Polyhedron::FaceType> triangularMesh;
0067 
0068   const Transform3& ctransform = localToGlobalTransform(gctx);
0069   Vector3 left(0, 0, -100.);
0070   Vector3 right(0, 0, 100.);
0071 
0072   // The central wire/straw
0073   vertices.push_back(ctransform * left);
0074   vertices.push_back(ctransform * right);
0075   faces.push_back({0, 1});
0076   vertices.push_back(ctransform * Vector3(0., 0., 0.));
0077   triangularMesh.push_back({0, 2, 1});
0078 
0079   return Polyhedron(vertices, faces, triangularMesh);
0080 }
0081 
0082 }  // namespace Acts