2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
6 inline bool DiscSurface::operator==(const DiscSurface& dsf) const
11 bool transfEqual(transform().isApprox(dsf.transform(), 10e-8));
12 bool centerEqual = (transfEqual) ? (center() == dsf.center()) : false;
13 bool boundsEqual = (centerEqual) ? (bounds() == dsf.bounds()) : false;
17 /** Return the surface type */
18 inline constexpr SurfaceType
19 DiscSurface::type() const
21 return DiscSurface::staticType;
24 template<int DIM, class T>
25 std::unique_ptr<ParametersT<DIM, T, DiscSurface>>
26 DiscSurface::createUniqueParameters(double l1,
31 std::optional<AmgSymMatrix(DIM)> cov) const
33 return std::make_unique<ParametersT<DIM, T, DiscSurface>>(
34 l1, l2, phi, theta, qop, *this, std::move(cov));
37 /** Use the Surface as a ParametersBase constructor, from global parameters */
38 template<int DIM, class T>
39 std::unique_ptr<ParametersT<DIM, T, DiscSurface>>
40 DiscSurface::createUniqueParameters(const Amg::Vector3D& position,
41 const Amg::Vector3D& momentum,
43 std::optional<AmgSymMatrix(DIM)> cov) const
45 return std::make_unique<ParametersT<DIM, T, DiscSurface>>(
46 position, momentum, charge, *this, std::move(cov));
50 DiscSurface::clone() const
52 return new DiscSurface(*this);
55 inline const SurfaceBounds&
56 DiscSurface::bounds() const
59 return (*(m_bounds.get()));
60 if (Surface::m_associatedDetElement &&
61 Surface::m_associatedDetElementId.is_valid()) {
62 return m_associatedDetElement->bounds(Surface::m_associatedDetElementId);
64 if (Surface::m_associatedDetElement)
65 return m_associatedDetElement->bounds();
70 DiscSurface::insideBounds(const Amg::Vector2D& locpos,
74 return bounds().inside(locpos, tol1, tol2);
78 DiscSurface::insideBoundsCheck(const Amg::Vector2D& locpos,
79 const BoundaryCheck& bchk) const
81 return (bounds().inside(locpos, bchk));
85 DiscSurface::localParametersToPosition(const LocalParameters& locpars) const
87 if (locpars.contains(Trk::locR) && locpars.contains(Trk::locPhi))
88 return Amg::Vector2D(locpars[Trk::locR], locpars[Trk::locPhi]);
89 if (locpars.contains(Trk::locR))
90 return Amg::Vector2D(locpars[Trk::locR], 0.);
91 if (locpars.contains(Trk::locPhi))
92 return Amg::Vector2D(0.5 * bounds().r(), locpars[Trk::locPhi]);
93 return Amg::Vector2D(0.5 * bounds().r(), 0.);
96 /** Return properly formatted class name for screen output */
98 DiscSurface::name() const
100 return "Trk::DiscSurface";