ATLAS Offline Software
SimplePolygonBrepVolumeBounds.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 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 
17 class MsgStream;
18 
19 namespace Trk {
20 
21 class Surface;
22 class PlaneSurface;
23 class RectangleBounds;
24 
45  public:
48 
50  SimplePolygonBrepVolumeBounds(std::vector<std::pair<float, float> > xyvtx,
51  float hlengthz);
52 
54  SimplePolygonBrepVolumeBounds(std::vector<std::pair<double, double> > xyvtx,
55  double hlengthz);
56 
59 
62 
65  const SimplePolygonBrepVolumeBounds& bobo);
66 
68  SimplePolygonBrepVolumeBounds* clone() const override final;
69 
72  bool inside(const Amg::Vector3D&, double tol = 0.) const override final;
73 
76  (const Amg::Transform3D& transform) override final;
77 
81  bool forceInside = false) const override final;
83  std::vector<std::pair<double, double> > xyVertices() const;
85  double halflengthZ() const;
86 
89 
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  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 
143  const {
144  return new SimplePolygonBrepVolumeBounds(*this);
145 }
146 inline std::vector<std::pair<double, double> >
148  return m_xyVtx;
149 }
150 
152  return m_halfZ;
153 }
154 
156  const {
157  return m_combinedVolume;
158 }
159 
161  return m_envelope;
162 }
163 
165  const Amg::Vector3D&, const Amg::Vector3D&, bool) const {
167 }
168 
169 } // namespace Trk
170 
171 #endif // TRKVOLUMES_SIMPLEPOLYGONBREPVOLUMEBOUNDS_H
172 
Trk::y
@ y
Definition: ParamDefs.h:56
Trk::SimplePolygonBrepVolumeBounds::halflengthZ
double halflengthZ() const
This method returns the halflength in local z.
Definition: SimplePolygonBrepVolumeBounds.h:151
Trk::SimplePolygonBrepVolumeBounds::operator=
SimplePolygonBrepVolumeBounds & operator=(const SimplePolygonBrepVolumeBounds &bobo)
Assignment operator.
Definition: SimplePolygonBrepVolumeBounds.cxx:149
Trk::SimplePolygonBrepVolumeBounds
Definition: SimplePolygonBrepVolumeBounds.h:44
Trk::SimplePolygonBrepVolumeBounds::SimplePolygonBrepVolumeBounds
SimplePolygonBrepVolumeBounds(std::vector< std::pair< double, double > > xyvtx, double hlengthz)
Constructor - generic case (from double)
Trk::EightObjectsAccessor
std::array< ObjectAccessor::value_type, 8 > EightObjectsAccessor
Definition: ObjectsAccessor.h:18
Trk::SimplePolygonBrepVolumeBounds::m_ordering
int m_ordering
-1 not set/ 1 anticlockwise / 0 clockwise
Definition: SimplePolygonBrepVolumeBounds.h:133
hist_file_dump.d
d
Definition: hist_file_dump.py:137
Trk::SimplePolygonBrepVolumeBounds::Intersect
bool Intersect(std::pair< double, double > a, std::pair< double, double > b, std::pair< double, double > c, std::pair< double, double > d) const
Definition: SimplePolygonBrepVolumeBounds.cxx:355
Trk::SimplePolygonBrepVolumeBounds::InCone
bool InCone(int i, int j, const std::vector< std::pair< double, double > > &inputVertices) const
Definition: SimplePolygonBrepVolumeBounds.cxx:367
Trk::SimplePolygonBrepVolumeBounds::Diagonal
bool Diagonal(int i, int j, const std::vector< std::pair< double, double > > &inputVertices) const
Definition: SimplePolygonBrepVolumeBounds.cxx:417
Trk::SimplePolygonBrepVolumeBounds::m_halfX
double m_halfX
halflength in x - to define enclosing rectangle
Definition: SimplePolygonBrepVolumeBounds.h:129
Surface
Definition: Trigger/TrigAccel/TrigCudaFitter/src/Surface.h:8
Trk::SimplePolygonBrepVolumeBounds::SimplePolygonBrepVolumeBounds
SimplePolygonBrepVolumeBounds(std::vector< std::pair< float, float > > xyvtx, float hlengthz)
Constructor - generic case (from float)
Trk::SimplePolygonBrepVolumeBounds::Xor
static bool Xor(bool x, bool y)
Definition: SimplePolygonBrepVolumeBounds.cxx:326
VolumeBounds.h
ObjectsAccessor.h
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
Trk::SimplePolygonBrepVolumeBounds::m_objectAccessor
Trk::EightObjectsAccessor m_objectAccessor
There's only one single object Acessor for the moment has to be implemented if Cuboids are used more ...
Definition: SimplePolygonBrepVolumeBounds.h:139
Trk::SimplePolygonBrepVolumeBounds::xyVertices
std::vector< std::pair< double, double > > xyVertices() const
This method returns the set of xy generating vertices.
Definition: SimplePolygonBrepVolumeBounds.h:147
Trk::SimplePolygonBrepVolumeBounds::TriangulatePolygon
std::vector< std::pair< double, double > > TriangulatePolygon(const std::vector< std::pair< double, double > > &Vertices) const
Definition: SimplePolygonBrepVolumeBounds.cxx:429
Trk::SimplePolygonBrepVolumeBounds::sideSurf
Trk::PlaneSurface * sideSurf(const Amg::Transform3D &, unsigned int, unsigned int) const
Definition: SimplePolygonBrepVolumeBounds.cxx:209
Trk::SimplePolygonBrepVolumeBounds::clone
SimplePolygonBrepVolumeBounds * clone() const override final
Virtual constructor.
Definition: SimplePolygonBrepVolumeBounds.h:142
GeoPrimitives.h
Trk::VolumeBounds
Definition: VolumeBounds.h:45
Trk::SimplePolygonBrepVolumeBounds::inside
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: SimplePolygonBrepVolumeBounds.cxx:255
Trk::SimplePolygonBrepVolumeBounds::boundarySurfaceAccessor
ObjectAccessor boundarySurfaceAccessor(const Amg::Vector3D &gp, const Amg::Vector3D &dir, bool forceInside=false) const override final
Provide accessor for BoundarySurfaces.
Definition: SimplePolygonBrepVolumeBounds.h:164
lumiFormat.i
int i
Definition: lumiFormat.py:85
Trk::SimplePolygonBrepVolumeBounds::Diagonalie
bool Diagonalie(int i, int j, const std::vector< std::pair< double, double > > &inputVertices) const
Definition: SimplePolygonBrepVolumeBounds.cxx:391
vector
Definition: MultiHisto.h:13
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::SimplePolygonBrepVolumeBounds::dump
MsgStream & dump(MsgStream &sl) const override
Output Method for MsgStream.
Definition: SimplePolygonBrepVolumeBounds.cxx:293
Trk::SimplePolygonBrepVolumeBounds::decomposeToSurfaces
const std::vector< const Trk::Surface * > * decomposeToSurfaces(const Amg::Transform3D &transform) override final
Method to decompose the Bounds into Surfaces.
Definition: SimplePolygonBrepVolumeBounds.cxx:171
Trk::SimplePolygonBrepVolumeBounds::m_combinedVolume
const Trk::Volume * m_combinedVolume
triangulated polygon
Definition: SimplePolygonBrepVolumeBounds.h:134
beamspotman.dir
string dir
Definition: beamspotman.py:623
Trk::SimplePolygonBrepVolumeBounds::m_xyVtx
std::vector< std::pair< double, double > > m_xyVtx
generating xy vertices
Definition: SimplePolygonBrepVolumeBounds.h:128
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Amg
Definition of ATLAS Math & Geometry primitives (Amg)
Definition: AmgStringHelpers.h:19
Trk::SimplePolygonBrepVolumeBounds::m_halfZ
double m_halfZ
halflength in z
Definition: SimplePolygonBrepVolumeBounds.h:131
private
#define private
Definition: DetDescrConditionsDict_dict_fixes.cxx:13
Trk::SimplePolygonBrepVolumeBounds::~SimplePolygonBrepVolumeBounds
virtual ~SimplePolygonBrepVolumeBounds()
Destructor.
Definition: SimplePolygonBrepVolumeBounds.cxx:142
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
Trk::SimplePolygonBrepVolumeBounds::SimplePolygonBrepVolumeBounds
SimplePolygonBrepVolumeBounds()
Default Constructor.
Definition: SimplePolygonBrepVolumeBounds.cxx:28
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::ObjectAccessor
Definition: ObjectAccessor.h:15
a
TList * a
Definition: liststreamerinfos.cxx:10
Trk::PlaneSurface
Definition: PlaneSurface.h:64
Trk::SimplePolygonBrepVolumeBounds::m_halfY
double m_halfY
halflength in y - to define enclosing rectangle
Definition: SimplePolygonBrepVolumeBounds.h:130
Trk::SimplePolygonBrepVolumeBounds::TriangulatePolygonCheck
std::vector< std::pair< double, double > > TriangulatePolygonCheck(const std::vector< std::pair< double, double > > &Vertices)
Definition: SimplePolygonBrepVolumeBounds.cxx:505
Trk::SimplePolygonBrepVolumeBounds::processSubVols
void processSubVols()
Definition: SimplePolygonBrepVolumeBounds.cxx:262
Trk::SimplePolygonBrepVolumeBounds::envelope
const Trk::Volume * envelope() const
This method returns the volume envelope.
Definition: SimplePolygonBrepVolumeBounds.h:160
Trk::SimplePolygonBrepVolumeBounds::combinedVolume
const Trk::Volume * combinedVolume() const
This method returns the transcript into combined volume.
Definition: SimplePolygonBrepVolumeBounds.h:155
Trk::SimplePolygonBrepVolumeBounds::Left
bool Left(std::pair< double, double > a, std::pair< double, double > b, std::pair< double, double > c) const
Definition: SimplePolygonBrepVolumeBounds.cxx:338
Trk::x
@ x
Definition: ParamDefs.h:55
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
Trk::Volume
Definition: Volume.h:35
python.compressB64.c
def c
Definition: compressB64.py:93
NSWL1::Vertices
std::vector< Vertex > Vertices
Definition: GeoUtils.h:19
Trk::SimplePolygonBrepVolumeBounds::m_envelope
const Trk::Volume * m_envelope
simplified envelope
Definition: SimplePolygonBrepVolumeBounds.h:135