Changeset 2b01e13 in git
- Timestamp:
- Dec 9, 2014, 1:50:13 PM (10 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- ad3b7ce
- Parents:
- 9e991f8
- Files:
-
- 1 deleted
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
README_4LHCb
r9e991f8 r2b01e13 50 50 2) Simulate p p -> b b~ events 51 51 52 53 wget http://cp3.irmp.ucl.ac.be/downloads/pp2bb.hep.tgz 52 54 tar -xzvf pp2bb.hep.tgz 53 55 ./DelphesSTDHEP examples/delphes_card_prelLHCb.tcl delphes_output.root pp2bb.hep … … 59 61 60 62 61 62 Simple analysis using TTree::Draw63 =================================64 65 Now we can start ROOT and look at the data stored in the output ROOT file.66 67 Start ROOT and load Delphes shared library:68 69 root -l70 gSystem->Load("libDelphes");71 72 Open ROOT file and do some basic analysis using Draw or TBrowser:73 74 TFile::Open("delphes_output.root");75 Delphes->Draw("Track.PT");76 TBrowser browser;77 78 Note 1: Delphes - tree name, it can be learned e.g. from TBrowser79 80 Note 2: Track - branch name; PT - variable (leaf) of this branch81 82 Complete description of all branches can be found in83 84 doc/RootTreeDescription.html85 86 This information is also available at87 88 https://cp3.irmp.ucl.ac.be/projects/delphes/wiki/WorkBook/RootTreeDescription89 90 91 Macro-based analysis92 ====================93 94 Analysis macro consists of histogram booking, event loop (histogram filling),95 histogram display.96 97 Start ROOT and load Delphes shared library:98 99 root -l100 gSystem->Load("libDelphes");101 102 Basic analysis macro:103 104 {105 // Create chain of root trees106 TChain chain("Delphes");107 chain.Add("delphes_output.root");108 109 // Create object of class ExRootTreeReader110 ExRootTreeReader *treeReader = new ExRootTreeReader(&chain);111 Long64_t numberOfEntries = treeReader->GetEntries();112 113 // Get pointers to branches used in this analysis114 TClonesArray *branchTrack = treeReader->UseBranch("Track");115 116 // Book histograms117 TH1 *histTrackPT = new TH1F("track pt", "track P_{T}", 50, 0.0, 20.0);118 119 // Loop over all events120 for(Int_t entry = 0; entry < numberOfEntries; ++entry)121 {122 123 // Load selected branches with data from specified event124 treeReader->ReadEntry(entry);125 126 // If event contains at least 1 track127 if(branchTrack->GetEntries() > 0)128 {129 // Take first track130 Track *track = (Track*) branchTrack->At(0);131 132 // Plot track transverse momentum133 histTrackPT->Fill(track->PT);134 135 // Print electron transverse momentum and Particle Data Group ID136 cout << track->PID<< " " << track->PT << endl;137 }138 139 }140 141 // Show resulting histograms142 histTrackPT->Draw();143 }144
Note:
See TracChangeset
for help on using the changeset viewer.