Analysis Software
Documentation for sPHENIX simulation 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 <iosfwd>
18 #include <memory>
19 
20 namespace Acts {
21 
22 class VolumeBounds;
23 using VolumeBoundsPtr = std::shared_ptr<const VolumeBounds>;
24 
32 
33 class Volume : public virtual GeometryObject {
34  public:
36 
43  Volume(const Transform3& transform, VolumeBoundsPtr volbounds);
44 
51  Volume(const Volume& vol, const Transform3& shift = Transform3::Identity());
52 
53  Volume() = delete;
54  virtual ~Volume() = default;
55 
59  Volume& operator=(const Volume& vol);
60 
62  const Transform3& transform() const;
63 
65  const Transform3& itransform() const;
66 
68  const Vector3& center() const;
69 
71  const VolumeBounds& volumeBounds() const;
72 
76  BoundingBox boundingBox(const Vector3& envelope = {0, 0, 0}) const;
77 
80  const BoundingBox& orientedBoundingBox() const;
81 
88  bool inside(const Vector3& gpos, double tol = 0.) const;
89 
98  BinningValue bValue) const override;
99 
100  protected:
106 };
107 
108 inline const Transform3& Volume::transform() const {
109  return m_transform;
110 }
111 
112 inline const Transform3& Volume::itransform() const {
113  return m_itransform;
114 }
115 
116 inline const Vector3& Volume::center() const {
117  return m_center;
118 }
119 
120 inline const VolumeBounds& Volume::volumeBounds() const {
121  return (*(m_volumeBounds.get()));
122 }
123 
125 std::ostream& operator<<(std::ostream& sl, const Volume& vol);
126 
127 } // namespace Acts