ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SurfaceBounds.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file SurfaceBounds.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2016-2020 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
9 #pragma once
10 #include <ostream>
11 
14 
15 namespace Acts {
16 
27  public:
31  enum BoundsType : int {
32  eCone = 0,
33  eCylinder = 1,
34  eDiamond = 2,
35  eDisc = 3,
36  eEllipse = 5,
37  eLine = 6,
40  eTriangle = 9,
43  eAnnulus = 12,
44  eBoundless = 13,
45  eOther = 14
46  };
47 
48  virtual ~SurfaceBounds() = default;
49 
53  virtual BoundsType type() const = 0;
54 
59  virtual std::vector<double> values() const = 0;
60 
68  virtual bool inside(const Vector2D& lposition,
69  const BoundaryCheck& bcheck) const = 0;
70 
75  virtual double distanceToBoundary(const Vector2D& lposition) const = 0;
76 
80  virtual std::ostream& toStream(std::ostream& os) const = 0;
81 };
82 
83 inline bool operator==(const SurfaceBounds& lhs, const SurfaceBounds& rhs) {
84  if (&lhs == &rhs) {
85  return true;
86  }
87  return (lhs.type() == rhs.type()) && (lhs.values() == rhs.values());
88 }
89 
90 inline bool operator!=(const SurfaceBounds& lhs, const SurfaceBounds& rhs) {
91  return !(lhs == rhs);
92 }
93 
94 inline std::ostream& operator<<(std::ostream& os, const SurfaceBounds& sb) {
95  return sb.toStream(os);
96 }
97 
98 } // namespace Acts