19 : FW::
IReader(), m_cfg(cfg), m_events(0), m_inputChain(nullptr) {
72 return {0
u, m_events};
77 ACTS_DEBUG(
"Trying to read recorded material from tracks.");
79 if (m_inputChain && context.
eventNumber < m_events) {
81 std::lock_guard<std::mutex> lock(m_read_mutex);
85 std::vector<Acts::RecordedMaterialTrack> mtrackCollection;
87 for (
size_t ib = 0; ib < m_cfg.batchSize; ++ib) {
89 m_inputChain->GetEntry(m_cfg.batchSize * context.
eventNumber + ib);
99 size_t msteps = m_step_length->size();
100 ACTS_VERBOSE(
"Reading " << msteps <<
" material steps.");
101 rmTrack.second.materialInteractions.reserve(msteps);
102 rmTrack.second.materialInX0 = 0.;
103 rmTrack.second.materialInL0 = 0.;
105 for (
size_t is = 0; is < msteps; ++is) {
106 double mX0 = (*m_step_X0)[is];
107 double mL0 = (*m_step_L0)[is];
108 double s = (*m_step_length)[is];
110 rmTrack.second.materialInX0 += s / mX0;
111 rmTrack.second.materialInL0 += s / mL0;
116 Acts::Vector3D((*m_step_x)[is], (*m_step_y)[is], (*m_step_z)[is]);
118 mX0, mL0, (*m_step_A)[is], (*m_step_Z)[is], (*m_step_rho)[is], s);
119 rmTrack.second.materialInteractions.push_back(std::move(mInteraction));
121 mtrackCollection.push_back(std::move(rmTrack));
125 context.
eventStore.
add(m_cfg.collection, std::move(mtrackCollection));