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

#include <AbstractVolume.h>

Inheritance diagram for Trk::AbstractVolume:
Collaboration diagram for Trk::AbstractVolume:

Public Member Functions

 AbstractVolume ()
 Default Constructor - needed for pool and inherited classes. More...
 
 AbstractVolume (const AbstractVolume &vol)
 Copy constructor. More...
 
 AbstractVolume (Amg::Transform3D *htrans, VolumeBounds *volbounds)
 Constructor with Amg::Transform3D*, VolumeBounds*, passing ownership. More...
 
virtual ~AbstractVolume ()
 Virtual Destructor. More...
 
AbstractVolumeoperator= (const AbstractVolume &vol)
 Assignment operator. More...
 
AbstractVolumeclone () const
 Implicit constructor. More...
 
const std::vector< SharedObject< const BoundarySurface< AbstractVolume > > > & boundarySurfaces () const
 Method to return the BoundarySurfaces. 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...
 

Private Member Functions

void createBoundarySurfaces ()
 Private method to create BoundarySurfaces. More...
 

Private Attributes

std::vector< SharedObject< const BoundarySurface< AbstractVolume > > > * m_boundarySurfaces
 boundary Surfaces More...
 

Detailed Description

AbstractVolume description inside the tracking realm. This is the purely geometrical object volume.

The Trk::AbstractVolume is constructed by giving a pointer to a HepGeom::Transform3D and a pointer to Trk::VolumeBounds, this implies that the ownership of the objects pointed to is passed as well.

A Trk::AbstractVolume is in first place a collection class of Trk::BoundarySurface, the vector of Trk::BoundarySurface is returned by the Trk::VolumeBounds that carry a decompose method.

Boundary surfaces can be shared between AbstractVolumes to enhance automatic navigation between AbstractVolumes, therefor they are reference counted by a Trk::SharedObject holder class.

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

Definition at line 51 of file AbstractVolume.h.

Constructor & Destructor Documentation

◆ AbstractVolume() [1/3]

Trk::AbstractVolume::AbstractVolume ( )

Default Constructor - needed for pool and inherited classes.

Definition at line 30 of file AbstractVolume.cxx.

31  : Volume()
32  , m_boundarySurfaces(nullptr)
33 {}

◆ AbstractVolume() [2/3]

Trk::AbstractVolume::AbstractVolume ( const AbstractVolume vol)

Copy constructor.

Definition at line 46 of file AbstractVolume.cxx.

47  : Volume(vol)
48  , m_boundarySurfaces(nullptr)
49 {}

◆ AbstractVolume() [3/3]

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

Constructor with Amg::Transform3D*, VolumeBounds*, passing ownership.

Definition at line 36 of file AbstractVolume.cxx.

39  : Volume(htrans, volbounds)
40  , m_boundarySurfaces(nullptr)
41 {
43 }

◆ ~AbstractVolume()

Trk::AbstractVolume::~AbstractVolume ( )
virtual

Virtual Destructor.

Definition at line 52 of file AbstractVolume.cxx.

53 {
54  delete m_boundarySurfaces;
55 }

Member Function Documentation

◆ boundarySurfaceAccessor()

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

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 }

◆ boundarySurfaces()

const std::vector< Trk::SharedObject< const Trk::BoundarySurface< Trk::AbstractVolume > > > & Trk::AbstractVolume::boundarySurfaces ( ) const

Method to return the BoundarySurfaces.

Definition at line 73 of file AbstractVolume.cxx.

74 {
75  return (*m_boundarySurfaces);
76 }

◆ center()

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

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()

AbstractVolume * Trk::AbstractVolume::clone ( ) const
inlinevirtual

Implicit constructor.

Reimplemented from Trk::Volume.

Definition at line 84 of file AbstractVolume.h.

84  {
85  return new AbstractVolume(*this);
86 }

◆ createBoundarySurfaces()

void Trk::AbstractVolume::createBoundarySurfaces ( )
private

Private method to create BoundarySurfaces.

Definition at line 78 of file AbstractVolume.cxx.

79 {
80  // prepare the BoundarySurfaces
81  m_boundarySurfaces = new std::vector<
83  // transform Surfaces To BoundarySurfaces
84  const std::vector<const Trk::Surface*>* surfaces =
86  std::vector<const Trk::Surface*>::const_iterator surfIter = surfaces->begin();
87 
88  // counter to flip the inner/outer position for Cylinders
89  int sfCounter = 0;
90  int sfNumber = surfaces->size();
91 
92  for (; surfIter != surfaces->end(); ++surfIter) {
93  sfCounter++;
94  const Trk::PlaneSurface* psf =
95  dynamic_cast<const Trk::PlaneSurface*>(*surfIter);
96  if (psf) {
97  m_boundarySurfaces->push_back(
100  this, nullptr, *psf)));
101  delete psf;
102  continue;
103  }
104  const Trk::DiscSurface* dsf =
105  dynamic_cast<const Trk::DiscSurface*>(*surfIter);
106  if (dsf) {
107  m_boundarySurfaces->push_back(
110  this, nullptr, *dsf)));
111  delete dsf;
112  continue;
113  }
114  const Trk::CylinderSurface* csf =
115  dynamic_cast<const Trk::CylinderSurface*>(*surfIter);
116  if (csf) {
117  Trk::AbstractVolume* inner =
118  (sfCounter == 3 && sfNumber > 3) ? nullptr : this;
119  Trk::AbstractVolume* outer = (inner) ? nullptr : this;
120  m_boundarySurfaces->push_back(
123  inner, outer, *csf)));
124  delete csf;
125  continue;
126  }
127  }
128 
129  delete surfaces;
130 }

◆ inside()

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

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::AbstractVolume & Trk::AbstractVolume::operator= ( const AbstractVolume vol)

Assignment operator.

Definition at line 59 of file AbstractVolume.cxx.

60 {
61  if (this != &vol) {
62  Volume::operator=(vol);
63  delete m_boundarySurfaces;
64  m_boundarySurfaces = new std::vector<
66  *vol.m_boundarySurfaces);
67  }
68  return *this;
69 }

◆ transform()

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

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 ( )
inlineinherited

Definition at line 103 of file Volume.h.

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

◆ volumeBounds() [2/2]

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

returns the volumeBounds()

Definition at line 97 of file Volume.h.

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

Member Data Documentation

◆ m_boundarySurfaces

std::vector<SharedObject<const BoundarySurface<AbstractVolume> > >* Trk::AbstractVolume::m_boundarySurfaces
private

boundary Surfaces

Definition at line 81 of file AbstractVolume.h.

◆ m_center

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

center position of the surface

Definition at line 77 of file Volume.h.

◆ m_transform

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

HepGeom::Transform3D.

Definition at line 76 of file Volume.h.

◆ m_volumeBounds

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

the volumeBounds

Definition at line 78 of file Volume.h.


The documentation for this class was generated from the following files:
Trk::Volume::operator=
Volume & operator=(const Volume &vol)
Assignment operator.
Definition: Volume.cxx:63
Trk::Volume::Volume
Volume()
Default constructor.
Definition: Volume.cxx:21
Trk::BoundarySurface
Definition: BoundarySurface.h:50
Trk::Volume::m_center
CxxUtils::CachedUniquePtr< Amg::Vector3D > m_center
center position of the surface
Definition: Volume.h:77
Trk::AbstractVolume
Definition: AbstractVolume.h:51
Trk::DiscSurface
Definition: DiscSurface.h:54
Trk::BoundaryPlaneSurface
Definition: BoundaryPlaneSurface.h:38
Trk::BoundaryDiscSurface
Definition: BoundaryDiscSurface.h:40
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::CylinderSurface
Definition: CylinderSurface.h:55
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::VolumeBounds::decomposeToSurfaces
virtual const std::vector< const Trk::Surface * > * decomposeToSurfaces(const Amg::Transform3D &transform)=0
Method to decompose the Bounds into Surfaces, the Volume can turn them into BoundarySurfaces.
Trk::BoundaryCylinderSurface
Definition: BoundaryCylinderSurface.h:37
Trk::ObjectAccessor
Definition: ObjectAccessor.h:15
Trk::SharedObject
std::shared_ptr< T > SharedObject
Definition: SharedObject.h:24
Trk::PlaneSurface
Definition: PlaneSurface.h:64
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::AbstractVolume::m_boundarySurfaces
std::vector< SharedObject< const BoundarySurface< AbstractVolume > > > * m_boundarySurfaces
boundary Surfaces
Definition: AbstractVolume.h:81
Trk::AbstractVolume::AbstractVolume
AbstractVolume()
Default Constructor - needed for pool and inherited classes.
Definition: AbstractVolume.cxx:30
Trk::AbstractVolume::createBoundarySurfaces
void createBoundarySurfaces()
Private method to create BoundarySurfaces.
Definition: AbstractVolume.cxx:78