Changes in modules/UniqueObjectFinder.cc [77e9ae1:93da593] in git
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/UniqueObjectFinder.cc
r77e9ae1 r93da593 17 17 */ 18 18 19 19 20 /** \class UniqueObjectFinder 20 21 * … … 31 32 #include "classes/DelphesFormula.h" 32 33 34 #include "ExRootAnalysis/ExRootResult.h" 35 #include "ExRootAnalysis/ExRootFilter.h" 33 36 #include "ExRootAnalysis/ExRootClassifier.h" 34 #include "ExRootAnalysis/ExRootFilter.h"35 #include "ExRootAnalysis/ExRootResult.h"36 37 38 #include "TMath.h" 39 #include "TString.h" 40 #include "TFormula.h" 41 #include "TRandom3.h" 42 #include "TObjArray.h" 37 43 #include "TDatabasePDG.h" 38 #include "TFormula.h"39 44 #include "TLorentzVector.h" 40 #include "TMath.h"41 #include "TObjArray.h"42 #include "TRandom3.h"43 #include "TString.h"44 45 45 #include <algorithm> 46 #include <algorithm> 47 #include <stdexcept> 46 48 #include <iostream> 47 49 #include <sstream> 48 #include <stdexcept>49 50 50 51 using namespace std; … … 66 67 void UniqueObjectFinder::Init() 67 68 { 68 // use GetUniqueID algorithm to find unique objects (faster than the default Overlaps method)69 fUseUniqueID = GetBool("UseUniqueID", false);70 71 69 // import arrays with output from other modules 72 70 … … 79 77 80 78 size = param.GetSize(); 81 for(i = 0; i < size /2; ++i)79 for(i = 0; i < size/2; ++i) 82 80 { 83 array = ImportArray(param[i *2].GetString());81 array = ImportArray(param[i*2].GetString()); 84 82 iterator = array->MakeIterator(); 85 83 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()))); 87 85 } 88 86 } … … 92 90 void UniqueObjectFinder::Finish() 93 91 { 94 vector< pair<TIterator *, TObjArray *> >::iterator itInputMap;92 vector< pair< TIterator *, TObjArray * > >::iterator itInputMap; 95 93 TIterator *iterator; 96 94 … … 108 106 { 109 107 Candidate *candidate; 110 vector< pair<TIterator *, TObjArray *> >::iterator itInputMap;108 vector< pair< TIterator *, TObjArray * > >::iterator itInputMap; 111 109 TIterator *iterator; 112 110 TObjArray *array; … … 120 118 // loop over all candidates 121 119 iterator->Reset(); 122 while((candidate = static_cast<Candidate 120 while((candidate = static_cast<Candidate*>(iterator->Next()))) 123 121 { 124 122 if(Unique(candidate, itInputMap)) … … 132 130 //------------------------------------------------------------------------------ 133 131 134 Bool_t UniqueObjectFinder::Unique(Candidate *candidate, vector< pair<TIterator *, TObjArray *> >::iterator itInputMap)132 Bool_t UniqueObjectFinder::Unique(Candidate *candidate, vector< pair< TIterator *, TObjArray * > >::iterator itInputMap) 135 133 { 136 134 Candidate *previousCandidate; 137 vector< pair<TIterator *, TObjArray *> >::iterator previousItInputMap;135 vector< pair< TIterator *, TObjArray * > >::iterator previousItInputMap; 138 136 TObjArray *array; 139 137 … … 146 144 // loop over all candidates 147 145 iterator.Reset(); 148 while((previousCandidate = static_cast<Candidate 146 while((previousCandidate = static_cast<Candidate*>(iterator.Next()))) 149 147 { 150 if( fUseUniqueID)148 if(candidate->Overlaps(previousCandidate)) 151 149 { 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; 163 151 } 164 152 }
Note:
See TracChangeset
for help on using the changeset viewer.