Belle II Software development
topoana.py
1
8import basf2
9from modularAnalysis import inputMdst
10from modularAnalysis import variablesToNtuple
11from variables.MCGenTopo import mc_gen_topo
12import os # Newly added statement 1!
13
14mypath = basf2.Path()
15
16# load input ROOT file
17inputMdst(basf2.find_file('B02D0pi0_D02pi0pi0.root', 'examples', False), mypath)
18
19# Output the variables to a ntuple
20variablesToNtuple('', mc_gen_topo(200), 'MCGenTopo', 'MCGenTopo.root', path=mypath)
21
22# Process the events
23basf2.process(mypath)
24
25# Print out the summary
26print(basf2.statistics)
27
28# Invoke the TopoAna program
29os.system('topoana.exe topoana.card') # Newly added statement 2!