ECCE @ 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 
10 // AbstractVolume.h, Acts project
12 #pragma once
13 #include <memory>
14 
20 
21 namespace Acts {
22 
23 class VolumeBounds;
24 using VolumeBoundsPtr = std::shared_ptr<const VolumeBounds>;
25 
33 
34 class Volume : public virtual GeometryObject {
35  public:
37 
39  Volume();
40 
47  Volume(const std::shared_ptr<const Transform3D>& htrans,
48  VolumeBoundsPtr volbounds);
49 
56  Volume(const Volume& vol, const Transform3D* shift = nullptr);
57 
59  virtual ~Volume();
60 
64  Volume& operator=(const Volume& vol);
65 
67  const Transform3D& transform() const;
68 
70  const Transform3D& itransform() const;
71 
73  const Vector3D& center() const;
74 
76  const VolumeBounds& volumeBounds() const;
77 
81  BoundingBox boundingBox(const Vector3D& envelope = {0, 0, 0}) const;
82 
85  const BoundingBox& orientedBoundingBox() const;
86 
93  bool inside(const Vector3D& gpos, double tol = 0.) const;
94 
103  BinningValue bValue) const override;
104 
105  protected:
106  std::shared_ptr<const Transform3D> m_transform;
111 };
112 
113 inline const Transform3D& Volume::transform() const {
114  if (m_transform) {
115  return (*(m_transform.get()));
116  }
117  return Acts::s_idTransform;
118 }
119 
120 inline const Transform3D& Volume::itransform() const {
121  return m_itransform;
122 }
123 
124 inline const Vector3D& Volume::center() const {
125  return m_center;
126 }
127 
128 inline const VolumeBounds& Volume::volumeBounds() const {
129  return (*(m_volumeBounds.get()));
130 }
131 
133 std::ostream& operator<<(std::ostream& sl, const Volume& vol);
134 
135 } // namespace Acts