From 5618d5b00df0d1fb6344389d183aae128444574c Mon Sep 17 00:00:00 2001 From: tmadlener Date: Tue, 28 Nov 2023 10:53:44 +0100 Subject: [PATCH] Make sure to also TrackerHits correctly from EDM4hep to LCIO --- .../include/k4EDM4hep2LcioConv/k4EDM4hep2LcioConv.ipp | 5 +++++ tests/src/EDM4hep2LCIOUtilities.cc | 3 +++ 2 files changed, 8 insertions(+) diff --git a/k4EDM4hep2LcioConv/include/k4EDM4hep2LcioConv/k4EDM4hep2LcioConv.ipp b/k4EDM4hep2LcioConv/include/k4EDM4hep2LcioConv/k4EDM4hep2LcioConv.ipp index a24598a6..0a6e3602 100644 --- a/k4EDM4hep2LcioConv/include/k4EDM4hep2LcioConv/k4EDM4hep2LcioConv.ipp +++ b/k4EDM4hep2LcioConv/include/k4EDM4hep2LcioConv/k4EDM4hep2LcioConv.ipp @@ -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()); + } } } } diff --git a/tests/src/EDM4hep2LCIOUtilities.cc b/tests/src/EDM4hep2LCIOUtilities.cc index e912e1ac..378fbd98 100644 --- a/tests/src/EDM4hep2LCIOUtilities.cc +++ b/tests/src/EDM4hep2LCIOUtilities.cc @@ -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& link_trackerhit_idcs, const std::vector& track_link_tracks_idcs) { @@ -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) { @@ -335,6 +337,7 @@ podio::Frame createExampleEvent() test_config::nSubdetectorHitNumbers, test_config::nTrackStates, trackerHits, + trackerHitPlanes, test_config::trackTrackerHitIdcs, test_config::trackTrackIdcs), "tracks");