ATLAS Offline Software
CombinedVolumeBounds.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // CombinedVolumeBounds.h, (c) ATLAS Detector software
8 
9 #ifndef TRKVOLUMES_COMBINEDVOLUMEBOUNDS_H
10 #define TRKVOLUMES_COMBINEDVOLUMEBOUNDS_H
11 
12 // Trk
14 #include "TrkVolumes/Volume.h"
16 
17 // Eigen
19 
20 class MsgStream;
21 
22 namespace Trk {
23 
24 class SurfaceBounds;
25 class Volume;
26 class Surface;
27 
42 class CombinedVolumeBounds final : public VolumeBounds {
43  public:
46 
49 
52 
54  virtual ~CombinedVolumeBounds();
55 
58 
60  virtual CombinedVolumeBounds* clone() const override final;
61 
64  virtual bool inside(const Amg::Vector3D&, double tol = 0.) const override final;
65 
67  virtual const std::vector<const Trk::Surface*>* decomposeToSurfaces
68  (const Amg::Transform3D& transform) override final;
69 
72  const Amg::Vector3D& gp, const Amg::Vector3D& dir,
73  bool forceInside = false) const override final;
74 
76  const Volume* first() const;
77 
79  const Volume* second() const;
80 
82  bool intersection() const;
83 
85  const std::vector<bool>& boundsOrientation() const;
86 
88  virtual MsgStream& dump(MsgStream& sl) const override final;
89 
91  virtual std::ostream& dump(std::ostream& sl) const override final;
92 
93  private:
95  Trk::Volume* subtrVol) ;
96 
101  std::vector<bool> m_boundsOrientation;
102 };
103 
105  return new CombinedVolumeBounds(*this);
106 }
107 
109  double tol) const {
110  if (m_intersection)
111  return (m_first->inside(pos, tol) && m_second->inside(pos, tol));
112  return (m_first->inside(pos, tol) || m_second->inside(pos, tol));
113 }
114 
115 inline const Volume* CombinedVolumeBounds::first() const { return m_first; }
116 
117 inline const Volume* CombinedVolumeBounds::second() const { return m_second; }
118 
120  return m_intersection;
121 }
122 
124  const Amg::Vector3D&, const Amg::Vector3D&, bool) const {
126 }
127 
128 inline const std::vector<bool>& CombinedVolumeBounds::boundsOrientation() const {
129  return (m_boundsOrientation);
130 }
131 
132 } // namespace Trk
133 
134 #endif // TRKVOLUMES_COMBINEDVOLUMEBOUNDS_H
135 
Trk::CombinedVolumeBounds::intersection
bool intersection() const
This method distinguishes between Union(0) and Intersection(1)
Definition: CombinedVolumeBounds.h:119
Trk::CombinedVolumeBounds::m_second
Volume * m_second
Definition: CombinedVolumeBounds.h:98
Trk::CombinedVolumeBounds::boundarySurfaceAccessor
virtual ObjectAccessor boundarySurfaceAccessor(const Amg::Vector3D &gp, const Amg::Vector3D &dir, bool forceInside=false) const override final
Provide accessor for BoundarySurfaces.
Definition: CombinedVolumeBounds.h:123
Trk::CombinedVolumeBounds::m_boundsOrientation
std::vector< bool > m_boundsOrientation
Definition: CombinedVolumeBounds.h:101
Trk::CombinedVolumeBounds::operator=
CombinedVolumeBounds & operator=(const CombinedVolumeBounds &bobo)
Assignment operator.
Definition: CombinedVolumeBounds.cxx:77
Trk::Volume::inside
bool inside(const Amg::Vector3D &gp, double tol=0.) const
Inside() method for checks.
Definition: Volume.cxx:90
Trk::EightObjectsAccessor
std::array< ObjectAccessor::value_type, 8 > EightObjectsAccessor
Definition: ObjectsAccessor.h:18
Surface
Definition: Trigger/TrigAccel/TrigCudaFitter/src/Surface.h:8
Trk::CombinedVolumeBounds::m_intersection
bool m_intersection
Definition: CombinedVolumeBounds.h:99
Trk::CombinedVolumeBounds::clone
virtual CombinedVolumeBounds * clone() const override final
Virtual constructor.
Definition: CombinedVolumeBounds.h:104
VolumeBounds.h
ObjectsAccessor.h
Trk::CombinedVolumeBounds::first
const Volume * first() const
This method returns the first VolumeBounds.
Definition: CombinedVolumeBounds.h:115
Trk::CombinedVolumeBounds::boundsOrientation
const std::vector< bool > & boundsOrientation() const
This method returns bounds orientation.
Definition: CombinedVolumeBounds.h:128
GeoPrimitives.h
Trk::VolumeBounds
Definition: VolumeBounds.h:45
Volume.h
Trk::CombinedVolumeBounds::~CombinedVolumeBounds
virtual ~CombinedVolumeBounds()
Destructor.
Definition: CombinedVolumeBounds.cxx:69
Trk::CombinedVolumeBounds::dump
virtual MsgStream & dump(MsgStream &sl) const override final
Output Method for MsgStream.
Definition: CombinedVolumeBounds.cxx:347
Trk::CombinedVolumeBounds::createSubtractedVolume
static Trk::Volume * createSubtractedVolume(const Amg::Transform3D &transf, Trk::Volume *subtrVol)
Definition: CombinedVolumeBounds.cxx:373
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::CombinedVolumeBounds::m_objectAccessor
EightObjectsAccessor m_objectAccessor
Definition: CombinedVolumeBounds.h:100
Trk::CombinedVolumeBounds::CombinedVolumeBounds
CombinedVolumeBounds()
Default Constructor.
Definition: CombinedVolumeBounds.cxx:34
beamspotman.dir
string dir
Definition: beamspotman.py:623
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
Trk::ObjectAccessor
Definition: ObjectAccessor.h:15
Trk::CombinedVolumeBounds::m_first
Volume * m_first
Definition: CombinedVolumeBounds.h:97
Trk::CombinedVolumeBounds::inside
virtual bool inside(const Amg::Vector3D &, double tol=0.) const override final
This method checks if position in the 3D volume frame is inside the volume.
Definition: CombinedVolumeBounds.h:108
Trk::CombinedVolumeBounds
Definition: CombinedVolumeBounds.h:42
Trk::CombinedVolumeBounds::second
const Volume * second() const
This method returns the second VolumeBounds.
Definition: CombinedVolumeBounds.h:117
Trk::Volume
Definition: Volume.h:35
Trk::CombinedVolumeBounds::decomposeToSurfaces
virtual const std::vector< const Trk::Surface * > * decomposeToSurfaces(const Amg::Transform3D &transform) override final
Method to decompose the Bounds into boundarySurfaces.
Definition: CombinedVolumeBounds.cxx:94