ATLAS Offline Software
Loading...
Searching...
No Matches
Trk::CuboidVolumeBounds Class Referencefinal

Bounds for a cubical Volume, the decomposeToSurfaces method creates a vector of 6 surfaces: More...

#include <CuboidVolumeBounds.h>

Inheritance diagram for Trk::CuboidVolumeBounds:
Collaboration diagram for Trk::CuboidVolumeBounds:

Public Member Functions

 CuboidVolumeBounds ()
 Default Constructor.
 CuboidVolumeBounds (double hlenghtx, double hlenghty, double hlengthz)
 Constructor - the box boundaries.
 CuboidVolumeBounds (const CuboidVolumeBounds &bobo)
 Copy Constructor.
virtual ~CuboidVolumeBounds ()
 Destructor.
CuboidVolumeBoundsoperator= (const CuboidVolumeBounds &bobo)
 Assignment operator.
CuboidVolumeBoundsclone () const override final
 Virtual constructor.
bool inside (const Amg::Vector3D &, double tol=0.) const override final
 This method checks if position in the 3D volume frame is inside the cylinder.
virtual std::vector< std::unique_ptr< Trk::Surface > > decomposeToSurfaces (const Amg::Transform3D &transform) override final
 Method to decompose the Bounds into boundarySurfaces.
ObjectAccessor boundarySurfaceAccessor (const Amg::Vector3D &gp, const Amg::Vector3D &dir, bool forceInside=false) const override final
 Provide accessor for BoundarySurfaces.
double halflengthX () const
 This method returns the halflength in local x.
double halflengthY () const
 This method returns the halflength in local y.
double halflengthZ () const
 This method returns the halflength in local z.
MsgStream & dump (MsgStream &sl) const override final
 Output Method for MsgStream.
std::ostream & dump (std::ostream &sl) const override final
 Output Method for std::ostream.

Private Member Functions

std::shared_ptr< RectangleBoundsfaceXYRectangleBounds () const
 This method returns the associated RecantleBounds of the face PlaneSurface parallel to local xy plane.
std::shared_ptr< RectangleBoundsfaceYZRectangleBounds () const
 This method returns the associated RecantleBounds of the face PlaneSurface parallel to local yz plane.
std::shared_ptr< RectangleBoundsfaceZXRectangleBounds () const
 This method returns the associated RecantleBounds of the face PlaneSurface parallel to local zx plane.

Private Attributes

double m_halfX
double m_halfY
double m_halfZ
SixObjectsAccessor m_objectAccessor
 There's only one single object Acessor for the moment has to be implemented if Cuboids are used more widely.

Detailed Description

Bounds for a cubical Volume, the decomposeToSurfaces method creates a vector of 6 surfaces:

BoundarySurfaceFace [index]:

  • negativeFaceXY [0] : Rectangular Trk::PlaneSurface, parallel to \( xy \) plane at negative \( z \)
  • positiveFaceXY [1] : Rectangular Trk::PlaneSurface, parallel to \( xy \) plane at positive \( z \)
  • negativeFaceXY [2] : Rectangular Trk::PlaneSurface, attached to \( yz \) plane at negative \( x \)
  • positiveFaceXY [3] : Rectangular Trk::PlaneSurface, attached to \( yz \) plane at negative \( x \)
  • negativeFaceXY [4] : Rectangular Trk::PlaneSurface, parallel to \( zx \) plane at negative \( y \)
  • positiveFaceXY [5] : Rectangular Trk::PlaneSurface, parallel to \( zx \) plane at positive \( y \)
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 52 of file CuboidVolumeBounds.h.

Constructor & Destructor Documentation

◆ CuboidVolumeBounds() [1/3]

Trk::CuboidVolumeBounds::CuboidVolumeBounds ( )

Default Constructor.

Definition at line 22 of file CuboidVolumeBounds.cxx.

23 : VolumeBounds()
24 , m_halfX(0.)
25 , m_halfY(0.)
26 , m_halfZ(0.)
28{}
SixObjectsAccessor m_objectAccessor
There's only one single object Acessor for the moment has to be implemented if Cuboids are used more ...
VolumeBounds()
Default Constructor.

◆ CuboidVolumeBounds() [2/3]

Trk::CuboidVolumeBounds::CuboidVolumeBounds ( double hlenghtx,
double hlenghty,
double hlengthz )

Constructor - the box boundaries.

Definition at line 30 of file CuboidVolumeBounds.cxx.

34 : VolumeBounds()
35 , m_halfX(halex)
36 , m_halfY(haley)
37 , m_halfZ(halez)
39{}

◆ CuboidVolumeBounds() [3/3]

Trk::CuboidVolumeBounds::CuboidVolumeBounds ( const CuboidVolumeBounds & bobo)

Copy Constructor.

Definition at line 41 of file CuboidVolumeBounds.cxx.

42 : VolumeBounds()
43 , m_halfX(bobo.m_halfX)
44 , m_halfY(bobo.m_halfY)
45 , m_halfZ(bobo.m_halfZ)
46 , m_objectAccessor(bobo.m_objectAccessor)
47{}

◆ ~CuboidVolumeBounds()

Trk::CuboidVolumeBounds::~CuboidVolumeBounds ( )
virtualdefault

Destructor.

Member Function Documentation

◆ boundarySurfaceAccessor()

ObjectAccessor Trk::CuboidVolumeBounds::boundarySurfaceAccessor ( const Amg::Vector3D & gp,
const Amg::Vector3D & dir,
bool forceInside = false ) const
inlinefinaloverridevirtual

Provide accessor for BoundarySurfaces.

Implements Trk::VolumeBounds.

Definition at line 138 of file CuboidVolumeBounds.h.

139 {
140 return Trk::ObjectAccessor(m_objectAccessor);
141}

◆ clone()

CuboidVolumeBounds * Trk::CuboidVolumeBounds::clone ( ) const
inlinefinaloverridevirtual

Virtual constructor.

Implements Trk::VolumeBounds.

Definition at line 122 of file CuboidVolumeBounds.h.

122 {
123 return new CuboidVolumeBounds(*this);
124}
CuboidVolumeBounds()
Default Constructor.

◆ decomposeToSurfaces()

std::vector< std::unique_ptr< Trk::Surface > > Trk::CuboidVolumeBounds::decomposeToSurfaces ( const Amg::Transform3D & transform)
finaloverridevirtual

Method to decompose the Bounds into boundarySurfaces.

Implements Trk::VolumeBounds.

Definition at line 64 of file CuboidVolumeBounds.cxx.

66{
67
68 auto retsf = std::vector<std::unique_ptr<Trk::Surface>>() ;
69 // memory optimisation
70 retsf.reserve(6);
71 // face surfaces xy
72 // (1) - at negative local z
73 retsf.push_back(std::make_unique<Trk::PlaneSurface>(
75 transform *
76 Amg::AngleAxis3D(180. * Gaudi::Units::deg, Amg::Vector3D(0., 1., 0.)) *
78 this->faceXYRectangleBounds()));
79 // (2) - at positive local z
80 retsf.push_back(std::make_unique<Trk::PlaneSurface>(
82 transform *
84 this->faceXYRectangleBounds()));
85 // face surfaces yz
86 // transmute cyclical
87 // (3) - at negative local x
88 retsf.push_back(std::make_unique<Trk::PlaneSurface>(
90 transform *
91 Amg::AngleAxis3D(180. * Gaudi::Units::deg, Amg::Vector3D(0., 0., 1.)) *
93 Amg::AngleAxis3D(90. * Gaudi::Units::deg, Amg::Vector3D(0., 1., 0)) *
94 Amg::AngleAxis3D(90. * Gaudi::Units::deg, Amg::Vector3D(0., 0., 1.))),
95 this->faceYZRectangleBounds()));
96 // (4) - at positive local x
97 retsf.push_back(std::make_unique<Trk::PlaneSurface>(
99 transform *
101 Amg::AngleAxis3D(90. * Gaudi::Units::deg, Amg::Vector3D(0., 1., 0.)) *
102 Amg::AngleAxis3D(90. * Gaudi::Units::deg, Amg::Vector3D(0., 0., 1.))),
103 this->faceYZRectangleBounds()));
104 // face surfaces zx
105 // (5) - at negative local y
106 retsf.push_back(std::make_unique<Trk::PlaneSurface>(
108 transform *
109 Amg::AngleAxis3D(180. * Gaudi::Units::deg, Amg::Vector3D(1., 0., 0.)) *
111 Amg::AngleAxis3D(-90 * Gaudi::Units::deg, Amg::Vector3D(0., 1., 0.)) *
112 Amg::AngleAxis3D(-90. * Gaudi::Units::deg, Amg::Vector3D(1., 0., 0.))),
113 this->faceZXRectangleBounds()));
114 // (6) - at positive local y
115 retsf.push_back(std::make_unique<Trk::PlaneSurface>(
117 transform *
119 Amg::AngleAxis3D(-90 * Gaudi::Units::deg, Amg::Vector3D(0., 1., 0.)) *
120 Amg::AngleAxis3D(-90. * Gaudi::Units::deg, Amg::Vector3D(1., 0., 0.))),
121 this->faceZXRectangleBounds()));
122
123 return retsf;
124}
double halflengthX() const
This method returns the halflength in local x.
std::shared_ptr< RectangleBounds > faceZXRectangleBounds() const
This method returns the associated RecantleBounds of the face PlaneSurface parallel to local zx plane...
std::shared_ptr< RectangleBounds > faceYZRectangleBounds() const
This method returns the associated RecantleBounds of the face PlaneSurface parallel to local yz plane...
double halflengthY() const
This method returns the halflength in local y.
std::shared_ptr< RectangleBounds > faceXYRectangleBounds() const
This method returns the associated RecantleBounds of the face PlaneSurface parallel to local xy plane...
double halflengthZ() const
This method returns the halflength in local z.
Eigen::AngleAxisd AngleAxis3D
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D
Eigen::Translation< double, 3 > Translation3D

◆ dump() [1/2]

MsgStream & Trk::CuboidVolumeBounds::dump ( MsgStream & sl) const
finaloverridevirtual

Output Method for MsgStream.

Implements Trk::VolumeBounds.

Definition at line 147 of file CuboidVolumeBounds.cxx.

148{
149
150 std::stringstream temp_sl;
151 temp_sl << std::setiosflags(std::ios::fixed);
152 temp_sl << std::setprecision(7);
153 temp_sl << "Trk::CuboidVolumeBounds: (halfX, halfY, halfZ) = ";
154 temp_sl << "(" << m_halfX << ", " << m_halfY << ", " << m_halfZ << ")";
155 sl << temp_sl.str();
156 return sl;
157}

◆ dump() [2/2]

std::ostream & Trk::CuboidVolumeBounds::dump ( std::ostream & sl) const
finaloverridevirtual

Output Method for std::ostream.

Implements Trk::VolumeBounds.

Definition at line 160 of file CuboidVolumeBounds.cxx.

161{
162 std::stringstream temp_sl;
163 temp_sl << std::setiosflags(std::ios::fixed);
164 temp_sl << std::setprecision(7);
165 temp_sl << "Trk::CuboidVolumeBounds: (halfX, halfY, halfZ) = ";
166 temp_sl << "(" << m_halfX << ", " << m_halfY << ", " << m_halfZ << ")";
167 sl << temp_sl.str();
168 return sl;
169}

◆ faceXYRectangleBounds()

std::shared_ptr< Trk::RectangleBounds > Trk::CuboidVolumeBounds::faceXYRectangleBounds ( ) const
private

This method returns the associated RecantleBounds of the face PlaneSurface parallel to local xy plane.

Definition at line 127 of file CuboidVolumeBounds.cxx.

128{
129 return std::make_shared<Trk::RectangleBounds>(m_halfX, m_halfY);
130}

◆ faceYZRectangleBounds()

std::shared_ptr< Trk::RectangleBounds > Trk::CuboidVolumeBounds::faceYZRectangleBounds ( ) const
private

This method returns the associated RecantleBounds of the face PlaneSurface parallel to local yz plane.

Definition at line 133 of file CuboidVolumeBounds.cxx.

134{
135 return std::make_shared<Trk::RectangleBounds>(m_halfY, m_halfZ);
136}

◆ faceZXRectangleBounds()

std::shared_ptr< Trk::RectangleBounds > Trk::CuboidVolumeBounds::faceZXRectangleBounds ( ) const
private

This method returns the associated RecantleBounds of the face PlaneSurface parallel to local zx plane.

Definition at line 139 of file CuboidVolumeBounds.cxx.

140{
141 return std::make_shared<Trk::RectangleBounds>(m_halfZ, m_halfX);
142}

◆ halflengthX()

double Trk::CuboidVolumeBounds::halflengthX ( ) const
inline

This method returns the halflength in local x.

Definition at line 132 of file CuboidVolumeBounds.h.

132{ return m_halfX; }

◆ halflengthY()

double Trk::CuboidVolumeBounds::halflengthY ( ) const
inline

This method returns the halflength in local y.

Definition at line 134 of file CuboidVolumeBounds.h.

134{ return m_halfY; }

◆ halflengthZ()

double Trk::CuboidVolumeBounds::halflengthZ ( ) const
inline

This method returns the halflength in local z.

Definition at line 136 of file CuboidVolumeBounds.h.

136{ return m_halfZ; }

◆ inside()

bool Trk::CuboidVolumeBounds::inside ( const Amg::Vector3D & pos,
double tol = 0. ) const
inlinefinaloverridevirtual

This method checks if position in the 3D volume frame is inside the cylinder.

Implements Trk::VolumeBounds.

Definition at line 126 of file CuboidVolumeBounds.h.

127 {
128 return (fabs(pos.x()) <= m_halfX + tol && fabs(pos.y()) <= m_halfY + tol &&
129 fabs(pos.z()) <= m_halfZ + tol);
130}

◆ operator=()

Trk::CuboidVolumeBounds & Trk::CuboidVolumeBounds::operator= ( const CuboidVolumeBounds & bobo)

Assignment operator.

Definition at line 52 of file CuboidVolumeBounds.cxx.

53{
54 if (this != &bobo) {
55 m_halfX = bobo.m_halfX;
56 m_halfY = bobo.m_halfY;
57 m_halfZ = bobo.m_halfZ;
58 m_objectAccessor = bobo.m_objectAccessor;
59 }
60 return *this;
61}

Member Data Documentation

◆ m_halfX

double Trk::CuboidVolumeBounds::m_halfX
private

Definition at line 113 of file CuboidVolumeBounds.h.

◆ m_halfY

double Trk::CuboidVolumeBounds::m_halfY
private

Definition at line 114 of file CuboidVolumeBounds.h.

◆ m_halfZ

double Trk::CuboidVolumeBounds::m_halfZ
private

Definition at line 115 of file CuboidVolumeBounds.h.

◆ m_objectAccessor

SixObjectsAccessor Trk::CuboidVolumeBounds::m_objectAccessor
private

There's only one single object Acessor for the moment has to be implemented if Cuboids are used more widely.

Definition at line 119 of file CuboidVolumeBounds.h.


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