ATLAS Offline Software
Loading...
Searching...
No Matches
CombinedVolumeBounds.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 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#include <memory>
21
22class MsgStream;
23
24namespace Trk {
25
26class SurfaceBounds;
27class Volume;
28class Surface;
29
43
44class CombinedVolumeBounds final : public VolumeBounds {
45 public:
48
50 CombinedVolumeBounds(std::unique_ptr<Volume> first,
51 std::unique_ptr<Volume> second,
52 bool intersection);
53
56
59
62
64 virtual CombinedVolumeBounds* clone() const override final;
65
68 virtual bool inside(const Amg::Vector3D&, double tol = 0.) const override final;
69
72 (const Amg::Transform3D& transform) override final;
73
76 const Amg::Vector3D& gp, const Amg::Vector3D& dir,
77 bool forceInside = false) const override final;
78
81
84
86 bool intersection() const;
87
90
92 virtual MsgStream& dump(MsgStream& sl) const override final;
93
95 virtual std::ostream& dump(std::ostream& sl) const override final;
96
97 private:
99 const Trk::Volume* subtrVol);
100
102 std::unique_ptr<Volume> m_second{};
105 std::vector<bool> m_boundsOrientation{};
106};
107
109 return new CombinedVolumeBounds(*this);
110}
111
112inline bool CombinedVolumeBounds::inside(const Amg::Vector3D& pos, double tol) const {
113 if (m_intersection) {
114 return (m_first->inside(pos, tol) && m_second->inside(pos, tol));
115 }
116 return (m_first->inside(pos, tol) || m_second->inside(pos, tol));
117}
118
119inline const Volume* CombinedVolumeBounds::first() const {
120 return m_first.get();
121}
122
124 return m_second.get();
125}
126
128 return m_intersection;
129}
130
135
136inline const std::vector<bool>& CombinedVolumeBounds::boundsOrientation() const {
137 return (m_boundsOrientation);
138}
139
140} // namespace Trk
141
142#endif // TRKVOLUMES_COMBINEDVOLUMEBOUNDS_H
143
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D
std::unique_ptr< Volume > m_second
virtual ObjectAccessor boundarySurfaceAccessor(const Amg::Vector3D &gp, const Amg::Vector3D &dir, bool forceInside=false) const override final
Provide accessor for BoundarySurfaces.
const Volume * second() const
This method returns the second VolumeBounds.
const Volume * first() const
This method returns the first VolumeBounds.
CombinedVolumeBounds()
Default Constructor.
virtual std::vector< std::unique_ptr< Trk::Surface > > decomposeToSurfaces(const Amg::Transform3D &transform) override final
Method to decompose the Bounds into boundarySurfaces.
CombinedVolumeBounds & operator=(const CombinedVolumeBounds &bobo)
Assignment operator.
std::unique_ptr< Volume > m_first
const std::vector< bool > & boundsOrientation() const
This method returns bounds orientation.
EightObjectsAccessor m_objectAccessor
virtual ~CombinedVolumeBounds()
Destructor.
bool intersection() const
This method distinguishes between Union(0) and Intersection(1)
virtual CombinedVolumeBounds * clone() const override final
Virtual constructor.
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.
static Trk::Volume * createSubtractedVolume(const Amg::Transform3D &transf, const Trk::Volume *subtrVol)
std::vector< bool > m_boundsOrientation
Abstract base class for surface bounds to be specified.
Abstract Base Class for tracking surfaces.
VolumeBounds()
Default Constructor.
Base class for all volumes inside the tracking realm, it defines the interface for inherited Volume c...
Definition Volume.h:36
STL class.
STL class.
Definition of ATLAS Math & Geometry primitives (Amg)
Eigen::Matrix< double, 3, 1 > Vector3D
Ensure that the ATLAS eigen extensions are properly loaded.
std::array< ObjectAccessor::value_type, 8 > EightObjectsAccessor
-event-from-file
STL namespace.
#define private