From 3e2e3247dea29ca313f4e5bef04442a897f41f9d Mon Sep 17 00:00:00 2001 From: tmadlener Date: Thu, 8 Feb 2024 17:18:54 +0100 Subject: [PATCH] Remove the particleIDUsed from the reco particle --- .../k4EDM4hep2LcioConv/k4EDM4hep2LcioConv.ipp | 19 ------------------- .../k4EDM4hep2LcioConv/k4Lcio2EDM4hepConv.ipp | 14 -------------- tests/src/CompareEDM4hepLCIO.cc | 16 ---------------- 3 files changed, 49 deletions(-) diff --git a/k4EDM4hep2LcioConv/include/k4EDM4hep2LcioConv/k4EDM4hep2LcioConv.ipp b/k4EDM4hep2LcioConv/include/k4EDM4hep2LcioConv/k4EDM4hep2LcioConv.ipp index 30de4329..2e9f7dc0 100644 --- a/k4EDM4hep2LcioConv/include/k4EDM4hep2LcioConv/k4EDM4hep2LcioConv.ipp +++ b/k4EDM4hep2LcioConv/include/k4EDM4hep2LcioConv/k4EDM4hep2LcioConv.ipp @@ -552,25 +552,6 @@ namespace EDM4hep2LCIOConv { } } - // Link sinlge associated Particle - auto edm_pid_used = edm_rp.getParticleIDUsed(); - if (edm_pid_used.isAvailable()) { - for (const auto& lcio_pid : lcio_recp->getParticleIDs()) { - bool is_same = true; - is_same = is_same && (lcio_pid->getType() == edm_pid_used.getType()); - is_same = is_same && (lcio_pid->getPDG() == edm_pid_used.getPDG()); - is_same = is_same && (lcio_pid->getLikelihood() == edm_pid_used.getLikelihood()); - is_same = is_same && (lcio_pid->getAlgorithmType() == edm_pid_used.getAlgorithmType()); - for (int i = 0; i < edm_pid_used.parameters_size(); ++i) { - is_same = is_same && (edm_pid_used.getParameters(i) == lcio_pid->getParameters()[i]); - } - if (is_same) { - lcio_recp->setParticleIDUsed(lcio_pid); - break; - } - } - } - // Link sinlge associated Vertex if found in converted ones auto vertex = edm_rp.getStartVertex(); if (vertex.isAvailable()) { diff --git a/k4EDM4hep2LcioConv/include/k4EDM4hep2LcioConv/k4Lcio2EDM4hepConv.ipp b/k4EDM4hep2LcioConv/include/k4EDM4hep2LcioConv/k4Lcio2EDM4hepConv.ipp index 6527fe77..8e347778 100644 --- a/k4EDM4hep2LcioConv/include/k4EDM4hep2LcioConv/k4Lcio2EDM4hepConv.ipp +++ b/k4EDM4hep2LcioConv/include/k4EDM4hep2LcioConv/k4Lcio2EDM4hepConv.ipp @@ -159,20 +159,6 @@ namespace LCIO2EDM4hepConv { lval.addToParticleIDs(k4EDM4hep2LcioConv::detail::getMapped(pidIt)); } } - - const auto lcioPidUsed = rval->getParticleIDUsed(); - if (lcioPidUsed == nullptr) { - continue; - } - if (const auto edm4hepPid = k4EDM4hep2LcioConv::detail::mapLookupTo(lcioPidUsed, particleIDMap)) { - lval.setParticleIDUsed(edm4hepPid.value()); - } - else { - auto pid = convertParticleID(lcioPidUsed); - particleIDs->push_back(pid); - k4EDM4hep2LcioConv::detail::mapInsert(lcioPidUsed, pid, particleIDMap); - lval.setParticleIDUsed(pid); - } } std::vector results; diff --git a/tests/src/CompareEDM4hepLCIO.cc b/tests/src/CompareEDM4hepLCIO.cc index 0b86d8d8..b0d60063 100644 --- a/tests/src/CompareEDM4hepLCIO.cc +++ b/tests/src/CompareEDM4hepLCIO.cc @@ -208,22 +208,6 @@ bool compare( } } - const auto lcioPIDUsed = lcioElem->getParticleIDUsed(); - const auto edmPIDUsed = edm4hepElem.getParticleIDUsed(); - if (lcioPIDUsed == nullptr) { - if (edmPIDUsed.isAvailable()) { - std::cerr << "particleIDUsed is not available in LCIO, but points to " << edmPIDUsed.getObjectID() - << " in EDM4hep for ReconstructedParticle" << std::endl; - return false; - } - } - else { - if (!compare(lcioPIDUsed, edmPIDUsed)) { - std::cerr << "particleIDUsed differs in ReconstructedParticle (LCIO: " << lcioPIDUsed - << ", EDM4hep: " << edmPIDUsed << ")" << std::endl; - return false; - } - } return true; }