2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
6 inline bool StraightLineSurface::operator==(const StraightLineSurface& slsf) const
11 bool transfEqual(transform().isApprox(slsf.transform(), 10e-8));
12 bool centerEqual = (transfEqual) ? (center() == slsf.center()) : false;
13 bool boundsEqual = (centerEqual) ? (bounds() == slsf.bounds()) : false;
17 /** Return the surface type */
18 inline constexpr SurfaceType
19 StraightLineSurface::type() const
21 return StraightLineSurface::staticType;
24 template<int DIM, class T>
25 std::unique_ptr<ParametersT<DIM, T, StraightLineSurface>>
26 StraightLineSurface::createUniqueParameters(
32 std::optional<AmgSymMatrix(DIM)> cov) const
34 return std::make_unique<ParametersT<DIM, T, StraightLineSurface>>(
35 l1, l2, phi, theta, qop, *this, std::move(cov));
38 /** Use the Surface as a ParametersBase constructor, from global parameters */
39 template<int DIM, class T>
40 std::unique_ptr<ParametersT<DIM, T, StraightLineSurface>>
41 StraightLineSurface::createUniqueParameters(
42 const Amg::Vector3D& position,
43 const Amg::Vector3D& momentum,
45 std::optional<AmgSymMatrix(DIM)> cov) const
47 return std::make_unique<ParametersT<DIM, T, StraightLineSurface>>(
48 position, momentum, charge, *this, std::move(cov));
51 inline StraightLineSurface*
52 StraightLineSurface::clone() const
54 return new StraightLineSurface(*this);
57 inline const SurfaceBounds&
58 StraightLineSurface::bounds() const
61 return *(m_bounds.get());
62 if (Surface::m_associatedDetElement &&
63 Surface::m_associatedDetElementId.is_valid()) {
64 return m_associatedDetElement->bounds(Surface::m_associatedDetElementId);
66 if (Surface::m_associatedDetElement)
67 return m_associatedDetElement->bounds();
72 StraightLineSurface::insideBounds(const Amg::Vector2D& locpos,
76 if (!(m_bounds.get()) && !Surface::m_associatedDetElement)
78 return (std::abs(locpos[locR]) < bounds().r() + tol1 &&
79 bounds().insideLoc2(locpos, tol2));
83 StraightLineSurface::insideBoundsCheck(const Amg::Vector2D& locpos,
84 const BoundaryCheck& bchk) const
86 return StraightLineSurface::insideBounds(
87 locpos, bchk.toleranceLoc1, bchk.toleranceLoc2);
90 inline const Amg::Vector3D&
91 StraightLineSurface::lineDirection() const
93 if (!m_lineDirection.isValid()) {
94 m_lineDirection.set(transform().linear().col(2));
96 return *(m_lineDirection.ptr());
99 /** the pathCorrection for derived classes with thickness */
101 StraightLineSurface::pathCorrection(const Amg::Vector3D&,
102 const Amg::Vector3D&) const
107 /** Return properly formatted class name for screen output */
109 StraightLineSurface::name() const
111 return "Trk::StraightLineSurface";