From ec478967554cc4746637052fa3f8022191e998f5 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Wed, 20 Nov 2024 18:06:33 -0600 Subject: [PATCH 1/3] feat: support EDM4hep v0.99, with TrackerHit as interface type --- .../fardetectors/FarDetectorLinearTracking.cc | 10 +++++++++- .../fardetectors/FarDetectorLinearTracking.h | 8 ++++++++ .../fardetectors/FarDetectorTrackerCluster.h | 12 ++++++++++-- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/src/algorithms/fardetectors/FarDetectorLinearTracking.cc b/src/algorithms/fardetectors/FarDetectorLinearTracking.cc index 5d93d42bce..4e1af93635 100644 --- a/src/algorithms/fardetectors/FarDetectorLinearTracking.cc +++ b/src/algorithms/fardetectors/FarDetectorLinearTracking.cc @@ -6,7 +6,15 @@ #include #include #include +#include +#if EDM4HEP_BUILD_VERSION < EDM4HEP_VERSION(0, 99, 0) #include +namespace edm4hep { + using TrackerHit3DCollection = TrackerHitCollection; +} +#else +#include +#endif #include #include #include @@ -71,7 +79,7 @@ namespace eicrecon { void FarDetectorLinearTracking::buildMatrixRecursive(int level, Eigen::MatrixXd* hitMatrix, - const std::vector>& hits, + const std::vector>& hits, gsl::not_null outputTracks ) const { // Iterate over hits in this layer diff --git a/src/algorithms/fardetectors/FarDetectorLinearTracking.h b/src/algorithms/fardetectors/FarDetectorLinearTracking.h index d9caea23f5..86ed297130 100644 --- a/src/algorithms/fardetectors/FarDetectorLinearTracking.h +++ b/src/algorithms/fardetectors/FarDetectorLinearTracking.h @@ -7,7 +7,15 @@ #include #include #include +#include +#if EDM4HEP_BUILD_VERSION < EDM4HEP_VERSION(0, 99, 0) #include +namespace edm4hep { + using TrackerHit3DCollection = TrackerHitCollection; +} +#else +#include +#endif #include #include #include diff --git a/src/algorithms/fardetectors/FarDetectorTrackerCluster.h b/src/algorithms/fardetectors/FarDetectorTrackerCluster.h index 6ac60e5067..07e307f657 100644 --- a/src/algorithms/fardetectors/FarDetectorTrackerCluster.h +++ b/src/algorithms/fardetectors/FarDetectorTrackerCluster.h @@ -9,7 +9,15 @@ #include #include #include +#include +#if EDM4HEP_BUILD_VERSION < EDM4HEP_VERSION(0, 99, 0) #include +namespace edm4hep { + using TrackerHit3DCollection = TrackerHitCollection; +} +#else +#include +#endif #include #include #include @@ -32,7 +40,7 @@ namespace eicrecon { using FarDetectorTrackerClusterAlgorithm = algorithms::Algorithm>, - algorithms::Output>>; + algorithms::Output>>; class FarDetectorTrackerCluster : public FarDetectorTrackerClusterAlgorithm, public WithPodConfig { @@ -55,7 +63,7 @@ class FarDetectorTrackerCluster : public FarDetectorTrackerClusterAlgorithm, std::vector ClusterHits(const edm4eic::RawTrackerHitCollection&) const; /** Convert clusters to TrackerHits **/ - void ConvertClusters(const std::vector&, edm4hep::TrackerHitCollection&) const; + void ConvertClusters(const std::vector&, edm4hep::TrackerHit3DCollection&) const; private: const dd4hep::Detector* m_detector{nullptr}; From 9ea6e3a6ac79c4a9f0f686b80f2baaffee1b0de2 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Wed, 20 Nov 2024 18:44:48 -0600 Subject: [PATCH 2/3] fix: one more conversion to edm4hep::TrackerHit3D --- src/algorithms/fardetectors/FarDetectorTrackerCluster.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/algorithms/fardetectors/FarDetectorTrackerCluster.cc b/src/algorithms/fardetectors/FarDetectorTrackerCluster.cc index b12a61b738..b129121ddd 100644 --- a/src/algorithms/fardetectors/FarDetectorTrackerCluster.cc +++ b/src/algorithms/fardetectors/FarDetectorTrackerCluster.cc @@ -174,7 +174,7 @@ FarDetectorTrackerCluster::ClusterHits(const edm4eic::RawTrackerHitCollection& i // Convert to global coordinates and create TrackerHits void FarDetectorTrackerCluster::ConvertClusters( const std::vector& clusters, - edm4hep::TrackerHitCollection& outputClusters) const { + edm4hep::TrackerHit3DCollection& outputClusters) const { // Get context of first hit const dd4hep::VolumeManagerContext* context = m_cellid_converter->findContext(clusters[0].cellID); From 1dbc737a0c64cc15e3c6a0039afce7418928b1da Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Wed, 20 Nov 2024 18:45:32 -0600 Subject: [PATCH 3/3] fix: one more conversion to edm4hep::TrackerHit3D --- src/algorithms/fardetectors/FarDetectorLinearTracking.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/algorithms/fardetectors/FarDetectorLinearTracking.h b/src/algorithms/fardetectors/FarDetectorLinearTracking.h index 86ed297130..0fadfbda30 100644 --- a/src/algorithms/fardetectors/FarDetectorLinearTracking.h +++ b/src/algorithms/fardetectors/FarDetectorLinearTracking.h @@ -26,7 +26,7 @@ namespace edm4hep { namespace eicrecon { using FarDetectorLinearTrackingAlgorithm = - algorithms::Algorithm>, + algorithms::Algorithm>, algorithms::Output>; class FarDetectorLinearTracking : public FarDetectorLinearTrackingAlgorithm, @@ -52,7 +52,7 @@ class FarDetectorLinearTracking : public FarDetectorLinearTrackingAlgorithm, void buildMatrixRecursive(int level, Eigen::MatrixXd* hitMatrix, - const std::vector>& hits, + const std::vector>& hits, gsl::not_null outputTracks) const; void checkHitCombination(Eigen::MatrixXd* hitMatrix,