Skip to content

Commit

Permalink
Remove the particleIDUsed from the reco particle
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadlener committed Feb 8, 2024
1 parent 3b9d4e5 commit 3e2e324
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<CollNamePair> results;
Expand Down
16 changes: 0 additions & 16 deletions tests/src/CompareEDM4hepLCIO.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 3e2e324

Please sign in to comment.