ATLAS Offline Software
Loading...
Searching...
No Matches
SimplePolygonBrepVolumeBounds.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// SimplePolygonBrepVolumeBounds.h, (c) ATLAS Detector software
8
9#ifndef TRKVOLUMES_SIMPLEPOLYGONBREPVOLUMEBOUNDS_H
10#define TRKVOLUMES_SIMPLEPOLYGONBREPVOLUMEBOUNDS_H
11
12// Trk
16
17class MsgStream;
18
19namespace Trk {
20
21class Surface;
22class PlaneSurface;
23class RectangleBounds;
24
43
45 public:
48
50 SimplePolygonBrepVolumeBounds(const std::vector<std::pair<float, float> >& xyvtx,
51 float hlengthz);
52
54 SimplePolygonBrepVolumeBounds(const std::vector<std::pair<double, double> >& xyvtx,
55 double hlengthz);
56
59
62
66
68 SimplePolygonBrepVolumeBounds* clone() const override final;
69
72 bool inside(const Amg::Vector3D&, double tol = 0.) const override final;
73
75 virtual std::vector<std::unique_ptr<Trk::Surface>> decomposeToSurfaces
76 (const Amg::Transform3D& transform) override final;
77
80 const Amg::Vector3D& gp, const Amg::Vector3D& dir,
81 bool forceInside = false) const override final;
83 const std::vector<std::pair<double, double> >& xyVertices() const;
85 double halflengthZ() const;
86
88 const Trk::Volume* combinedVolume() const;
89
91 const Trk::Volume* envelope() const;
92
94 MsgStream& dump(MsgStream& sl) const override;
95
97 std::ostream& dump(std::ostream& sl) const override;
98
99 private:
100 void processSubVols();
101 std::unique_ptr<Trk::PlaneSurface> sideSurf(const Amg::Transform3D&, unsigned int,
102 unsigned int) const;
103 static bool Xor(bool x, bool y) ;
104
105 bool Left(std::pair<double, double> a, std::pair<double, double> b,
106 std::pair<double, double> c) const;
107
108 bool Intersect(std::pair<double, double> a, std::pair<double, double> b,
109 std::pair<double, double> c,
110 std::pair<double, double> d) const;
111
112 bool InCone(int i, int j,
113 const std::vector<std::pair<double, double> >& inputVertices) const;
114
115 bool Diagonalie(int i, int j,
116 const std::vector<std::pair<double, double> >& inputVertices) const;
117
118 bool Diagonal(
119 int i, int j,
120 const std::vector<std::pair<double, double> >& inputVertices) const;
121
122 std::vector<std::pair<double, double> > TriangulatePolygon(
123 const std::vector<std::pair<double, double> >& Vertices) const;
124
125 std::vector<std::pair<double, double> > TriangulatePolygonCheck(
126 const std::vector<std::pair<double, double> >& Vertices);
127
128 std::vector<std::pair<double, double> > m_xyVtx;
129 double m_halfX;
130 double m_halfY;
131 double m_halfZ;
132
136
140};
141
146inline const std::vector<std::pair<double, double> >&
150
152 return m_halfZ;
153}
154
159
161 return m_envelope;
162}
163
168
169} // namespace Trk
170
171#endif // TRKVOLUMES_SIMPLEPOLYGONBREPVOLUMEBOUNDS_H
172
static Double_t a
Class for a planaer rectangular or trapezoidal surface in the ATLAS detector.
Bounds for a rectangular, planar surface.
double m_halfX
halflength in x - to define enclosing rectangle
int m_ordering
-1 not set/ 1 anticlockwise / 0 clockwise
SimplePolygonBrepVolumeBounds * clone() const override final
Virtual constructor.
std::vector< std::pair< double, double > > TriangulatePolygon(const std::vector< std::pair< double, double > > &Vertices) const
double halflengthZ() const
This method returns the halflength in local z.
std::unique_ptr< Trk::PlaneSurface > sideSurf(const Amg::Transform3D &, unsigned int, unsigned int) const
const std::vector< std::pair< double, double > > & xyVertices() const
This method returns the set of xy generating vertices.
const Trk::Volume * envelope() const
This method returns the volume envelope.
virtual std::vector< std::unique_ptr< Trk::Surface > > decomposeToSurfaces(const Amg::Transform3D &transform) override final
Method to decompose the Bounds into Surfaces.
const Trk::Volume * combinedVolume() const
This method returns the transcript into combined volume.
bool Diagonalie(int i, int j, const std::vector< std::pair< double, double > > &inputVertices) const
bool Diagonal(int i, int j, const std::vector< std::pair< double, double > > &inputVertices) const
bool Left(std::pair< double, double > a, std::pair< double, double > b, std::pair< double, double > c) const
Trk::EightObjectsAccessor m_objectAccessor
There's only one single object Acessor for the moment has to be implemented if Cuboids are used more ...
const Trk::Volume * m_envelope
simplified envelope
const Trk::Volume * m_combinedVolume
triangulated polygon
std::vector< std::pair< double, double > > TriangulatePolygonCheck(const std::vector< std::pair< double, double > > &Vertices)
double m_halfY
halflength in y - to define enclosing rectangle
std::vector< std::pair< double, double > > m_xyVtx
generating xy vertices
SimplePolygonBrepVolumeBounds & operator=(const SimplePolygonBrepVolumeBounds &bobo)
Assignment operator.
ObjectAccessor boundarySurfaceAccessor(const Amg::Vector3D &gp, const Amg::Vector3D &dir, bool forceInside=false) const override final
Provide accessor for BoundarySurfaces.
bool InCone(int i, int j, const std::vector< std::pair< double, double > > &inputVertices) const
bool Intersect(std::pair< double, double > a, std::pair< double, double > b, std::pair< double, double > c, std::pair< double, double > d) const
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
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D
Ensure that the ATLAS eigen extensions are properly loaded.
std::array< ObjectAccessor::value_type, 8 > EightObjectsAccessor
@ x
Definition ParamDefs.h:55
@ y
Definition ParamDefs.h:56
-event-from-file