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 6 of file tree_test.py.

Member Function Documentation

◆ test_fill()

def tree_test.TreeTestCase.test_fill (   self)

Definition at line 8 of file tree_test.py.

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()
19 

◆ test_iterate()

def tree_test.TreeTestCase.test_iterate (   self)

Definition at line 27 of file tree_test.py.

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 
34 

◆ test_read()

def tree_test.TreeTestCase.test_read (   self)

Definition at line 20 of file tree_test.py.

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)
26