Analysis Software
Documentation for
sPHENIX
simulation software
Home page
Related Pages
Modules
Namespaces
Classes
Files
Examples
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
ActsSourceLink.h
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file ActsSourceLink.h
1
#ifndef TRACKBASE_ACTSSOURCELINK_H
2
#define TRACKBASE_ACTSSOURCELINK_H
3
4
#include <
Acts/EventData/SourceLink.hpp
>
5
#include <
Acts/Geometry/TrackingGeometry.hpp
>
6
#include <
Acts/Surfaces/Surface.hpp
>
7
8
#include "
TrkrDefs.h
"
9
10
#include <cassert>
11
#include <iostream>
12
17
class
ActsSourceLink
final
18
{
19
public
:
20
using
Index
= uint8_t;
21
23
constexpr
ActsSourceLink
(
Acts::GeometryIdentifier
gid
,
Index
idx
)
24
:
m_geometryId
(gid)
25
,
m_index
(idx)
26
,
m_cluskey
(0)
27
{
28
}
29
constexpr
ActsSourceLink
(
Acts::GeometryIdentifier
gid
,
Index
idx
,
TrkrDefs::cluskey
cluskey
)
30
:
m_geometryId
(gid)
31
,
m_index
(idx)
32
,
m_cluskey
(cluskey)
33
{
34
}
35
36
// Construct an invalid source link. Must be default constructible to
38
ActsSourceLink
()
39
:
m_geometryId
{
Acts::GeometryIdentifier
{}}
40
,
m_index
(UINT8_MAX)
41
,
m_cluskey
(UINT64_MAX)
42
{
43
}
44
45
ActsSourceLink
(
const
ActsSourceLink
&) =
default
;
46
ActsSourceLink
(
ActsSourceLink
&&) =
default
;
47
ActsSourceLink
&
operator=
(
const
ActsSourceLink
&) =
default
;
48
ActsSourceLink
&
operator=
(
ActsSourceLink
&&) =
default
;
49
51
constexpr
Index
index
()
const
{
return
m_index
; }
52
constexpr
TrkrDefs::cluskey
cluskey
()
const
{
return
m_cluskey
; }
53
constexpr
Acts::GeometryIdentifier
geometryId
()
const
{
return
m_geometryId
; }
54
55
struct
SurfaceAccessor
56
{
57
const
Acts::TrackingGeometry
&
trackingGeometry
;
58
const
Acts::Surface
*
operator()
(
const
Acts::SourceLink
& sourceLink)
const
59
{
60
const
auto
& sl = sourceLink.
get
<
ActsSourceLink
>();
61
return
trackingGeometry
.
findSurface
(sl.geometryId());
62
}
63
};
64
65
private
:
66
Acts::GeometryIdentifier
m_geometryId
;
67
Index
m_index
;
68
TrkrDefs::cluskey
m_cluskey
;
69
70
friend
constexpr
bool
operator==
(
const
ActsSourceLink
&
lhs
,
71
const
ActsSourceLink
&
rhs
)
72
{
73
return
(lhs.
geometryId
() == rhs.
geometryId
()) and
74
(lhs.
m_index
== rhs.
m_index
) and
75
(lhs.
m_cluskey
== rhs.
m_cluskey
);
76
}
77
friend
constexpr
bool
operator!=
(
const
ActsSourceLink
&
lhs
,
78
const
ActsSourceLink
&
rhs
)
79
{
80
return
not(lhs == rhs);
81
}
82
};
83
84
#endif
coresoftware
blob
master
offline
packages
trackbase
ActsSourceLink.h
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:08
using
1.8.2 with
sPHENIX GitHub integration