EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Volume.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Volume.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 
16 
17 #include <memory>
18 
19 namespace Acts {
20 
21 class VolumeBounds;
22 using VolumeBoundsPtr = std::shared_ptr<const VolumeBounds>;
23 
31 
32 class Volume : public virtual GeometryObject {
33  public:
35 
42  Volume(const Transform3D& transform, VolumeBoundsPtr volbounds);
43 
50  Volume(const Volume& vol, const Transform3D& shift = Transform3D::Identity());
51 
52  Volume() = delete;
53  virtual ~Volume() = default;
54 
58  Volume& operator=(const Volume& vol);
59 
61  const Transform3D& transform() const;
62 
64  const Transform3D& itransform() const;
65 
67  const Vector3D& center() const;
68 
70  const VolumeBounds& volumeBounds() const;
71 
75  BoundingBox boundingBox(const Vector3D& envelope = {0, 0, 0}) const;
76 
79  const BoundingBox& orientedBoundingBox() const;
80 
87  bool inside(const Vector3D& gpos, double tol = 0.) const;
88 
97  BinningValue bValue) const override;
98 
99  protected:
105 };
106 
107 inline const Transform3D& Volume::transform() const {
108  return m_transform;
109 }
110 
111 inline const Transform3D& Volume::itransform() const {
112  return m_itransform;
113 }
114 
115 inline const Vector3D& Volume::center() const {
116  return m_center;
117 }
118 
119 inline const VolumeBounds& Volume::volumeBounds() const {
120  return (*(m_volumeBounds.get()));
121 }
122 
124 std::ostream& operator<<(std::ostream& sl, const Volume& vol);
125 
126 } // namespace Acts