Changeset 4170544 in git for modules/DenseTrackFilter.cc
- Timestamp:
- Dec 7, 2017, 1:55:15 AM (7 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- 0c5bf12
- Parents:
- fce5dd5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/DenseTrackFilter.cc
rfce5dd5 r4170544 111 111 112 112 // Eta x Phi smearing to be applied 113 fEtaPhiRes = GetDouble("EtaPhiRes", 0.00 5);114 115 fTrackInputArray = ImportArray(GetString("TrackInputArray", "TrackMerger /tracks"));113 fEtaPhiRes = GetDouble("EtaPhiRes", 0.003); 114 115 fTrackInputArray = ImportArray(GetString("TrackInputArray", "TrackMergerProp/tracks")); 116 116 fItTrackInputArray = fTrackInputArray->MakeIterator(); 117 117 … … 139 139 void DenseTrackFilter::Process() 140 140 { 141 Candidate * candidate, *track, *bestTrack, *mother, *trackRef, *bestTrackRef;141 Candidate *track; 142 142 TLorentzVector position, momentum; 143 143 Short_t etaBin, phiBin, flags; 144 Int_t number , towerTrackHits;144 Int_t number; 145 145 Long64_t towerHit, towerEtaPhi, hitEtaPhi; 146 147 Double_t pt, ptmax, eta, phi; 148 Bool_t matched; 146 Double_t ptmax; 149 147 150 148 vector< Double_t >::iterator itEtaBin; … … 191 189 // loop over all hits 192 190 towerEtaPhi = 0; 193 bestTrack = 0; 194 fTower = 0; 191 fBestTrack = 0; 195 192 ptmax = 0.0; 196 towerTrackHits = 0;193 fTowerTrackHits = 0; 197 194 198 195 for(itTowerHits = fTowerHits.begin(); itTowerHits != fTowerHits.end(); ++itTowerHits) … … 202 199 number = (towerHit) & 0x0000000000FFFFFFLL; 203 200 hitEtaPhi = towerHit >> 32; 201 204 202 if(towerEtaPhi != hitEtaPhi) 205 203 { 206 204 // switch to next tower 207 205 towerEtaPhi = hitEtaPhi; 208 206 209 207 // saving track with highest pT that hit the tower 210 if(towerTrackHits > 0) 211 { 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 242 } 208 FillTrack(); 243 209 244 210 ptmax = 0.0; 245 towerTrackHits = 0;246 bestTrack = 0;211 fTowerTrackHits = 0; 212 fBestTrack = 0; 247 213 } 248 214 // check for track hits … … 250 216 if(flags & 1) 251 217 { 252 ++ towerTrackHits;218 ++fTowerTrackHits; 253 219 track = static_cast<Candidate*>(fDenseChargedInputArray->At(number)); 254 220 momentum = track->Momentum; … … 256 222 if (momentum.Pt() > ptmax) 257 223 { 258 259 bestTrack = track;224 ptmax = momentum.Pt(); 225 fBestTrack = track; 260 226 } 261 227 continue; 262 228 } 263 } 264 265 } 229 230 } 231 232 // here fill last tower 233 FillTrack(); 234 235 } 236 237 238 239 //------------------------------------------------------------------------------ 240 241 void DenseTrackFilter::FillTrack() 242 { 243 244 Candidate *candidate, *track, *mother, *trackRef, *bestTrackRef; 245 Double_t pt, eta, phi; 246 Bool_t matched; 247 248 // 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 }
Note:
See TracChangeset
for help on using the changeset viewer.