Skip to content
Snippets Groups Projects
Commit c8a2c084 authored by Gerhard Raven's avatar Gerhard Raven
Browse files

Prefer LinksByKey::link over LinksByKey::addReference

parent df7628d7
No related branches found
No related tags found
No related merge requests found
......@@ -108,9 +108,7 @@ namespace {
} );
// remove any possible duplicates
partList.erase( std::unique( partList.begin(), partList.end() ), partList.end() );
for ( const auto& part : partList ) {
olink.addReference( id.lhcbID(), -1, part->index(), olink.linkID( &mcParts ), 1.0 );
}
for ( const auto& part : partList ) { olink.link( id.lhcbID(), mcParts( part->index() ), 1.0 ); }
}
/**
......
......@@ -147,15 +147,8 @@ struct ProtoParticleAssociator : public LHCb::Algorithm::MultiTransformer<std::t
// all MCParticle objects are always in a single container).
// See LinksByKey::resolveLinks for one way to load the target
// container given the target link ID from the input table.
const auto target_index = ref.objectKey();
const auto* mcp = mcparticles.object( target_index );
const auto source_index = pp->index();
const auto source_link_id = pp_links.linkID( pp->parent() );
const auto target_link_id = pp_links.linkID( mcp->parent() );
const auto weight = ref.weight();
pp_links.addReference( source_index, source_link_id, target_index, target_link_id, weight );
pp_table.relate( pp, mcp, weight )
pp_links.link( pp, mcparticles( ref.objectKey() ), ref.weight() );
pp_table.relate( pp, mcparticles( ref.objectKey() ), ref.weight() )
.orThrow( "Unexpected duplicate relation found", "ProtoParticleAssociator::operator()" );
ok = l->nextReference( ref );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment