Changeset 341014c in git for modules/DenseTrackFilter.cc
- Timestamp:
- Feb 12, 2019, 9:29:17 PM (6 years ago)
- Branches:
- ImprovedOutputFile, Timing, llp, master
- Children:
- 6455202
- Parents:
- 45e58be
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/DenseTrackFilter.cc
r45e58be r341014c 17 17 */ 18 18 19 20 19 /** \class DenseTrackFilter 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; … … 71 70 Long_t i, j, k, size, sizeEtaBins, sizePhiBins; 72 71 TBinMap::iterator itEtaBin; 73 set< Double_t>::iterator itPhiBin;74 vector< Double_t> *phiBins;72 set<Double_t>::iterator itPhiBin; 73 vector<Double_t> *phiBins; 75 74 76 75 // read eta and phi bins … … 80 79 fEtaBins.clear(); 81 80 fPhiBins.clear(); 82 for(i = 0; i < size /2; ++i)83 { 84 paramEtaBins = param[i *2];81 for(i = 0; i < size / 2; ++i) 82 { 83 paramEtaBins = param[i * 2]; 85 84 sizeEtaBins = paramEtaBins.GetSize(); 86 paramPhiBins = param[i *2 + 1];85 paramPhiBins = param[i * 2 + 1]; 87 86 sizePhiBins = paramPhiBins.GetSize(); 88 87 … … 101 100 { 102 101 fEtaBins.push_back(itEtaBin->first); 103 phiBins = new vector< double>(itEtaBin->second.size());102 phiBins = new vector<double>(itEtaBin->second.size()); 104 103 fPhiBins.push_back(phiBins); 105 104 phiBins->clear(); … … 126 125 void DenseTrackFilter::Finish() 127 126 { 128 vector< vector< Double_t >*>::iterator itPhiBin;127 vector<vector<Double_t> *>::iterator itPhiBin; 129 128 if(fItTrackInputArray) delete fItTrackInputArray; 130 129 for(itPhiBin = fPhiBins.begin(); itPhiBin != fPhiBins.end(); ++itPhiBin) … … 145 144 Double_t ptmax; 146 145 147 vector< Double_t>::iterator itEtaBin;148 vector< Double_t>::iterator itPhiBin;149 vector< Double_t> *phiBins;150 151 vector< Long64_t>::iterator itTowerHits;146 vector<Double_t>::iterator itEtaBin; 147 vector<Double_t>::iterator itPhiBin; 148 vector<Double_t> *phiBins; 149 150 vector<Long64_t>::iterator itTowerHits; 152 151 153 152 fTowerHits.clear(); … … 156 155 fItTrackInputArray->Reset(); 157 156 number = -1; 158 while((track = static_cast<Candidate *>(fItTrackInputArray->Next())))157 while((track = static_cast<Candidate *>(fItTrackInputArray->Next()))) 159 158 { 160 159 const TLorentzVector &trackPosition = track->Position; … … 196 195 towerHit = (*itTowerHits); 197 196 flags = (towerHit >> 24) & 0x00000000000000FFLL; 198 number = (towerHit) &0x0000000000FFFFFFLL;197 number = (towerHit)&0x0000000000FFFFFFLL; 199 198 hitEtaPhi = towerHit >> 32; 200 199 … … 216 215 { 217 216 ++fTowerTrackHits; 218 track = static_cast<Candidate *>(fTrackInputArray->At(number));217 track = static_cast<Candidate *>(fTrackInputArray->At(number)); 219 218 momentum = track->Momentum; 220 219 … … 226 225 continue; 227 226 } 228 229 227 } 230 228 231 229 // here fill last tower 232 230 FillTrack(); 233 234 231 } 235 232 … … 245 242 // saving track with highest pT that hit the tower 246 243 if(fTowerTrackHits < 1) return; 247 244 248 245 numberOfCandidates = fBestTrack->GetCandidates()->GetEntriesFast(); 249 246 if(numberOfCandidates < 1) return; 250 247 251 track = static_cast<Candidate *>(fBestTrack->GetCandidates()->At(numberOfCandidates - 1));252 candidate = static_cast<Candidate *>(track->Clone());248 track = static_cast<Candidate *>(fBestTrack->GetCandidates()->At(numberOfCandidates - 1)); 249 candidate = static_cast<Candidate *>(track->Clone()); 253 250 pt = candidate->Momentum.Pt(); 254 251 eta = candidate->Momentum.Eta(); … … 256 253 eta = gRandom->Gaus(eta, fEtaPhiRes); 257 254 phi = gRandom->Gaus(phi, fEtaPhiRes); 258 candidate->Momentum.SetPtEtaPhiE(pt, eta, phi, pt *TMath::CosH(eta));255 candidate->Momentum.SetPtEtaPhiE(pt, eta, phi, pt * TMath::CosH(eta)); 259 256 candidate->AddCandidate(track); 260 257 … … 262 259 switch(TMath::Abs(candidate->PID)) 263 260 { 264 265 266 267 268 269 270 271 272 } 273 } 261 case 11: 262 fElectronOutputArray->Add(candidate); 263 break; 264 case 13: 265 fMuonOutputArray->Add(candidate); 266 break; 267 default: 268 fChargedHadronOutputArray->Add(candidate); 269 } 270 }
Note:
See TracChangeset
for help on using the changeset viewer.