63 const auto& fdst_particles =
64 frame_.get<edm4hep::ReconstructedParticleCollection>(
"fDST_MAIN_Particles");
65 const auto& fdst_tracks =
66 frame_.get<edm4hep::TrackCollection>(
"fDST_TRAC_Tracks");
67 const std::size_t n_fdst_tracks = fdst_tracks.size();
69 const std::string dedx_algo = dedxAlgorithm(
frame_);
70 const std::string dedx_name =
sdstName(dedx_algo,
"Dedx");
72 edm4hep::ParticleIDCollection haid_out, muid_out, elid_out, dedx_out;
74 frame_.get<edm4hep::ParticleIDCollection>(
sdstName(
"HAID",
"HadronID")),
75 haid_out, fdst_particles);
77 frame_.get<edm4hep::ParticleIDCollection>(
sdstName(
"MUID",
"MuonID")),
78 muid_out, fdst_particles);
80 frame_.get<edm4hep::ParticleIDCollection>(
sdstName(
"ELID",
"ElectronID")),
81 elid_out, fdst_particles);
83 frame_.get<edm4hep::ParticleIDCollection>(dedx_name),
84 dedx_out, fdst_particles);
87 edm4hep::RecDqdxCollection dqdx_out;
88 const auto& sdst_dqdx =
89 frame_.get<edm4hep::RecDqdxCollection>(dedx_name +
"RecDqdx");
90 for (
const auto& sq : sdst_dqdx) {
91 auto dq = dqdx_out.create();
92 dq.setDQdx(sq.getDQdx());
93 const auto& src_trk = sq.getTrack();
94 const auto tidx = src_trk.getObjectID().index;
95 if (tidx >= 0 &&
static_cast<std::size_t
>(tidx) < n_fdst_tracks) {
96 dq.setTrack(fdst_tracks[tidx]);