ATLAS Offline Software
Public Member Functions | Protected Attributes | List of all members
Trk::Volume Class Reference

#include <Volume.h>

Inheritance diagram for Trk::Volume:
Collaboration diagram for Trk::Volume:

Public Member Functions

 Volume ()
 Default constructor. More...
 
 Volume (Amg::Transform3D *htrans, VolumeBounds *volBounds)
 Expizit constructor with arguments. More...
 
 Volume (const Volume &vol)
 Copy Constructor. More...
 
 Volume (const Volume &vol, const Amg::Transform3D &shift)
 Copy Constructor. More...
 
virtual ~Volume ()
 Destructor. More...
 
Volumeoperator= (const Volume &vol)
 Assignment operator. More...
 
virtual Volumeclone () const
 Pseudo-constructor. More...
 
const Amg::Transform3Dtransform () const
 Return methods for geometry transform. More...
 
const Amg::Vector3Dcenter () const
 returns the center of the volume More...
 
const VolumeBoundsvolumeBounds () const
 returns the volumeBounds() More...
 
VolumeBoundsvolumeBounds ()
 
bool inside (const Amg::Vector3D &gp, double tol=0.) const
 Inside() method for checks. More...
 
ObjectAccessor boundarySurfaceAccessor (const Amg::Vector3D &gp, const Amg::Vector3D &mom, bool forceInside=false) const
 Provide accessor for BoundarySurfaces. More...
 

Protected Attributes

std::unique_ptr< Amg::Transform3Dm_transform
 HepGeom::Transform3D. More...
 
CxxUtils::CachedUniquePtr< Amg::Vector3Dm_center
 center position of the surface More...
 
SharedObject< VolumeBoundsm_volumeBounds
 the volumeBounds More...
 

Detailed Description

Base class for all volumes inside the tracking realm, it defines the interface for inherited Volume classes regarding the geometrical information.

Author
Andre.nosp@m.as.S.nosp@m.alzbu.nosp@m.rger.nosp@m.@cern.nosp@m..ch

Definition at line 35 of file Volume.h.

Constructor & Destructor Documentation

◆ Volume() [1/4]

Trk::Volume::Volume ( )

Default constructor.

Definition at line 21 of file Volume.cxx.

22  : m_transform(nullptr)
23  , m_center(nullptr)
24  , m_volumeBounds()
25 {}

◆ Volume() [2/4]

Trk::Volume::Volume ( Amg::Transform3D htrans,
Trk::VolumeBounds volbounds 
)

Expizit constructor with arguments.

Definition at line 28 of file Volume.cxx.

29  : m_transform(htrans)
30  , m_center(nullptr)
31  , m_volumeBounds(volbounds)
32 {}

◆ Volume() [3/4]

Trk::Volume::Volume ( const Volume vol)

Copy Constructor.

Definition at line 35 of file Volume.cxx.

36  : m_transform(
37  vol.m_transform ? std::make_unique<Amg::Transform3D>(*(vol.m_transform))
38  : nullptr)
39  , m_center(
40  (vol.m_center) ? std::make_unique<Amg::Vector3D>(*(vol.m_center))
41  : nullptr)
42  , m_volumeBounds(vol.m_volumeBounds)
43 {}

◆ Volume() [4/4]

Trk::Volume::Volume ( const Volume vol,
const Amg::Transform3D shift 
)

Copy Constructor.

Definition at line 46 of file Volume.cxx.

47  : m_transform(
48  vol.m_transform
49  ? std::make_unique<Amg::Transform3D>(shift * (*(vol.m_transform)))
50  : std::make_unique<Amg::Transform3D>(shift))
51  , m_center(
52  (vol.m_center)
53  ? std::make_unique<Amg::Vector3D>(shift * (*(vol.m_center)))
54  : nullptr)
55  , m_volumeBounds(vol.m_volumeBounds)
56 {}

◆ ~Volume()

Trk::Volume::~Volume ( )
virtualdefault

Destructor.

Member Function Documentation

◆ boundarySurfaceAccessor()

Trk::ObjectAccessor Trk::Volume::boundarySurfaceAccessor ( const Amg::Vector3D gp,
const Amg::Vector3D mom,
bool  forceInside = false 
) const

Provide accessor for BoundarySurfaces.

Definition at line 100 of file Volume.cxx.

104 {
105  if (!m_transform) {
106  return Trk::ObjectAccessor(
107  volumeBounds().boundarySurfaceAccessor(gp, dir, forceInside));
108  }
110  transform().inverse() * gp, dir, forceInside));
111 }

◆ center()

const Amg::Vector3D & Trk::Volume::center ( ) const
inline

returns the center of the volume

Definition at line 86 of file Volume.h.

87  {
88  if (m_center) return (*m_center);
89  if (!m_center && m_transform){
90  m_center.set(std::make_unique<Amg::Vector3D>(std::as_const(*m_transform).translation()));
91  return(*m_center);
92  }
93  return Trk::s_origin;
94  }

◆ clone()

Trk::Volume * Trk::Volume::clone ( ) const
virtual

Pseudo-constructor.

Reimplemented in Trk::AbstractVolume.

Definition at line 78 of file Volume.cxx.

79 {
80  return new Trk::Volume(*this);
81 }

◆ inside()

ATH_FLATTEN bool Trk::Volume::inside ( const Amg::Vector3D gp,
double  tol = 0. 
) const

Inside() method for checks.

Definition at line 90 of file Volume.cxx.

91 {
92  if (!m_transform) {
93  return (volumeBounds()).inside(gp, tol);
94  }
95  Amg::Vector3D posInVolFrame((transform().inverse()) * gp);
96  return (volumeBounds()).inside(posInVolFrame, tol);
97 }

◆ operator=()

Trk::Volume & Trk::Volume::operator= ( const Volume vol)

Assignment operator.

Definition at line 63 of file Volume.cxx.

64 {
65  if (this != &vol) {
66  m_transform = vol.m_transform
67  ? std::make_unique<Amg::Transform3D>(*vol.m_transform)
68  : nullptr;
69  m_center = vol.m_center
70  ? std::make_unique<const Amg::Vector3D>(*(vol.m_center))
71  : nullptr;
72  m_volumeBounds = vol.m_volumeBounds;
73  }
74  return *this;
75 }

◆ transform()

const Amg::Transform3D & Trk::Volume::transform ( ) const
inline

Return methods for geometry transform.

Definition at line 81 of file Volume.h.

82  { if (m_transform) return(*m_transform);
83  return Trk::s_idTransform;
84  }

◆ volumeBounds() [1/2]

VolumeBounds & Trk::Volume::volumeBounds ( )
inline

Definition at line 103 of file Volume.h.

104  {
105  return *(m_volumeBounds.get());
106  }

◆ volumeBounds() [2/2]

const VolumeBounds & Trk::Volume::volumeBounds ( ) const
inline

returns the volumeBounds()

Definition at line 97 of file Volume.h.

98  {
99  return *(m_volumeBounds.get());
100  }

Member Data Documentation

◆ m_center

CxxUtils::CachedUniquePtr<Amg::Vector3D> Trk::Volume::m_center
protected

center position of the surface

Definition at line 77 of file Volume.h.

◆ m_transform

std::unique_ptr<Amg::Transform3D> Trk::Volume::m_transform
protected

HepGeom::Transform3D.

Definition at line 76 of file Volume.h.

◆ m_volumeBounds

SharedObject<VolumeBounds> Trk::Volume::m_volumeBounds
protected

the volumeBounds

Definition at line 78 of file Volume.h.


The documentation for this class was generated from the following files:
Trk::Volume::m_center
CxxUtils::CachedUniquePtr< Amg::Vector3D > m_center
center position of the surface
Definition: Volume.h:77
MuonR4::inverse
CalibratedSpacePoint::Covariance_t inverse(const CalibratedSpacePoint::Covariance_t &mat)
Inverts the parsed matrix.
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/UtilFunctions.cxx:65
Trk::Volume::boundarySurfaceAccessor
ObjectAccessor boundarySurfaceAccessor(const Amg::Vector3D &gp, const Amg::Vector3D &mom, bool forceInside=false) const
Provide accessor for BoundarySurfaces.
Definition: Volume.cxx:100
beamspotman.dir
string dir
Definition: beamspotman.py:623
Trk::Volume::transform
const Amg::Transform3D & transform() const
Return methods for geometry transform.
Definition: Volume.h:81
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::ObjectAccessor
Definition: ObjectAccessor.h:15
Trk::Volume::volumeBounds
const VolumeBounds & volumeBounds() const
returns the volumeBounds()
Definition: Volume.h:97
Trk::Volume::m_transform
std::unique_ptr< Amg::Transform3D > m_transform
HepGeom::Transform3D.
Definition: Volume.h:76
Trk::Volume::m_volumeBounds
SharedObject< VolumeBounds > m_volumeBounds
the volumeBounds
Definition: Volume.h:78
Trk::Volume
Definition: Volume.h:35