ATLAS Offline Software
Loading...
Searching...
No Matches
Trk::Volume Class Reference

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

#include <Volume.h>

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

Public Member Functions

 Volume ()=default
 Defaults copies are special due ot unique ptr data member.
 Volume (Volume &&)=default
Volumeoperator= (Volume &&)=default
virtual ~Volume ()=default
 Volume (std::unique_ptr< Amg::Transform3D > htrans, std::shared_ptr< VolumeBounds > volBounds)
 Constructor with arguments.
 Volume (const Volume &vol)
 Copy Constructor.
 Volume (const Volume &vol, const Amg::Transform3D &shift)
 Copy Constructor.
Volumeoperator= (const Volume &vol)
 Assignment operator.
virtual Volumeclone () const
 polymorpic deep copy
const Amg::Transform3Dtransform () const
 Return methods for geometry transform.
const Amg::Vector3Dcenter () const
 returns the center of the volume
const VolumeBoundsvolumeBounds () const
 returns the volumeBounds()
VolumeBoundsvolumeBounds ()
bool inside (const Amg::Vector3D &gp, double tol=0.) const
 Inside() method for checks.
ObjectAccessor boundarySurfaceAccessor (const Amg::Vector3D &gp, const Amg::Vector3D &mom, bool forceInside=false) const
 Provide accessor for BoundarySurfaces.

Protected Attributes

std::unique_ptr< Amg::Transform3Dm_transform = nullptr
 Transform3D (optional)
Amg::Vector3D m_center = Trk::s_origin
 center position of the surface
std::shared_ptr< VolumeBoundsm_volumeBounds = nullptr
 the volumeBounds

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
Christos Anastopoulos (Athena MT modifications)

Definition at line 36 of file Volume.h.

Constructor & Destructor Documentation

◆ Volume() [1/5]

Trk::Volume::Volume ( )
default

Defaults copies are special due ot unique ptr data member.

◆ Volume() [2/5]

Trk::Volume::Volume ( Volume && )
default

◆ ~Volume()

virtual Trk::Volume::~Volume ( )
virtualdefault

◆ Volume() [3/5]

Trk::Volume::Volume ( std::unique_ptr< Amg::Transform3D > htrans,
std::shared_ptr< VolumeBounds > volBounds )

Constructor with arguments.

Definition at line 22 of file Volume.cxx.

24 : m_transform(std::move(htrans))
25 , m_center(m_transform ? m_transform->translation() : Trk::s_origin)
26 , m_volumeBounds(std::move(volbounds))
27{}
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
static const Amg::Vector3D s_origin(0, 0, 0)
origin position

◆ Volume() [4/5]

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

Copy Constructor.

Definition at line 30 of file Volume.cxx.

31 : m_transform(vol.m_transform
32 ? std::make_unique<Amg::Transform3D>(*(vol.m_transform))
33 : nullptr),
34 m_center(vol.m_center),
35 m_volumeBounds(vol.m_volumeBounds) {}

◆ Volume() [5/5]

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

Copy Constructor.

Definition at line 38 of file Volume.cxx.

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

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 82 of file Volume.cxx.

86{
87 if (!m_transform) {
88 return Trk::ObjectAccessor(
89 volumeBounds().boundarySurfaceAccessor(gp, dir, forceInside));
90 }
91 return Trk::ObjectAccessor(volumeBounds().boundarySurfaceAccessor(
92 transform().inverse() * gp, dir, forceInside));
93}
const Amg::Transform3D & transform() const
Return methods for geometry transform.
Definition Volume.h:83
VolumeBounds & volumeBounds()
Definition Volume.h:102
ObjectAccessor boundarySurfaceAccessor(const Amg::Vector3D &gp, const Amg::Vector3D &mom, bool forceInside=false) const
Provide accessor for BoundarySurfaces.
Definition Volume.cxx:82

◆ center()

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

returns the center of the volume

Definition at line 90 of file Volume.h.

91 {
92 return m_center;
93 }

◆ clone()

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

polymorpic deep copy

Definition at line 60 of file Volume.cxx.

61{
62 return new Trk::Volume(*this);
63}

◆ inside()

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

Inside() method for checks.

Definition at line 72 of file Volume.cxx.

73{
74 if (!m_transform) {
75 return (volumeBounds()).inside(gp, tol);
76 }
77 Amg::Vector3D posInVolFrame((transform().inverse()) * gp);
78 return (volumeBounds()).inside(posInVolFrame, tol);
79}
Eigen::Matrix< double, 3, 1 > Vector3D

◆ operator=() [1/2]

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

Assignment operator.

Definition at line 47 of file Volume.cxx.

48{
49 if (this != &vol) {
50 m_transform = vol.m_transform
51 ? std::make_unique<Amg::Transform3D>(*vol.m_transform)
52 : nullptr;
53 m_center = vol.m_center;
54 m_volumeBounds = vol.m_volumeBounds;
55 }
56 return *this;
57}

◆ operator=() [2/2]

Volume & Trk::Volume::operator= ( Volume && )
default

◆ transform()

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

Return methods for geometry transform.

Definition at line 83 of file Volume.h.

83 {
84 if (m_transform) {
85 return (*m_transform);
86 }
87 return Trk::s_idTransform;
88 }
static const Amg::Transform3D s_idTransform
idendity transformation

◆ volumeBounds() [1/2]

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

Definition at line 102 of file Volume.h.

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

◆ volumeBounds() [2/2]

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

returns the volumeBounds()

Definition at line 96 of file Volume.h.

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

Member Data Documentation

◆ m_center

Amg::Vector3D Trk::Volume::m_center = Trk::s_origin
protected

center position of the surface

Definition at line 79 of file Volume.h.

◆ m_transform

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

Transform3D (optional)

Definition at line 78 of file Volume.h.

◆ m_volumeBounds

std::shared_ptr<VolumeBounds> Trk::Volume::m_volumeBounds = nullptr
protected

the volumeBounds

Definition at line 80 of file Volume.h.


The documentation for this class was generated from the following files: