Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-15 08:27:30

0001 // This file is part of the Acts project.
0002 //
0003 // Copyright (C) 2016-2020 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 http://mozilla.org/MPL/2.0/.
0008 
0009 #pragma once
0010 
0011 #include "Acts/Definitions/Algebra.hpp"
0012 #include "Acts/Geometry/GeometryContext.hpp"
0013 #include "Acts/Surfaces/LineBounds.hpp"
0014 #include "Acts/Surfaces/LineSurface.hpp"
0015 #include "Acts/Surfaces/Surface.hpp"
0016 #include "Acts/Surfaces/SurfaceConcept.hpp"
0017 
0018 #include <cstddef>
0019 #include <memory>
0020 #include <string>
0021 
0022 namespace Acts {
0023 
0024 class DetectorElementBase;
0025 struct Polyhedron;
0026 class LineBounds;
0027 
0028 ///  @class StrawSurface
0029 ///
0030 ///  Class for a StrawSurface in the TrackingGeometry
0031 ///  to describe dirft tube and straw like detectors.
0032 ///
0033 /// @image html LineSurface.png
0034 ///
0035 class StrawSurface : public LineSurface {
0036   friend class Surface;
0037 
0038  protected:
0039   /// Constructor from Transform3 and bounds
0040   ///
0041   /// @param transform the transform that positions the straw in the global
0042   /// frame
0043   /// @param radius is the straw radius
0044   /// @param halez is the half length in z
0045   StrawSurface(const Transform3& transform, double radius, double halez);
0046 
0047   /// Constructor from Transform3 and a shared bounds object
0048   ///
0049   /// @param transform the transform that positions the straw in the global
0050   /// frame
0051   /// @param lbounds are the bounds describing the straw dimensions, can be
0052   /// optionally nullptr
0053   StrawSurface(const Transform3& transform,
0054                std::shared_ptr<const LineBounds> lbounds = nullptr);
0055 
0056   /// Constructor from DetectorElementBase : Element proxy
0057   ///
0058   /// @param lbounds are the bounds describing the straw dimensions, they must
0059   /// not be nullptr
0060   /// @param detelement for which this surface is (at least) one representation
0061   StrawSurface(const std::shared_ptr<const LineBounds>& lbounds,
0062                const DetectorElementBase& detelement);
0063 
0064   /// Copy constructor
0065   ///
0066   /// @param other is the source surface for copying
0067   StrawSurface(const StrawSurface& other);
0068 
0069   /// Copy constructor - with shift
0070   ///
0071   /// @param gctx The current geometry context object, e.g. alignment
0072   /// @param other is the source cone surface
0073   /// @param shift is the additional transform applied after copying
0074   StrawSurface(const GeometryContext& gctx, const StrawSurface& other,
0075                const Transform3& shift);
0076 
0077  public:
0078   ~StrawSurface() override = default;
0079   StrawSurface() = delete;
0080 
0081   /// Assignment operator
0082   ///
0083   /// @param other is the source surface for copying
0084   StrawSurface& operator=(const StrawSurface& other);
0085 
0086   /// Return the surface type
0087   SurfaceType type() const final;
0088 
0089   /// Return properly formatted class name for screen output */
0090   std::string name() const final;
0091 
0092   /// Return a Polyhedron for the surfaces
0093   ///
0094   /// @param gctx The current geometry context object, e.g. alignment
0095   /// @param lseg Number of segments along curved lines, it represents
0096   /// the full 2*M_PI coverange, if lseg is set to 1 only the extrema
0097   /// are given @note if lseg is set to 1 then only the straw is created
0098   ///
0099   /// @return A list of vertices and a face/facett description of it
0100   Polyhedron polyhedronRepresentation(const GeometryContext& gctx,
0101                                       std::size_t lseg) const final;
0102 };
0103 
0104 inline Surface::SurfaceType StrawSurface::type() const {
0105   return Surface::Straw;
0106 }
0107 
0108 inline std::string Acts::StrawSurface::name() const {
0109   return "Acts::StrawSurface";
0110 }
0111 
0112 static_assert(SurfaceConcept<StrawSurface>,
0113               "StrawSurface does not fulfill SurfaceConcept");
0114 
0115 }  // namespace Acts