ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Trk::CuboidVolumeBounds Class Referencefinal

#include <CuboidVolumeBounds.h>

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

Public Member Functions

 CuboidVolumeBounds ()
 Default Constructor. More...
 
 CuboidVolumeBounds (double hlenghtx, double hlenghty, double hlengthz)
 Constructor - the box boundaries. More...
 
 CuboidVolumeBounds (const CuboidVolumeBounds &bobo)
 Copy Constructor. More...
 
virtual ~CuboidVolumeBounds ()
 Destructor. More...
 
CuboidVolumeBoundsoperator= (const CuboidVolumeBounds &bobo)
 Assignment operator. More...
 
CuboidVolumeBoundsclone () const override final
 Virtual constructor. More...
 
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. More...
 
const std::vector< const Trk::Surface * > * decomposeToSurfaces (const Amg::Transform3D &transform) override final
 Method to decompose the Bounds into boundarySurfaces. More...
 
ObjectAccessor boundarySurfaceAccessor (const Amg::Vector3D &gp, const Amg::Vector3D &dir, bool forceInside=false) const override final
 Provide accessor for BoundarySurfaces. More...
 
double halflengthX () const
 This method returns the halflength in local x. More...
 
double halflengthY () const
 This method returns the halflength in local y. More...
 
double halflengthZ () const
 This method returns the halflength in local z. More...
 
MsgStream & dump (MsgStream &sl) const override final
 Output Method for MsgStream. More...
 
std::ostream & dump (std::ostream &sl) const override final
 Output Method for std::ostream. More...
 

Private Member Functions

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

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. More...
 

Detailed Description

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

BoundarySurfaceFace [index]:

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 {}

◆ 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  {
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 }

◆ decomposeToSurfaces()

const std::vector< const 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  std::vector<const Trk::Surface*>* retsf =
69  new std::vector<const Trk::Surface*>;
70  // memory optimisation
71  retsf->reserve(6);
72  // face surfaces xy
73  // (1) - at negative local z
74  retsf->push_back(new Trk::PlaneSurface(
76  transform *
77  Amg::AngleAxis3D(180. * Gaudi::Units::deg, Amg::Vector3D(0., 1., 0.)) *
78  Amg::Translation3D(Amg::Vector3D(0., 0., this->halflengthZ()))),
79  this->faceXYRectangleBounds()));
80  // (2) - at positive local z
81  retsf->push_back(new Trk::PlaneSurface(
83  transform *
84  Amg::Translation3D(Amg::Vector3D(0., 0., this->halflengthZ()))),
85  this->faceXYRectangleBounds()));
86  // face surfaces yz
87  // transmute cyclical
88  // (3) - at negative local x
89  retsf->push_back(new Trk::PlaneSurface(
91  transform *
92  Amg::AngleAxis3D(180. * Gaudi::Units::deg, Amg::Vector3D(0., 0., 1.)) *
96  this->faceYZRectangleBounds()));
97  // (4) - at positive local x
98  retsf->push_back(new Trk::PlaneSurface(
100  transform *
101  Amg::Translation3D(Amg::Vector3D(this->halflengthX(), 0., 0.)) *
102  Amg::AngleAxis3D(90. * Gaudi::Units::deg, Amg::Vector3D(0., 1., 0.)) *
103  Amg::AngleAxis3D(90. * Gaudi::Units::deg, Amg::Vector3D(0., 0., 1.))),
104  this->faceYZRectangleBounds()));
105  // face surfaces zx
106  // (5) - at negative local y
107  retsf->push_back(new Trk::PlaneSurface(
109  transform *
110  Amg::AngleAxis3D(180. * Gaudi::Units::deg, Amg::Vector3D(1., 0., 0.)) *
111  Amg::Translation3D(Amg::Vector3D(0., this->halflengthY(), 0.)) *
112  Amg::AngleAxis3D(-90 * Gaudi::Units::deg, Amg::Vector3D(0., 1., 0.)) *
113  Amg::AngleAxis3D(-90. * Gaudi::Units::deg, Amg::Vector3D(1., 0., 0.))),
114  this->faceZXRectangleBounds()));
115  // (6) - at positive local y
116  retsf->push_back(new Trk::PlaneSurface(
118  transform *
119  Amg::Translation3D(Amg::Vector3D(0., this->halflengthY(), 0.)) *
120  Amg::AngleAxis3D(-90 * Gaudi::Units::deg, Amg::Vector3D(0., 1., 0.)) *
121  Amg::AngleAxis3D(-90. * Gaudi::Units::deg, Amg::Vector3D(1., 0., 0.))),
122  this->faceZXRectangleBounds()));
123 
124  return retsf;
125 }

◆ dump() [1/2]

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

Output Method for MsgStream.

Implements Trk::VolumeBounds.

Definition at line 148 of file CuboidVolumeBounds.cxx.

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

◆ dump() [2/2]

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

Output Method for std::ostream.

Implements Trk::VolumeBounds.

Definition at line 161 of file CuboidVolumeBounds.cxx.

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

◆ faceXYRectangleBounds()

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 128 of file CuboidVolumeBounds.cxx.

129 {
130  return new Trk::RectangleBounds(m_halfX, m_halfY);
131 }

◆ faceYZRectangleBounds()

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 134 of file CuboidVolumeBounds.cxx.

135 {
136  return new Trk::RectangleBounds(m_halfY, m_halfZ);
137 }

◆ faceZXRectangleBounds()

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 140 of file CuboidVolumeBounds.cxx.

141 {
142  return new Trk::RectangleBounds(m_halfZ, m_halfX);
143 }

◆ 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:
Trk::CuboidVolumeBounds::halflengthZ
double halflengthZ() const
This method returns the halflength in local z.
Definition: CuboidVolumeBounds.h:136
Trk::RectangleBounds
Definition: RectangleBounds.h:38
deg
#define deg
Definition: SbPolyhedron.cxx:17
Trk::CuboidVolumeBounds::halflengthX
double halflengthX() const
This method returns the halflength in local x.
Definition: CuboidVolumeBounds.h:132
Trk::CuboidVolumeBounds::m_halfX
double m_halfX
Definition: CuboidVolumeBounds.h:113
Trk::CuboidVolumeBounds::halflengthY
double halflengthY() const
This method returns the halflength in local y.
Definition: CuboidVolumeBounds.h:134
Trk::CuboidVolumeBounds::faceYZRectangleBounds
RectangleBounds * faceYZRectangleBounds() const
This method returns the associated RecantleBounds of the face PlaneSurface parallel to local yz plane...
Definition: CuboidVolumeBounds.cxx:134
Trk::CuboidVolumeBounds::m_objectAccessor
SixObjectsAccessor m_objectAccessor
There's only one single object Acessor for the moment has to be implemented if Cuboids are used more ...
Definition: CuboidVolumeBounds.h:119
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition: GeoPrimitivesHelpers.h:156
Trk::CuboidVolumeBounds::faceXYRectangleBounds
RectangleBounds * faceXYRectangleBounds() const
This method returns the associated RecantleBounds of the face PlaneSurface parallel to local xy plane...
Definition: CuboidVolumeBounds.cxx:128
Trk::CuboidVolumeBounds::faceZXRectangleBounds
RectangleBounds * faceZXRectangleBounds() const
This method returns the associated RecantleBounds of the face PlaneSurface parallel to local zx plane...
Definition: CuboidVolumeBounds.cxx:140
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::CuboidVolumeBounds::m_halfZ
double m_halfZ
Definition: CuboidVolumeBounds.h:115
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
Trk::ObjectAccessor
Definition: ObjectAccessor.h:15
Trk::PlaneSurface
Definition: PlaneSurface.h:64
Amg::Translation3D
Eigen::Translation< double, 3 > Translation3D
Definition: GeoPrimitives.h:44
Trk::CuboidVolumeBounds::CuboidVolumeBounds
CuboidVolumeBounds()
Default Constructor.
Definition: CuboidVolumeBounds.cxx:22
Amg::AngleAxis3D
Eigen::AngleAxisd AngleAxis3D
Definition: GeoPrimitives.h:45
Trk::CuboidVolumeBounds::m_halfY
double m_halfY
Definition: CuboidVolumeBounds.h:114
Trk::VolumeBounds::VolumeBounds
VolumeBounds()
Default Constructor.
Definition: VolumeBounds.h:48