Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support EDM4hep v0.99, with TrackerHit as interface type #1676

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/algorithms/fardetectors/FarDetectorLinearTracking.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@
#include <edm4eic/TrackPoint.h>
#include <edm4eic/TrackSegmentCollection.h>
#include <edm4eic/vector_utils.h>
#include <edm4hep/EDM4hepVersion.h>
#if EDM4HEP_BUILD_VERSION < EDM4HEP_VERSION(0, 99, 0)
veprbl marked this conversation as resolved.
Show resolved Hide resolved
#include <edm4hep/TrackerHitCollection.h>
namespace edm4hep {
using TrackerHit3DCollection = TrackerHitCollection;
}
#else
#include <edm4hep/TrackerHit3DCollection.h>
#endif
#include <edm4hep/Vector3d.h>
#include <edm4hep/Vector3f.h>
#include <edm4hep/utils/vector_utils.h>
Expand Down Expand Up @@ -71,7 +79,7 @@ namespace eicrecon {

void FarDetectorLinearTracking::buildMatrixRecursive(int level,
Eigen::MatrixXd* hitMatrix,
const std::vector<gsl::not_null<const edm4hep::TrackerHitCollection*>>& hits,
const std::vector<gsl::not_null<const edm4hep::TrackerHit3DCollection*>>& hits,
gsl::not_null<edm4eic::TrackSegmentCollection*> outputTracks ) const {

// Iterate over hits in this layer
Expand Down
8 changes: 8 additions & 0 deletions src/algorithms/fardetectors/FarDetectorLinearTracking.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@
#include <algorithms/algorithm.h>
#include <algorithms/interfaces/WithPodConfig.h>
#include <edm4eic/TrackSegmentCollection.h>
#include <edm4hep/EDM4hepVersion.h>
#if EDM4HEP_BUILD_VERSION < EDM4HEP_VERSION(0, 99, 0)
#include <edm4hep/TrackerHitCollection.h>
namespace edm4hep {
using TrackerHit3DCollection = TrackerHitCollection;
}
#else
#include <edm4hep/TrackerHit3DCollection.h>
#endif
#include <gsl/pointers>
#include <string>
#include <string_view>
Expand Down
12 changes: 10 additions & 2 deletions src/algorithms/fardetectors/FarDetectorTrackerCluster.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@
#include <Parsers/Primitives.h>
#include <algorithms/algorithm.h>
#include <edm4eic/RawTrackerHitCollection.h>
#include <edm4hep/EDM4hepVersion.h>
#if EDM4HEP_BUILD_VERSION < EDM4HEP_VERSION(0, 99, 0)
#include <edm4hep/TrackerHitCollection.h>
namespace edm4hep {
using TrackerHit3DCollection = TrackerHitCollection;
}
#else
#include <edm4hep/TrackerHit3DCollection.h>
#endif
#include <podio/ObjectID.h>
#include <string>
#include <string_view>
Expand All @@ -32,7 +40,7 @@ namespace eicrecon {

using FarDetectorTrackerClusterAlgorithm =
algorithms::Algorithm<algorithms::Input<std::vector<edm4eic::RawTrackerHitCollection>>,
algorithms::Output<std::vector<edm4hep::TrackerHitCollection>>>;
algorithms::Output<std::vector<edm4hep::TrackerHit3DCollection>>>;

class FarDetectorTrackerCluster : public FarDetectorTrackerClusterAlgorithm,
public WithPodConfig<FarDetectorTrackerClusterConfig> {
Expand All @@ -55,7 +63,7 @@ class FarDetectorTrackerCluster : public FarDetectorTrackerClusterAlgorithm,
std::vector<FDTrackerCluster> ClusterHits(const edm4eic::RawTrackerHitCollection&) const;

/** Convert clusters to TrackerHits **/
void ConvertClusters(const std::vector<FDTrackerCluster>&, edm4hep::TrackerHitCollection&) const;
void ConvertClusters(const std::vector<FDTrackerCluster>&, edm4hep::TrackerHit3DCollection&) const;

private:
const dd4hep::Detector* m_detector{nullptr};
Expand Down
Loading