CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
testtree Namespace Reference

Functions

def create_tree
 

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 
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
Definition: testtree.py:4