26 #include <TMathBase.h>
35 throw std::invalid_argument(
"Missing input filename");
38 throw std::invalid_argument(
"Missing tree name");
49 std::int32_t eventNumber = 0;
52 m_inputChain->SetBranchAddress(
"EventNumber", &eventNumber);
121 std::vector<long long> m_entryNumbers;
127 m_entryNumbers.data(),
false);
133 ACTS_DEBUG(
"Trying to read track parameters from ntuple.");
136 std::shared_ptr<Acts::PerigeeSurface>
surface =
137 Acts::Surface::makeShared<Acts::PerigeeSurface>(
pos);
141 return ProcessCode::ABORT;
144 std::lock_guard<std::mutex> lock(m_read_mutex);
147 m_inputChain->GetEntry(
entry);
149 <<
" stored as entry: " <<
entry);
151 const unsigned int nTracks = m_branches.track_d0.size();
152 const unsigned int nTruthVtx = m_branches.truthvertex_z.size();
153 const unsigned int nRecoVtx = m_branches.recovertex_z.size();
160 trackContainer.reserve(nTracks);
162 for (
unsigned int i = 0;
i < nTracks;
i++) {
177 m_branches.track_var_d0[
i];
179 m_branches.track_var_z0[
i];
181 m_branches.track_var_phi[
i];
183 m_branches.track_var_theta[
i];
185 m_branches.track_var_qOverP[
i];
188 m_branches.track_cov_d0z0[
i];
190 m_branches.track_cov_d0phi[
i];
192 m_branches.track_cov_d0theta[
i];
194 m_branches.track_cov_d0qOverP[
i];
196 m_branches.track_cov_z0phi[
i];
198 m_branches.track_cov_z0theta[
i];
200 m_branches.track_cov_z0qOverP[
i];
202 m_branches.track_cov_phitheta[
i];
204 m_branches.track_cov_phiqOverP[
i];
206 m_branches.track_cov_tehtaqOverP[
i];
209 m_branches.track_cov_d0z0[
i];
211 m_branches.track_cov_d0phi[
i];
213 m_branches.track_cov_d0theta[
i];
215 m_branches.track_cov_d0qOverP[
i];
217 m_branches.track_cov_z0phi[
i];
219 m_branches.track_cov_z0theta[
i];
221 m_branches.track_cov_z0qOverP[
i];
223 m_branches.track_cov_phitheta[
i];
225 m_branches.track_cov_phiqOverP[
i];
227 m_branches.track_cov_tehtaqOverP[
i];
232 trackContainer.push_back(tc);
235 std::vector<Acts::Vector4> truthVertexContainer;
236 for (
unsigned int i = 0;
i < nTruthVtx;
i++) {
237 Acts::Vector4 vtx(m_branches.truthvertex_x[
i], m_branches.truthvertex_y[
i],
238 m_branches.truthvertex_z[
i], m_branches.truthvertex_t[
i]);
239 truthVertexContainer.push_back(vtx);
241 std::vector<Acts::Vector4> recoVertexContainer;
242 for (
unsigned int i = 0;
i < nRecoVtx;
i++) {
243 Acts::Vector4 vtx(m_branches.recovertex_x[
i], m_branches.recovertex_y[
i],
244 m_branches.recovertex_z[
i], 0);
245 recoVertexContainer.push_back(vtx);
252 beamspotPos << m_branches.beamspot_x, m_branches.beamspot_y,
253 m_branches.beamspot_z;
254 beamspotCov << m_branches.beamspot_sigX * m_branches.beamspot_sigX, 0, 0, 0,
255 m_branches.beamspot_sigY * m_branches.beamspot_sigY, 0, 0, 0,
256 m_branches.beamspot_sigZ * m_branches.beamspot_sigZ;
261 m_outputTrackParameters(context,
std::move(trackContainer));
262 m_outputTruthVtxParameters(context,
std::move(truthVertexContainer));
263 m_outputRecoVtxParameters(context,
std::move(recoVertexContainer));
264 m_outputBeamspotConstraint(context,
std::move(beamspotConstraint));