CMS 3D CMS Logo

testtree.py
Go to the documentation of this file.
1 from __future__ import print_function
2 from ROOT import TFile
3 from PhysicsTools.HeppyCore.statistics.tree import Tree
4 
5 def create_tree(filename="test_tree.root"):
6  outfile = TFile(filename, 'recreate')
7  tree = Tree('test_tree', 'A test tree')
8  tree.var('var1')
9  for i in range(100):
10  tree.fill('var1', i)
11  tree.tree.Fill()
12  print('creating a tree', tree.tree.GetName(),\
13  tree.tree.GetEntries(), 'entries in',\
14  outfile.GetName())
15  outfile.Write()
def create_tree(filename="test_tree.root")
Definition: testtree.py:5
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:65