CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 6 of file tree_test.py.

Member Function Documentation

def tree_test.TreeTestCase.test_fill (   self)

Definition at line 8 of file tree_test.py.

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

Definition at line 27 of file tree_test.py.

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

Definition at line 20 of file tree_test.py.

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