ATLAS Offline Software
PlaneSurface.icc
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 namespace Trk {
6 
7 inline bool PlaneSurface::operator==(const PlaneSurface& psf) const
8 {
9  if (this == &psf){
10  return true;
11  }
12  bool transfEqual(transform().isApprox(psf.transform(), 10e-8));
13  bool centerEqual = center() == psf.center();
14  bool boundsEqual = bounds() == psf.bounds();
15  return transfEqual && centerEqual && boundsEqual;
16 }
17 
18 inline constexpr SurfaceType
19 PlaneSurface::type() const
20 {
21  return PlaneSurface::staticType;
22 }
23 
24 /** Use the Surface as a ParametersBase constructor, from local parameters */
25 template<int DIM, class T>
26 std::unique_ptr<ParametersT<DIM, T, PlaneSurface>>
27 PlaneSurface::createUniqueParameters(double l1,
28  double l2,
29  double phi,
30  double theta,
31  double qop,
32  std::optional<AmgSymMatrix(DIM)> cov) const
33 {
34  return std::make_unique<ParametersT<DIM, T, PlaneSurface>>(
35  l1, l2, phi, theta, qop, *this, std::move(cov));
36 }
37 
38 /** Use the Surface as a ParametersBase constructor, from global parameters */
39 template<int DIM, class T>
40 std::unique_ptr<ParametersT<DIM, T, PlaneSurface>>
41 PlaneSurface::createUniqueParameters(const Amg::Vector3D& position,
42  const Amg::Vector3D& momentum,
43  double charge,
44  std::optional<AmgSymMatrix(DIM)> cov) const
45 {
46  return std::make_unique<ParametersT<DIM, T, PlaneSurface>>(
47  position, momentum, charge, *this, std::move(cov));
48 }
49 
50 /** Return properly formatted class name for screen output */
51 inline std::string
52 PlaneSurface::name() const
53 {
54  return "Trk::PlaneSurface";
55 }
56 
57 inline PlaneSurface*
58 PlaneSurface::clone() const
59 {
60  return new PlaneSurface(*this);
61 }
62 
63 inline bool
64 PlaneSurface::insideBounds(const Amg::Vector2D& locpos,
65  double tol1,
66  double tol2) const
67 {
68  return (bounds().inside(locpos, tol1, tol2));
69 }
70 
71 inline bool
72 PlaneSurface::insideBoundsCheck(const Amg::Vector2D& locpos,
73  const BoundaryCheck& bchk) const
74 {
75  return (bounds().inside(locpos, bchk));
76 }
77 
78 inline const SurfaceBounds&
79 PlaneSurface::bounds() const
80 {
81  if (m_bounds.get())
82  return *(m_bounds.get());
83  if (Surface::m_associatedDetElement &&
84  Surface::m_associatedDetElementId.is_valid()) {
85  return m_associatedDetElement->bounds(Surface::m_associatedDetElementId);
86  }
87  if (Surface::m_associatedDetElement)
88  return m_associatedDetElement->bounds();
89  return s_boundless;
90 }
91 }