Changeset 49234af in git for examples/Example3.C
- Timestamp:
- Dec 9, 2014, 1:27:13 PM (10 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- 37deb3b, 9e991f8
- Parents:
- f6b6ee7 (diff), e7e90df (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
examples/Example3.C
rf6b6ee7 r49234af 1 1 /* 2 This macro shows how to access the particle-level reference for reconstructed objects. 3 It is also shown how to loop over the jet constituents. 4 2 5 root -l examples/Example3.C'("delphes_output.root")' 3 6 */ … … 36 39 37 40 plots->fElectronDeltaPT = result->AddHist1D( 38 "electron deltapt", "(p_{T}^{particle} - p_{T}^{electron})/p_{T}^{particle}",41 "electron_delta_pt", "(p_{T}^{particle} - p_{T}^{electron})/p_{T}^{particle}", 39 42 "(p_{T}^{particle} - p_{T}^{electron})/p_{T}^{particle}", "number of electrons", 40 43 100, -0.1, 0.1); 41 44 42 45 plots->fElectronDeltaEta = result->AddHist1D( 43 "electron deltaeta", "(#eta^{particle} - #eta^{electron})/#eta^{particle}",46 "electron_delta_eta", "(#eta^{particle} - #eta^{electron})/#eta^{particle}", 44 47 "(#eta^{particle} - #eta^{electron})/#eta^{particle}", "number of electrons", 45 48 100, -0.1, 0.1); 46 49 47 50 plots->fPhotonDeltaPT = result->AddHist1D( 48 "photon deltapt", "(p_{T}^{particle} - p_{T}^{photon})/p_{T}^{particle}",51 "photon_delta_pt", "(p_{T}^{particle} - p_{T}^{photon})/p_{T}^{particle}", 49 52 "(p_{T}^{particle} - p_{T}^{photon})/p_{T}^{particle}", "number of photons", 50 53 100, -0.1, 0.1); 51 54 52 55 plots->fPhotonDeltaEta = result->AddHist1D( 53 "photon deltaeta", "(#eta^{particle} - #eta^{photon})/#eta^{particle}",56 "photon_delta_eta", "(#eta^{particle} - #eta^{photon})/#eta^{particle}", 54 57 "(#eta^{particle} - #eta^{photon})/#eta^{particle}", "number of photons", 55 58 100, -0.1, 0.1); 56 59 57 60 plots->fPhotonDeltaE = result->AddHist1D( 58 "photon deltaenergy", "(E^{particle} - E^{photon})/E^{particle}",61 "photon_delta_energy", "(E^{particle} - E^{photon})/E^{particle}", 59 62 "(E^{particle} - E^{photon})/E^{particle}", "number of photons", 60 63 100, -0.1, 0.1); 61 64 62 65 plots->fMuonDeltaPT = result->AddHist1D( 63 "muon deltapt", "(p_{T}^{particle} - p_{T}^{muon})/p_{T}^{particle}",66 "muon_delta_pt", "(p_{T}^{particle} - p_{T}^{muon})/p_{T}^{particle}", 64 67 "(p_{T}^{particle} - p_{T}^{muon})/p_{T}^{particle}", "number of muons", 65 68 100, -0.1, 0.1); 66 69 67 70 plots->fMuonDeltaEta = result->AddHist1D( 68 "muon deltaeta", "(#eta^{particle} - #eta^{muon})/#eta^{particle}",71 "muon_delta_eta", "(#eta^{particle} - #eta^{muon})/#eta^{particle}", 69 72 "(#eta^{particle} - #eta^{muon})/#eta^{particle}", "number of muons", 70 73 100, -0.1, 0.1); 71 74 72 75 plots->fTrackDeltaPT = result->AddHist1D( 73 "track deltapt", "(p_{T}^{particle} - p_{T}^{track})/p_{T}^{particle}",76 "track_delta_pt", "(p_{T}^{particle} - p_{T}^{track})/p_{T}^{particle}", 74 77 "(p_{T}^{particle} - p_{T}^{track})/p_{T}^{particle}", "number of tracks", 75 78 100, -0.1, 0.1); 76 79 77 80 plots->fTrackDeltaEta = result->AddHist1D( 78 "track deltaeta", "(#eta^{particle} - #eta^{track})/#eta^{particle}",81 "track_delta_eta", "(#eta^{particle} - #eta^{track})/#eta^{particle}", 79 82 "(#eta^{particle} - #eta^{track})/#eta^{particle}", "number of tracks", 80 83 100, -0.1, 0.1); 81 84 82 85 plots->fJetDeltaPT = result->AddHist1D( 83 "jet deltapt", "(p_{T}^{jet} - p_{T}^{constituents})/p_{T}^{jet}",86 "jet_delta_pt", "(p_{T}^{jet} - p_{T}^{constituents})/p_{T}^{jet}", 84 87 "(p_{T}^{jet} - p_{T}^{constituents})/p_{T}^{jet}", "number of jets", 85 88 100, -1.0e-1, 1.0e-1); … … 179 182 } 180 183 181 cout<<"-- New event -- "<<endl;184 // cout<<"-- New event -- "<<endl; 182 185 183 186 // Loop over all jets in event … … 188 191 momentum.SetPxPyPzE(0.0, 0.0, 0.0, 0.0); 189 192 190 cout<<"Looping over jet constituents. Jet pt: "<<jet->PT<<", eta: "<<jet->Eta<<", phi: "<<jet->Phi<<endl;193 //cout<<"Looping over jet constituents. Jet pt: "<<jet->PT<<", eta: "<<jet->Eta<<", phi: "<<jet->Phi<<endl; 191 194 192 195 // Loop over all jet's constituents … … 201 204 { 202 205 particle = (GenParticle*) object; 203 cout << " GenPart pt: " << particle->PT << ", eta: " << particle->Eta << ", phi: " << particle->Phi << endl;206 //cout << " GenPart pt: " << particle->PT << ", eta: " << particle->Eta << ", phi: " << particle->Phi << endl; 204 207 momentum += particle->P4(); 205 208 } … … 207 210 { 208 211 track = (Track*) object; 209 cout << " Track pt: " << track->PT << ", eta: " << track->Eta << ", phi: " << track->Phi << endl;212 //cout << " Track pt: " << track->PT << ", eta: " << track->Eta << ", phi: " << track->Phi << endl; 210 213 momentum += track->P4(); 211 214 } … … 213 216 { 214 217 tower = (Tower*) object; 215 cout << " Tower pt: " << tower->ET << ", eta: " << tower->Eta << ", phi: " << tower->Phi << endl;218 //cout << " Tower pt: " << tower->ET << ", eta: " << tower->Eta << ", phi: " << tower->Phi << endl; 216 219 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 220 } 224 221 }
Note:
See TracChangeset
for help on using the changeset viewer.