Changeset 1385 in svn for trunk/examples/Example3.C
- Timestamp:
- Apr 17, 2014, 1:41:34 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/Example3.C
r1357 r1385 95 95 TClonesArray *branchPhoton = treeReader->UseBranch("Photon"); 96 96 TClonesArray *branchMuon = treeReader->UseBranch("Muon"); 97 98 TClonesArray *branchTrack = treeReader->UseBranch("Track"); 99 TClonesArray *branchTower = treeReader->UseBranch("Tower"); 97 100 98 101 TClonesArray *branchEFlowTrack = treeReader->UseBranch("EFlowTrack"); … … 167 170 168 171 // Loop over all tracks in event 169 for(i = 0; i < branch EFlowTrack->GetEntriesFast(); ++i)170 { 171 track = (Track*) branch EFlowTrack->At(i);172 for(i = 0; i < branchTrack->GetEntriesFast(); ++i) 173 { 174 track = (Track*) branchTrack->At(i); 172 175 particle = (GenParticle*) track->Particle.GetObject(); 173 176 … … 197 200 if(object->IsA() == GenParticle::Class()) 198 201 { 199 cout<<" GenPart pt: "<<((GenParticle*) object)->PT<<", eta: "<<((GenParticle*) object)->Eta<<", phi: "<<((GenParticle*) object)->Phi<<endl; 200 momentum += ((GenParticle*) object)->P4(); 202 particle = (GenParticle*) object; 203 cout << " GenPart pt: " << particle->PT << ", eta: " << particle->Eta << ", phi: " << particle->Phi << endl; 204 momentum += particle->P4(); 201 205 } 202 206 else if(object->IsA() == Track::Class()) 203 207 { 204 cout<<" Track pt: "<<((Track*) object)->PT<<", eta: "<<((Track*) object)->Eta<<", phi: "<<((Track*) object)->Phi<<endl; 205 momentum += ((Track*) object)->P4(); 208 track = (Track*) object; 209 cout << " Track pt: " << track->PT << ", eta: " << track->Eta << ", phi: " << track->Phi << endl; 210 momentum += track->P4(); 206 211 } 207 212 else if(object->IsA() == Tower::Class()) 208 213 { 209 cout<<" Tower pt: "<<((Tower*) object)->ET<<", eta: "<<((Tower*) object)->Eta<<", phi: "<<((Tower*) object)->Phi<<endl; 210 momentum += ((Tower*) object)->P4(); 214 tower = (Tower*) object; 215 cout << " Tower pt: " << tower->ET << ", eta: " << tower->Eta << ", phi: " << tower->Phi << endl; 216 momentum += tower->P4(); 211 217 } 212 218 else if(object->IsA() == Muon::Class()) 213 219 { 214 cout<<" Muon pt: "<<((Muon*) object)->PT<<", eta: "<<((Muon*) object)->Eta<<", phi: "<<((Muon*) object)->Phi<<endl; 215 momentum += ((Muon*) object)->P4(); 220 muon = (Muon*) object; 221 cout << " Muon pt: " << muon->PT << ", eta: " << muon->Eta << ", phi: " << muon->Phi << endl; 222 momentum += muon->P4(); 216 223 } 217 224 }
Note:
See TracChangeset
for help on using the changeset viewer.