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
12 
13 #include <ostream>
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 
74  virtual std::ostream& toStream(std::ostream& os) const = 0;
75 };
76 
77 inline bool operator==(const SurfaceBounds& lhs, const SurfaceBounds& rhs) {
78  if (&lhs == &rhs) {
79  return true;
80  }
81  return (lhs.type() == rhs.type()) && (lhs.values() == rhs.values());
82 }
83 
84 inline bool operator!=(const SurfaceBounds& lhs, const SurfaceBounds& rhs) {
85  return !(lhs == rhs);
86 }
87 
88 inline std::ostream& operator<<(std::ostream& os, const SurfaceBounds& sb) {
89  return sb.toStream(os);
90 }
91 
92 } // namespace Acts