Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 08:21:37

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 #pragma once
0010 
0011 #include "Acts/Definitions/Algebra.hpp"
0012 #include "Acts/Surfaces/BoundaryTolerance.hpp"
0013 #include "Acts/Surfaces/SurfaceBounds.hpp"
0014 
0015 #include <array>
0016 #include <iosfwd>
0017 #include <vector>
0018 
0019 namespace Acts {
0020 
0021 /// @class LineBounds
0022 ///
0023 /// Bounds for a LineSurface.
0024 class LineBounds : public SurfaceBounds {
0025  public:
0026   enum BoundValues : int { eR = 0, eHalfLengthZ = 1, eSize = 2 };
0027 
0028   /// Constructor
0029   ///
0030   /// @param r is the radius of the cylinder, default = 0.
0031   /// @param halfZ is the half length in z, default = 0.
0032   LineBounds(double r, double halfZ) noexcept(false) : m_values({r, halfZ}) {
0033     checkConsistency();
0034   }
0035 
0036   /// Constructor - from fixed size array
0037   ///
0038   /// @param values The parameter values
0039   LineBounds(const std::array<double, eSize>& values) noexcept(false)
0040       : m_values(values) {
0041     checkConsistency();
0042   }
0043 
0044   BoundsType type() const final { return SurfaceBounds::eLine; }
0045 
0046   /// Return the bound values as dynamically sized vector
0047   ///
0048   /// @return this returns a copy of the internal values
0049   std::vector<double> values() const final;
0050 
0051   /// Inside check for the bounds object driven by the boundary check directive
0052   /// Each Bounds has a method inside, which checks if a LocalPosition is inside
0053   /// the bounds  Inside can be called without/with tolerances.
0054   ///
0055   /// @param lposition Local position (assumed to be in right surface frame)
0056   /// @param boundaryTolerance boundary check directive
0057   ///
0058   /// @return boolean indicator for the success of this operation
0059   bool inside(const Vector2& lposition,
0060               const BoundaryTolerance& boundaryTolerance) const final;
0061 
0062   /// Output Method for std::ostream
0063   ///
0064   /// @param sl is the ostream to be dumped into
0065   std::ostream& toStream(std::ostream& sl) const final;
0066 
0067   /// Access to the bound values
0068   /// @param bValue the class nested enum for the array access
0069   double get(BoundValues bValue) const { return m_values[bValue]; }
0070 
0071  private:
0072   std::array<double, eSize> m_values;
0073 
0074   /// Check the input values for consistency, will throw a logic_exception
0075   /// if consistency is not given
0076   void checkConsistency() noexcept(false);
0077 };
0078 
0079 }  // namespace Acts