Changes in examples/Example3.C [fc4e460:21f3c04] in git
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
examples/Example3.C
rfc4e460 r21f3c04 1 1 /* 2 3 This macro shows how to access the particle-level reference for reconstructed objects. 4 It is also shown how to loop over the jet constituents. 5 6 root -l examples/Example3.C\(\"delphes_output.root\"\) 2 root -l examples/Example3.C'("delphes_output.root")' 7 3 */ 8 4 … … 40 36 41 37 plots->fElectronDeltaPT = result->AddHist1D( 42 "electron _delta_pt", "(p_{T}^{particle} - p_{T}^{electron})/p_{T}^{particle}",38 "electron delta pt", "(p_{T}^{particle} - p_{T}^{electron})/p_{T}^{particle}", 43 39 "(p_{T}^{particle} - p_{T}^{electron})/p_{T}^{particle}", "number of electrons", 44 40 100, -0.1, 0.1); 45 41 46 42 plots->fElectronDeltaEta = result->AddHist1D( 47 "electron _delta_eta", "(#eta^{particle} - #eta^{electron})/#eta^{particle}",43 "electron delta eta", "(#eta^{particle} - #eta^{electron})/#eta^{particle}", 48 44 "(#eta^{particle} - #eta^{electron})/#eta^{particle}", "number of electrons", 49 45 100, -0.1, 0.1); 50 46 51 47 plots->fPhotonDeltaPT = result->AddHist1D( 52 "photon _delta_pt", "(p_{T}^{particle} - p_{T}^{photon})/p_{T}^{particle}",48 "photon delta pt", "(p_{T}^{particle} - p_{T}^{photon})/p_{T}^{particle}", 53 49 "(p_{T}^{particle} - p_{T}^{photon})/p_{T}^{particle}", "number of photons", 54 50 100, -0.1, 0.1); 55 51 56 52 plots->fPhotonDeltaEta = result->AddHist1D( 57 "photon _delta_eta", "(#eta^{particle} - #eta^{photon})/#eta^{particle}",53 "photon delta eta", "(#eta^{particle} - #eta^{photon})/#eta^{particle}", 58 54 "(#eta^{particle} - #eta^{photon})/#eta^{particle}", "number of photons", 59 55 100, -0.1, 0.1); 60 56 61 57 plots->fPhotonDeltaE = result->AddHist1D( 62 "photon _delta_energy", "(E^{particle} - E^{photon})/E^{particle}",58 "photon delta energy", "(E^{particle} - E^{photon})/E^{particle}", 63 59 "(E^{particle} - E^{photon})/E^{particle}", "number of photons", 64 60 100, -0.1, 0.1); 65 61 66 62 plots->fMuonDeltaPT = result->AddHist1D( 67 "muon _delta_pt", "(p_{T}^{particle} - p_{T}^{muon})/p_{T}^{particle}",63 "muon delta pt", "(p_{T}^{particle} - p_{T}^{muon})/p_{T}^{particle}", 68 64 "(p_{T}^{particle} - p_{T}^{muon})/p_{T}^{particle}", "number of muons", 69 65 100, -0.1, 0.1); 70 66 71 67 plots->fMuonDeltaEta = result->AddHist1D( 72 "muon _delta_eta", "(#eta^{particle} - #eta^{muon})/#eta^{particle}",68 "muon delta eta", "(#eta^{particle} - #eta^{muon})/#eta^{particle}", 73 69 "(#eta^{particle} - #eta^{muon})/#eta^{particle}", "number of muons", 74 70 100, -0.1, 0.1); 75 71 76 72 plots->fTrackDeltaPT = result->AddHist1D( 77 "track _delta_pt", "(p_{T}^{particle} - p_{T}^{track})/p_{T}^{particle}",73 "track delta pt", "(p_{T}^{particle} - p_{T}^{track})/p_{T}^{particle}", 78 74 "(p_{T}^{particle} - p_{T}^{track})/p_{T}^{particle}", "number of tracks", 79 75 100, -0.1, 0.1); 80 76 81 77 plots->fTrackDeltaEta = result->AddHist1D( 82 "track _delta_eta", "(#eta^{particle} - #eta^{track})/#eta^{particle}",78 "track delta eta", "(#eta^{particle} - #eta^{track})/#eta^{particle}", 83 79 "(#eta^{particle} - #eta^{track})/#eta^{particle}", "number of tracks", 84 80 100, -0.1, 0.1); 85 81 86 82 plots->fJetDeltaPT = result->AddHist1D( 87 "jet _delta_pt", "(p_{T}^{jet} - p_{T}^{constituents})/p_{T}^{jet}",83 "jet delta pt", "(p_{T}^{jet} - p_{T}^{constituents})/p_{T}^{jet}", 88 84 "(p_{T}^{jet} - p_{T}^{constituents})/p_{T}^{jet}", "number of jets", 89 85 100, -1.0e-1, 1.0e-1); … … 183 179 } 184 180 185 //cout<<"-- New event -- "<<endl;181 cout<<"-- New event -- "<<endl; 186 182 187 183 // Loop over all jets in event … … 192 188 momentum.SetPxPyPzE(0.0, 0.0, 0.0, 0.0); 193 189 194 //cout<<"Looping over jet constituents. Jet pt: "<<jet->PT<<", eta: "<<jet->Eta<<", phi: "<<jet->Phi<<endl;190 cout<<"Looping over jet constituents. Jet pt: "<<jet->PT<<", eta: "<<jet->Eta<<", phi: "<<jet->Phi<<endl; 195 191 196 192 // Loop over all jet's constituents … … 205 201 { 206 202 particle = (GenParticle*) object; 207 //cout << " GenPart pt: " << particle->PT << ", eta: " << particle->Eta << ", phi: " << particle->Phi << endl;203 cout << " GenPart pt: " << particle->PT << ", eta: " << particle->Eta << ", phi: " << particle->Phi << endl; 208 204 momentum += particle->P4(); 209 205 } … … 211 207 { 212 208 track = (Track*) object; 213 //cout << " Track pt: " << track->PT << ", eta: " << track->Eta << ", phi: " << track->Phi << endl;209 cout << " Track pt: " << track->PT << ", eta: " << track->Eta << ", phi: " << track->Phi << endl; 214 210 momentum += track->P4(); 215 211 } … … 217 213 { 218 214 tower = (Tower*) object; 219 //cout << " Tower pt: " << tower->ET << ", eta: " << tower->Eta << ", phi: " << tower->Phi << endl;215 cout << " Tower pt: " << tower->ET << ", eta: " << tower->Eta << ", phi: " << tower->Phi << endl; 220 216 momentum += tower->P4(); 217 } 218 else if(object->IsA() == Muon::Class()) 219 { 220 muon = (Muon*) object; 221 cout << " Muon pt: " << muon->PT << ", eta: " << muon->Eta << ", phi: " << muon->Phi << endl; 222 momentum += muon->P4(); 221 223 } 222 224 }
Note:
See TracChangeset
for help on using the changeset viewer.