- Timestamp:
- Jun 6, 2018, 3:30:22 PM (7 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- b24f05a
- Parents:
- 5b51d33
- Location:
- modules
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/DenseTrackFilter.cc
r5b51d33 rec37bc3 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; … … 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 … … 244 243 Int_t numberOfCandidates; 245 244 246 numberOfCandidates = fBestTrack->GetCandidates()->GetEntriesFast(); 247 245 246 cout<<fBestTrack<<endl; 247 248 248 // saving track with highest pT that hit the tower 249 if(fTowerTrackHits > 0 && numberOfCandidates > 1) 250 { 251 track = static_cast<Candidate*>(fBestTrack->GetCandidates()->At(numberOfCandidates - 2)); 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 fTrackOutputArray->Add(candidate); 261 } 262 } 249 if(fTowerTrackHits > 0) 250 { 251 252 numberOfCandidates = fBestTrack->GetCandidates()->GetEntriesFast(); 253 if (numberOfCandidates < 2) 254 cout<<fBestTrack<<endl; 255 256 if (numberOfCandidates > 1) 257 { 258 259 track = static_cast<Candidate*>(fBestTrack->GetCandidates()->At(numberOfCandidates - 1)); 260 candidate = static_cast<Candidate*>(track->Clone()); 261 pt = candidate->Momentum.Pt(); 262 eta = candidate->Momentum.Eta(); 263 phi = candidate->Momentum.Phi(); 264 eta = gRandom->Gaus(eta, fEtaPhiRes); 265 phi = gRandom->Gaus(phi, fEtaPhiRes); 266 candidate->Momentum.SetPtEtaPhiE(pt, eta, phi, pt*TMath::CosH(eta)); 267 candidate->AddCandidate(track); 268 fTrackOutputArray->Add(candidate); 269 switch(TMath::Abs(candidate->PID)) 270 { 271 case 11: 272 fElectronOutputArray->Add(candidate); 273 break; 274 case 13: 275 fMuonOutputArray->Add(candidate); 276 break; 277 default: 278 fChargedHadronOutputArray->Add(candidate); 279 } 280 281 } 282 } 283 284 } -
modules/DenseTrackFilter.h
r5b51d33 rec37bc3 69 69 70 70 const TObjArray *fTrackInputArray; //! 71 72 71 TObjArray *fTrackOutputArray; //! 73 72 73 TObjArray *fChargedHadronOutputArray; //! 74 TObjArray *fElectronOutputArray; //! 75 TObjArray *fMuonOutputArray; //! 74 76 75 const TObjArray *fDenseChargedInputArray;76 TIterator *fItDenseChargedInputArray;77 78 77 void FillTrack(); 79 78 ClassDef(DenseTrackFilter, 1)
Note:
See TracChangeset
for help on using the changeset viewer.