Fork me on GitHub

Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/UniqueObjectFinder.cc

    r77e9ae1 r93da593  
    1717 */
    1818
     19
    1920/** \class UniqueObjectFinder
    2021 *
     
    3132#include "classes/DelphesFormula.h"
    3233
     34#include "ExRootAnalysis/ExRootResult.h"
     35#include "ExRootAnalysis/ExRootFilter.h"
    3336#include "ExRootAnalysis/ExRootClassifier.h"
    34 #include "ExRootAnalysis/ExRootFilter.h"
    35 #include "ExRootAnalysis/ExRootResult.h"
    3637
     38#include "TMath.h"
     39#include "TString.h"
     40#include "TFormula.h"
     41#include "TRandom3.h"
     42#include "TObjArray.h"
    3743#include "TDatabasePDG.h"
    38 #include "TFormula.h"
    3944#include "TLorentzVector.h"
    40 #include "TMath.h"
    41 #include "TObjArray.h"
    42 #include "TRandom3.h"
    43 #include "TString.h"
    4445
    45 #include <algorithm>
     46#include <algorithm>
     47#include <stdexcept>
    4648#include <iostream>
    4749#include <sstream>
    48 #include <stdexcept>
    4950
    5051using namespace std;
     
    6667void UniqueObjectFinder::Init()
    6768{
    68   // use GetUniqueID algorithm to find unique objects (faster than the default Overlaps method)
    69   fUseUniqueID = GetBool("UseUniqueID", false);
    70 
    7169  // import arrays with output from other modules
    7270
     
    7977
    8078  size = param.GetSize();
    81   for(i = 0; i < size / 2; ++i)
     79  for(i = 0; i < size/2; ++i)
    8280  {
    83     array = ImportArray(param[i * 2].GetString());
     81    array = ImportArray(param[i*2].GetString());
    8482    iterator = array->MakeIterator();
    8583
    86     fInputMap.push_back(make_pair(iterator, ExportArray(param[i * 2 + 1].GetString())));
     84    fInputMap.push_back(make_pair(iterator, ExportArray(param[i*2 + 1].GetString())));
    8785  }
    8886}
     
    9290void UniqueObjectFinder::Finish()
    9391{
    94   vector<pair<TIterator *, TObjArray *> >::iterator itInputMap;
     92  vector< pair< TIterator *, TObjArray * > >::iterator itInputMap;
    9593  TIterator *iterator;
    9694
     
    108106{
    109107  Candidate *candidate;
    110   vector<pair<TIterator *, TObjArray *> >::iterator itInputMap;
     108  vector< pair< TIterator *, TObjArray * > >::iterator itInputMap;
    111109  TIterator *iterator;
    112110  TObjArray *array;
     
    120118    // loop over all candidates
    121119    iterator->Reset();
    122     while((candidate = static_cast<Candidate *>(iterator->Next())))
     120    while((candidate = static_cast<Candidate*>(iterator->Next())))
    123121    {
    124122      if(Unique(candidate, itInputMap))
     
    132130//------------------------------------------------------------------------------
    133131
    134 Bool_t UniqueObjectFinder::Unique(Candidate *candidate, vector<pair<TIterator *, TObjArray *> >::iterator itInputMap)
     132Bool_t UniqueObjectFinder::Unique(Candidate *candidate, vector< pair< TIterator *, TObjArray * > >::iterator itInputMap)
    135133{
    136134  Candidate *previousCandidate;
    137   vector<pair<TIterator *, TObjArray *> >::iterator previousItInputMap;
     135  vector< pair< TIterator *, TObjArray * > >::iterator previousItInputMap;
    138136  TObjArray *array;
    139137
     
    146144    // loop over all candidates
    147145    iterator.Reset();
    148     while((previousCandidate = static_cast<Candidate *>(iterator.Next())))
     146    while((previousCandidate = static_cast<Candidate*>(iterator.Next())))
    149147    {
    150       if(fUseUniqueID)
     148      if(candidate->Overlaps(previousCandidate))
    151149      {
    152         if(candidate->GetUniqueID() == previousCandidate->GetUniqueID())
    153         {
    154           return kFALSE;
    155         }
    156       }
    157       else
    158       {
    159         if(candidate->Overlaps(previousCandidate))
    160         {
    161           return kFALSE;
    162         }
     150        return kFALSE;
    163151      }
    164152    }
Note: See TracChangeset for help on using the changeset viewer.