Belle II Software development
ReconstructForTREPS.py
1#!/usr/bin/env python3
2
3
10
11import basf2
12from modularAnalysis import fillParticleListFromMC, reconstructDecay, variablesToNtuple, inputMdst
13
14# main path
15main = basf2.create_path()
16
17# load input mdst file
18inputMdst('utrepsbpipi_100k.root', path=main)
19
20# get pi+:MC from MCParticles
21fillParticleListFromMC('pi+:MC', 'mcPrimary', path=main)
22
23# reconstruct a virtual gamma for convenience
24reconstructDecay('gamma:Virtual -> pi+:MC pi-:MC', '', path=main)
25
26# store variables of gamma:Virtual to ntuple
27variablesToNtuple('gamma:Virtual', ['M', 'E', 'daughter(0, cosTheta)', 'daughter(1, cosTheta)'], path=main)
28
29# process
30basf2.process(main)
31
32# show call statistics
33print(basf2.statistics)