From a1dcfc130bf038310ef8b7e784b5857d8c253027 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Mon, 10 Feb 2025 21:57:14 -0600 Subject: [PATCH] refactor: Integrate source link container into measurements container in Examples (#3732) @37.1.0: (fixup) --- JugTrack/src/components/SingleTrackSourceLinker.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/JugTrack/src/components/SingleTrackSourceLinker.cpp b/JugTrack/src/components/SingleTrackSourceLinker.cpp index 7327b86..ad3e492 100644 --- a/JugTrack/src/components/SingleTrackSourceLinker.cpp +++ b/JugTrack/src/components/SingleTrackSourceLinker.cpp @@ -48,7 +48,9 @@ class SingleTrackSourceLinker : public GaudiAlgorithm { private: DataHandle m_inputHitCollection{"inputHitCollection", Gaudi::DataHandle::Reader, this}; DataHandle> m_sourceLinkStorage{"sourceLinkStorage", Gaudi::DataHandle::Writer, this}; +#if Acts_VERSION_MAJOR < 37 || (Acts_VERSION_MAJOR == 37 && Acts_VERSION_MINOR == 0) DataHandle m_outputSourceLinks{"outputSourceLinks", Gaudi::DataHandle::Writer, this}; +#endif DataHandle m_outputMeasurements{"outputMeasurements", Gaudi::DataHandle::Writer, this}; DataHandle m_outputProtoTracks{"outputProtoTracks", Gaudi::DataHandle::Writer, this}; /// Pointer to the geometry service @@ -60,7 +62,9 @@ class SingleTrackSourceLinker : public GaudiAlgorithm { SingleTrackSourceLinker(const std::string& name, ISvcLocator* svcLoc) : GaudiAlgorithm(name, svcLoc) { declareProperty("inputHitCollection", m_inputHitCollection, ""); declareProperty("sourceLinkStorage", m_sourceLinkStorage, ""); +#if Acts_VERSION_MAJOR < 37 || (Acts_VERSION_MAJOR == 37 && Acts_VERSION_MINOR == 0) declareProperty("outputSourceLinks", m_outputSourceLinks, ""); +#endif declareProperty("outputMeasurements", m_outputMeasurements, ""); declareProperty("outputProtoTracks", m_outputProtoTracks, ""); } @@ -90,13 +94,15 @@ class SingleTrackSourceLinker : public GaudiAlgorithm { const edm4eic::TrackerHitCollection* hits = m_inputHitCollection.get(); // Create output collections auto* linkStorage = m_sourceLinkStorage.createAndPut(); +#if Acts_VERSION_MAJOR < 37 || (Acts_VERSION_MAJOR == 37 && Acts_VERSION_MINOR == 0) auto* sourceLinks = m_outputSourceLinks.createAndPut(); + sourceLinks->reserve(hits->size()); +#endif auto* measurements = m_outputMeasurements.createAndPut(); + measurements->reserve(hits->size()); auto* protoTracks = m_outputProtoTracks.createAndPut(); // IndexMultimap hitParticlesMap; // IndexMultimap hitSimHitsMap; - sourceLinks->reserve(hits->size()); - measurements->reserve(hits->size()); // assume single track --> one ProtoTrack ActsExamples::ProtoTrack track; @@ -164,8 +170,10 @@ class SingleTrackSourceLinker : public GaudiAlgorithm { auto geoId = surface->geometryId(); linkStorage->emplace_back(geoId, ihit); +#if Acts_VERSION_MAJOR < 37 || (Acts_VERSION_MAJOR == 37 && Acts_VERSION_MINOR == 0) ActsExamples::IndexSourceLink& sourceLink = linkStorage->back(); sourceLinks->emplace_hint(sourceLinks->end(), sourceLink); +#endif #if Acts_VERSION_MAJOR > 37 || (Acts_VERSION_MAJOR == 37 && Acts_VERSION_MINOR >= 1) std::array indices = {Acts::eBoundLoc0, Acts::eBoundLoc1};