ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
TrkDetDescr
TrkDetDescrGeoModelCnv
TrkDetDescrGeoModelCnv
VolumeIntersection.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
// VolumeIntersection.h, (c) ATLAS Detector software
8
9
#ifndef TRKDETDESCRGEOMODELCNV_VOLUMEINTERSECTION_H
10
#define TRKDETDESCRGEOMODELCNV_VOLUMEINTERSECTION_H
11
12
#include <memory>
13
#include <utility>
//for std::pair
14
#include <vector>
15
16
#include "
TrkDetDescrGeoModelCnv/GeoShapeConverter.h
"
17
18
namespace
Trk
{
19
class
Volume
;
20
}
21
22
namespace
Trk
{
23
24
struct
PolygonCache
{
25
double
hZ
{0.};
26
double
minZ
{0.};
27
double
maxZ
{0.};
28
Amg::Vector3D
center
{Amg::Vector3D::Zero()};
29
int
nVtx
{0};
30
std::vector<Amg::Vector3D>
vertices
{};
31
std::vector<std::pair<double, double>>
xyVertices
{};
// size+1
32
std::vector<bool>
commonVertices
{};
33
std::vector<std::pair<double, double>>
edges
{};
34
PolygonCache
() =
default
;
35
};
36
37
struct
EdgeCross
{
38
39
std::pair<int, int>
edge_id
{};
40
std::pair<double, double>
edge_pos
{};
41
bool
used
{
false
};
42
EdgeCross
(std::pair<int, int> ei, std::pair<double, double> ep)
43
:
edge_id
(
std
::move(ei)),
edge_pos
(
std
::move(ep)){};
44
};
45
54
55
class
VolumeIntersection
{
56
57
public
:
58
static
std::pair<bool, std::unique_ptr<Trk::Volume>>
intersect
(
59
const
Volume
& volA,
const
Volume
& volB) ;
60
61
static
std::pair<bool, std::unique_ptr<Trk::Volume>>
intersectApproximative
(
62
const
Volume
& volA,
const
Volume
& volB) ;
63
64
private
:
65
static
PolygonCache
polygonXY
(
const
Volume
& inVol,
int
swap
= 0) ;
66
static
Trk::PolygonCache
intersectPgon
(
Trk::PolygonCache
&,
67
Trk::PolygonCache
&) ;
68
69
static
bool
inside
(
const
std::pair<double, double>& vtx,
70
const
std::vector<std::pair<double, double>>& pgon) ;
71
72
static
double
det
(
const
std::pair<double, double>&
a
,
73
const
std::pair<double, double>& b,
bool
) ;
74
};
75
76
}
// end of namespace Trk
77
78
#endif
swap
void swap(DataVector< T > &a, DataVector< T > &b)
See DataVector<T, BASE>::swap().
GeoShapeConverter.h
a
static Double_t a
Definition
LArPhysWaveHECTool.cxx:38
Trk::VolumeIntersection
A Simple Helper Class that collects methods for calculation of overlap of two geometrical objects.
Definition
VolumeIntersection.h:55
Trk::VolumeIntersection::intersect
static std::pair< bool, std::unique_ptr< Trk::Volume > > intersect(const Volume &volA, const Volume &volB)
Definition
VolumeIntersection.cxx:38
Trk::VolumeIntersection::intersectApproximative
static std::pair< bool, std::unique_ptr< Trk::Volume > > intersectApproximative(const Volume &volA, const Volume &volB)
Definition
VolumeIntersection.cxx:416
Trk::VolumeIntersection::intersectPgon
static Trk::PolygonCache intersectPgon(Trk::PolygonCache &, Trk::PolygonCache &)
Definition
VolumeIntersection.cxx:108
Trk::VolumeIntersection::polygonXY
static PolygonCache polygonXY(const Volume &inVol, int swap=0)
Definition
VolumeIntersection.cxx:238
Trk::VolumeIntersection::det
static double det(const std::pair< double, double > &a, const std::pair< double, double > &b, bool)
Definition
VolumeIntersection.cxx:405
Trk::Volume
Base class for all volumes inside the tracking realm, it defines the interface for inherited Volume c...
Definition
Volume.h:36
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition
GeoPrimitives.h:47
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition
FakeTrackBuilder.h:9
Trk::inside
@ inside
Definition
PropDirection.h:29
std
STL namespace.
Trk::EdgeCross::EdgeCross
EdgeCross(std::pair< int, int > ei, std::pair< double, double > ep)
Definition
VolumeIntersection.h:42
Trk::EdgeCross::edge_id
std::pair< int, int > edge_id
Definition
VolumeIntersection.h:39
Trk::EdgeCross::edge_pos
std::pair< double, double > edge_pos
Definition
VolumeIntersection.h:40
Trk::EdgeCross::used
bool used
Definition
VolumeIntersection.h:41
Trk::PolygonCache
Definition
VolumeIntersection.h:24
Trk::PolygonCache::center
Amg::Vector3D center
Definition
VolumeIntersection.h:28
Trk::PolygonCache::nVtx
int nVtx
Definition
VolumeIntersection.h:29
Trk::PolygonCache::xyVertices
std::vector< std::pair< double, double > > xyVertices
Definition
VolumeIntersection.h:31
Trk::PolygonCache::vertices
std::vector< Amg::Vector3D > vertices
Definition
VolumeIntersection.h:30
Trk::PolygonCache::maxZ
double maxZ
Definition
VolumeIntersection.h:27
Trk::PolygonCache::PolygonCache
PolygonCache()=default
Trk::PolygonCache::minZ
double minZ
Definition
VolumeIntersection.h:26
Trk::PolygonCache::edges
std::vector< std::pair< double, double > > edges
Definition
VolumeIntersection.h:33
Trk::PolygonCache::commonVertices
std::vector< bool > commonVertices
Definition
VolumeIntersection.h:32
Trk::PolygonCache::hZ
double hZ
Definition
VolumeIntersection.h:25
Generated on
for ATLAS Offline Software by
1.17.0