ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VolumeBounds.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file VolumeBounds.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2016-2018 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 <iomanip>
11 #include <iostream>
12 #include <memory>
13 #include "Acts/Geometry/Volume.hpp"
17 
18 namespace Acts {
19 
20 class Surface;
21 class Volume;
22 
23 class VolumeBounds;
24 using VolumeBoundsPtr = std::shared_ptr<const VolumeBounds>;
25 
26 using SurfacePtr = std::shared_ptr<const Surface>;
27 using SurfacePtrVector = std::vector<SurfacePtr>;
28 
43 class VolumeBounds {
44  public:
45  // @enum BoundsType
48  enum BoundsType : int {
49  eCone = 0,
50  eCuboid = 1,
52  eCylinder = 3,
55  eOther = 6
56  };
57 
58  VolumeBounds() = default;
59 
60  virtual ~VolumeBounds() = default;
61 
65  virtual BoundsType type() const = 0;
66 
71  virtual std::vector<double> values() const = 0;
72 
79  virtual bool inside(const Vector3D& gpos, double tol = 0.) const = 0;
80 
89  const Transform3D* transform) const = 0;
90 
97  const Transform3D* trf = nullptr, const Vector3D& envelope = {0, 0, 0},
98  const Volume* entity = nullptr) const = 0;
99 
105  virtual Vector3D binningOffset(BinningValue bValue) const;
106 
112  virtual double binningBorder(BinningValue bValue) const;
113 
117  virtual std::ostream& toStream(std::ostream& sl) const = 0;
118 };
119 
122  BinningValue /*bValue*/) const { // standard offset is 0.,0.,0.
123  return Vector3D(0., 0., 0.);
124 }
125 
126 inline double VolumeBounds::binningBorder(BinningValue /*bValue*/) const {
127  return 0.;
128 }
129 
131 std::ostream& operator<<(std::ostream& sl, const VolumeBounds& vb);
132 
133 inline bool operator==(const VolumeBounds& lhs, const VolumeBounds& rhs) {
134  if (&lhs == &rhs) {
135  return true;
136  }
137  return (lhs.type() == rhs.type()) && (lhs.values() == rhs.values());
138 }
139 
140 } // namespace Acts