Skip to content

Commit

Permalink
refactor: Integrate source link container into measurements container…
Browse files Browse the repository at this point in the history
… in Examples (#3732) @37.1.0: (fixup)
  • Loading branch information
wdconinc committed Feb 11, 2025
1 parent e9a2a62 commit a1dcfc1
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions JugTrack/src/components/SingleTrackSourceLinker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ class SingleTrackSourceLinker : public GaudiAlgorithm {
private:
DataHandle<edm4eic::TrackerHitCollection> m_inputHitCollection{"inputHitCollection", Gaudi::DataHandle::Reader, this};
DataHandle<std::list<ActsExamples::IndexSourceLink>> m_sourceLinkStorage{"sourceLinkStorage", Gaudi::DataHandle::Writer, this};
#if Acts_VERSION_MAJOR < 37 || (Acts_VERSION_MAJOR == 37 && Acts_VERSION_MINOR == 0)
DataHandle<ActsExamples::IndexSourceLinkContainer> m_outputSourceLinks{"outputSourceLinks", Gaudi::DataHandle::Writer, this};
#endif
DataHandle<ActsExamples::MeasurementContainer> m_outputMeasurements{"outputMeasurements", Gaudi::DataHandle::Writer, this};
DataHandle<ActsExamples::ProtoTrackContainer> m_outputProtoTracks{"outputProtoTracks", Gaudi::DataHandle::Writer, this};
/// Pointer to the geometry service
Expand All @@ -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, "");
}
Expand Down Expand Up @@ -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<ActsFatras::Barcode> hitParticlesMap;
// IndexMultimap<Index> hitSimHitsMap;
sourceLinks->reserve(hits->size());
measurements->reserve(hits->size());

// assume single track --> one ProtoTrack
ActsExamples::ProtoTrack track;
Expand Down Expand Up @@ -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<Acts::BoundIndices, 2> indices = {Acts::eBoundLoc0, Acts::eBoundLoc1};
Expand Down

0 comments on commit a1dcfc1

Please sign in to comment.