Changeset 667a02a in git for modules/DenseTrackFilter.cc
- Timestamp:
- Jun 8, 2018, 3:23:13 PM (7 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- e57c062
- Parents:
- 001ee95 (diff), 17d0ab8 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/DenseTrackFilter.cc
r001ee95 r667a02a 54 54 55 55 DenseTrackFilter::DenseTrackFilter() : 56 fItTrackInputArray(0) , fItDenseChargedInputArray(0)56 fItTrackInputArray(0) 57 57 { 58 58 } … … 116 116 fItTrackInputArray = fTrackInputArray->MakeIterator(); 117 117 118 fDenseChargedInputArray = ImportArray(GetString("DenseChargedInputArray", "DenseMergeTracks/tracks"));119 fItDenseChargedInputArray = fDenseChargedInputArray->MakeIterator();120 121 118 fTrackOutputArray = ExportArray(GetString("TrackOutputArray", "tracks")); 119 fChargedHadronOutputArray = ExportArray(GetString("ChargedHadronOutputArray", "chargedHadrons")); 120 fElectronOutputArray = ExportArray(GetString("ElectronOutputArray", "electrons")); 121 fMuonOutputArray = ExportArray(GetString("MuonOutputArray", "muons")); 122 122 } 123 123 … … 128 128 vector< vector< Double_t >* >::iterator itPhiBin; 129 129 if(fItTrackInputArray) delete fItTrackInputArray; 130 if(fItDenseChargedInputArray) delete fItDenseChargedInputArray;131 130 for(itPhiBin = fPhiBins.begin(); itPhiBin != fPhiBins.end(); ++itPhiBin) 132 131 { … … 155 154 156 155 // loop over all tracks 157 fIt DenseChargedInputArray->Reset();156 fItTrackInputArray->Reset(); 158 157 number = -1; 159 while((track = static_cast<Candidate*>(fIt DenseChargedInputArray->Next())))158 while((track = static_cast<Candidate*>(fItTrackInputArray->Next()))) 160 159 { 161 160 const TLorentzVector &trackPosition = track->Position; … … 204 203 // switch to next tower 205 204 towerEtaPhi = hitEtaPhi; 206 205 207 206 // saving track with highest pT that hit the tower 208 207 FillTrack(); … … 213 212 } 214 213 // check for track hits 215 214 216 215 if(flags & 1) 217 216 { 218 217 ++fTowerTrackHits; 219 track = static_cast<Candidate*>(f DenseChargedInputArray->At(number));218 track = static_cast<Candidate*>(fTrackInputArray->At(number)); 220 219 momentum = track->Momentum; 221 220 222 if (momentum.Pt() > ptmax)221 if(momentum.Pt() > ptmax) 223 222 { 224 223 ptmax = momentum.Pt(); 225 224 fBestTrack = track; 226 225 } 227 226 continue; 228 227 } 229 230 } 231 228 229 } 230 232 231 // here fill last tower 233 232 FillTrack(); 234 235 } 236 237 233 234 } 238 235 239 236 //------------------------------------------------------------------------------ … … 241 238 void DenseTrackFilter::FillTrack() 242 239 { 243 244 Candidate *candidate, *track , *mother, *trackRef, *bestTrackRef;240 241 Candidate *candidate, *track; 245 242 Double_t pt, eta, phi; 246 Bool_t matched;247 243 Int_t numberOfCandidates; 244 248 245 // saving track with highest pT that hit the tower 249 if(fTowerTrackHits > 0) 250 { 251 bestTrackRef = static_cast<Candidate*>(fBestTrack->GetCandidates()->At(0)); 252 253 // find corresponding track in properly propagated tracks 254 fItTrackInputArray->Reset(); 255 matched = kFALSE; 256 int ntrack = 0; 257 while((track = static_cast<Candidate*>(fItTrackInputArray->Next()))) 258 { 259 ntrack++; 260 trackRef = static_cast<Candidate*>(track->GetCandidates()->At(0)); 261 262 if (trackRef->GetUniqueID() == bestTrackRef->GetUniqueID()) 263 { 264 mother = track; 265 candidate = static_cast<Candidate*>(track->Clone()); 266 pt = candidate->Momentum.Pt(); 267 eta = candidate->Momentum.Eta(); 268 phi = candidate->Momentum.Phi(); 269 eta = gRandom->Gaus(eta, fEtaPhiRes); 270 phi = gRandom->Gaus(phi, fEtaPhiRes); 271 candidate->Momentum.SetPtEtaPhiE(pt, eta, phi, pt*TMath::CosH(eta)); 272 candidate->AddCandidate(mother); 273 fTrackOutputArray->Add(candidate); 274 matched = kTRUE; 275 } 276 if (matched) break; 277 } 278 } 279 280 281 } 246 if(fTowerTrackHits < 1) return; 247 248 numberOfCandidates = fBestTrack->GetCandidates()->GetEntriesFast(); 249 if(numberOfCandidates < 1) return; 250 251 track = static_cast<Candidate*>(fBestTrack->GetCandidates()->At(numberOfCandidates - 1)); 252 candidate = static_cast<Candidate*>(track->Clone()); 253 pt = candidate->Momentum.Pt(); 254 eta = candidate->Momentum.Eta(); 255 phi = candidate->Momentum.Phi(); 256 eta = gRandom->Gaus(eta, fEtaPhiRes); 257 phi = gRandom->Gaus(phi, fEtaPhiRes); 258 candidate->Momentum.SetPtEtaPhiE(pt, eta, phi, pt*TMath::CosH(eta)); 259 candidate->AddCandidate(track); 260 261 fTrackOutputArray->Add(candidate); 262 switch(TMath::Abs(candidate->PID)) 263 { 264 case 11: 265 fElectronOutputArray->Add(candidate); 266 break; 267 case 13: 268 fMuonOutputArray->Add(candidate); 269 break; 270 default: 271 fChargedHadronOutputArray->Add(candidate); 272 } 273 }
Note:
See TracChangeset
for help on using the changeset viewer.