Belle II Software  release-05-02-19
pyroot_tfile.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 # This test catches a regression in PyRoot (in root 5.34/19+?, fixed in 5.34/23)
5 from basf2 import find_file
6 import ROOT
7 
8 path = find_file('framework/tests/chaintest_2.root')
9 f = ROOT.TFile(path)
10 tree = f.Get('tree')
11 
12 tree.GetEntry(0)
13 hits = tree.PXDSimHits
14 nentries = hits.GetEntriesFast()
15 print(nentries)
16 hit = hits[0]
17 hit.Dump()