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