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