Changeset 3f51314 in git for display/DelphesBranchElement.cc
- Timestamp:
- Oct 25, 2014, 11:32:13 PM (10 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- ad015db
- Parents:
- 2ca23b5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
display/DelphesBranchElement.cc
r2ca23b5 r3f51314 26 26 #include <iostream> 27 27 28 //TODO implement GetVectors() 29 28 30 // special case for calo towers 29 31 template<> DelphesBranchElement<DelphesCaloData>::DelphesBranchElement(const char* name, TClonesArray* branch, const enum EColor color, Float_t maxPt):DelphesBranchBase(name, branch, color, maxPt) { … … 46 48 data_->DataChanged(); 47 49 } 50 } 51 template<> std::vector<TLorentzVector> DelphesBranchElement<DelphesCaloData>::GetVectors() { 52 std::vector<TLorentzVector> output; 53 if(TString(GetType())=="Tower") { 54 TIter itTower(branch_); 55 Tower *tower; 56 while((tower = (Tower *) itTower.Next())) { 57 TLorentzVector v; 58 v.SetPtEtaPhiM(tower->Eem+tower->Ehad,(tower->Edges[0]+tower->Edges[1])/2.,(tower->Edges[2]+tower->Edges[3])/2.,0.); 59 output.push_back(v); 60 } 61 } 62 return output; 48 63 } 49 64 … … 91 106 } 92 107 } 108 template<> std::vector<TLorentzVector> DelphesBranchElement<TEveElementList>::GetVectors() { 109 std::vector<TLorentzVector> output; 110 if(TString(GetType())=="Jet") { 111 TIter itJet(branch_); 112 Jet *jet; 113 // Loop over all jets 114 while((jet = (Jet *) itJet.Next())) { 115 TLorentzVector v; 116 v.SetPtEtaPhiM(jet->PT, jet->Eta, jet->Phi, jet->Mass); 117 output.push_back(v); 118 } 119 } else if(TString(GetType())=="MissingET") { 120 TIter itMet(branch_); 121 MissingET *MET; 122 // Missing Et 123 while((MET = (MissingET*) itMet.Next())) { 124 TLorentzVector v; 125 v.SetPtEtaPhiM(MET->MET,MET->Eta,MET->Phi,0.); 126 output.push_back(v); 127 } 128 } 129 return output; 130 } 93 131 94 132 // special case for track lists … … 199 237 } 200 238 } 239 template<> std::vector<TLorentzVector> DelphesBranchElement<TEveTrackList>::GetVectors() { 240 std::vector<TLorentzVector> output; 241 TString type = GetType(); 242 TIter itTrack(branch_); 243 if(type=="Track") { // CASE 1: TRACKS 244 Track *track; 245 while((track = (Track *) itTrack.Next())) { 246 output.push_back(track->P4()); 247 } 248 } else if(type=="Electron") { // CASE 2: ELECTRONS 249 Electron *electron; 250 while((electron = (Electron *) itTrack.Next())) { 251 output.push_back(electron->P4()); 252 } 253 } else if(type=="Muon") { // CASE 3: MUONS 254 Muon *muon; 255 while((muon = (Muon *) itTrack.Next())) { 256 output.push_back(muon->P4()); 257 } 258 } else if(type=="Photon") { // CASE 4: PHOTONS 259 Photon *photon; 260 while((photon = (Photon *) itTrack.Next())) { 261 output.push_back(photon->P4()); 262 } 263 } else if(type=="GenParticle") { // CASE 5: GENPARTICLES 264 GenParticle *particle; 265 while((particle = (GenParticle *) itTrack.Next())) { 266 if(particle->Status != 1) continue; 267 output.push_back(particle->P4()); 268 } 269 } 270 return output; 271 }
Note:
See TracChangeset
for help on using the changeset viewer.