20 : ActsExamples::
IReader(), m_cfg(cfg), m_events(0), m_inputChain(nullptr) {
75 std::pair<size_t, size_t>
77 return {0
u, m_events};
82 ACTS_DEBUG(
"Trying to read recorded material from tracks.");
84 if (m_inputChain && context.
eventNumber < m_events) {
86 std::lock_guard<std::mutex> lock(m_read_mutex);
90 std::vector<Acts::RecordedMaterialTrack> mtrackCollection;
92 for (
size_t ib = 0; ib < m_cfg.batchSize; ++ib) {
94 m_inputChain->GetEntry(m_cfg.batchSize * context.
eventNumber + ib);
104 size_t msteps = m_step_length->size();
105 ACTS_VERBOSE(
"Reading " << msteps <<
" material steps.");
106 rmTrack.second.materialInteractions.reserve(msteps);
107 rmTrack.second.materialInX0 = 0.;
108 rmTrack.second.materialInL0 = 0.;
110 for (
size_t is = 0; is < msteps; ++is) {
111 double mX0 = (*m_step_X0)[is];
112 double mL0 = (*m_step_L0)[is];
113 double s = (*m_step_length)[is];
115 rmTrack.second.materialInX0 += s / mX0;
116 rmTrack.second.materialInL0 += s / mL0;
121 Acts::Vector3D((*m_step_x)[is], (*m_step_y)[is], (*m_step_z)[is]);
123 (*m_step_dx)[is], (*m_step_dy)[is], (*m_step_dz)[is]);
126 (*m_step_Z)[is], (*m_step_rho)[is]),
128 rmTrack.second.materialInteractions.push_back(std::move(mInteraction));
130 mtrackCollection.push_back(std::move(rmTrack));
134 context.
eventStore.
add(m_cfg.collection, std::move(mtrackCollection));