Belle II Software
development
pyroot_tfile.py
1
#!/usr/bin/env python3
2
3
10
11
# This test catches a regression in PyRoot (in root 5.34/19+?, fixed in 5.34/23)
12
from
basf2
import
find_file
13
import
ROOT
14
15
path = find_file(
'framework/tests/chaintest_2.root'
)
16
17
with
ROOT.TFile(path)
as
f:
18
tree = f.Get(
'tree'
)
19
hits = ROOT.TClonesArray(
'Belle2::PXDSimHit'
)
20
tree.SetBranchAddress(
'PXDSimHits'
, hits)
21
tree.GetEntry(0)
22
assert
(hits.GetEntriesFast() > 0)
23
hit = hits[0]
24
hit.Dump()
framework
tests
pyroot_tfile.py
Generated on Mon Sep 1 2025 02:52:02 for Belle II Software by
1.13.2