Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
Tree tutorials

Example code which illustrates how to use ROOT trees and ntuples.

Files

file  basic.C
  View in nbviewer Open in SWAN
Read data from an ascii file and create a root file with an histogram and an ntuple.
 
file  basic2.C
  View in nbviewer Open in SWAN
Create can ntuple reading data from an ascii file.
 
file  bill.C
  View in nbviewer Open in SWAN
Benchmark comparing row-wise and column-wise storage performance
 
file  cernbuild.C
  View in nbviewer Open in SWAN
Read data (CERN staff) from an ascii file and create a root file with a Tree.
 
file  cernstaff.C
  View in nbviewer Open in SWAN
Playing with a Tree containing variables of type character
 
file  circular.C
  View in nbviewer Open in SWAN
Example of a circular Tree
 
file  clonesA_Event.C
 Example to write & read a Tree built with a complex class inheritance tree.
 
file  copytree.C
  View in nbviewer Open in SWAN
Copy a subset of a Tree to a new Tree
 
file  copytree2.C
  View in nbviewer Open in SWAN
Copy a subset of a Tree to a new Tree, one branch in a separate file.
 
file  copytree3.C
  View in nbviewer Open in SWAN
Example of Root macro to copy a subset of a Tree to a new Tree, selecting entries.
 
file  drawsparse.C
  View in nbviewer Open in SWAN
Convert a THnSparse to a TTree using efficient iteration through the THnSparse and draw a THnSparse using TParallelCoord.
 
file  h1analysis.C
  View in nbviewer Open in SWAN
Example of analysis class for the H1 data.
 
file  h1analysisProxy.C
 Example of analysis class for the H1 data using code generated by MakeProxy.
 
file  h1analysisTreeReader.C
 H1 analysis example expressed in terms of TTreeReader (see h1analysis.C).
 
file  h1chain.C
  View in nbviewer Open in SWAN
Creates a TChain to be used by the h1analysis.C class the symbol H1 must point to a directory where the H1 data sets have been installed.
 
file  hsimpleProxy.C
  View in nbviewer Open in SWAN

 
file  hsimpleProxyDriver.C
  View in nbviewer Open in SWAN
This is the driver of the hsimpleProxy example It provides the infrastructure to run that code on an ntuple To be run from the tutorials directory
 
file  hsimpleReader.C
  View in nbviewer Open in SWAN
TTreeReader simplest example.
 
file  htest.C
  View in nbviewer Open in SWAN
Save histograms in Tree branches
 
file  hvector.C
  View in nbviewer Open in SWAN
Write and read STL vectors in a tree.
 
file  jets.C
 Usage of a Tree using the JetEvent class.
 
file  ntuple1.C
  View in nbviewer Open in SWAN
Simple tree analysis.
 
file  parallelcoord.C
  View in nbviewer Open in SWAN
Script illustrating the use of the TParallelCoord class
 
file  parallelcoordtrans.C
  View in nbviewer Open in SWAN
Use of transparency with ||-Coord.
 
file  printSizes.C
  View in nbviewer Open in SWAN
This macro can be used to get aggregate information on the size take on disk or in memory by the various branches in a TTree.
 
file  run_h1analysis.C
  View in nbviewer Open in SWAN
Macro driving the analysis can specify file name and type
 
file  spider.C
  View in nbviewer Open in SWAN
TSpider example.
 
file  staff.C
  View in nbviewer Open in SWAN
Create a plot of the data in cernstaff.root To create cernstaff.root, execute tutorial $ROOTSYS/tutorials/tree/cernbuild.C
 
file  tcl.C
  View in nbviewer Open in SWAN
How to write a TClonesArray to a TTree
 
file  temperature.C
 This tutorial illustrates how to use the highlight mode with trees.
 
file  tree.C
  View in nbviewer Open in SWAN
Display the Tree data structures
 
file  tree0.C
  View in nbviewer Open in SWAN
Simple Event class example
 
file  tree1.C
  View in nbviewer Open in SWAN
This example is a variant of hsimple.C but using a TTree instead of a TNtuple.
 
file  tree2.C
  View in nbviewer Open in SWAN
This example illustrates how to make a Tree from variables or arrays in a C struct - without a dictionary, by creating the branches for builtin types (int, float, double) and arrays explicitly.
 
file  tree2a.C
  View in nbviewer Open in SWAN
This example is the same as tree2.C, but uses a class instead of a C-struct.
 
file  tree3.C
  View in nbviewer Open in SWAN
Example of a Tree where branches are variable length arrays A second Tree is created and filled in parallel.
 
file  tree4.C
  View in nbviewer Open in SWAN
This example writes a tree with objects of the class Event.
 
file  treefriend.C
  View in nbviewer Open in SWAN
Illustrates how to use Tree friends:
 
file  treegetval.C
  View in nbviewer Open in SWAN
Illustrates how to retrieve TTree variables in arrays.