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
SimMultiTrajectory.hpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file SimMultiTrajectory.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 "
Acts/EventData/MultiTrajectory.hpp
"
12
#include "
Acts/EventData/TrackParameters.hpp
"
13
#include "
ActsExamples/EventData/SimSourceLink.hpp
"
14
#include "
ActsExamples/Validation/ProtoTrackClassification.hpp
"
15
16
#include <unordered_map>
17
#include <utility>
18
19
namespace
ActsExamples {
20
using
IndexedParams
= std::unordered_map<size_t, Acts::BoundTrackParameters>;
21
32
struct
SimMultiTrajectory
{
33
public
:
36
SimMultiTrajectory
() =
default
;
37
44
SimMultiTrajectory
(
const
Acts::MultiTrajectory<SimSourceLink>
& multiTraj,
45
const
std::vector<size_t>& tTips,
46
const
IndexedParams
&
parameters
)
47
:
m_multiTrajectory
(multiTraj),
48
m_trackTips
(tTips),
49
m_trackParameters
(parameters) {}
50
54
SimMultiTrajectory
(
const
SimMultiTrajectory
& rhs)
55
:
m_multiTrajectory
(rhs.
m_multiTrajectory
),
56
m_trackTips
(rhs.
m_trackTips
),
57
m_trackParameters
(rhs.
m_trackParameters
) {}
58
62
SimMultiTrajectory
(
SimMultiTrajectory
&& rhs)
63
:
m_multiTrajectory
(std::move(rhs.
m_multiTrajectory
)),
64
m_trackTips
(std::move(rhs.
m_trackTips
)),
65
m_trackParameters
(std::move(rhs.
m_trackParameters
)) {}
66
69
~SimMultiTrajectory
() =
default
;
70
74
SimMultiTrajectory
&
operator=
(
const
SimMultiTrajectory
& rhs) {
75
m_multiTrajectory
= rhs.
m_multiTrajectory
;
76
m_trackTips
= rhs.
m_trackTips
;
77
m_trackParameters
= rhs.
m_trackParameters
;
78
return
*
this
;
79
}
80
84
SimMultiTrajectory
&
operator=
(
SimMultiTrajectory
&& rhs) {
85
m_multiTrajectory
= std::move(rhs.m_multiTrajectory);
86
m_trackTips
= std::move(rhs.m_trackTips);
87
m_trackParameters
= std::move(rhs.m_trackParameters);
88
return
*
this
;
89
}
90
96
bool
hasTrajectory
(
const
size_t
& entryIndex)
const
{
97
return
std::count(
m_trackTips
.begin(),
m_trackTips
.end(), entryIndex) > 0;
98
}
99
105
bool
hasTrackParameters
(
const
size_t
& entryIndex)
const
{
106
return
m_trackParameters
.count(entryIndex) > 0;
107
}
108
114
std::pair<std::vector<size_t>,
Acts::MultiTrajectory<SimSourceLink>
>
115
trajectory
()
const
{
116
return
std::make_pair(
m_trackTips
,
m_multiTrajectory
);
117
}
118
124
const
Acts::BoundTrackParameters
&
trackParameters
(
125
const
size_t
& entryIndex)
const
{
126
auto
it
=
m_trackParameters
.find(entryIndex);
127
if
(
it
!=
m_trackParameters
.end()) {
128
return
it
->second;
129
}
else
{
130
throw
std::runtime_error(
131
"No fitted track parameters for trajectory with entry index = "
+
132
std::to_string
(entryIndex));
133
}
134
}
135
141
std::vector<ParticleHitCount>
identifyMajorityParticle
(
142
const
size_t
& entryIndex)
const
;
143
144
private
:
145
// The multiTrajectory
146
Acts::MultiTrajectory<SimSourceLink>
m_multiTrajectory
;
147
148
// The entry indices of trajectories stored in multiTrajectory
149
std::vector<size_t>
m_trackTips
= {};
150
151
// The fitted parameters at the provided surface for individual trajectories
152
IndexedParams
m_trackParameters
= {};
153
};
154
155
}
// namespace ActsExamples
acts
blob
sPHENIX
Examples
Framework
include
ActsExamples
EventData
SimMultiTrajectory.hpp
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:25
using
1.8.2 with
EIC GitHub integration