ATLAS Offline Software
Loading...
Searching...
No Matches
Volume.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
6// AbstractVolume.h, (c) ATLAS Detector software
8
9#ifndef TRKVOLUMES_VOLUME_H
10#define TRKVOLUMES_VOLUME_H
11
12//Trk
16//
18//std
19#include <memory>
20
21class MsgStream;
22
23namespace Trk {
24
25 class VolumeBounds;
26
36 class Volume {
37 public:
39 Volume() = default;
40 Volume(Volume&&) = default;
41 Volume& operator=(Volume&&) = default;
42 virtual ~Volume() = default;
43
45 Volume(std::unique_ptr<Amg::Transform3D> htrans,
46 std::shared_ptr<VolumeBounds> volBounds);
47
49 Volume(const Volume& vol);
50
52 Volume(const Volume& vol, const Amg::Transform3D& shift);
53
55 Volume& operator=(const Volume& vol);
56
58 virtual Volume* clone() const;
59
61 const Amg::Transform3D& transform() const;
62
64 const Amg::Vector3D& center() const;
65
67 const VolumeBounds& volumeBounds() const;
69
71 bool inside(const Amg::Vector3D& gp, double tol=0.) const ;
72
75 const Amg::Vector3D& mom,
76 bool forceInside=false) const;
77 protected:
78 std::unique_ptr<Amg::Transform3D> m_transform = nullptr;
80 std::shared_ptr<VolumeBounds> m_volumeBounds = nullptr;
81 };
82
83 inline const Amg::Transform3D& Volume::transform() const {
84 if (m_transform) {
85 return (*m_transform);
86 }
87 return Trk::s_idTransform;
88 }
89
90 inline const Amg::Vector3D& Volume::center() const
91 {
92 return m_center;
93 }
94
95 inline const VolumeBounds&
97 {
98 return *(m_volumeBounds.get());
99 }
100
101 inline VolumeBounds&
103 {
104 return *(m_volumeBounds.get());
105 }
106
107
109MsgStream& operator << ( MsgStream& sl, const Volume& vol);
110std::ostream& operator << ( std::ostream& sl, const Volume& vol);
111
112
113} // end of namespace Trk
114
115CLASS_DEF( Trk::Volume , 125765716 , 1 )
116
117
118#endif // TRKVOLUMES_VOLUME_H
119
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Pure Absract Base Class for Volume bounds.
Base class for all volumes inside the tracking realm, it defines the interface for inherited Volume c...
Definition Volume.h:36
virtual ~Volume()=default
Volume(Volume &&)=default
Volume()=default
Defaults copies are special due ot unique ptr data member.
const Amg::Vector3D & center() const
returns the center of the volume
Definition Volume.h:90
Volume & operator=(Volume &&)=default
const Amg::Transform3D & transform() const
Return methods for geometry transform.
Definition Volume.h:83
const VolumeBounds & volumeBounds() const
returns the volumeBounds()
Definition Volume.h:96
Amg::Vector3D m_center
center position of the surface
Definition Volume.h:79
std::unique_ptr< Amg::Transform3D > m_transform
Transform3D (optional)
Definition Volume.h:78
std::shared_ptr< VolumeBounds > m_volumeBounds
the volumeBounds
Definition Volume.h:80
ObjectAccessor boundarySurfaceAccessor(const Amg::Vector3D &gp, const Amg::Vector3D &mom, bool forceInside=false) const
Provide accessor for BoundarySurfaces.
Definition Volume.cxx:82
virtual Volume * clone() const
polymorpic deep copy
Definition Volume.cxx:60
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D
Ensure that the ATLAS eigen extensions are properly loaded.
static const Amg::Transform3D s_idTransform
idendity transformation
MsgStream & operator<<(MsgStream &sl, const AlignModule &alignModule)
overload of << operator for MsgStream for debug output
static const Amg::Vector3D s_origin(0, 0, 0)
origin position