Fork me on GitHub

Changeset fbb617b in git for examples/Example1.C


Ignore:
Timestamp:
Dec 14, 2014, 12:06:59 AM (10 years ago)
Author:
Pavel Demin <pavel.demin@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
cf1ff2c
Parents:
57e1804
Message:

improve formatting and remove trailing spaces

File:
1 edited

Legend:

Unmodified
Added
Removed
  • examples/Example1.C

    r57e1804 rfbb617b  
    22Simple macro showing how to access branches from the delphes output root file,
    33loop over events, and plot simple quantities such as the jet pt and the di-electron invariant
    4 mass. 
     4mass.
    55
    66root -l examples/Example1.C'("delphes_output.root")'
     
    1616  TChain chain("Delphes");
    1717  chain.Add(inputFile);
    18  
     18
    1919  // Create object of class ExRootTreeReader
    2020  ExRootTreeReader *treeReader = new ExRootTreeReader(&chain);
    2121  Long64_t numberOfEntries = treeReader->GetEntries();
    22  
     22
    2323  // Get pointers to branches used in this analysis
    2424  TClonesArray *branchJet = treeReader->UseBranch("Jet");
    2525  TClonesArray *branchElectron = treeReader->UseBranch("Electron");
    26  
     26
    2727  // Book histograms
    2828  TH1 *histJetPT = new TH1F("jet_pt", "jet P_{T}", 100, 0.0, 100.0);
     
    3434    // Load selected branches with data from specified event
    3535    treeReader->ReadEntry(entry);
    36  
     36
    3737    // If event contains at least 1 jet
    3838    if(branchJet->GetEntries() > 0)
     
    4040      // Take first jet
    4141      Jet *jet = (Jet*) branchJet->At(0);
    42      
     42
    4343      // Plot jet transverse momentum
    4444      histJetPT->Fill(jet->PT);
    45      
     45
    4646      // Print jet transverse momentum
    4747      cout << "Jet pt: "<<jet->PT << endl;
Note: See TracChangeset for help on using the changeset viewer.