EIC Software
Reference for
EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
SimIdentifier.hpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file SimIdentifier.hpp
1
// This file is part of the Acts project.
2
//
3
// Copyright (C) 2016-2018 CERN for the benefit of the Acts project
4
//
5
// This Source Code Form is subject to the terms of the Mozilla Public
6
// License, v. 2.0. If a copy of the MPL was not distributed with this
7
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
9
#pragma once
10
11
#include "
Acts/EventData/MeasurementHelpers.hpp
"
12
13
#include <cstddef>
14
#include <vector>
15
16
namespace
ActsExamples {
17
26
class
SimIdentifier
:
public
Acts::MinimalSourceLink
{
27
public
:
28
using
Value
= uint64_t;
29
using
Difference
= int64_t;
30
34
explicit
SimIdentifier
(
Value
value
) :
m_value
(value) {}
39
SimIdentifier
(
Value
value
, std::vector<std::size_t>
indices
)
40
:
m_value
(value),
m_indices
(std::move(indices)) {}
41
42
// Explicitely defaulted constructors and assignment operators
43
SimIdentifier
() =
default
;
44
SimIdentifier
(
const
SimIdentifier
&) =
default
;
45
SimIdentifier
(
SimIdentifier
&&) =
default
;
46
SimIdentifier
&
operator=
(
const
SimIdentifier
&) =
default
;
47
SimIdentifier
&
operator=
(
SimIdentifier
&&) =
default
;
48
50
SimIdentifier
&
operator=
(
Value
value
);
52
operator
Value
()
const
{
return
m_value
; }
53
55
Value
value
()
const
{
return
m_value
; }
57
const
std::vector<std::size_t>&
indices
()
const
{
return
m_indices
; }
58
60
void
addIndex
(std::size_t index) {
m_indices
.push_back(index); }
61
62
private
:
64
Value
m_value
= 0
u
;
66
std::vector<std::size_t>
m_indices
;
67
68
friend
constexpr
bool
operator<
(
const
SimIdentifier
& lhs,
69
const
SimIdentifier
& rhs) {
70
return
lhs.
m_value
< rhs.
m_value
;
71
}
72
friend
bool
operator==
(
const
SimIdentifier
& lhs,
const
SimIdentifier
& rhs) {
73
return
lhs.
m_value
== rhs.
m_value
;
74
}
75
};
76
77
}
// end of namespace ActsExamples
78
79
using
identifier_type
=
::ActsExamples::SimIdentifier::Value
;
80
using
identifier_diff
=
::ActsExamples::SimIdentifier::Difference
;
81
using
Identifier
=
::ActsExamples::SimIdentifier
;
acts
blob
sPHENIX
Examples
Framework
include
ActsExamples
EventData
SimIdentifier.hpp
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:25
using
1.8.2 with
EIC GitHub integration