ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
TrkDetDescr
TrkGeometry
TrkGeometry
IApproachDescriptor.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
// IApproachDescriptor.h, (c) ATLAS Detector software
8
9
#ifndef TRKGEOMETRY_IAPPROACHDESCRIPTOR_H
10
#define TRKGEOMETRY_IAPPROACHDESCRIPTOR_H
11
12
// Trk
13
#include <memory>
14
15
#include "
GeoPrimitives/GeoPrimitives.h
"
16
#include "
TrkDetDescrUtils/BinnedArray.h
"
17
#include "
TrkSurfaces/Surface.h
"
18
namespace
Trk
{
19
24
25
class
ApproachSurfaces
:
public
std::vector<Surface*> {
26
public
:
27
// Default constructor
28
ApproachSurfaces
() :
std
::
vector
<
Surface
*>() {}
29
30
// Desctructur with cleanup
31
~ApproachSurfaces
() {
32
for
(
auto
& sf : (*
this
)) {
33
delete
sf;
34
}
35
}
36
};
37
44
45
class
IApproachDescriptor
{
46
public
:
47
// Default constructor
48
IApproachDescriptor
(std::unique_ptr<ApproachSurfaces> aSurfaces,
49
bool
rebuild
=
true
)
50
:
m_approachSurfaces
(
std
::move(aSurfaces)),
51
m_approachSurfaceArraySurface
(nullptr),
52
m_approachSurfaceArray
(nullptr),
53
m_rebuild
(
rebuild
) {}
54
55
// Default constructor
56
IApproachDescriptor
(
57
std::unique_ptr<
BinnedArray<const ApproachSurfaces>
> aSurfaceArray,
58
std::unique_ptr<Surface> aSurfaceArraySurface =
nullptr
)
59
:
m_approachSurfaces
(nullptr),
60
m_approachSurfaceArraySurface
(
std
::move(aSurfaceArraySurface)),
61
m_approachSurfaceArray
(
std
::move(aSurfaceArray)),
62
m_rebuild
(false) {}
63
64
virtual
~IApproachDescriptor
() =
default
;
65
66
// register Layer
67
void
registerLayer
(
const
Layer
& lay);
68
69
// Telling you if it needs to be rebuilt
70
bool
rebuild
()
const
;
71
78
virtual
const
ApproachSurfaces
*
approachSurfaces
(
79
const
Amg::Vector3D
& pos,
const
Amg::Vector3D
& dir)
const
= 0;
80
81
private
:
82
// register the Layer
83
void
registerLayerToSurfaces
(
const
Layer
& lay,
84
const
ApproachSurfaces
& aSurfaces);
85
86
IApproachDescriptor
(
const
IApproachDescriptor
&) =
delete
;
87
IApproachDescriptor
&
operator=
(
const
IApproachDescriptor
&) =
delete
;
88
89
protected
:
90
std::unique_ptr<ApproachSurfaces>
m_approachSurfaces
;
91
std::unique_ptr<Surface>
m_approachSurfaceArraySurface
;
92
std::unique_ptr<BinnedArray<const ApproachSurfaces>>
m_approachSurfaceArray
;
93
bool
m_rebuild
;
94
};
95
96
inline
bool
IApproachDescriptor::rebuild
()
const
{
return
m_rebuild
; }
97
98
inline
void
IApproachDescriptor::registerLayer
(
const
Layer
& lay) {
99
if
(
m_approachSurfaces
)
registerLayerToSurfaces
(lay, *
m_approachSurfaces
);
100
if
(
m_approachSurfaceArraySurface
) {
101
m_approachSurfaceArraySurface
->associateLayer(lay);
102
m_approachSurfaceArraySurface
->setOwner(
Trk::TGOwn
);
103
}
104
if
(
m_approachSurfaceArray
) {
105
std::span<ApproachSurfaces const * const> aSurfaceObjects =
106
m_approachSurfaceArray
->arrayObjects();
107
for
(
auto
& aSurfaces : aSurfaceObjects) {
108
registerLayerToSurfaces
(lay, *aSurfaces);
109
}
110
}
111
}
112
113
inline
void
IApproachDescriptor::registerLayerToSurfaces
(
114
const
Layer
& lay,
const
ApproachSurfaces
& aSurfaces) {
115
for
(
Trk::Surface
* aSurface : aSurfaces) {
116
aSurface->associateLayer(lay);
117
aSurface->setOwner(
Trk::TGOwn
);
118
}
119
}
120
}
// namespace Trk
121
122
#endif
// TRKGEOMETRY_IAPPROACHDESCRIPTOR_H
123
BinnedArray.h
GeoPrimitives.h
Surface.h
Trk::ApproachSurfaces
just implement the delete on the objects
Definition
IApproachDescriptor.h:25
Trk::ApproachSurfaces::~ApproachSurfaces
~ApproachSurfaces()
Definition
IApproachDescriptor.h:31
Trk::ApproachSurfaces::ApproachSurfaces
ApproachSurfaces()
Definition
IApproachDescriptor.h:28
Trk::BinnedArray
Binned Array for avoiding map searches/.
Definition
BinnedArray.h:36
Trk::IApproachDescriptor::m_approachSurfaces
std::unique_ptr< ApproachSurfaces > m_approachSurfaces
Definition
IApproachDescriptor.h:90
Trk::IApproachDescriptor::registerLayerToSurfaces
void registerLayerToSurfaces(const Layer &lay, const ApproachSurfaces &aSurfaces)
Definition
IApproachDescriptor.h:113
Trk::IApproachDescriptor::rebuild
bool rebuild() const
Definition
IApproachDescriptor.h:96
Trk::IApproachDescriptor::IApproachDescriptor
IApproachDescriptor(std::unique_ptr< BinnedArray< const ApproachSurfaces > > aSurfaceArray, std::unique_ptr< Surface > aSurfaceArraySurface=nullptr)
Definition
IApproachDescriptor.h:56
Trk::IApproachDescriptor::IApproachDescriptor
IApproachDescriptor(const IApproachDescriptor &)=delete
Trk::IApproachDescriptor::operator=
IApproachDescriptor & operator=(const IApproachDescriptor &)=delete
Trk::IApproachDescriptor::IApproachDescriptor
IApproachDescriptor(std::unique_ptr< ApproachSurfaces > aSurfaces, bool rebuild=true)
Definition
IApproachDescriptor.h:48
Trk::IApproachDescriptor::registerLayer
void registerLayer(const Layer &lay)
Definition
IApproachDescriptor.h:98
Trk::IApproachDescriptor::m_rebuild
bool m_rebuild
Definition
IApproachDescriptor.h:93
Trk::IApproachDescriptor::~IApproachDescriptor
virtual ~IApproachDescriptor()=default
Trk::IApproachDescriptor::m_approachSurfaceArray
std::unique_ptr< BinnedArray< const ApproachSurfaces > > m_approachSurfaceArray
Definition
IApproachDescriptor.h:92
Trk::IApproachDescriptor::m_approachSurfaceArraySurface
std::unique_ptr< Surface > m_approachSurfaceArraySurface
Definition
IApproachDescriptor.h:91
Trk::IApproachDescriptor::approachSurfaces
virtual const ApproachSurfaces * approachSurfaces(const Amg::Vector3D &pos, const Amg::Vector3D &dir) const =0
get the compatible surfaces
Trk::Layer
Base Class for a Detector Layer in the Tracking realm.
Definition
Layer.h:72
Trk::Surface
Abstract Base Class for tracking surfaces.
Definition
Surface.h:79
vector
Definition
MultiHisto.h:13
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::TGOwn
@ TGOwn
Definition
Surface.h:58
std
STL namespace.
Generated on
for ATLAS Offline Software by
1.17.0