Changes in modules/TrackPileUpSubtractor.cc [781edf86:341014c] in git
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/TrackPileUpSubtractor.cc
r781edf86 r341014c 17 17 */ 18 18 19 20 19 /** \class TrackPileUpSubtractor 21 20 * … … 32 31 #include "classes/DelphesFormula.h" 33 32 33 #include "ExRootAnalysis/ExRootClassifier.h" 34 #include "ExRootAnalysis/ExRootFilter.h" 34 35 #include "ExRootAnalysis/ExRootResult.h" 35 #include "ExRootAnalysis/ExRootFilter.h"36 #include "ExRootAnalysis/ExRootClassifier.h"37 36 37 #include "TDatabasePDG.h" 38 #include "TFormula.h" 39 #include "TLorentzVector.h" 38 40 #include "TMath.h" 41 #include "TObjArray.h" 42 #include "TRandom3.h" 39 43 #include "TString.h" 40 #include "TFormula.h"41 #include "TRandom3.h"42 #include "TObjArray.h"43 #include "TDatabasePDG.h"44 #include "TLorentzVector.h"45 44 46 45 #include <algorithm> 47 #include <stdexcept>48 46 #include <iostream> 49 47 #include <sstream> 48 #include <stdexcept> 50 49 51 50 using namespace std; … … 54 53 55 54 TrackPileUpSubtractor::TrackPileUpSubtractor() : 56 fFormula(0) 55 fFormula(0) 57 56 { 58 57 fFormula = new DelphesFormula; … … 88 87 89 88 size = param.GetSize(); 90 for(i = 0; i < size /2; ++i)89 for(i = 0; i < size / 2; ++i) 91 90 { 92 array = ImportArray(param[i *2].GetString());91 array = ImportArray(param[i * 2].GetString()); 93 92 iterator = array->MakeIterator(); 94 93 95 fInputMap[iterator] = ExportArray(param[i *2 + 1].GetString());94 fInputMap[iterator] = ExportArray(param[i * 2 + 1].GetString()); 96 95 } 97 96 } … … 101 100 void TrackPileUpSubtractor::Finish() 102 101 { 103 map< TIterator *, TObjArray *>::iterator itInputMap;102 map<TIterator *, TObjArray *>::iterator itInputMap; 104 103 TIterator *iterator; 105 104 … … 119 118 { 120 119 Candidate *candidate, *particle; 121 map< TIterator *, TObjArray *>::iterator itInputMap;120 map<TIterator *, TObjArray *>::iterator itInputMap; 122 121 TIterator *iterator; 123 122 TObjArray *array; 124 Double_t z, zvtx =0;123 Double_t z, zvtx = 0; 125 124 Double_t pt, eta, phi, e; 126 127 125 128 126 // find z position of primary vertex 129 127 130 128 fItVertexInputArray->Reset(); 131 while((candidate = static_cast<Candidate *>(fItVertexInputArray->Next())))129 while((candidate = static_cast<Candidate *>(fItVertexInputArray->Next()))) 132 130 { 133 131 if(!candidate->IsPU) … … 146 144 // loop over all candidates 147 145 iterator->Reset(); 148 while((candidate = static_cast<Candidate *>(iterator->Next())))146 while((candidate = static_cast<Candidate *>(iterator->Next()))) 149 147 { 150 particle = static_cast<Candidate *>(candidate->GetCandidates()->At(0));148 particle = static_cast<Candidate *>(candidate->GetCandidates()->At(0)); 151 149 const TLorentzVector &candidateMomentum = particle->Momentum; 152 150 … … 155 153 phi = candidateMomentum.Phi(); 156 154 e = candidateMomentum.E(); 157 155 158 156 z = particle->Position.Z(); 159 157 … … 161 159 // assume perfect pile-up subtraction for tracks outside fZVertexResolution 162 160 163 if(candidate->Charge != 0 && candidate->IsPU && TMath::Abs(z-zvtx) > fFormula->Eval(pt, eta, phi, e)* 1.0e3)161 if(candidate->Charge != 0 && candidate->IsPU && TMath::Abs(z - zvtx) > fFormula->Eval(pt, eta, phi, e) * 1.0e3) 164 162 { 165 163 candidate->IsRecoPU = 1;
Note:
See TracChangeset
for help on using the changeset viewer.