ATLAS Offline Software
Loading...
Searching...
No Matches
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
17
18namespace Trk {
19class Volume;
20}
21
22namespace Trk {
23
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
37struct 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
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) ;
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
void swap(DataVector< T > &a, DataVector< T > &b)
See DataVector<T, BASE>::swap().
static Double_t a
A Simple Helper Class that collects methods for calculation of overlap of two geometrical objects.
static std::pair< bool, std::unique_ptr< Trk::Volume > > intersect(const Volume &volA, const Volume &volB)
static std::pair< bool, std::unique_ptr< Trk::Volume > > intersectApproximative(const Volume &volA, const Volume &volB)
static Trk::PolygonCache intersectPgon(Trk::PolygonCache &, Trk::PolygonCache &)
static PolygonCache polygonXY(const Volume &inVol, int swap=0)
static double det(const std::pair< double, double > &a, const std::pair< double, double > &b, bool)
Base class for all volumes inside the tracking realm, it defines the interface for inherited Volume c...
Definition Volume.h:36
Eigen::Matrix< double, 3, 1 > Vector3D
Ensure that the ATLAS eigen extensions are properly loaded.
STL namespace.
EdgeCross(std::pair< int, int > ei, std::pair< double, double > ep)
std::pair< int, int > edge_id
std::pair< double, double > edge_pos
std::vector< std::pair< double, double > > xyVertices
std::vector< Amg::Vector3D > vertices
PolygonCache()=default
std::vector< std::pair< double, double > > edges
std::vector< bool > commonVertices