Fork me on GitHub

Changeset 4e8e72b in git


Ignore:
Timestamp:
Mar 2, 2022, 9:37:50 PM (3 years ago)
Author:
Pavel Demin <pavel-demin@…>
Branches:
master
Children:
cc8716b
Parents:
2a2f310
Message:

deduplicate particles in TreeWriter::FillParticles

File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/TreeWriter.cc

    r2a2f310 r4e8e72b  
    4545#include "TString.h"
    4646
     47#include <set>
    4748#include <algorithm>
    4849#include <iostream>
     
    149150{
    150151  TIter it1(candidate->GetCandidates());
     152  set<Candidate *> s;
     153  set<Candidate *>::iterator it3;
    151154  it1.Reset();
     155  s.clear();
    152156  array->Clear();
    153157
     
    159163    if(candidate->GetCandidates()->GetEntriesFast() == 0)
    160164    {
    161       array->Add(candidate);
     165      s.insert(candidate);
    162166      continue;
    163167    }
     
    167171    if(candidate->GetCandidates()->GetEntriesFast() == 0)
    168172    {
    169       array->Add(candidate);
     173      s.insert(candidate);
    170174      continue;
    171175    }
     
    178182      if(candidate->GetCandidates()->GetEntriesFast() == 0)
    179183      {
    180         array->Add(candidate);
     184        s.insert(candidate);
    181185      }
    182186    }
     187  }
     188
     189  for(it3 = s.begin(); it3 != s.end(); ++it3)
     190  {
     191    array->Add(*it3);
    183192  }
    184193}
Note: See TracChangeset for help on using the changeset viewer.