CMS 3D CMS Logo

List of all members | Public Member Functions
tree_test.TreeTestCase Class Reference
Inheritance diagram for tree_test.TreeTestCase:

Public Member Functions

def test_fill (self)
 
def test_iterate (self)
 
def test_read (self)
 

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

Definition at line 26 of file tree_test.py.

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

Definition at line 19 of file tree_test.py.

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