Skip to content

Commit

Permalink
Make sure to also TrackerHits correctly from EDM4hep to LCIO
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadlener committed Jan 19, 2024
1 parent 75255da commit 073cbfa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,11 @@ namespace EDM4hep2LCIOConv {
if (const auto lcio_trh = k4EDM4hep2LcioConv::detail::mapLookupFrom(edm_tr_trh, lookup_pairs.trackerHits)) {
lcio_tr->addHit(lcio_trh.value());
}
else if (
const auto lcio_trh =
k4EDM4hep2LcioConv::detail::mapLookupFrom(edm_tr_trh, lookup_pairs.trackerHitPlanes)) {
lcio_tr->addHit(lcio_trh.value());
}
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions tests/src/EDM4hep2LCIOUtilities.cc
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ edm4hep::TrackCollection createTracks(
const int subdetectorhitnumbers,
const int num_track_states,
const edm4hep::TrackerHit3DCollection& trackerHits,
const edm4hep::TrackerHitPlaneCollection& trackerHitPlanes,
const std::vector<std::size_t>& link_trackerhit_idcs,
const std::vector<test_config::IdxPair>& track_link_tracks_idcs)
{
Expand All @@ -213,6 +214,7 @@ edm4hep::TrackCollection createTracks(

for (auto& idx : link_trackerhit_idcs) {
elem.addToTrackerHits(trackerHits[idx]);
elem.addToTrackerHits(trackerHitPlanes[idx]);
}

for (int j = 0; j < num_track_states; ++j) {
Expand Down Expand Up @@ -335,6 +337,7 @@ podio::Frame createExampleEvent()
test_config::nSubdetectorHitNumbers,
test_config::nTrackStates,
trackerHits,
trackerHitPlanes,
test_config::trackTrackerHitIdcs,
test_config::trackTrackIdcs),
"tracks");
Expand Down

0 comments on commit 073cbfa

Please sign in to comment.