From ddcaa6bf49c33f6791d2e3af1a3f6a644fdbbfd3 Mon Sep 17 00:00:00 2001 From: tmadlener Date: Wed, 2 Oct 2024 10:34:17 +0200 Subject: [PATCH 1/2] Switch from Associations to Links --- RecCalorimeter/src/components/CreateTruthJet.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/RecCalorimeter/src/components/CreateTruthJet.cpp b/RecCalorimeter/src/components/CreateTruthJet.cpp index 0e48e87..c39e407 100644 --- a/RecCalorimeter/src/components/CreateTruthJet.cpp +++ b/RecCalorimeter/src/components/CreateTruthJet.cpp @@ -7,7 +7,7 @@ // EDM4hep #include "edm4hep/MCParticleCollection.h" -#include "edm4hep/MCRecoParticleAssociationCollection.h" +#include "edm4hep/RecoMCParticleLinkCollection.h" #include "edm4hep/ReconstructedParticleCollection.h" // k4RecCalorimeter @@ -39,7 +39,7 @@ struct CreateTruthJet final : k4FWCore::MultiTransformer< std::tuple( + edm4hep::RecoMCParticleLinkCollection>( const edm4hep::MCParticleCollection &)> { CreateTruthJet(const std::string &name, ISvcLocator *svcLoc) @@ -61,7 +61,7 @@ struct CreateTruthJet final } std::tuple + edm4hep::RecoMCParticleLinkCollection> operator()(const edm4hep::MCParticleCollection &input) const override { std::vector clustersPJ; @@ -79,7 +79,7 @@ struct CreateTruthJet final m_clusterer->cluster(clustersPJ); auto edmJets = edm4hep::ReconstructedParticleCollection(); - auto assoc = edm4hep::MCRecoParticleAssociationCollection(); + auto assoc = edm4hep::RecoMCParticleLinkCollection(); for (auto cjet : inclusiveJets) { edm4hep::MutableReconstructedParticle jet; @@ -93,8 +93,8 @@ struct CreateTruthJet final int index = constit.user_info().index(); auto association = assoc.create(); - association.setRec(jet); - association.setSim((input)[index]); + association.setFrom(jet); + association.setTo((input)[index]); } edmJets.push_back(jet); From b6c3753e9fd43d2426c33dff3e1bdda0d87cd95e Mon Sep 17 00:00:00 2001 From: tmadlener Date: Wed, 2 Oct 2024 10:34:55 +0200 Subject: [PATCH 2/2] Rename variables to match types better --- RecCalorimeter/src/components/CreateTruthJet.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/RecCalorimeter/src/components/CreateTruthJet.cpp b/RecCalorimeter/src/components/CreateTruthJet.cpp index c39e407..913614a 100644 --- a/RecCalorimeter/src/components/CreateTruthJet.cpp +++ b/RecCalorimeter/src/components/CreateTruthJet.cpp @@ -79,7 +79,7 @@ struct CreateTruthJet final m_clusterer->cluster(clustersPJ); auto edmJets = edm4hep::ReconstructedParticleCollection(); - auto assoc = edm4hep::RecoMCParticleLinkCollection(); + auto links = edm4hep::RecoMCParticleLinkCollection(); for (auto cjet : inclusiveJets) { edm4hep::MutableReconstructedParticle jet; @@ -92,15 +92,15 @@ struct CreateTruthJet final for (auto constit : constits) { int index = constit.user_info().index(); - auto association = assoc.create(); - association.setFrom(jet); - association.setTo((input)[index]); + auto link = links.create(); + link.setFrom(jet); + link.setTo((input)[index]); } edmJets.push_back(jet); } - return std::make_tuple(std::move(edmJets), std::move(assoc)); + return std::make_tuple(std::move(edmJets), std::move(links)); } StatusCode finalize() override {