ATLAS Offline Software
Loading...
Searching...
No Matches
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
5namespace Trk {
6
7inline 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
18inline constexpr SurfaceType
19PlaneSurface::type() const
20{
21 return PlaneSurface::staticType;
22}
23
24/** Use the Surface as a ParametersBase constructor, from local parameters */
25template<int DIM, class T>
26std::unique_ptr<ParametersT<DIM, T, PlaneSurface>>
27PlaneSurface::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 */
39template<int DIM, class T>
40std::unique_ptr<ParametersT<DIM, T, PlaneSurface>>
41PlaneSurface::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 */
51inline std::string
52PlaneSurface::name() const
53{
54 return "Trk::PlaneSurface";
55}
56
57inline PlaneSurface*
58PlaneSurface::clone() const
59{
60 return new PlaneSurface(*this);
61}
62
63inline bool
64PlaneSurface::insideBounds(const Amg::Vector2D& locpos,
65 double tol1,
66 double tol2) const
67{
68 return (bounds().inside(locpos, tol1, tol2));
69}
70
71inline bool
72PlaneSurface::insideBoundsCheck(const Amg::Vector2D& locpos,
73 const BoundaryCheck& bchk) const
74{
75 return (bounds().inside(locpos, bchk));
76}
77
78inline const SurfaceBounds&
79PlaneSurface::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}