ECCE @ EIC Software
Reference for
ECCE @ 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 <cstddef>
12
#include <vector>
13
14
#include "
Acts/EventData/MeasurementHelpers.hpp
"
15
16
namespace
FW {
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 FW
78
79
using
identifier_type
=
::FW::SimIdentifier::Value
;
80
using
identifier_diff
=
::FW::SimIdentifier::Difference
;
81
using
Identifier
=
::FW::SimIdentifier
;
acts
blob
master
Examples
Framework
include
ACTFW
EventData
SimIdentifier.hpp
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:23
using
1.8.2 with
ECCE GitHub integration