5 #include <Acts/EventData/Types.hpp>
13 "params",
"covParams",
"nMeasurements",
"nHoles",
"chi2f",
14 "ndf",
"nOutliers",
"nSharedHits",
"tipIndex",
"stemIndex",
15 "particleHypothesis",
"surfaceIndex"};
17 using namespace Acts::HashedStringLiteral;
19 std::set<Acts::HashedString>
result;
21 result.insert(Acts::hashStringDynamic(
s));
29 : m_trackBackend(link)
34 if (itrack >= m_surfaces.size())
35 throw std::out_of_range(
36 "TrackSummaryContainer index out of range when accessing reference "
38 return m_surfaces[itrack].get();
46 return m_trackBackend->size();
51 std::any component_impl(C& container, Acts::HashedString
key,
53 using namespace Acts::HashedStringLiteral;
55 case "nMeasurements"_hash:
56 return container.at(itrack)->nMeasurementsPtr();
58 return container.at(itrack)->nHolesPtr();
60 return container.at(itrack)->chi2fPtr();
62 return container.at(itrack)->ndfPtr();
63 case "nOutliers"_hash:
64 return container.at(itrack)->nOutliersPtr();
65 case "nSharedHits"_hash:
66 return container.at(itrack)->nSharedHitsPtr();
68 return container.at(itrack)->tipIndexPtr();
69 case "stemIndex"_hash:
70 return container.at(itrack)->stemIndexPtr();
80 std::any
result = ::component_impl(*m_trackBackend,
key, itrack);
84 for (
auto&
d : m_decorations) {
87 return d.getter(m_trackBackend->getStore(), itrack,
d.auxid);
90 throw std::runtime_error(
"TrackSummaryContainer no such component " +
96 return m_trackBackend->at(itrack)->paramsEigen();
101 return m_trackBackend->at(itrack)->covParamsEigen();
114 std::vector<Acts::HashedString>
result;
115 for (
const auto&
d: m_decorations) {
116 if (staticVariableHashes.count(
d.hash) == 1) {
125 for (
auto xAODSurfacePtr: *
src) {
126 m_surfaces.push_back(
decodeSurface(xAODSurfacePtr, geoContext));
138 m_mutableTrackBackend = std::make_unique<xAOD::TrackSummaryContainer>();
139 m_mutableTrackBackendAux = std::make_unique<xAOD::TrackSummaryAuxContainer>();
140 m_mutableTrackBackend->setStore(m_mutableTrackBackendAux.get());
147 m_mutableTrackBackend = std::move(
other.m_mutableTrackBackend);
148 m_mutableTrackBackendAux = std::move(
other.m_mutableTrackBackendAux);
149 m_mutableTrackBackend->setStore(m_mutableTrackBackendAux.get());
152 m_surfaces = std::move(
other.m_surfaces);
153 m_decorations = std::move(
other.m_decorations);
161 m_mutableTrackBackend = std::exchange(
other.m_mutableTrackBackend,
nullptr);
162 m_mutableTrackBackendAux = std::exchange(
other.m_mutableTrackBackendAux,
nullptr);
165 m_mutableTrackBackend->setStore(m_mutableTrackBackendAux.get());
168 m_surfaces = std::move(
other.m_surfaces);
169 m_decorations = std::move(
other.m_decorations);
177 other.m_surfaces.clear();
178 other.m_decorations.clear();
184 m_mutableTrackBackend->push_back(std::make_unique<xAOD::TrackSummary>());
185 m_mutableTrackBackend->back()->resize();
187 m_mutableTrackBackend->back()->setParticleHypothesis(
xAOD::pion);
188 m_surfaces.push_back(
nullptr);
189 return m_mutableTrackBackend->size() - 1;
194 if (itrack >= m_mutableTrackBackend->size()) {
195 throw std::out_of_range(
"removeTrack_impl");
197 m_mutableTrackBackend->erase(m_mutableTrackBackend->begin() + itrack);
203 const std::any& src_ptr) {
204 if ( staticVariableHashes.count(
key) == 1) {
return; }
205 for (
const auto&
d: m_decorations) {
206 if (
d.hash !=
key) {
continue; }
207 d.copier(m_mutableTrackBackendAux.get(), itrack,
d.auxid, src_ptr);
213 std::any
result = ::component_impl(*m_mutableTrackBackend,
key, itrack);
217 for (
auto&
d : m_decorations) {
219 return d.setter(m_mutableTrackBackendAux.get(), itrack,
d.auxid);
222 throw std::runtime_error(
"TrackSummaryContainer no such component " +
228 return m_mutableTrackBackend->at(itrack)->paramsEigen();
233 return m_mutableTrackBackend->at(itrack)->covParamsEigen();
238 for (
auto&
d :
other.m_decorations) {
239 m_decorations.push_back(
d);
245 for (
auto&
d :
other.m_decorations) {
246 m_decorations.push_back(
d);
251 m_mutableTrackBackend->reserve(
size);
255 m_mutableTrackBackend->clear();
261 m_surfaces[itrack] = surface;
265 dest->resize(m_surfaces.size());
266 size_t destIndex = 0;
270 if ( m_surfaces[
index] ==
nullptr or m_surfaces[
index]->geometryId().
value() != 0 ) {
271 m_mutableTrackBackend->at(
index)->setSurfaceIndex(Acts::kTrackIndexInvalid);
273 m_mutableTrackBackend->at(
index)->setSurfaceIndex(destIndex);
278 dest->resize(destIndex);