From 718392bcca30293dd4dbaafc145cd32fa106a553 Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Fri, 27 Sep 2024 18:19:43 +0200 Subject: [PATCH 1/4] Fix a few warnings after the change Association -> Link --- Tracking/components/PlotTrackHitResiduals.cpp | 4 ++-- Tracking/components/TracksFromGenParticles.cpp | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Tracking/components/PlotTrackHitResiduals.cpp b/Tracking/components/PlotTrackHitResiduals.cpp index a9626e8..ca0b77f 100644 --- a/Tracking/components/PlotTrackHitResiduals.cpp +++ b/Tracking/components/PlotTrackHitResiduals.cpp @@ -40,7 +40,7 @@ namespace Gaudi::Accumulators { */ struct PlotTrackHitDistances final - : k4FWCore::Consumer { + : k4FWCore::Consumer { PlotTrackHitDistances(const std::string& name, ISvcLocator* svcLoc) : Consumer( name, svcLoc, @@ -49,7 +49,7 @@ struct PlotTrackHitDistances final KeyValues("InputTracksFromGenParticlesAssociation", {"TracksFromGenParticlesAssociation"}), }) {} - void operator()(const edm4hep::SimTrackerHitCollection& simTrackerHits, const edm4hep::MCRecoTrackParticleAssociationCollection& trackParticleAssociations) const override { + void operator()(const edm4hep::SimTrackerHitCollection& simTrackerHits, const edm4hep::TrackMCParticleLinkCollection& trackParticleAssociations) const override { for (const auto& trackParticleAssociation : trackParticleAssociations) { auto genParticle = trackParticleAssociation.getSim(); diff --git a/Tracking/components/TracksFromGenParticles.cpp b/Tracking/components/TracksFromGenParticles.cpp index af03cb8..5c0aad7 100644 --- a/Tracking/components/TracksFromGenParticles.cpp +++ b/Tracking/components/TracksFromGenParticles.cpp @@ -27,7 +27,7 @@ */ struct TracksFromGenParticles final - : k4FWCore::MultiTransformer(const edm4hep::MCParticleCollection&)> { + : k4FWCore::MultiTransformer(const edm4hep::MCParticleCollection&)> { TracksFromGenParticles(const std::string& name, ISvcLocator* svcLoc) : MultiTransformer( name, svcLoc, @@ -36,10 +36,10 @@ struct TracksFromGenParticles final KeyValues("OutputMCRecoTrackParticleAssociation", {"TracksFromGenParticlesAssociation"})}) { } -std::tuple operator()(const edm4hep::MCParticleCollection& genParticleColl) const override { +std::tuple operator()(const edm4hep::MCParticleCollection& genParticleColl) const override { auto outputTrackCollection = edm4hep::TrackCollection(); - auto MCRecoTrackParticleAssociationCollection = edm4hep::MCRecoTrackParticleAssociationCollection(); + auto MCRecoTrackParticleAssociationCollection = edm4hep::TrackMCParticleLinkCollection(); for (const auto& genParticle : genParticleColl) { debug() << "Particle decayed in tracker: " << genParticle.isDecayedInTracker() << endmsg; @@ -76,9 +76,9 @@ std::tuple Date: Fri, 27 Sep 2024 18:22:51 +0200 Subject: [PATCH 2/4] Fix a few more warnings --- Tracking/components/PlotTrackHitResiduals.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tracking/components/PlotTrackHitResiduals.cpp b/Tracking/components/PlotTrackHitResiduals.cpp index ca0b77f..a94356e 100644 --- a/Tracking/components/PlotTrackHitResiduals.cpp +++ b/Tracking/components/PlotTrackHitResiduals.cpp @@ -52,8 +52,8 @@ struct PlotTrackHitDistances final void operator()(const edm4hep::SimTrackerHitCollection& simTrackerHits, const edm4hep::TrackMCParticleLinkCollection& trackParticleAssociations) const override { for (const auto& trackParticleAssociation : trackParticleAssociations) { - auto genParticle = trackParticleAssociation.getSim(); - auto track = trackParticleAssociation.getRec(); + auto genParticle = trackParticleAssociation.getTo(); + auto track = trackParticleAssociation.getFrom(); edm4hep::TrackState trackStateAtIP; bool found_trackStateAtIP = false; for (const auto& trackState : track.getTrackStates()) { From 19f8f3b6b7c56efadbd4a73cd710ef5a9bb0fdd4 Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Fri, 27 Sep 2024 18:31:11 +0200 Subject: [PATCH 3/4] Fix a couple of includes --- Tracking/components/PlotTrackHitResiduals.cpp | 2 +- Tracking/components/TracksFromGenParticles.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Tracking/components/PlotTrackHitResiduals.cpp b/Tracking/components/PlotTrackHitResiduals.cpp index a94356e..ea12224 100644 --- a/Tracking/components/PlotTrackHitResiduals.cpp +++ b/Tracking/components/PlotTrackHitResiduals.cpp @@ -6,7 +6,7 @@ // edm4hep #include "edm4hep/MCParticleCollection.h" #include "edm4hep/TrackCollection.h" -#include "edm4hep/MCRecoTrackParticleAssociationCollection.h" +#include "edm4hep/TrackMCParticleLinkCollection.h" #include "edm4hep/SimTrackerHitCollection.h" // marlin diff --git a/Tracking/components/TracksFromGenParticles.cpp b/Tracking/components/TracksFromGenParticles.cpp index 5c0aad7..d4c7a1c 100644 --- a/Tracking/components/TracksFromGenParticles.cpp +++ b/Tracking/components/TracksFromGenParticles.cpp @@ -3,7 +3,7 @@ // edm4hep #include "edm4hep/MCParticleCollection.h" #include "edm4hep/TrackCollection.h" -#include "edm4hep/MCRecoTrackParticleAssociationCollection.h" +#include "edm4hep/TrackMCParticleLinkCollection.h" // marlin #include From bcb225686c292b53a9fb6ea41a8441927e5d7646 Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Fri, 27 Sep 2024 18:46:30 +0200 Subject: [PATCH 4/4] Add missing edm4hep:: --- Tracking/components/TracksFromGenParticles.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tracking/components/TracksFromGenParticles.cpp b/Tracking/components/TracksFromGenParticles.cpp index d4c7a1c..dab2af0 100644 --- a/Tracking/components/TracksFromGenParticles.cpp +++ b/Tracking/components/TracksFromGenParticles.cpp @@ -76,7 +76,7 @@ std::tuple ope outputTrackCollection.push_back(trackFromGen); // Building the association between tracks and genParticles - auto MCRecoTrackParticleAssociation = MutableTrackMCParticleLink(); + auto MCRecoTrackParticleAssociation = edm4hep::MutableTrackMCParticleLink(); MCRecoTrackParticleAssociation.setFrom(trackFromGen); MCRecoTrackParticleAssociation.setTo(genParticle); MCRecoTrackParticleAssociationCollection.push_back(MCRecoTrackParticleAssociation);