Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: Ensure by force that the deepest root of the connected graph is always found in PFBA #14844

Merged
merged 1 commit into from Jun 12, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions RecoParticleFlow/PFProducer/src/PFBlockAlgo.cc
Expand Up @@ -165,7 +165,7 @@ void PFBlockAlgo::findBlocks() {
const auto elem_size = bare_elements_.size();
for( unsigned i = 0; i < elem_size; ++i ) {
for( unsigned j = 0; j < elem_size; ++j ) {
if( j == i ) continue;
if( qu.connected(i,j) || j == i ) continue;
if( !_linkTests[_linkTestSquare[bare_elements_[i]->type()][bare_elements_[j]->type()]] ) {
j = ranges_[bare_elements_[j]->type()].second;
continue;
Expand All @@ -188,7 +188,8 @@ void PFBlockAlgo::findBlocks() {
std::vector<unsigned> keys;
keys.reserve(elements_.size());
for( unsigned i = 0; i < elements_.size(); ++i ) {
unsigned key = qu.find(i);
unsigned key = i;
while( key != qu.find(key) ) key = qu.find(key); // make sure we always find the root node...
auto pos = std::lower_bound(keys.begin(),keys.end(),key);
if( pos == keys.end() || *pos != key ) {
keys.insert(pos,key);
Expand Down