From f2cdf4707007a3df2b400092277bcedcb85bc0b3 Mon Sep 17 00:00:00 2001 From: lgray Date: Thu, 2 Jun 2016 11:44:47 -0500 Subject: [PATCH] run forward and backwards checks when looking for links, minor performance penalty --- RecoParticleFlow/PFProducer/src/PFBlockAlgo.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/RecoParticleFlow/PFProducer/src/PFBlockAlgo.cc b/RecoParticleFlow/PFProducer/src/PFBlockAlgo.cc index cd60d2473687c..1cd8a453f57eb 100644 --- a/RecoParticleFlow/PFProducer/src/PFBlockAlgo.cc +++ b/RecoParticleFlow/PFProducer/src/PFBlockAlgo.cc @@ -164,7 +164,8 @@ void PFBlockAlgo::findBlocks() { QuickUnion qu(bare_elements_.size()); const auto elem_size = bare_elements_.size(); for( unsigned i = 0; i < elem_size; ++i ) { - for( unsigned j = 0; j < i; ++j ) { + for( unsigned j = 0; j < elem_size; ++j ) { + if( j == i ) continue; if( !_linkTests[_linkTestSquare[bare_elements_[i]->type()][bare_elements_[j]->type()]] ) { j = ranges_[bare_elements_[j]->type()].second; continue;