Changeset e999d62 in git
- Timestamp:
- Dec 5, 2017, 8:45:56 PM (7 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- 8562e4e
- Parents:
- 6d1fff5
- Location:
- modules
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/DenseTrackFilter.cc
r6d1fff5 re999d62 54 54 55 55 DenseTrackFilter::DenseTrackFilter() : 56 fItTrackInputArray(0) 56 fItTrackInputArray(0), fItDenseChargedInputArray(0) 57 57 { 58 58 } … … 113 113 fEtaPhiRes = GetDouble("EtaPhiRes", 0.005); 114 114 115 fTrackInputArray = ImportArray(GetString("TrackInputArray", " ParticlePropagator/tracks"));115 fTrackInputArray = ImportArray(GetString("TrackInputArray", "TrackMerger/tracks")); 116 116 fItTrackInputArray = fTrackInputArray->MakeIterator(); 117 118 fDenseChargedInputArray = ImportArray(GetString("DenseChargedInputArray", "DenseMergeTracks/tracks")); 119 fItDenseChargedInputArray = fDenseChargedInputArray->MakeIterator(); 117 120 118 121 fTrackOutputArray = ExportArray(GetString("TrackOutputArray", "tracks")); … … 125 128 vector< vector< Double_t >* >::iterator itPhiBin; 126 129 if(fItTrackInputArray) delete fItTrackInputArray; 130 if(fItDenseChargedInputArray) delete fItDenseChargedInputArray; 127 131 for(itPhiBin = fPhiBins.begin(); itPhiBin != fPhiBins.end(); ++itPhiBin) 128 132 { … … 135 139 void DenseTrackFilter::Process() 136 140 { 137 Candidate *candidate, *track, *bestTrack, *mother ;141 Candidate *candidate, *track, *bestTrack, *mother, *trackRef, *bestTrackRef; 138 142 TLorentzVector position, momentum; 139 143 Short_t etaBin, phiBin, flags; … … 142 146 143 147 Double_t pt, ptmax, eta, phi; 148 Bool_t matched; 144 149 145 150 vector< Double_t >::iterator itEtaBin; … … 152 157 153 158 // loop over all tracks 154 fIt TrackInputArray->Reset();159 fItDenseChargedInputArray->Reset(); 155 160 number = -1; 156 while((track = static_cast<Candidate*>(fIt TrackInputArray->Next())))161 while((track = static_cast<Candidate*>(fItDenseChargedInputArray->Next()))) 157 162 { 158 163 const TLorentzVector &trackPosition = track->Position; … … 205 210 if(towerTrackHits > 0) 206 211 { 207 mother = bestTrack; 208 candidate = static_cast<Candidate*>(bestTrack->Clone()); 209 pt = candidate->Momentum.Pt(); 210 eta = candidate->Momentum.Eta(); 211 phi = candidate->Momentum.Phi(); 212 eta = gRandom->Gaus(eta, fEtaPhiRes); 213 phi = gRandom->Gaus(phi, fEtaPhiRes); 214 candidate->Momentum.SetPtEtaPhiE(pt, eta, phi, pt*TMath::CosH(eta)); 215 candidate->AddCandidate(mother); 216 fTrackOutputArray->Add(candidate); 212 bestTrackRef = static_cast<Candidate*>(bestTrack->GetCandidates()->At(0)); 213 214 // find corresponding track in properly propagated tracks 215 216 217 fItTrackInputArray->Reset(); 218 matched = kFALSE; 219 int ntrack = 0; 220 while((track = static_cast<Candidate*>(fItTrackInputArray->Next()))) 221 { 222 ntrack++; 223 trackRef = static_cast<Candidate*>(track->GetCandidates()->At(0)); 224 if (trackRef->GetUniqueID() == bestTrackRef->GetUniqueID()) 225 { 226 mother = track; 227 candidate = static_cast<Candidate*>(track->Clone()); 228 pt = candidate->Momentum.Pt(); 229 eta = candidate->Momentum.Eta(); 230 phi = candidate->Momentum.Phi(); 231 eta = gRandom->Gaus(eta, fEtaPhiRes); 232 phi = gRandom->Gaus(phi, fEtaPhiRes); 233 candidate->Momentum.SetPtEtaPhiE(pt, eta, phi, pt*TMath::CosH(eta)); 234 candidate->AddCandidate(mother); 235 fTrackOutputArray->Add(candidate); 236 matched = kTRUE; 237 } 238 if (matched) break; 239 } 240 241 // find track 217 242 } 218 243 … … 226 251 { 227 252 ++towerTrackHits; 228 track = static_cast<Candidate*>(f TrackInputArray->At(number));253 track = static_cast<Candidate*>(fDenseChargedInputArray->At(number)); 229 254 momentum = track->Momentum; 230 255 … … 237 262 } 238 263 } 239 } 264 265 } -
modules/DenseTrackFilter.h
r6d1fff5 re999d62 70 70 TObjArray *fTrackOutputArray; //! 71 71 72 73 const TObjArray *fDenseChargedInputArray; 74 TIterator *fItDenseChargedInputArray; 75 72 76 ClassDef(DenseTrackFilter, 1) 73 77 };
Note:
See TracChangeset
for help on using the changeset viewer.