CMS 3D CMS Logo

Functions
testtree Namespace Reference

Functions

def create_tree (filename="test_tree.root")
 

Function Documentation

def testtree.create_tree (   filename = "test_tree.root")

Definition at line 4 of file testtree.py.

Referenced by eventstfile_test.EventsTFileTestCase.test(), and chain_test.ChainTestCase.test_get().

4 def create_tree(filename="test_tree.root"):
5  outfile = TFile(filename, 'recreate')
6  tree = Tree('test_tree', 'A test tree')
7  tree.var('var1')
8  for i in range(100):
9  tree.fill('var1', i)
10  tree.tree.Fill()
11  print 'creating a tree', tree.tree.GetName(),\
12  tree.tree.GetEntries(), 'entries in',\
13  outfile.GetName()
14  outfile.Write()
15 
def create_tree(filename="test_tree.root")
Definition: testtree.py:4