CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
tree_test.TreeTestCase Class Reference
Inheritance diagram for tree_test.TreeTestCase:

Public Member Functions

def test_fill
 
def test_iterate
 
def test_read
 

Detailed Description

Definition at line 5 of file tree_test.py.

Member Function Documentation

def tree_test.TreeTestCase.test_fill (   self)

Definition at line 7 of file tree_test.py.

7 
8  def test_fill(self):
9  fi = TFile('tree.root','RECREATE')
10  tr = Tree('test_tree', 'A test tree')
11  tr.var('a')
12  tr.var('b')
13  tr.fill('a', 3)
14  tr.fill('a', 4)
15  tr.fill('b', 5)
16  tr.tree.Fill()
17  fi.Write()
18  fi.Close()
Definition: tree.py:5
def tree_test.TreeTestCase.test_iterate (   self)

Definition at line 26 of file tree_test.py.

26 
27  def test_iterate(self):
28  fi = TFile('tree.root')
29  tr = fi.Get('test_tree')
30  for ev in tr:
31  self.assertEqual(ev.a, 4)
32  break
33 
def tree_test.TreeTestCase.test_read (   self)

Definition at line 19 of file tree_test.py.

19 
20  def test_read(self):
21  fi = TFile('tree.root')
22  tr = fi.Get('test_tree')
23  self.assertEqual(tr.GetEntries(), 1)
24  tr.GetEntry(0)
25  self.assertEqual(tr.a, 4)