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
TrkrClusterMultiTrajectory.hpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file TrkrClusterMultiTrajectory.hpp
1
// This file is part of the Acts project.
2
//
3
// Copyright (C) 2019 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 <unordered_map>
12
#include <utility>
13
14
#include "
ActsExamples/EventData/TrkrClusterSourceLink.hpp
"
15
#include "
ActsExamples/Validation/ProtoTrackClassification.hpp
"
16
#include "
Acts/EventData/MultiTrajectory.hpp
"
17
#include "
Acts/EventData/TrackParameters.hpp
"
18
19
namespace
ActsExamples {
20
using
IndexedParams
= std::unordered_map<size_t, Acts::BoundTrackParameters>;
21
using
SourceLink
=
ActsExamples::TrkrClusterSourceLink
;
22
33
struct
TrkrClusterMultiTrajectory
{
34
public
:
37
TrkrClusterMultiTrajectory
() =
default
;
38
45
TrkrClusterMultiTrajectory
(
const
Acts::MultiTrajectory<SourceLink>
& multiTraj,
46
const
std::vector<size_t>& tTips,
47
const
IndexedParams
&
parameters
,
48
const
int
& vertexId)
49
:
m_multiTrajectory
(multiTraj),
50
m_trackTips
(tTips),
51
m_trackParameters
(parameters),
52
m_vertexId
(vertexId){}
53
57
TrkrClusterMultiTrajectory
(
const
TrkrClusterMultiTrajectory
& rhs)
58
:
m_multiTrajectory
(rhs.
m_multiTrajectory
),
59
m_trackTips
(rhs.
m_trackTips
),
60
m_trackParameters
(rhs.
m_trackParameters
),
61
m_vertexId
(rhs.
m_vertexId
){}
62
66
TrkrClusterMultiTrajectory
(
TrkrClusterMultiTrajectory
&& rhs)
67
:
m_multiTrajectory
(std::move(rhs.
m_multiTrajectory
)),
68
m_trackTips
(std::move(rhs.
m_trackTips
)),
69
m_trackParameters
(std::move(rhs.
m_trackParameters
)),
70
m_vertexId
(std::move(rhs.
m_vertexId
)){}
71
74
~TrkrClusterMultiTrajectory
() =
default
;
75
79
TrkrClusterMultiTrajectory
&
operator=
(
const
TrkrClusterMultiTrajectory
& rhs) {
80
m_multiTrajectory
= rhs.
m_multiTrajectory
;
81
m_trackTips
= rhs.
m_trackTips
;
82
m_trackParameters
= rhs.
m_trackParameters
;
83
m_vertexId
= rhs.
m_vertexId
;
84
return
*
this
;
85
}
86
90
TrkrClusterMultiTrajectory
&
operator=
(
TrkrClusterMultiTrajectory
&& rhs) {
91
m_multiTrajectory
= std::move(rhs.m_multiTrajectory);
92
m_trackTips
= std::move(rhs.m_trackTips);
93
m_trackParameters
= std::move(rhs.m_trackParameters);
94
m_vertexId
= std::move(rhs.m_vertexId);
95
return
*
this
;
96
}
97
103
bool
hasTrajectory
(
const
size_t
& entryIndex)
const
{
104
return
std::count(
m_trackTips
.begin(),
m_trackTips
.end(), entryIndex) > 0;
105
}
106
112
bool
hasTrackParameters
(
const
size_t
& entryIndex)
const
{
113
return
m_trackParameters
.count(entryIndex) > 0;
114
}
115
121
std::pair<std::vector<size_t>,
Acts::MultiTrajectory<SourceLink>
>
122
trajectory
()
const
{
123
return
std::make_pair(
m_trackTips
,
m_multiTrajectory
);
124
}
125
131
const
Acts::BoundTrackParameters
&
trackParameters
(
const
size_t
& entryIndex)
const
{
132
auto
it
=
m_trackParameters
.find(entryIndex);
133
if
(
it
!=
m_trackParameters
.end()) {
134
return
it
->second;
135
}
else
{
136
throw
std::runtime_error(
137
"No fitted track parameters for trajectory with entry index = "
+
138
std::to_string
(entryIndex));
139
}
140
}
141
142
private
:
143
// The multiTrajectory
144
Acts::MultiTrajectory<SourceLink>
m_multiTrajectory
;
145
146
// The entry indices of trajectories stored in multiTrajectory
147
std::vector<size_t>
m_trackTips
= {};
148
149
// The fitted parameters at the provided surface for individual trajectories
150
IndexedParams
m_trackParameters
= {};
151
152
unsigned
int
m_vertexId
= 9999;
153
};
154
155
}
// namespace ActsExamples
acts
blob
sPHENIX
Examples
Framework
include
ActsExamples
EventData
TrkrClusterMultiTrajectory.hpp
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:25
using
1.8.2 with
EIC GitHub integration