Changeset fbb617b in git for examples/Example1.C
- Timestamp:
- Dec 14, 2014, 12:06:59 AM (10 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- cf1ff2c
- Parents:
- 57e1804
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
examples/Example1.C
r57e1804 rfbb617b 2 2 Simple macro showing how to access branches from the delphes output root file, 3 3 loop over events, and plot simple quantities such as the jet pt and the di-electron invariant 4 mass. 4 mass. 5 5 6 6 root -l examples/Example1.C'("delphes_output.root")' … … 16 16 TChain chain("Delphes"); 17 17 chain.Add(inputFile); 18 18 19 19 // Create object of class ExRootTreeReader 20 20 ExRootTreeReader *treeReader = new ExRootTreeReader(&chain); 21 21 Long64_t numberOfEntries = treeReader->GetEntries(); 22 22 23 23 // Get pointers to branches used in this analysis 24 24 TClonesArray *branchJet = treeReader->UseBranch("Jet"); 25 25 TClonesArray *branchElectron = treeReader->UseBranch("Electron"); 26 26 27 27 // Book histograms 28 28 TH1 *histJetPT = new TH1F("jet_pt", "jet P_{T}", 100, 0.0, 100.0); … … 34 34 // Load selected branches with data from specified event 35 35 treeReader->ReadEntry(entry); 36 36 37 37 // If event contains at least 1 jet 38 38 if(branchJet->GetEntries() > 0) … … 40 40 // Take first jet 41 41 Jet *jet = (Jet*) branchJet->At(0); 42 42 43 43 // Plot jet transverse momentum 44 44 histJetPT->Fill(jet->PT); 45 45 46 46 // Print jet transverse momentum 47 47 cout << "Jet pt: "<<jet->PT << endl;
Note:
See TracChangeset
for help on using the changeset viewer.