21 : m_cfg(std::move(cfg)),
23 m_inputChain(nullptr),
68 return "RootVertexAndTracksReader";
73 return {0
u, m_events};
78 ACTS_DEBUG(
"Trying to read vertex and tracks.");
80 if (m_inputChain && context.
eventNumber < m_events) {
82 std::lock_guard<std::mutex> lock(m_read_mutex);
85 std::vector<FW::VertexAndTracks> mCollection;
87 for (
size_t ib = 0; ib < m_cfg.batchSize; ++ib) {
89 m_inputChain->GetEntry(m_cfg.batchSize * context.
eventNumber + ib);
94 for (
size_t idx = 0;
idx < m_ptrVx->size(); ++
idx) {
101 std::vector<Acts::BoundParameters> tracks;
103 for (
size_t trkId = 0; trkId < m_ptrD0->size(); ++trkId) {
105 if (static_cast<size_t>((*m_ptrVtxID)[trkId]) ==
idx) {
108 newTrackParams << (*m_ptrD0)[trkId], (*m_ptrZ0)[trkId],
109 (*m_ptrPhi)[trkId], (*m_ptrTheta)[trkId], (*m_ptrQP)[trkId],
113 std::vector<double> trkCovVec = (*m_ptrTrkCov)[trkId];
117 Eigen::Map<Acts::BoundSymMatrix>(trkCovVec.data());
120 std::shared_ptr<Acts::PerigeeSurface> perigeeSurface =
121 Acts::Surface::makeShared<Acts::PerigeeSurface>(
125 newTrackParams, perigeeSurface));
129 vtxAndTracks.
tracks = tracks;
131 mCollection.push_back(std::move(vtxAndTracks));
136 context.
eventStore.
add(m_cfg.outputCollection, std::move(mCollection));