Changeset 1357 in svn for trunk/examples/Example3.C
- Timestamp:
- Mar 9, 2014, 12:10:05 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/Example3.C
r1339 r1357 20 20 TH1 *fTrackDeltaEta; 21 21 22 TH1 *fTowerDeltaEem;23 TH1 *fTowerDeltaEhad;24 25 22 TH1 *fJetDeltaPT; 26 23 }; … … 82 79 "(#eta^{particle} - #eta^{track})/#eta^{particle}", "number of tracks", 83 80 100, -0.1, 0.1); 84 85 plots->fTowerDeltaEem = result->AddHist1D(86 "tower delta Eem", "(Eem^{particles} - Eem^{tower})/Eem^{particles}",87 "(Eem^{particles} - Eem^{tower})/Eem^{particles}", "number of tower",88 100, -0.5, 0.5);89 90 plots->fTowerDeltaEhad = result->AddHist1D(91 "tower delta Ehad", "(Ehad^{particles} - Ehad^{tower})/Ehad^{particles}",92 "(Ehad^{particles} - Ehad^{tower})/Ehad^{particles}", "number of tower",93 100, -5.0, 5.0);94 81 95 82 plots->fJetDeltaPT = result->AddHist1D( … … 110 97 111 98 TClonesArray *branchEFlowTrack = treeReader->UseBranch("EFlowTrack"); 112 TClonesArray *branchEFlowTower = treeReader->UseBranch("EFlowTower"); 99 TClonesArray *branchEFlowPhoton = treeReader->UseBranch("EFlowPhoton"); 100 TClonesArray *branchEFlowNeutralHadron = treeReader->UseBranch("EFlowNeutralHadron"); 113 101 TClonesArray *branchJet = treeReader->UseBranch("Jet"); 114 102 … … 188 176 } 189 177 190 // Loop over all towers in event 191 for(i = 0; i < branchEFlowTower->GetEntriesFast(); ++i) 192 { 193 tower = (Tower*) branchEFlowTower->At(i); 194 195 Eem = 0.0; 196 Ehad = 0.0; 197 skip = kFALSE; 198 for(j = 0; j < tower->Particles.GetEntriesFast(); ++j) 199 { 200 particle = (GenParticle*) tower->Particles.At(j); 201 pdgCode = TMath::Abs(particle->PID); 202 203 // skip muons and neutrinos 204 if(pdgCode == 12 || pdgCode == 13 || pdgCode == 14 || pdgCode == 16) 205 { 206 continue; 207 } 208 209 // skip K0short and Lambda 210 if(pdgCode == 310 || pdgCode == 3122) 211 { 212 skip = kTRUE; 213 } 214 215 if(pdgCode == 11 || pdgCode == 22) 216 { 217 Eem += particle->E; 218 } 219 else 220 { 221 Ehad += particle->E; 222 } 223 } 224 if(skip) continue; 225 if(Eem > 0.0 && tower->Eem > 0.0) plots->fTowerDeltaEem->Fill((Eem - tower->Eem)/Eem); 226 if(Ehad > 0.0 && tower->Ehad > 0.0) plots->fTowerDeltaEhad->Fill((Ehad - tower->Ehad)/Ehad); 227 } 178 cout<<"-- New event -- "<<endl; 228 179 229 180 // Loop over all jets in event … … 233 184 234 185 momentum.SetPxPyPzE(0.0, 0.0, 0.0, 0.0); 186 187 cout<<"Looping over jet constituents. Jet pt: "<<jet->PT<<", eta: "<<jet->Eta<<", phi: "<<jet->Phi<<endl; 235 188 236 189 // Loop over all jet's constituents … … 244 197 if(object->IsA() == GenParticle::Class()) 245 198 { 199 cout<<" GenPart pt: "<<((GenParticle*) object)->PT<<", eta: "<<((GenParticle*) object)->Eta<<", phi: "<<((GenParticle*) object)->Phi<<endl; 246 200 momentum += ((GenParticle*) object)->P4(); 247 201 } 248 202 else if(object->IsA() == Track::Class()) 249 203 { 204 cout<<" Track pt: "<<((Track*) object)->PT<<", eta: "<<((Track*) object)->Eta<<", phi: "<<((Track*) object)->Phi<<endl; 250 205 momentum += ((Track*) object)->P4(); 251 206 } 252 207 else if(object->IsA() == Tower::Class()) 253 208 { 209 cout<<" Tower pt: "<<((Tower*) object)->ET<<", eta: "<<((Tower*) object)->Eta<<", phi: "<<((Tower*) object)->Phi<<endl; 254 210 momentum += ((Tower*) object)->P4(); 255 211 } 256 212 else if(object->IsA() == Muon::Class()) 257 213 { 214 cout<<" Muon pt: "<<((Muon*) object)->PT<<", eta: "<<((Muon*) object)->Eta<<", phi: "<<((Muon*) object)->Phi<<endl; 258 215 momentum += ((Muon*) object)->P4(); 259 216 }
Note:
See TracChangeset
for help on using the changeset viewer.